From 06e8a0825b9fd8ed9b815434b6acef1166a24a62 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Thu, 9 Apr 2015 20:45:43 +0300 Subject: [PATCH 01/24] Improve armcc output regex pattern to handle armasm messages --- workspace_tools/toolchains/arm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace_tools/toolchains/arm.py b/workspace_tools/toolchains/arm.py index 9f391e8f405..36cddd042d3 100644 --- a/workspace_tools/toolchains/arm.py +++ b/workspace_tools/toolchains/arm.py @@ -27,7 +27,7 @@ class ARM(mbedToolchain): LIBRARY_EXT = '.ar' STD_LIB_NAME = "%s.ar" - DIAGNOSTIC_PATTERN = re.compile('"(?P[^"]+)", line (?P\d+): (?PWarning|Error): (?P.+)') + DIAGNOSTIC_PATTERN = re.compile('"(?P[^"]+)", line (?P\d+)( \(column (?P\d+)\)|): (?PWarning|Error): (?P.+)') DEP_PATTERN = re.compile('\S+:\s(?P.+)\n') def __init__(self, target, options=None, notify=None, macros=None, silent=False): From c233c8810786788342853765d0455ea64b2aa423 Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 7 Apr 2015 00:33:26 -0700 Subject: [PATCH 02/24] [mbed][CAN] Implement CAN::mode for C_CAN controllers Implement all CAN modes except for GlobalTest on on the LPC11CXX and LPC15XX targets which use the C_CAN controller Fix swapped ordering between MODE_TEST_LOCAL and MODE_TEST_GLOBAL in the HAL definition of CanMode. --- libraries/mbed/hal/can_api.h | 2 +- .../TARGET_LPC11CXX/can_api.c | 37 ++++++++++++- .../hal/TARGET_NXP/TARGET_LPC15XX/can_api.c | 52 ++++++++++++++++++- 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/libraries/mbed/hal/can_api.h b/libraries/mbed/hal/can_api.h index 48bc104695f..2f51cea9e33 100644 --- a/libraries/mbed/hal/can_api.h +++ b/libraries/mbed/hal/can_api.h @@ -45,8 +45,8 @@ typedef enum { MODE_RESET, MODE_NORMAL, MODE_SILENT, - MODE_TEST_GLOBAL, MODE_TEST_LOCAL, + MODE_TEST_GLOBAL, MODE_TEST_SILENT } CanMode; diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/can_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/can_api.c index b017d1ab25b..93fcdf89ff7 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/can_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/can_api.c @@ -45,7 +45,42 @@ static inline void can_enable(can_t *obj) { } int can_mode(can_t *obj, CanMode mode) { - return 0; // not implemented + int success = 0; + switch (mode) { + case MODE_RESET: + LPC_CAN->CNTL &=~CANCNTL_TEST; + can_disable(obj); + success = 1; + break; + case MODE_NORMAL: + LPC_CAN->CNTL &=~CANCNTL_TEST; + can_enable(obj); + success = 1; + break; + case MODE_SILENT: + LPC_CAN->CNTL |= CANCNTL_TEST; + LPC_CAN->TEST |= CANTEST_SILENT; + LPC_CAN->TEST &=~CANTEST_LBACK; + success = 1; + break; + case MODE_TEST_LOCAL: + LPC_CAN->CNTL |= CANCNTL_TEST; + LPC_CAN->TEST &=~CANTEST_SILENT; + LPC_CAN->TEST |= CANTEST_LBACK; + success = 1; + break; + case MODE_TEST_SILENT: + LPC_CAN->CNTL |= CANCNTL_TEST; + LPC_CAN->TEST |= (CANCNTL_LBACK | CANTEST_SILENT); + success = 1; + break; + case MODE_TEST_GLOBAL: + default: + success = 0; + break; + } + + return success; } int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle) { diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/can_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/can_api.c index bb738dbf2b5..c2d925667b2 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/can_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/can_api.c @@ -56,6 +56,21 @@ #define CANIFn_CMDMSK_RD (0UL << 7) #define CANIFn_CMDREQ_BUSY (1UL << 15) +#define CANCNTL_INIT (1 << 0) // Initialization +#define CANCNTL_IE (1 << 1) // Module interrupt enable +#define CANCNTL_SIE (1 << 2) // Status change interrupt enable +#define CANCNTL_EIE (1 << 3) // Error interrupt enable +#define CANCNTL_DAR (1 << 5) // Disable automatic retransmission +#define CANCNTL_CCE (1 << 6) // Configuration change enable +#define CANCNTL_TEST (1 << 7) // Test mode enable + +#define CANTEST_BASIC (1 << 2) // Basic mode +#define CANTEST_SILENT (1 << 3) // Silent mode +#define CANTEST_LBACK (1 << 4) // Loop back mode +#define CANTEST_TX_MASK 0x0060 // Control of CAN_TXD pins +#define CANTEST_TX_SHIFT 5 +#define CANTEST_RX (1 << 7) // Monitors the actual value of the CAN_RXD pin. + static uint32_t can_irq_id = 0; static can_irq_handler irq_handler; @@ -70,7 +85,42 @@ static inline void can_enable(can_t *obj) { } int can_mode(can_t *obj, CanMode mode) { - return 0; // not implemented + int success = 0; + switch (mode) { + case MODE_RESET: + LPC_C_CAN0->CANCNTL &=~CANCNTL_TEST; + can_disable(obj); + success = 1; + break; + case MODE_NORMAL: + LPC_C_CAN0->CANCNTL &=~CANCNTL_TEST; + can_enable(obj); + success = 1; + break; + case MODE_SILENT: + LPC_C_CAN0->CANCNTL |= CANCNTL_TEST; + LPC_C_CAN0->CANTEST |= CANTEST_SILENT; + LPC_C_CAN0->CANTEST &=~ CANTEST_LBACK; + success = 1; + break; + case MODE_TEST_LOCAL: + LPC_C_CAN0->CANCNTL |= CANCNTL_TEST; + LPC_C_CAN0->CANTEST &=~CANTEST_SILENT; + LPC_C_CAN0->CANTEST |= CANTEST_LBACK; + success = 1; + break; + case MODE_TEST_SILENT: + LPC_C_CAN0->CANCNTL |= CANCNTL_TEST; + LPC_C_CAN0->CANTEST |= (CANTEST_LBACK | CANTEST_SILENT); + success = 1; + break; + case MODE_TEST_GLOBAL: + default: + success = 0; + break; + } + + return success; } int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle) { From 52f20bfcad2e36f0a75c228370dcb876fa5beaeb Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 7 Apr 2015 00:37:35 -0700 Subject: [PATCH 03/24] [mbed][tests] Add CAN loopback test case Add test case that configures a MUT for in CAN self-test mode and sends a series of test messages to verify that it works. --- libraries/tests/mbed/can_loopback/main.cpp | 50 ++++++++++++++++++++++ workspace_tools/tests.py | 16 ++++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 libraries/tests/mbed/can_loopback/main.cpp diff --git a/libraries/tests/mbed/can_loopback/main.cpp b/libraries/tests/mbed/can_loopback/main.cpp new file mode 100644 index 00000000000..3ac87f1281a --- /dev/null +++ b/libraries/tests/mbed/can_loopback/main.cpp @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "test_env.h" + +#if defined(TARGET_LPC1549) +CAN can1(D9, D8); +#elif defined(TARGET_LPC1768) || defined(TARGET_LPC4088) +CAN can1(p9, p10); +#endif + +#define TEST_ITERATIONS 127 + +int main() { + MBED_HOSTTEST_TIMEOUT(20); + MBED_HOSTTEST_SELECT(dev_null); + MBED_HOSTTEST_DESCRIPTION(CAN Loopback); + MBED_HOSTTEST_START("MBED_A27"); + + can1.mode(CAN::Reset); + + if (!can1.mode(CAN::LocalTest)) { + printf("Mode change failed\n"); + } + + char success_count = 0; + for (char i=0; i < TEST_ITERATIONS; i++) { + unsigned int id = 1337; + CANMessage tx_msg(id, &i, sizeof(i)); + bool sent = false; + if (can1.write(tx_msg)) { + printf("Sent %u: %d\n", id, i); + sent = true; + } + wait_ms(50); + + bool read = false; + CANMessage rx_msg; + if (can1.read(rx_msg)) { + printf("Read %u: %d\n", rx_msg.id, rx_msg.data[0]); + read = (rx_msg.id == id) && (rx_msg.data[0] == i); + } + + bool success = sent && read; + + if (success) { + success_count++; + } + } + + MBED_HOSTTEST_RESULT(success_count == TEST_ITERATIONS); +} diff --git a/workspace_tools/tests.py b/workspace_tools/tests.py index 55c326cae23..fe76f04a4e0 100644 --- a/workspace_tools/tests.py +++ b/workspace_tools/tests.py @@ -80,7 +80,12 @@ * i2c_eeprom: * LPC1*: (SDA=p28 , SCL=p27) * KL25Z: (SDA=PTE0, SCL=PTE1) - + + * can_transceiver: + * LPC1768: (RX=p9, TX=p10) + * LPC1549: (RX=D9, TX=D8) + * LPC4088: (RX=p9, TX=p10) + """ TESTS = [ # Automated MBED tests @@ -270,6 +275,15 @@ "automated": True, "duration": 10, }, + { + "id": "MBED_A27", "description": "CAN loopback test", + "source_dir": join(TEST_DIR, "mbed", "can_loopback"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "duration": 20, + "peripherals": ["can_transceiver"], + "mcu": ["LPC1549", "LPC1768"], + }, { "id": "MBED_BLINKY", "description": "Blinky", "source_dir": join(TEST_DIR, "mbed", "blinky"), From fe04561a7cf4fe98f714837d276fe18547d7081b Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 7 Apr 2015 21:58:45 -0700 Subject: [PATCH 04/24] [mbed][LPC17XX] Implement CAN::mode for LPC176X Implement all CAN modes except for GlobalTest and SilentTest on on the LPC17XX --- .../hal/TARGET_NXP/TARGET_LPC176X/can_api.c | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/can_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/can_api.c index 5aab4451339..75d6d7e633a 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/can_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/can_api.c @@ -79,7 +79,45 @@ static inline void can_enable(can_t *obj) { } int can_mode(can_t *obj, CanMode mode) { - return 0; // not implemented + int success = 0; + switch (mode) { + case MODE_RESET: + // Clear all special modes + can_reset(obj); + obj->dev->MOD &=~ 0x06; + success = 1; + break; + case MODE_NORMAL: + // Clear all special modes + can_disable(obj); + obj->dev->MOD &=~ 0x06; + can_enable(obj); + success = 1; + break; + case MODE_SILENT: + // Set listen-only mode and clear self-test mode + can_disable(obj); + obj->dev->MOD |= 0x02; + obj->dev->MOD &=~ 0x04; + can_enable(obj); + success = 1; + break; + case MODE_TEST_LOCAL: + // Set self-test mode and clear listen-only mode + can_disable(obj); + obj->dev->MOD |= 0x04; + obj->dev->MOD &=~ 0x02; + can_enable(obj); + success = 1; + break; + case MODE_TEST_SILENT: + case MODE_TEST_GLOBAL: + default: + success = 0; + break; + } + + return success; } int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle) { @@ -316,6 +354,12 @@ int can_write(can_t *obj, CAN_Message msg, int cc) { const unsigned int *buf = (const unsigned int *)&m; CANStatus = obj->dev->SR; + + // Send the message to ourself if in a test mode + if (obj->dev->MOD & 0x04) { + cc = 1; + } + if (CANStatus & 0x00000004) { obj->dev->TFI1 = buf[0] & 0xC00F0000; obj->dev->TID1 = buf[1]; From c9324b7c0f3ed4a5e71ca48dcee143b046530b27 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Thu, 23 Apr 2015 19:33:13 +0300 Subject: [PATCH 05/24] Added C12832 LCD display library and SPI C12832 test. --- libraries/tests/mbed/spi_C12832/main.cpp | 54 ++ libraries/tests/peripherals/C12832/C12832.cpp | 564 ++++++++++++++++++ libraries/tests/peripherals/C12832/C12832.h | 314 ++++++++++ .../peripherals/C12832/GraphicsDisplay.cpp | 176 ++++++ .../peripherals/C12832/GraphicsDisplay.h | 55 ++ libraries/tests/peripherals/C12832/Small_7.h | 104 ++++ .../tests/peripherals/C12832/TextDisplay.cpp | 77 +++ .../tests/peripherals/C12832/TextDisplay.h | 96 +++ workspace_tools/tests.py | 8 + 9 files changed, 1448 insertions(+) create mode 100644 libraries/tests/mbed/spi_C12832/main.cpp create mode 100644 libraries/tests/peripherals/C12832/C12832.cpp create mode 100644 libraries/tests/peripherals/C12832/C12832.h create mode 100644 libraries/tests/peripherals/C12832/GraphicsDisplay.cpp create mode 100644 libraries/tests/peripherals/C12832/GraphicsDisplay.h create mode 100644 libraries/tests/peripherals/C12832/Small_7.h create mode 100644 libraries/tests/peripherals/C12832/TextDisplay.cpp create mode 100644 libraries/tests/peripherals/C12832/TextDisplay.h diff --git a/libraries/tests/mbed/spi_C12832/main.cpp b/libraries/tests/mbed/spi_C12832/main.cpp new file mode 100644 index 00000000000..772fd0544d4 --- /dev/null +++ b/libraries/tests/mbed/spi_C12832/main.cpp @@ -0,0 +1,54 @@ +/* Copyright (c) 2010-2011 mbed.org, MIT License +* +* Permission is hereby granted, free of charge, to any person obtaining a copy of this software +* and associated documentation files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all copies or +* substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test_env.h" +#include "mbed.h" +#include "C12832.h" + +int main() +{ + MBED_HOSTTEST_TIMEOUT(15); + MBED_HOSTTEST_SELECT(default_auto); + MBED_HOSTTEST_DESCRIPTION(SPI C12832 display); + MBED_HOSTTEST_START("MBED_35"); + + C12832 lcd(D11, D13, D12, D7, D10); + + // clear the screen + lcd.cls(); + + // print the first line and wait 3 sec + lcd.locate(0,3); + lcd.printf("mbed application board!"); + + // print the counter prefix; the number will be printed in the while loop + lcd.locate(0,15); + lcd.printf("Counting:"); + + int i=1, j=0; + while(i++,i<=200) { + lcd.locate(42,15); + lcd.printf("%d", i); + if (i % 50 == 0) { + lcd.invert(j = j ? 0 : 1); + }; + wait(0.001); + } + + MBED_HOSTTEST_RESULT(1); +} \ No newline at end of file diff --git a/libraries/tests/peripherals/C12832/C12832.cpp b/libraries/tests/peripherals/C12832/C12832.cpp new file mode 100644 index 00000000000..8fa28b67572 --- /dev/null +++ b/libraries/tests/peripherals/C12832/C12832.cpp @@ -0,0 +1,564 @@ +/* mbed library for the mbed Lab Board 128*32 pixel LCD + * use C12832 controller + * Copyright (c) 2012 Peter Drescher - DC2PD + * Released under the MIT License: http://mbed.org/license/mit + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// 13.10.12 initial design +// 25.10.12 add autorefresh of screen +// 25.10.12 add standart font +// 20.12.12 add bitmap graphics + +// optional defines : +// #define debug_lcd 1 + +#include "C12832.h" +#include "mbed.h" +#include "stdio.h" +#include "Small_7.h" + +#define BPP 1 // Bits per pixel + + +C12832::C12832(PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char* name) + : GraphicsDisplay(name),_spi(mosi,NC,sck),_reset(reset),_A0(a0),_CS(ncs) +{ + orientation = 1; + draw_mode = NORMAL; + char_x = 0; + lcd_reset(); +} + + +int C12832::width() +{ + if (orientation == 0 || orientation == 2) return 32; + else return 128; +} + +int C12832::height() +{ + if (orientation == 0 || orientation == 2) return 128; + else return 32; +} + + +void C12832::invert(unsigned int o) +{ + if(o == 0) wr_cmd(0xA6); + else wr_cmd(0xA7); +} + + +void C12832::set_contrast(unsigned int o) +{ + contrast = o; + wr_cmd(0x81); // set volume + wr_cmd(o & 0x3F); +} + +unsigned int C12832::get_contrast(void) +{ + return(contrast); +} + + +// write command to lcd controller + +void C12832::wr_cmd(unsigned char cmd) +{ + _A0 = 0; + _CS = 0; + _spi.write(cmd); + _CS = 1; +} + +// write data to lcd controller + +void C12832::wr_dat(unsigned char dat) +{ + _A0 = 1; + _CS = 0; + _spi.write(dat); + _CS = 1; +} + +// reset and init the lcd controller + +void C12832::lcd_reset() +{ + + _spi.format(8,3); // 8 bit spi mode 3 + _spi.frequency(20000000); // 19,2 Mhz SPI clock + _A0 = 0; + _CS = 1; + _reset = 0; // display reset + wait_us(50); + _reset = 1; // end reset + wait_ms(5); + + /* Start Initial Sequence ----------------------------------------------------*/ + + wr_cmd(0xAE); // display off + wr_cmd(0xA2); // bias voltage + + wr_cmd(0xA0); + wr_cmd(0xC8); // colum normal + + wr_cmd(0x22); // voltage resistor ratio + wr_cmd(0x2F); // power on + //wr_cmd(0xA4); // LCD display ram + wr_cmd(0x40); // start line = 0 + wr_cmd(0xAF); // display ON + + wr_cmd(0x81); // set contrast + wr_cmd(0x17); // set contrast + + wr_cmd(0xA6); // display normal + + + // clear and update LCD + memset(buffer,0x00,512); // clear display buffer + copy_to_lcd(); + auto_up = 1; // switch on auto update + // dont do this by default. Make the user call + //claim(stdout); // redirekt printf to lcd + locate(0,0); + set_font((unsigned char*)Small_7); // standart font +} + +// set one pixel in buffer + +void C12832::pixel(int x, int y, int color) +{ + // first check parameter + if(x > 128 || y > 32 || x < 0 || y < 0) return; + + if(draw_mode == NORMAL) { + if(color == 0) + buffer[x + ((y/8) * 128)] &= ~(1 << (y%8)); // erase pixel + else + buffer[x + ((y/8) * 128)] |= (1 << (y%8)); // set pixel + } else { // XOR mode + if(color == 1) + buffer[x + ((y/8) * 128)] ^= (1 << (y%8)); // xor pixel + } +} + +// update lcd + +void C12832::copy_to_lcd(void) +{ + + int i=0; + + //page 0 + wr_cmd(0x00); // set column low nibble 0 + wr_cmd(0x10); // set column hi nibble 0 + wr_cmd(0xB0); // set page address 0 + _A0 = 1; + for(i=0; i<128; i++) { + wr_dat(buffer[i]); + } + + // page 1 + wr_cmd(0x00); // set column low nibble 0 + wr_cmd(0x10); // set column hi nibble 0 + wr_cmd(0xB1); // set page address 1 + _A0 = 1; + for(i=128; i<256; i++) { + wr_dat(buffer[i]); + } + + //page 2 + wr_cmd(0x00); // set column low nibble 0 + wr_cmd(0x10); // set column hi nibble 0 + wr_cmd(0xB2); // set page address 2 + _A0 = 1; + for(i=256; i<384; i++) { + wr_dat(buffer[i]); + } + + //page 3 + wr_cmd(0x00); // set column low nibble 0 + wr_cmd(0x10); // set column hi nibble 0 + wr_cmd(0xB3); // set page address 3 + _A0 = 1; + + _CS = 0; + + for(i=384; i<512; i++) { + wr_dat(buffer[i]); + } + +} + +void C12832::cls(void) +{ + memset(buffer,0x00,512); // clear display buffer + copy_to_lcd(); +} + + +void C12832::line(int x0, int y0, int x1, int y1, int color) +{ + int dx = 0, dy = 0; + int dx_sym = 0, dy_sym = 0; + int dx_x2 = 0, dy_x2 = 0; + int di = 0; + + dx = x1-x0; + dy = y1-y0; + + // if (dx == 0) { /* vertical line */ + // if (y1 > y0) vline(x0,y0,y1,color); + // else vline(x0,y1,y0,color); + // return; + // } + + if (dx > 0) { + dx_sym = 1; + } else { + dx_sym = -1; + } + // if (dy == 0) { /* horizontal line */ + // if (x1 > x0) hline(x0,x1,y0,color); + // else hline(x1,x0,y0,color); + // return; + // } + + if (dy > 0) { + dy_sym = 1; + } else { + dy_sym = -1; + } + + dx = dx_sym*dx; + dy = dy_sym*dy; + + dx_x2 = dx*2; + dy_x2 = dy*2; + + if (dx >= dy) { + di = dy_x2 - dx; + while (x0 != x1) { + + pixel(x0, y0, color); + x0 += dx_sym; + if (di<0) { + di += dy_x2; + } else { + di += dy_x2 - dx_x2; + y0 += dy_sym; + } + } + pixel(x0, y0, color); + } else { + di = dx_x2 - dy; + while (y0 != y1) { + pixel(x0, y0, color); + y0 += dy_sym; + if (di < 0) { + di += dx_x2; + } else { + di += dx_x2 - dy_x2; + x0 += dx_sym; + } + } + pixel(x0, y0, color); + } + if(auto_up) copy_to_lcd(); +} + +void C12832::rect(int x0, int y0, int x1, int y1, int color) +{ + + if (x1 > x0) line(x0,y0,x1,y0,color); + else line(x1,y0,x0,y0,color); + + if (y1 > y0) line(x0,y0,x0,y1,color); + else line(x0,y1,x0,y0,color); + + if (x1 > x0) line(x0,y1,x1,y1,color); + else line(x1,y1,x0,y1,color); + + if (y1 > y0) line(x1,y0,x1,y1,color); + else line(x1,y1,x1,y0,color); + + if(auto_up) copy_to_lcd(); +} + +void C12832::fillrect(int x0, int y0, int x1, int y1, int color) +{ + int l,c,i; + if(x0 > x1) { + i = x0; + x0 = x1; + x1 = i; + } + + if(y0 > y1) { + i = y0; + y0 = y1; + y1 = i; + } + + for(l = x0; l<= x1; l ++) { + for(c = y0; c<= y1; c++) { + pixel(l,c,color); + } + } + if(auto_up) copy_to_lcd(); +} + + + +void C12832::circle(int x0, int y0, int r, int color) +{ + + int draw_x0, draw_y0; + int draw_x1, draw_y1; + int draw_x2, draw_y2; + int draw_x3, draw_y3; + int draw_x4, draw_y4; + int draw_x5, draw_y5; + int draw_x6, draw_y6; + int draw_x7, draw_y7; + int xx, yy; + int di; + //WindowMax(); + if (r == 0) { /* no radius */ + return; + } + + draw_x0 = draw_x1 = x0; + draw_y0 = draw_y1 = y0 + r; + if (draw_y0 < height()) { + pixel(draw_x0, draw_y0, color); /* 90 degree */ + } + + draw_x2 = draw_x3 = x0; + draw_y2 = draw_y3 = y0 - r; + if (draw_y2 >= 0) { + pixel(draw_x2, draw_y2, color); /* 270 degree */ + } + + draw_x4 = draw_x6 = x0 + r; + draw_y4 = draw_y6 = y0; + if (draw_x4 < width()) { + pixel(draw_x4, draw_y4, color); /* 0 degree */ + } + + draw_x5 = draw_x7 = x0 - r; + draw_y5 = draw_y7 = y0; + if (draw_x5>=0) { + pixel(draw_x5, draw_y5, color); /* 180 degree */ + } + + if (r == 1) { + return; + } + + di = 3 - 2*r; + xx = 0; + yy = r; + while (xx < yy) { + + if (di < 0) { + di += 4*xx + 6; + } else { + di += 4*(xx - yy) + 10; + yy--; + draw_y0--; + draw_y1--; + draw_y2++; + draw_y3++; + draw_x4--; + draw_x5++; + draw_x6--; + draw_x7++; + } + xx++; + draw_x0++; + draw_x1--; + draw_x2++; + draw_x3--; + draw_y4++; + draw_y5++; + draw_y6--; + draw_y7--; + + if ( (draw_x0 <= width()) && (draw_y0>=0) ) { + pixel(draw_x0, draw_y0, color); + } + + if ( (draw_x1 >= 0) && (draw_y1 >= 0) ) { + pixel(draw_x1, draw_y1, color); + } + + if ( (draw_x2 <= width()) && (draw_y2 <= height()) ) { + pixel(draw_x2, draw_y2, color); + } + + if ( (draw_x3 >=0 ) && (draw_y3 <= height()) ) { + pixel(draw_x3, draw_y3, color); + } + + if ( (draw_x4 <= width()) && (draw_y4 >= 0) ) { + pixel(draw_x4, draw_y4, color); + } + + if ( (draw_x5 >= 0) && (draw_y5 >= 0) ) { + pixel(draw_x5, draw_y5, color); + } + if ( (draw_x6 <=width()) && (draw_y6 <= height()) ) { + pixel(draw_x6, draw_y6, color); + } + if ( (draw_x7 >= 0) && (draw_y7 <= height()) ) { + pixel(draw_x7, draw_y7, color); + } + } + if(auto_up) copy_to_lcd(); +} + +void C12832::fillcircle(int x, int y, int r, int color) +{ + int i,up; + up = auto_up; + auto_up = 0; // off + for (i = 0; i <= r; i++) + circle(x,y,i,color); + auto_up = up; + if(auto_up) copy_to_lcd(); +} + +void C12832::setmode(int mode) +{ + draw_mode = mode; +} + +void C12832::locate(int x, int y) +{ + char_x = x; + char_y = y; +} + + + +int C12832::columns() +{ + return width() / font[1]; +} + + + +int C12832::rows() +{ + return height() / font[2]; +} + + + +int C12832::_putc(int value) +{ + if (value == '\n') { // new line + char_x = 0; + char_y = char_y + font[2]; + if (char_y >= height() - font[2]) { + char_y = 0; + } + } else { + character(char_x, char_y, value); + if(auto_up) copy_to_lcd(); + } + return value; +} + +void C12832::character(int x, int y, int c) +{ + unsigned int hor,vert,offset,bpl,j,i,b; + unsigned char* zeichen; + unsigned char z,w; + + if ((c < 31) || (c > 127)) return; // test char range + + // read font parameter from start of array + offset = font[0]; // bytes / char + hor = font[1]; // get hor size of font + vert = font[2]; // get vert size of font + bpl = font[3]; // bytes per line + + if (char_x + hor > width()) { + char_x = 0; + char_y = char_y + vert; + if (char_y >= height() - font[2]) { + char_y = 0; + } + } + + zeichen = &font[((c -32) * offset) + 4]; // start of char bitmap + w = zeichen[0]; // width of actual char + // construct the char into the buffer + for (j=0; j> 3)+1]; + b = 1 << (j & 0x07); + if (( z & b ) == 0x00) { + pixel(x+i,y+j,0); + } else { + pixel(x+i,y+j,1); + } + + } + } + + char_x += w; +} + + +void C12832::set_font(unsigned char* f) +{ + font = f; +} + +void C12832::set_auto_up(unsigned int up) +{ + if(up ) auto_up = 1; + else auto_up = 0; +} + +unsigned int C12832::get_auto_up(void) +{ + return (auto_up); +} + +void C12832::print_bm(Bitmap bm, int x, int y) +{ + int h,v,b; + char d; + + for(v=0; v < bm.ySize; v++) { // lines + for(h=0; h < bm.xSize; h++) { // pixel + if(h + x > 127) break; + if(v + y > 31) break; + d = bm.data[bm.Byte_in_Line * v + ((h & 0xF8) >> 3)]; + b = 0x80 >> (h & 0x07); + if((d & b) == 0) { + pixel(x+h,y+v,0); + } else { + pixel(x+h,y+v,1); + } + } + } + +} + + diff --git a/libraries/tests/peripherals/C12832/C12832.h b/libraries/tests/peripherals/C12832/C12832.h new file mode 100644 index 00000000000..e106a07a7a2 --- /dev/null +++ b/libraries/tests/peripherals/C12832/C12832.h @@ -0,0 +1,314 @@ +/* mbed library for the mbed Lab Board 128*32 pixel LCD + * use C12832 controller + * Copyright (c) 2012 Peter Drescher - DC2PD + * Released under the MIT License: http://mbed.org/license/mit + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef C12832_H +#define C12832_H + +#include "mbed.h" +#include "GraphicsDisplay.h" + + +/** + * Optional Defines: + * #define debug_lcd 1 enable infos to PC_USB + */ + +// some defines for the DMA use +#define DMA_CHANNEL_ENABLE 1 +#define DMA_TRANSFER_TYPE_M2P (1UL << 11) +#define DMA_CHANNEL_TCIE (1UL << 31) +#define DMA_CHANNEL_SRC_INC (1UL << 26) +#define DMA_MASK_IE (1UL << 14) +#define DMA_MASK_ITC (1UL << 15) +#define DMA_SSP1_TX (1UL << 2) +#define DMA_SSP0_TX (0) +#define DMA_DEST_SSP1_TX (2UL << 6) +#define DMA_DEST_SSP0_TX (0UL << 6) + +/** + * Draw mode + * NORMAL + * XOR set pixel by xor the screen + */ +enum {NORMAL,XOR}; + +/** + * Bitmap + */ +struct Bitmap{ + int xSize; + int ySize; + int Byte_in_Line; + char* data; +}; + +/** + * The C12832 class + */ +class C12832 : public GraphicsDisplay +{ +public: + /** + * Create a C12832 object connected to SPI1 + */ + C12832(PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char* name = "LCD"); + + /** + * Get the width of the screen in pixel + * + * @returns width of screen in pixel + * + */ + virtual int width(); + + /** + * Get the height of the screen in pixel + * + * @returns height of screen in pixel + */ + virtual int height(); + + /** + * Draw a pixel at x,y black or white + * + * @param x horizontal position + * @param y vertical position + * @param color - 1 set pixel, 0 erase pixel + */ + virtual void pixel(int x, int y,int colour); + + /** + * Draw a circle + * + * @param x0,y0 center + * @param r radius + * @param color - 1 set pixel, 0 erase pixel + */ + void circle(int x, int y, int r, int colour); + + /** + * Draw a filled circle + * + * @param x0,y0 center + * @param r radius + * @param color - 1 set pixel, 0 erase pixel + * + * Use circle with different radius, + * Can miss some pixels + */ + void fillcircle(int x, int y, int r, int colour); + + /** + * Draw a 1 pixel line + * + * @param x0,y0 start point + * @param x1,y1 stop point + * @param color - 1 set pixel, 0 erase pixel + */ + void line(int x0, int y0, int x1, int y1, int colour); + + /** + * Draw a rect + * + * @param x0,y0 top left corner + * @param x1,y1 down right corner + * @param color - 1 set pixel, 0 erase pixel + */ + void rect(int x0, int y0, int x1, int y1, int colour); + + /** + * Draw a filled rect + * + * @param x0,y0 top left corner + * @param x1,y1 down right corner + * @param color - 1 set pixel, 0 erase pixel + */ + void fillrect(int x0, int y0, int x1, int y1, int colour); + + /** + * Copy display buffer to LCD + */ + void copy_to_lcd(void); + + /** + * Set the orienation of the screen + */ + + void set_contrast(unsigned int o); + + /** + * Read the contrast level + */ + unsigned int get_contrast(void); + + /** + * Invert the screen + * + * @param o = 0 normal, 1 invert + */ + void invert(unsigned int o); + + /** + * Clear the screen + */ + virtual void cls(void); + + /** + * Set the drawing mode + * + * @param mode NORMAl or XOR + */ + void setmode(int mode); + + virtual int columns(void); + + /** + * Calculate the max number of columns. + * Depends on actual font size + * + * @returns max column + */ + virtual int rows(void); + + /** + * Put a char on the screen + * + * @param value char to print + * @returns printed char + */ + virtual int _putc(int value); + + /** + * Draw a character on given position out of the active font to the LCD + * + * @param x x-position of char (top left) + * @param y y-position + * @param c char to print + */ + virtual void character(int x, int y, int c); + + /** + * Setup cursor position + * + * @param x x-position (top left) + * @param y y-position + */ + virtual void locate(int x, int y); + + /** + * Setup auto update of screen + * + * @param up 1 = on , 0 = off + * + * if switched off the program has to call copy_to_lcd() + * to update screen from framebuffer + */ + void set_auto_up(unsigned int up); + + /** + * Get status of the auto update function + * + * @returns if auto update is on + */ + unsigned int get_auto_up(void); + + /** Vars */ + SPI _spi; + DigitalOut _reset; + DigitalOut _A0; + DigitalOut _CS; + unsigned char* font; + unsigned int draw_mode; + + + /** + * Select the font to use + * + * @param f pointer to font array + * + * font array can created with GLCD Font Creator from http://www.mikroe.com + * you have to add 4 parameter at the beginning of the font array to use: + * - the number of byte / char + * - the vertial size in pixel + * - the horizontal size in pixel + * - the number of byte per vertical line + * you also have to change the array to char[] + */ + void set_font(unsigned char* f); + + /** + * Print bitmap to buffer + * + * @param bm Bitmap in flash + * @param x x start + * @param y y start + */ + void print_bm(Bitmap bm, int x, int y); + +protected: + + /** + * Draw a horizontal line + * + * @param x0 horizontal start + * @param x1 horizontal stop + * @param y vertical position + * @param color - 1 set pixel, 0 erase pixel + */ + void hline(int x0, int x1, int y, int colour); + + /** + * Draw a vertical line + * + * @param x horizontal position + * @param y0 vertical start + * @param y1 vertical stop + * @param color - 1 set pixel, 0 erase pixel + */ + void vline(int y0, int y1, int x, int colour); + + /** + * Init the C12832 LCD controller + */ + void lcd_reset(); + + /** + * Write data to the LCD controller + * + * @param dat data written to LCD controller + */ + void wr_dat(unsigned char value); + + /** + * Write a command the LCD controller + * + * @param cmd: command to be written + */ + void wr_cmd(unsigned char value); + + void wr_cnt(unsigned char cmd); + + unsigned int orientation; + unsigned int char_x; + unsigned int char_y; + unsigned char buffer[512]; + unsigned int contrast; + unsigned int auto_up; + +}; + + + + +#endif diff --git a/libraries/tests/peripherals/C12832/GraphicsDisplay.cpp b/libraries/tests/peripherals/C12832/GraphicsDisplay.cpp new file mode 100644 index 00000000000..51feb83f617 --- /dev/null +++ b/libraries/tests/peripherals/C12832/GraphicsDisplay.cpp @@ -0,0 +1,176 @@ +/* mbed GraphicsDisplay Display Library Base Class + * Copyright (c) 2007-2009 sford + * Released under the MIT License: http://mbed.org/license/mit + */ + +#include "GraphicsDisplay.h" + +const unsigned char FONT8x8[97][8] = { +0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00, // columns, rows, num_bytes_per_char +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // space 0x20 +0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00, // ! +0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00, // " +0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00, // # +0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00, // $ +0x00,0x63,0x66,0x0C,0x18,0x33,0x63,0x00, // % +0x1C,0x36,0x1C,0x3B,0x6E,0x66,0x3B,0x00, // & +0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00, // ' +0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00, // ( +0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00, // ) +0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00, // * +0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00, // + +0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30, // , +0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00, // - +0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00, // . +0x03,0x06,0x0C,0x18,0x30,0x60,0x40,0x00, // / (forward slash) +0x3E,0x63,0x63,0x6B,0x63,0x63,0x3E,0x00, // 0 0x30 +0x18,0x38,0x58,0x18,0x18,0x18,0x7E,0x00, // 1 +0x3C,0x66,0x06,0x1C,0x30,0x66,0x7E,0x00, // 2 +0x3C,0x66,0x06,0x1C,0x06,0x66,0x3C,0x00, // 3 +0x0E,0x1E,0x36,0x66,0x7F,0x06,0x0F,0x00, // 4 +0x7E,0x60,0x7C,0x06,0x06,0x66,0x3C,0x00, // 5 +0x1C,0x30,0x60,0x7C,0x66,0x66,0x3C,0x00, // 6 +0x7E,0x66,0x06,0x0C,0x18,0x18,0x18,0x00, // 7 +0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00, // 8 +0x3C,0x66,0x66,0x3E,0x06,0x0C,0x38,0x00, // 9 +0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00, // : +0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x30, // ; +0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00, // < +0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00, // = +0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00, // > +0x3C,0x66,0x06,0x0C,0x18,0x00,0x18,0x00, // ? +0x3E,0x63,0x6F,0x69,0x6F,0x60,0x3E,0x00, // @ 0x40 +0x18,0x3C,0x66,0x66,0x7E,0x66,0x66,0x00, // A +0x7E,0x33,0x33,0x3E,0x33,0x33,0x7E,0x00, // B +0x1E,0x33,0x60,0x60,0x60,0x33,0x1E,0x00, // C +0x7C,0x36,0x33,0x33,0x33,0x36,0x7C,0x00, // D +0x7F,0x31,0x34,0x3C,0x34,0x31,0x7F,0x00, // E +0x7F,0x31,0x34,0x3C,0x34,0x30,0x78,0x00, // F +0x1E,0x33,0x60,0x60,0x67,0x33,0x1F,0x00, // G +0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00, // H +0x3C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00, // I +0x0F,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, // J +0x73,0x33,0x36,0x3C,0x36,0x33,0x73,0x00, // K +0x78,0x30,0x30,0x30,0x31,0x33,0x7F,0x00, // L +0x63,0x77,0x7F,0x7F,0x6B,0x63,0x63,0x00, // M +0x63,0x73,0x7B,0x6F,0x67,0x63,0x63,0x00, // N +0x3E,0x63,0x63,0x63,0x63,0x63,0x3E,0x00, // O +0x7E,0x33,0x33,0x3E,0x30,0x30,0x78,0x00, // P 0x50 +0x3C,0x66,0x66,0x66,0x6E,0x3C,0x0E,0x00, // Q +0x7E,0x33,0x33,0x3E,0x36,0x33,0x73,0x00, // R +0x3C,0x66,0x30,0x18,0x0C,0x66,0x3C,0x00, // S +0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00, // T +0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x00, // U +0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00, // V +0x63,0x63,0x63,0x6B,0x7F,0x77,0x63,0x00, // W +0x63,0x63,0x36,0x1C,0x1C,0x36,0x63,0x00, // X +0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00, // Y +0x7F,0x63,0x46,0x0C,0x19,0x33,0x7F,0x00, // Z +0x3C,0x30,0x30,0x30,0x30,0x30,0x3C,0x00, // [ +0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x00, // \ (back slash) +0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00, // ] +0x08,0x1C,0x36,0x63,0x00,0x00,0x00,0x00, // ^ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, // _ +0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00, // ` 0x60 +0x00,0x00,0x3C,0x06,0x3E,0x66,0x3B,0x00, // a +0x70,0x30,0x3E,0x33,0x33,0x33,0x6E,0x00, // b +0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x00, // c +0x0E,0x06,0x3E,0x66,0x66,0x66,0x3B,0x00, // d +0x00,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00, // e +0x1C,0x36,0x30,0x78,0x30,0x30,0x78,0x00, // f +0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x7C, // g +0x70,0x30,0x36,0x3B,0x33,0x33,0x73,0x00, // h +0x18,0x00,0x38,0x18,0x18,0x18,0x3C,0x00, // i +0x06,0x00,0x06,0x06,0x06,0x66,0x66,0x3C, // j +0x70,0x30,0x33,0x36,0x3C,0x36,0x73,0x00, // k +0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00, // l +0x00,0x00,0x66,0x7F,0x7F,0x6B,0x63,0x00, // m +0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x00, // n +0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00, // o +0x00,0x00,0x6E,0x33,0x33,0x3E,0x30,0x78, // p +0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x0F, // q +0x00,0x00,0x6E,0x3B,0x33,0x30,0x78,0x00, // r +0x00,0x00,0x3E,0x60,0x3C,0x06,0x7C,0x00, // s +0x08,0x18,0x3E,0x18,0x18,0x1A,0x0C,0x00, // t +0x00,0x00,0x66,0x66,0x66,0x66,0x3B,0x00, // u +0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x00, // v +0x00,0x00,0x63,0x6B,0x7F,0x7F,0x36,0x00, // w +0x00,0x00,0x63,0x36,0x1C,0x36,0x63,0x00, // x +0x00,0x00,0x66,0x66,0x66,0x3E,0x06,0x7C, // y +0x00,0x00,0x7E,0x4C,0x18,0x32,0x7E,0x00, // z +0x0E,0x18,0x18,0x70,0x18,0x18,0x0E,0x00, // { +0x0C,0x0C,0x0C,0x00,0x0C,0x0C,0x0C,0x00, // | +0x70,0x18,0x18,0x0E,0x18,0x18,0x70,0x00, // } +0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00, // ~ +0x1C,0x36,0x36,0x1C,0x00,0x00,0x00,0x00}; // DEL + +GraphicsDisplay::GraphicsDisplay(const char *name):TextDisplay(name) { + foreground(0xFFFF); + background(0x0000); +} + +void GraphicsDisplay::character(int column, int row, int value) { + blitbit(column * 8, row * 8, 8, 8, (char*)&(FONT8x8[value - 0x1F][0])); +} + +void GraphicsDisplay::window(int x, int y, int w, int h) { + // current pixel location + _x = x; + _y = y; + // window settings + _x1 = x; + _x2 = x + w - 1; + _y1 = y; + _y2 = y + h - 1; +} + +void GraphicsDisplay::putp(int colour) { + // put pixel at current pixel location + pixel(_x, _y, colour); + // update pixel location based on window settings + _x++; + if(_x > _x2) { + _x = _x1; + _y++; + if(_y > _y2) { + _y = _y1; + } + } +} + +void GraphicsDisplay::fill(int x, int y, int w, int h, int colour) { + window(x, y, w, h); + for(int i=0; i> 3]; + int offset = i & 0x7; + int c = ((byte << offset) & 0x80) ? _foreground : _background; + putp(c); + } +} + +int GraphicsDisplay::columns() { + return width() / 8; +} + +int GraphicsDisplay::rows() { + return height() / 8; +} + diff --git a/libraries/tests/peripherals/C12832/GraphicsDisplay.h b/libraries/tests/peripherals/C12832/GraphicsDisplay.h new file mode 100644 index 00000000000..2dfe0f38306 --- /dev/null +++ b/libraries/tests/peripherals/C12832/GraphicsDisplay.h @@ -0,0 +1,55 @@ +/* mbed GraphicsDisplay Display Library Base Class + * Copyright (c) 2007-2009 sford + * Released under the MIT License: http://mbed.org/license/mit + * + * A library for providing a common base class for Graphics displays + * To port a new display, derive from this class and implement + * the constructor (setup the display), pixel (put a pixel + * at a location), width and height functions. Everything else + * (locate, printf, putc, cls, window, putp, fill, blit, blitbit) + * will come for free. You can also provide a specialised implementation + * of window and putp to speed up the results + */ + +#ifndef MBED_GRAPHICSDISPLAY_H +#define MBED_GRAPHICSDISPLAY_H + +#include "TextDisplay.h" + +class GraphicsDisplay : public TextDisplay { + +public: + + GraphicsDisplay(const char* name); + + virtual void pixel(int x, int y, int colour) = 0; + virtual int width() = 0; + virtual int height() = 0; + + virtual void window(int x, int y, int w, int h); + virtual void putp(int colour); + + virtual void cls(); + virtual void fill(int x, int y, int w, int h, int colour); + virtual void blit(int x, int y, int w, int h, const int *colour); + virtual void blitbit(int x, int y, int w, int h, const char* colour); + + virtual void character(int column, int row, int value); + virtual int columns(); + virtual int rows(); + +protected: + + // pixel location + short _x; + short _y; + + // window location + short _x1; + short _x2; + short _y1; + short _y2; + +}; + +#endif diff --git a/libraries/tests/peripherals/C12832/Small_7.h b/libraries/tests/peripherals/C12832/Small_7.h new file mode 100644 index 00000000000..b0a8f9a9228 --- /dev/null +++ b/libraries/tests/peripherals/C12832/Small_7.h @@ -0,0 +1,104 @@ +#ifndef small_7 +#define small_7 + +const unsigned char Small_7[] = { + 19,9,9,2, // Length,horz,vert,byte/vert + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char + 0x02, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ! + 0x04, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char " + 0x06, 0x00, 0x00, 0x50, 0x00, 0xF8, 0x00, 0x50, 0x00, 0xF8, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char # + 0x06, 0x00, 0x00, 0x8C, 0x00, 0x92, 0x00, 0xFE, 0x01, 0xA2, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char $ + 0x07, 0x1E, 0x00, 0x92, 0x00, 0x5E, 0x00, 0x20, 0x00, 0xF8, 0x00, 0x94, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char % + 0x07, 0x00, 0x00, 0x64, 0x00, 0x9A, 0x00, 0xAA, 0x00, 0xCC, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char & + 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ' + 0x03, 0x00, 0x00, 0x7C, 0x00, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ( + 0x03, 0x00, 0x00, 0x83, 0x01, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ) + 0x04, 0x00, 0x00, 0x30, 0x00, 0x78, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char * + 0x05, 0x10, 0x00, 0x10, 0x00, 0x7C, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char + + 0x02, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char , + 0x04, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char - + 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char . + 0x04, 0x00, 0x01, 0xE0, 0x00, 0x1C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char / + 0x05, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0 + 0x05, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1 + 0x05, 0x00, 0x00, 0x84, 0x00, 0xC2, 0x00, 0xA2, 0x00, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2 + 0x05, 0x00, 0x00, 0x82, 0x00, 0x92, 0x00, 0x92, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3 + 0x05, 0x00, 0x00, 0x38, 0x00, 0x2C, 0x00, 0x22, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4 + 0x05, 0x00, 0x00, 0x9E, 0x00, 0x92, 0x00, 0x92, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5 + 0x05, 0x00, 0x00, 0x7C, 0x00, 0x92, 0x00, 0x92, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6 + 0x05, 0x00, 0x00, 0x02, 0x00, 0xC2, 0x00, 0x32, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7 + 0x05, 0x00, 0x00, 0x6C, 0x00, 0x92, 0x00, 0x92, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8 + 0x05, 0x00, 0x00, 0x9C, 0x00, 0x92, 0x00, 0x92, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9 + 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char : + 0x02, 0x00, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ; + 0x05, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char < + 0x05, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char = + 0x05, 0x00, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char > + 0x05, 0x00, 0x00, 0x02, 0x00, 0xB2, 0x00, 0x12, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ? + 0x09, 0x00, 0x00, 0xF8, 0x00, 0x84, 0x01, 0x72, 0x01, 0x4A, 0x01, 0x4A, 0x01, 0x7A, 0x01, 0x42, 0x00, 0x3C, 0x00, // Code for char @ + 0x06, 0x00, 0x00, 0xF8, 0x00, 0x24, 0x00, 0x22, 0x00, 0x24, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char A + 0x06, 0x00, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B + 0x06, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C + 0x06, 0x00, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x82, 0x00, 0xC6, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F + 0x06, 0x00, 0x00, 0x7C, 0x00, 0xC6, 0x00, 0x82, 0x00, 0x92, 0x00, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G + 0x06, 0x00, 0x00, 0xFE, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char H + 0x02, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I + 0x04, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x10, 0x00, 0x2C, 0x00, 0xC2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char K + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L + 0x08, 0x00, 0x00, 0xFE, 0x00, 0x06, 0x00, 0x18, 0x00, 0xE0, 0x00, 0x18, 0x00, 0x06, 0x00, 0xFE, 0x00, 0x00, 0x00, // Code for char M + 0x06, 0x00, 0x00, 0xFE, 0x00, 0x06, 0x00, 0x18, 0x00, 0x60, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char N + 0x06, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char O + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P + 0x07, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0xC2, 0x00, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char Q + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char R + 0x05, 0x00, 0x00, 0xCC, 0x00, 0x92, 0x00, 0x92, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S + 0x06, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0xFE, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T + 0x06, 0x00, 0x00, 0x7E, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char U + 0x07, 0x00, 0x00, 0x06, 0x00, 0x3C, 0x00, 0xE0, 0x00, 0xE0, 0x00, 0x1C, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V + 0x06, 0x00, 0x00, 0x1E, 0x00, 0xE0, 0x00, 0x3E, 0x00, 0xE0, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char W + 0x06, 0x00, 0x00, 0x82, 0x00, 0x64, 0x00, 0x38, 0x00, 0x6C, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char X + 0x06, 0x00, 0x00, 0x02, 0x00, 0x0C, 0x00, 0xF0, 0x00, 0x0C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y + 0x06, 0x00, 0x00, 0x82, 0x00, 0xE2, 0x00, 0x92, 0x00, 0x8E, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Z + 0x03, 0x00, 0x00, 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [ + 0x04, 0x01, 0x00, 0x0E, 0x00, 0x70, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash + 0x02, 0x01, 0x01, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ] + 0x04, 0x00, 0x00, 0x18, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^ + 0x06, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char _ + 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ` + 0x05, 0x00, 0x00, 0xE8, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char a + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b + 0x05, 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c + 0x05, 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0x88, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d + 0x05, 0x00, 0x00, 0x70, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e + 0x04, 0x08, 0x00, 0xFE, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f + 0x05, 0x00, 0x00, 0x30, 0x00, 0x48, 0x01, 0x48, 0x01, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char g + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char h + 0x02, 0x00, 0x00, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i + 0x02, 0x00, 0x01, 0xFA, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j + 0x05, 0x00, 0x00, 0xFE, 0x00, 0x20, 0x00, 0x50, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k + 0x02, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l + 0x06, 0x00, 0x00, 0xF8, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char m + 0x05, 0x00, 0x00, 0xF8, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char n + 0x05, 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char o + 0x05, 0x00, 0x00, 0xF8, 0x01, 0x48, 0x00, 0x48, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p + 0x05, 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char q + 0x04, 0x00, 0x00, 0xF8, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char r + 0x04, 0x00, 0x00, 0x98, 0x00, 0xA8, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s + 0x04, 0x00, 0x00, 0x08, 0x00, 0xFC, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t + 0x05, 0x00, 0x00, 0x78, 0x00, 0x80, 0x00, 0x80, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char u + 0x04, 0x00, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v + 0x06, 0x00, 0x00, 0x78, 0x00, 0xC0, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char w + 0x05, 0x00, 0x00, 0x88, 0x00, 0x70, 0x00, 0x70, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char x + 0x05, 0x00, 0x00, 0x38, 0x00, 0x40, 0x01, 0x40, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y + 0x05, 0x00, 0x00, 0xC8, 0x00, 0xE8, 0x00, 0xB8, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z + 0x04, 0x10, 0x00, 0x38, 0x00, 0xEF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char { + 0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char | + 0x04, 0x01, 0x01, 0xC7, 0x01, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char } + 0x05, 0x0C, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ~ + 0x03, 0xFE, 0x01, 0x02, 0x01, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char  + }; + +#endif diff --git a/libraries/tests/peripherals/C12832/TextDisplay.cpp b/libraries/tests/peripherals/C12832/TextDisplay.cpp new file mode 100644 index 00000000000..0083e1cd8ba --- /dev/null +++ b/libraries/tests/peripherals/C12832/TextDisplay.cpp @@ -0,0 +1,77 @@ +/* mbed TextDisplay Display Library Base Class + * Copyright (c) 2007-2009 sford + * Released under the MIT License: http://mbed.org/license/mit + */ + +#include "TextDisplay.h" + +TextDisplay::TextDisplay(const char *name) : Stream(name){ + _row = 0; + _column = 0; + if (name == NULL) { + _path = NULL; + } else { + _path = new char[strlen(name) + 2]; + sprintf(_path, "/%s", name); + } +} + +int TextDisplay::_putc(int value) { + if(value == '\n') { + _column = 0; + _row++; + if(_row >= rows()) { + _row = 0; + } + } else { + character(_column, _row, value); + _column++; + if(_column >= columns()) { + _column = 0; + _row++; + if(_row >= rows()) { + _row = 0; + } + } + } + return value; +} + +// crude cls implementation, should generally be overwritten in derived class +void TextDisplay::cls() { + locate(0, 0); + for(int i=0; i Date: Fri, 24 Apr 2015 13:53:18 +0100 Subject: [PATCH 06/24] Added missing functionality for disabling interrupts in SerialBase.h --- libraries/mbed/api/SerialBase.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/mbed/api/SerialBase.h b/libraries/mbed/api/SerialBase.h index 07bc4b46310..b1aa8510422 100644 --- a/libraries/mbed/api/SerialBase.h +++ b/libraries/mbed/api/SerialBase.h @@ -100,6 +100,8 @@ class SerialBase { if((mptr != NULL) && (tptr != NULL)) { _irq[type].attach(tptr, mptr); serial_irq_set(&_serial, (SerialIrq)type, 1); + } else { + serial_irq_set(&_serial, (SerialIrq)type, 0); } } From 7bb1ea30fe381443f8964e84e103f7fac90d2b26 Mon Sep 17 00:00:00 2001 From: julbouln Date: Sat, 25 Apr 2015 17:40:31 +0200 Subject: [PATCH 07/24] add suspend callback to STM32F4 USBDevice HAL --- libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp b/libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp index 8faac617047..3ab8f38736e 100644 --- a/libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp +++ b/libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp @@ -307,7 +307,13 @@ void USBHAL::_usbisr(void) { void USBHAL::usbisr(void) { + if (OTG_FS->GREGS.GINTSTS & (1 << 11)) { // USB Suspend + suspendStateChanged(1); + }; + if (OTG_FS->GREGS.GINTSTS & (1 << 12)) { // USB Reset + suspendStateChanged(0); + // Set SNAK bits OTG_FS->OUTEP_REGS[0].DOEPCTL |= (1 << 27); OTG_FS->OUTEP_REGS[1].DOEPCTL |= (1 << 27); From 2ad8ff1853215030b7ed7f1925f570e8761e1f1c Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Sun, 26 Apr 2015 01:46:31 +0200 Subject: [PATCH 08/24] [STM32F4xx] update of STM32CubeF4 to version 1.5 - part 1 --- .../TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.c | 97 +- .../TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.h | 185 +- .../TARGET_STM32F4/stm32f4xx_hal_adc.c | 347 +- .../TARGET_STM32F4/stm32f4xx_hal_adc.h | 569 +-- .../TARGET_STM32F4/stm32f4xx_hal_adc_ex.c | 86 +- .../TARGET_STM32F4/stm32f4xx_hal_adc_ex.h | 224 +- .../TARGET_STM32F4/stm32f4xx_hal_can.c | 55 +- .../TARGET_STM32F4/stm32f4xx_hal_can.h | 434 +- .../TARGET_STM32F4/stm32f4xx_hal_cec.c | 1112 +++++ .../TARGET_STM32F4/stm32f4xx_hal_cec.h | 681 +++ .../TARGET_STM32F4/stm32f4xx_hal_conf.h | 407 -- .../TARGET_STM32F4/stm32f4xx_hal_cortex.c | 100 +- .../TARGET_STM32F4/stm32f4xx_hal_cortex.h | 87 +- .../TARGET_STM32F4/stm32f4xx_hal_crc.c | 37 +- .../TARGET_STM32F4/stm32f4xx_hal_crc.h | 136 +- .../TARGET_STM32F4/stm32f4xx_hal_cryp.c | 2745 +++++------ .../TARGET_STM32F4/stm32f4xx_hal_cryp.h | 247 +- .../TARGET_STM32F4/stm32f4xx_hal_cryp_ex.c | 1669 +++---- .../TARGET_STM32F4/stm32f4xx_hal_cryp_ex.h | 105 +- .../TARGET_STM32F4/stm32f4xx_hal_dac.c | 106 +- .../TARGET_STM32F4/stm32f4xx_hal_dac.h | 221 +- .../TARGET_STM32F4/stm32f4xx_hal_dac_ex.c | 30 +- .../TARGET_STM32F4/stm32f4xx_hal_dac_ex.h | 112 +- .../TARGET_STM32F4/stm32f4xx_hal_dcmi.c | 52 +- .../TARGET_STM32F4/stm32f4xx_hal_dcmi.h | 249 +- .../TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.c | 212 + .../TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.h | 221 + .../TARGET_STM32F4/stm32f4xx_hal_def.h | 31 +- .../TARGET_STM32F4/stm32f4xx_hal_dma.c | 76 +- .../TARGET_STM32F4/stm32f4xx_hal_dma.h | 252 +- .../TARGET_STM32F4/stm32f4xx_hal_dma2d.c | 80 +- .../TARGET_STM32F4/stm32f4xx_hal_dma2d.h | 208 +- .../TARGET_STM32F4/stm32f4xx_hal_dma_ex.c | 39 +- .../TARGET_STM32F4/stm32f4xx_hal_dma_ex.h | 45 +- .../TARGET_STM32F4/stm32f4xx_hal_eth.c | 269 +- .../TARGET_STM32F4/stm32f4xx_hal_eth.h | 1088 +++-- .../TARGET_STM32F4/stm32f4xx_hal_flash.c | 114 +- .../TARGET_STM32F4/stm32f4xx_hal_flash.h | 222 +- .../TARGET_STM32F4/stm32f4xx_hal_flash_ex.c | 215 +- .../TARGET_STM32F4/stm32f4xx_hal_flash_ex.h | 455 +- .../stm32f4xx_hal_flash_ramfunc.c | 37 +- .../stm32f4xx_hal_flash_ramfunc.h | 23 +- .../TARGET_STM32F4/stm32f4xx_hal_fmpi2c.c | 4098 +++++++++++++++++ .../TARGET_STM32F4/stm32f4xx_hal_fmpi2c.h | 577 +++ .../TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.c | 326 ++ .../TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.h | 151 + .../TARGET_STM32F4/stm32f4xx_hal_gpio.c | 153 +- .../TARGET_STM32F4/stm32f4xx_hal_gpio.h | 130 +- .../TARGET_STM32F4/stm32f4xx_hal_gpio_ex.h | 506 +- .../TARGET_STM32F4/stm32f4xx_hal_hash.c | 437 +- .../TARGET_STM32F4/stm32f4xx_hal_hash.h | 259 +- .../TARGET_STM32F4/stm32f4xx_hal_hash_ex.c | 420 +- .../TARGET_STM32F4/stm32f4xx_hal_hash_ex.h | 119 +- .../TARGET_STM32F4/stm32f4xx_hal_hcd.c | 211 +- .../TARGET_STM32F4/stm32f4xx_hal_hcd.h | 240 +- .../TARGET_STM32F4/stm32f4xx_hal_i2c.c | 108 +- .../TARGET_STM32F4/stm32f4xx_hal_i2c.h | 240 +- .../TARGET_STM32F4/stm32f4xx_hal_i2c_ex.c | 25 +- .../TARGET_STM32F4/stm32f4xx_hal_i2c_ex.h | 72 +- .../TARGET_STM32F4/stm32f4xx_hal_i2s.c | 400 +- .../TARGET_STM32F4/stm32f4xx_hal_i2s.h | 228 +- .../TARGET_STM32F4/stm32f4xx_hal_i2s_ex.c | 747 ++- .../TARGET_STM32F4/stm32f4xx_hal_i2s_ex.h | 76 +- .../TARGET_STM32F4/stm32f4xx_hal_irda.c | 195 +- .../TARGET_STM32F4/stm32f4xx_hal_irda.h | 235 +- .../TARGET_STM32F4/stm32f4xx_hal_iwdg.c | 34 +- .../TARGET_STM32F4/stm32f4xx_hal_iwdg.h | 170 +- .../TARGET_STM32F4/stm32f4xx_hal_ltdc.c | 89 +- .../TARGET_STM32F4/stm32f4xx_hal_ltdc.h | 267 +- .../stm32f4xx_hal_msp_template.c | 119 + .../TARGET_STM32F4/stm32f4xx_hal_nand.c | 427 +- .../TARGET_STM32F4/stm32f4xx_hal_nand.h | 186 +- .../TARGET_STM32F4/stm32f4xx_hal_nor.c | 311 +- .../TARGET_STM32F4/stm32f4xx_hal_nor.h | 180 +- 74 files changed, 17783 insertions(+), 7633 deletions(-) create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.h delete mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_msp_template.c diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.c index 4d6f570ea51..4a5586ddbdd 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief HAL module driver. * This is the common part of the HAL initialization * @@ -23,7 +23,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -57,18 +57,21 @@ * @{ */ -/** @defgroup HAL +/** @defgroup HAL HAL * @brief HAL module driver. * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup HAL_Private_Constants + * @{ + */ /** - * @brief STM32F4xx HAL Driver version number V1.1.0 - */ + * @brief STM32F4xx HAL Driver version number V1.3.0 + */ #define __STM32F4xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */ -#define __STM32F4xx_HAL_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_HAL_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_HAL_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24)\ @@ -83,26 +86,35 @@ /* --- MEMRMP Register ---*/ /* Alias word address of UFB_MODE bit */ #define MEMRMP_OFFSET SYSCFG_OFFSET -#define UFB_MODE_BitNumber ((uint8_t)0x8) -#define UFB_MODE_BB (PERIPH_BB_BASE + (MEMRMP_OFFSET * 32) + (UFB_MODE_BitNumber * 4)) +#define UFB_MODE_BIT_NUMBER POSITION_VAL(SYSCFG_MEMRMP_UFB_MODE) +#define UFB_MODE_BB (uint32_t)(PERIPH_BB_BASE + (MEMRMP_OFFSET * 32) + (UFB_MODE_BIT_NUMBER * 4)) /* --- CMPCR Register ---*/ /* Alias word address of CMP_PD bit */ #define CMPCR_OFFSET (SYSCFG_OFFSET + 0x20) -#define CMP_PD_BitNumber ((uint8_t)0x00) -#define CMPCR_CMP_PD_BB (PERIPH_BB_BASE + (CMPCR_OFFSET * 32) + (CMP_PD_BitNumber * 4)) +#define CMP_PD_BIT_NUMBER POSITION_VAL(SYSCFG_CMPCR_CMP_PD) +#define CMPCR_CMP_PD_BB (uint32_t)(PERIPH_BB_BASE + (CMPCR_OFFSET * 32) + (CMP_PD_BIT_NUMBER * 4)) +/** + * @} + */ + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup HAL_Private_Variables + * @{ + */ static __IO uint32_t uwTick; - +/** + * @} + */ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -/** @defgroup HAL_Private_Functions +/** @defgroup HAL_Exported_Functions HAL Exported Functions * @{ */ -/** @defgroup HAL_Group1 Initialization and de-initialization Functions +/** @defgroup HAL_Exported_Functions_Group1 Initialization and de-initialization Functions * @brief Initialization and de-initialization functions * @verbatim @@ -150,7 +162,6 @@ static __IO uint32_t uwTick; * @note SysTick is used as time base for the HAL_Delay() function, the application * need to ensure that the SysTick time base is always set to 1 millisecond * to have correct HAL operation. - * @param None * @retval HAL status */ HAL_StatusTypeDef HAL_Init(void) @@ -184,26 +195,25 @@ HAL_StatusTypeDef HAL_Init(void) /** * @brief This function de-Initializes common part of the HAL and stops the systick. * This function is optional. - * @param None * @retval HAL status */ HAL_StatusTypeDef HAL_DeInit(void) { /* Reset of all peripherals */ - __APB1_FORCE_RESET(); - __APB1_RELEASE_RESET(); + __HAL_RCC_APB1_FORCE_RESET(); + __HAL_RCC_APB1_RELEASE_RESET(); - __APB2_FORCE_RESET(); - __APB2_RELEASE_RESET(); + __HAL_RCC_APB2_FORCE_RESET(); + __HAL_RCC_APB2_RELEASE_RESET(); - __AHB1_FORCE_RESET(); - __AHB1_RELEASE_RESET(); + __HAL_RCC_AHB1_FORCE_RESET(); + __HAL_RCC_AHB1_RELEASE_RESET(); - __AHB2_FORCE_RESET(); - __AHB2_RELEASE_RESET(); + __HAL_RCC_AHB2_FORCE_RESET(); + __HAL_RCC_AHB2_RELEASE_RESET(); - __AHB3_FORCE_RESET(); - __AHB3_RELEASE_RESET(); + __HAL_RCC_AHB3_FORCE_RESET(); + __HAL_RCC_AHB3_RELEASE_RESET(); /* De-Init the low level hardware */ HAL_MspDeInit(); @@ -214,7 +224,6 @@ HAL_StatusTypeDef HAL_DeInit(void) /** * @brief Initializes the MSP. - * @param None * @retval None */ __weak void HAL_MspInit(void) @@ -226,7 +235,6 @@ __weak void HAL_MspInit(void) /** * @brief DeInitializes the MSP. - * @param None * @retval None */ __weak void HAL_MspDeInit(void) @@ -268,7 +276,7 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) * @} */ -/** @defgroup HAL_Group2 HAL Control functions +/** @defgroup HAL_Exported_Functions_Group2 HAL Control functions * @brief HAL Control functions * @verbatim @@ -298,7 +306,6 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) * in Systick ISR. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. - * @param None * @retval None */ __weak void HAL_IncTick(void) @@ -310,7 +317,6 @@ __weak void HAL_IncTick(void) * @brief Provides a tick value in millisecond. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. - * @param None * @retval tick value */ __weak uint32_t HAL_GetTick(void) @@ -324,7 +330,7 @@ __weak uint32_t HAL_GetTick(void) * @note In the default implementation , SysTick timer is the source of time base. * It is used to generate interrupts at regular time intervals where uwTick * is incremented. - * @note ThiS function is declared as __weak to be overwritten in case of other + * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @param Delay: specifies the delay time length, in milliseconds. * @retval None @@ -342,11 +348,10 @@ __weak void HAL_Delay(__IO uint32_t Delay) * @brief Suspend Tick increment. * @note In the default implementation , SysTick timer is the source of time base. It is * used to generate interrupts at regular time intervals. Once HAL_SuspendTick() - * is called, the the SysTick interrupt will be disabled and so Tick increment + * is called, the SysTick interrupt will be disabled and so Tick increment * is suspended. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. - * @param None * @retval None */ __weak void HAL_SuspendTick(void) @@ -359,11 +364,10 @@ __weak void HAL_SuspendTick(void) * @brief Resume Tick increment. * @note In the default implementation , SysTick timer is the source of time base. It is * used to generate interrupts at regular time intervals. Once HAL_ResumeTick() - * is called, the the SysTick interrupt will be enabled and so Tick increment + * is called, the SysTick interrupt will be enabled and so Tick increment * is resumed. * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. - * @param None * @retval None */ __weak void HAL_ResumeTick(void) @@ -374,7 +378,6 @@ __weak void HAL_ResumeTick(void) /** * @brief Returns the HAL revision - * @param None * @retval version : 0xXYZR (8bits for each decimal, R for RC) */ uint32_t HAL_GetHalVersion(void) @@ -384,7 +387,6 @@ uint32_t HAL_GetHalVersion(void) /** * @brief Returns the device revision identifier. - * @param None * @retval Device revision identifier */ uint32_t HAL_GetREVID(void) @@ -394,7 +396,6 @@ uint32_t HAL_GetREVID(void) /** * @brief Returns the device identifier. - * @param None * @retval Device identifier */ uint32_t HAL_GetDEVID(void) @@ -404,60 +405,54 @@ uint32_t HAL_GetDEVID(void) /** * @brief Enable the Debug Module during SLEEP mode - * @param None * @retval None */ -void HAL_EnableDBGSleepMode(void) +void HAL_DBGMCU_EnableDBGSleepMode(void) { SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); } /** * @brief Disable the Debug Module during SLEEP mode - * @param None * @retval None */ -void HAL_DisableDBGSleepMode(void) +void HAL_DBGMCU_DisableDBGSleepMode(void) { CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); } /** * @brief Enable the Debug Module during STOP mode - * @param None * @retval None */ -void HAL_EnableDBGStopMode(void) +void HAL_DBGMCU_EnableDBGStopMode(void) { SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); } /** * @brief Disable the Debug Module during STOP mode - * @param None * @retval None */ -void HAL_DisableDBGStopMode(void) +void HAL_DBGMCU_DisableDBGStopMode(void) { CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); } /** * @brief Enable the Debug Module during STANDBY mode - * @param None * @retval None */ -void HAL_EnableDBGStandbyMode(void) +void HAL_DBGMCU_EnableDBGStandbyMode(void) { SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); } /** * @brief Disable the Debug Module during STANDBY mode - * @param None * @retval None */ -void HAL_DisableDBGStandbyMode(void) +void HAL_DBGMCU_DisableDBGStandbyMode(void) { CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.h index 695c5d91aef..5a3b1e30ba0 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal.h @@ -2,14 +2,14 @@ ****************************************************************************** * @file stm32f4xx_hal.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief This file contains all the functions prototypes for the HAL * module driver. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -58,102 +58,119 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup HAL_Exported_Macros HAL Exported Macros + * @{ + */ /** @brief Freeze/Unfreeze Peripherals in Debug mode */ -#define __HAL_FREEZE_TIM2_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP)) -#define __HAL_FREEZE_TIM3_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP)) -#define __HAL_FREEZE_TIM4_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP)) -#define __HAL_FREEZE_TIM5_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP)) -#define __HAL_FREEZE_TIM6_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP)) -#define __HAL_FREEZE_TIM7_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP)) -#define __HAL_FREEZE_TIM12_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP)) -#define __HAL_FREEZE_TIM13_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP)) -#define __HAL_FREEZE_TIM14_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP)) -#define __HAL_FREEZE_RTC_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP)) -#define __HAL_FREEZE_WWDG_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP)) -#define __HAL_FREEZE_IWDG_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP)) -#define __HAL_FREEZE_I2C1_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) -#define __HAL_FREEZE_I2C2_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) -#define __HAL_FREEZE_I2C3_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) -#define __HAL_FREEZE_CAN1_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN1_STOP)) -#define __HAL_FREEZE_CAN2_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN2_STOP)) -#define __HAL_FREEZE_TIM1_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP)) -#define __HAL_FREEZE_TIM8_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP)) -#define __HAL_FREEZE_TIM9_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM9_STOP)) -#define __HAL_FREEZE_TIM10_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM10_STOP)) -#define __HAL_FREEZE_TIM11_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM11_STOP)) - -#define __HAL_UNFREEZE_TIM2_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP)) -#define __HAL_UNFREEZE_TIM3_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP)) -#define __HAL_UNFREEZE_TIM4_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP)) -#define __HAL_UNFREEZE_TIM5_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP)) -#define __HAL_UNFREEZE_TIM6_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP)) -#define __HAL_UNFREEZE_TIM7_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP)) -#define __HAL_UNFREEZE_TIM12_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP)) -#define __HAL_UNFREEZE_TIM13_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP)) -#define __HAL_UNFREEZE_TIM14_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP)) -#define __HAL_UNFREEZE_RTC_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP)) -#define __HAL_UNFREEZE_WWDG_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP)) -#define __HAL_UNFREEZE_IWDG_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP)) -#define __HAL_UNFREEZE_I2C1_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) -#define __HAL_UNFREEZE_I2C2_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) -#define __HAL_UNFREEZE_I2C3_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) -#define __HAL_UNFREEZE_CAN1_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN1_STOP)) -#define __HAL_UNFREEZE_CAN2_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN2_STOP)) -#define __HAL_UNFREEZE_TIM1_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP)) -#define __HAL_UNFREEZE_TIM8_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP)) -#define __HAL_UNFREEZE_TIM9_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM9_STOP)) -#define __HAL_UNFREEZE_TIM10_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM10_STOP)) -#define __HAL_UNFREEZE_TIM11_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM11_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM3() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM4() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM5() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM6() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM7() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM12() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM13() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM14() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP)) +#define __HAL_DBGMCU_FREEZE_RTC() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP)) +#define __HAL_DBGMCU_FREEZE_WWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP)) +#define __HAL_DBGMCU_FREEZE_IWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP)) +#define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_FREEZE_CAN1() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN1_STOP)) +#define __HAL_DBGMCU_FREEZE_CAN2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN2_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM1() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM8() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM9() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM9_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM10() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM10_STOP)) +#define __HAL_DBGMCU_FREEZE_TIM11() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM11_STOP)) + +#define __HAL_DBGMCU_UNFREEZE_TIM2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM3() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM4() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM5() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM6() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM7() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM12() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM13() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM14() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP)) +#define __HAL_DBGMCU_UNFREEZE_RTC() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP)) +#define __HAL_DBGMCU_UNFREEZE_WWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP)) +#define __HAL_DBGMCU_UNFREEZE_IWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP)) +#define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_UNFREEZE_CAN1() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN1_STOP)) +#define __HAL_DBGMCU_UNFREEZE_CAN2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN2_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM1() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM8() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM9() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM9_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM10() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM10_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM11() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM11_STOP)) /** @brief Main Flash memory mapped at 0x00000000 */ -#define __HAL_REMAPMEMORY_FLASH() (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE)) +#define __HAL_SYSCFG_REMAPMEMORY_FLASH() (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE)) /** @brief System Flash memory mapped at 0x00000000 */ -#define __HAL_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ - SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0;\ - }while(0); +#define __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ + SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0;\ + }while(0); /** @brief Embedded SRAM mapped at 0x00000000 */ -#define __HAL_REMAPMEMORY_SRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ - SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_0 | SYSCFG_MEMRMP_MEM_MODE_1);\ - }while(0); +#define __HAL_SYSCFG_REMAPMEMORY_SRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ + SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_0 | SYSCFG_MEMRMP_MEM_MODE_1);\ + }while(0); #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) /** @brief FSMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 */ -#define __HAL_REMAPMEMORY_FSMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ - SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ - }while(0); +#define __HAL_SYSCFG_REMAPMEMORY_FSMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ + SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ + }while(0); #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) /** @brief FMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 */ -#define __HAL_REMAPMEMORY_FMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ - SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ - }while(0); +#define __HAL_SYSCFG_REMAPMEMORY_FMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ + SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ + }while(0); /** @brief FMC/SDRAM Bank 1 and 2 mapped at 0x00000000 */ -#define __HAL_REMAPMEMORY_FMC_SDRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ - SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_2);\ - }while(0); +#define __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ + SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_2);\ + }while(0); #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ - +/** @addtogroup HAL_Exported_Functions + * @{ + */ +/** @addtogroup HAL_Exported_Functions_Group1 + * @{ + */ /* Initialization and de-initialization functions ******************************/ HAL_StatusTypeDef HAL_Init(void); HAL_StatusTypeDef HAL_DeInit(void); void HAL_MspInit(void); void HAL_MspDeInit(void); HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority); +/** + * @} + */ +/** @addtogroup HAL_Exported_Functions_Group2 + * @{ + */ /* Peripheral Control functions ************************************************/ void HAL_IncTick(void); void HAL_Delay(__IO uint32_t Delay); @@ -163,23 +180,45 @@ void HAL_ResumeTick(void); uint32_t HAL_GetHalVersion(void); uint32_t HAL_GetREVID(void); uint32_t HAL_GetDEVID(void); -void HAL_EnableDBGSleepMode(void); -void HAL_DisableDBGSleepMode(void); -void HAL_EnableDBGStopMode(void); -void HAL_DisableDBGStopMode(void); -void HAL_EnableDBGStandbyMode(void); -void HAL_DisableDBGStandbyMode(void); +void HAL_DBGMCU_EnableDBGSleepMode(void); +void HAL_DBGMCU_DisableDBGSleepMode(void); +void HAL_DBGMCU_EnableDBGStopMode(void); +void HAL_DBGMCU_DisableDBGStopMode(void); +void HAL_DBGMCU_EnableDBGStandbyMode(void); +void HAL_DBGMCU_DisableDBGStandbyMode(void); void HAL_EnableCompensationCell(void); void HAL_DisableCompensationCell(void); #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) void HAL_EnableMemorySwappingBank(void); void HAL_DisableMemorySwappingBank(void); #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ - +/** + * @} + */ /** * @} - */ + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/** @defgroup HAL_Private_Variables HAL Private Variables + * @{ + */ +/** + * @} + */ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup HAL_Private_Constants HAL Private Constants + * @{ + */ +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.c index a5512e561e9..1338ba6734c 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_adc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief This file provides firmware functions to manage the following * functionalities of the Analog to Digital Convertor (ADC) peripheral: * + Initialization and de-initialization functions @@ -36,35 +36,56 @@ ##### How to use this driver ##### ============================================================================== - [..] - (#)Initialize the ADC low level resources by implementing the HAL_ADC_MspInit(): - (##) Enable the ADC interface clock using __ADC_CLK_ENABLE() + [..] + (#)Initialize the ADC low level resources by implementing the HAL_ADC_MspInit(): + (##) Enable the ADC interface clock using __HAL_RCC_ADC_CLK_ENABLE() (##) ADC pins configuration (+++) Enable the clock for the ADC GPIOs using the following function: - __GPIOx_CLK_ENABLE() + __HAL_RCC_GPIOx_CLK_ENABLE() (+++) Configure these ADC pins in analog mode using HAL_GPIO_Init() (##) In case of using interrupts (e.g. HAL_ADC_Start_IT()) (+++) Configure the ADC interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the ADC IRQ handler using HAL_NVIC_EnableIRQ() (+++) In ADC IRQ handler, call HAL_ADC_IRQHandler() - (##) In case of using DMA to control data transfer (e.g. HAL_ADC_Start_DMA()) - (+++) Enable the DMAx interface clock using __DMAx_CLK_ENABLE() + (##) In case of using DMA to control data transfer (e.g. HAL_ADC_Start_DMA()) + (+++) Enable the DMAx interface clock using __HAL_RCC_DMAx_CLK_ENABLE() (+++) Configure and enable two DMA streams stream for managing data transfer from peripheral to memory (output stream) - (+++) Associate the initilalized DMA handle to the CRYP DMA handle + (+++) Associate the initialized DMA handle to the CRYP DMA handle using __HAL_LINKDMA() (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the two DMA Streams. The output stream should have higher priority than the input stream. - (#) Configure the ADC Prescaler, conversion resolution and data alignment - using the HAL_ADC_Init() function. - - (#) Configure the ADC regular channels group features, use HAL_ADC_Init() - and HAL_ADC_ConfigChannel() functions. - - (#) Three operation modes are available within this driver : - + *** Configuration of ADC, groups regular/injected, channels parameters *** + ============================================================================== + [..] + (#) Configure the ADC parameters (resolution, data alignment, ...) + and regular group parameters (conversion trigger, sequencer, ...) + using function HAL_ADC_Init(). + + (#) Configure the channels for regular group parameters (channel number, + channel rank into sequencer, ..., into regular group) + using function HAL_ADC_ConfigChannel(). + + (#) Optionally, configure the injected group parameters (conversion trigger, + sequencer, ..., of injected group) + and the channels for injected group parameters (channel number, + channel rank into sequencer, ..., into injected group) + using function HAL_ADCEx_InjectedConfigChannel(). + + (#) Optionally, configure the analog watchdog parameters (channels + monitored, thresholds, ...) using function HAL_ADC_AnalogWDGConfig(). + + (#) Optionally, for devices with several ADC instances: configure the + multimode parameters using function HAL_ADCEx_MultiModeConfigChannel(). + + *** Execution of ADC conversions *** + ============================================================================== + [..] + (#) ADC driver can be used among three modes: polling, interruption, + transfer by DMA. + *** Polling mode IO operation *** ================================= [..] @@ -80,10 +101,10 @@ (+) Start the ADC peripheral using HAL_ADC_Start_IT() (+) Use HAL_ADC_IRQHandler() called under ADC_IRQHandler() Interrupt subroutine (+) At ADC end of conversion HAL_ADC_ConvCpltCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADC_ConvCpltCallback + add his own code by customization of function pointer HAL_ADC_ConvCpltCallback (+) In case of ADC Error, HAL_ADC_ErrorCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADC_ErrorCallback - (+) Stop the ADC peripheral using HAL_ADC_Stop_IT() + add his own code by customization of function pointer HAL_ADC_ErrorCallback + (+) Stop the ADC peripheral using HAL_ADC_Stop_IT() *** DMA mode IO operation *** ============================== @@ -91,9 +112,9 @@ (+) Start the ADC peripheral using HAL_ADC_Start_DMA(), at this stage the user specify the length of data to be transferred at each end of conversion (+) At The end of data transfer by HAL_ADC_ConvCpltCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADC_ConvCpltCallback + add his own code by customization of function pointer HAL_ADC_ConvCpltCallback (+) In case of transfer Error, HAL_ADC_ErrorCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADC_ErrorCallback + add his own code by customization of function pointer HAL_ADC_ErrorCallback (+) Stop the ADC peripheral using HAL_ADC_Stop_DMA() *** ADC HAL driver macros list *** @@ -108,16 +129,42 @@ (+) __HAL_ADC_GET_IT_SOURCE: Check if the specified ADC interrupt source is enabled or disabled (+) __HAL_ADC_CLEAR_FLAG: Clear the ADC's pending flags (+) __HAL_ADC_GET_FLAG: Get the selected ADC's flag status - (+) __HAL_ADC_GET_RESOLUTION: Return resolution bits in CR1 register + (+) ADC_GET_RESOLUTION: Return resolution bits in CR1 register [..] - (@) You can refer to the ADC HAL driver header file for more useful macros - + (@) You can refer to the ADC HAL driver header file for more useful macros + + *** Deinitialization of ADC *** + ============================================================================== + [..] + (#) Disable the ADC interface + (++) ADC clock can be hard reset and disabled at RCC top level. + (++) Hard reset of ADC peripherals + using macro __HAL_RCC_ADC_FORCE_RESET(), __HAL_RCC_ADC_RELEASE_RESET(). + (++) ADC clock disable using the equivalent macro/functions as configuration step. + (+++) Example: + Into HAL_ADC_MspDeInit() (recommended code location) or with + other device clock parameters configuration: + (+++) HAL_RCC_GetOscConfig(&RCC_OscInitStructure); + (+++) RCC_OscInitStructure.OscillatorType = RCC_OSCILLATORTYPE_HSI; + (+++) RCC_OscInitStructure.HSIState = RCC_HSI_OFF; (if not used for system clock) + (+++) HAL_RCC_OscConfig(&RCC_OscInitStructure); + + (#) ADC pins configuration + (++) Disable the clock for the ADC GPIOs using macro __HAL_RCC_GPIOx_CLK_DISABLE() + + (#) Optionally, in case of usage of ADC with interruptions: + (++) Disable the NVIC for ADC using function HAL_NVIC_DisableIRQ(ADCx_IRQn) + + (#) Optionally, in case of usage of DMA: + (++) Deinitialize the DMA using function HAL_DMA_DeInit(). + (++) Disable the NVIC for DMA using function HAL_NVIC_DisableIRQ(DMAx_Channelx_IRQn) + @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -151,7 +198,7 @@ * @{ */ -/** @defgroup ADC +/** @defgroup ADC ADC * @brief ADC driver modules * @{ */ @@ -159,21 +206,26 @@ #ifdef HAL_ADC_MODULE_ENABLED /* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup ADC_Private_Functions + * @{ + */ /* Private function prototypes -----------------------------------------------*/ static void ADC_Init(ADC_HandleTypeDef* hadc); static void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma); static void ADC_DMAError(DMA_HandleTypeDef *hdma); -static void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma); -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup ADC_Private_Functions +static void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma); +/** + * @} + */ +/* Exported functions --------------------------------------------------------*/ +/** @defgroup ADC_Exported_Functions ADC Exported Functions * @{ - */ + */ -/** @defgroup ADC_Group1 Initialization and de-initialization functions +/** @defgroup ADC_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -217,16 +269,22 @@ HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc) assert_param(IS_ADC_RESOLUTION(hadc->Init.Resolution)); assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ScanConvMode)); assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); - assert_param(IS_ADC_EXT_TRIG_EDGE(hadc->Init.ExternalTrigConvEdge)); assert_param(IS_ADC_EXT_TRIG(hadc->Init.ExternalTrigConv)); assert_param(IS_ADC_DATA_ALIGN(hadc->Init.DataAlign)); assert_param(IS_ADC_REGULAR_LENGTH(hadc->Init.NbrOfConversion)); assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DMAContinuousRequests)); assert_param(IS_ADC_EOCSelection(hadc->Init.EOCSelection)); assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DiscontinuousConvMode)); + + if(hadc->Init.ExternalTrigConv != ADC_SOFTWARE_START) + { + assert_param(IS_ADC_EXT_TRIG_EDGE(hadc->Init.ExternalTrigConvEdge)); + } if(hadc->State == HAL_ADC_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hadc->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_ADC_MspInit(hadc); } @@ -313,7 +371,7 @@ __weak void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc) * @} */ -/** @defgroup ADC_Group2 IO operation functions +/** @defgroup ADC_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -341,7 +399,7 @@ __weak void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc) */ HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) { - uint16_t i = 0; + __IO uint32_t counter = 0; /* Check the parameters */ assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); @@ -363,24 +421,29 @@ HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) } /* Check if ADC peripheral is disabled in order to enable it and wait during - Tstab time the ADC's stabilization */ + Tstab time the ADC's stabilization */ if((hadc->Instance->CR2 & ADC_CR2_ADON) != ADC_CR2_ADON) { /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); - /* Delay inserted to wait during Tstab time the ADC's stabilazation */ - for(; i <= 540; i++) + /* Delay for ADC stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) { - __NOP(); + counter--; } } - + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + /* Check if Multimode enabled */ if(HAL_IS_BIT_CLR(ADC->CCR, ADC_CCR_MULTI)) { /* if no external trigger present enable software conversion of regular channels */ - if(hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE) + if((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET) { /* Enable the selected ADC software conversion for regular group */ hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART; @@ -389,16 +452,13 @@ HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) else { /* if instance of handle correspond to ADC1 and no external trigger present enable software conversion of regular channels */ - if((hadc->Instance == ADC1) && (hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE)) + if((hadc->Instance == ADC1) && ((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET)) { /* Enable the selected ADC software conversion for regular group */ hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART; } } - /* Process unlocked */ - __HAL_UNLOCK(hadc); - /* Return function status */ return HAL_OK; } @@ -427,6 +487,14 @@ HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc) /** * @brief Poll for regular conversion complete + * @note ADC conversion flags EOS (end of sequence) and EOC (end of + * conversion) are cleared by this function. + * @note This function cannot be used in a particular setup: ADC configured + * in DMA mode and polling for end of each conversion (ADC init + * parameter "EOCSelection" set to ADC_EOC_SINGLE_CONV). + * In this case, DMA resets the flag EOC and polling cannot be + * performed on each conversion. Nevertheless, polling can still + * be performed on the complete sequence. * @param hadc: pointer to a ADC_HandleTypeDef structure that contains * the configuration information for the specified ADC. * @param Timeout: Timeout value in millisecond. @@ -436,6 +504,24 @@ HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Ti { uint32_t tickstart = 0; + /* Verification that ADC configuration is compliant with polling for */ + /* each conversion: */ + /* Particular case is ADC configured in DMA mode and ADC sequencer with */ + /* several ranks and polling for end of each conversion. */ + /* For code simplicity sake, this particular case is generalized to */ + /* ADC configured in DMA mode and polling for end of each conversion. */ + if (HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_EOCS) && + HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_DMA) ) + { + /* Update ADC state machine to error */ + hadc->State = HAL_ADC_STATE_ERROR; + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + /* Get tick */ tickstart = HAL_GetTick(); @@ -477,8 +563,8 @@ HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Ti * the configuration information for the specified ADC. * @param EventType: the ADC event type. * This parameter can be one of the following values: - * @arg AWD_EVENT: ADC Analog watch Dog event. - * @arg OVR_EVENT: ADC Overrun event. + * @arg ADC_AWD_EVENT: ADC Analog watch Dog event. + * @arg ADC_OVR_EVENT: ADC Overrun event. * @param Timeout: Timeout value in millisecond. * @retval HAL status */ @@ -509,7 +595,7 @@ HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventTy } /* Check analog watchdog flag */ - if(EventType == AWD_EVENT) + if(EventType == ADC_AWD_EVENT) { /* Change ADC state */ hadc->State = HAL_ADC_STATE_AWD; @@ -539,7 +625,7 @@ HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventTy */ HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) { - uint16_t i = 0; + __IO uint32_t counter = 0; /* Check the parameters */ assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); @@ -570,10 +656,12 @@ HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); - /* Delay inserted to wait during Tstab time the ADC's stabilazation */ - for(; i <= 540; i++) + /* Delay for ADC stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) { - __NOP(); + counter--; } } @@ -583,11 +671,14 @@ HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) /* Enable the ADC end of conversion interrupt for regular group */ __HAL_ADC_ENABLE_IT(hadc, ADC_IT_EOC); + /* Process unlocked */ + __HAL_UNLOCK(hadc); + /* Check if Multimode enabled */ if(HAL_IS_BIT_CLR(ADC->CCR, ADC_CCR_MULTI)) { - /* if no externel trigger present enable software conversion of regular channels */ - if (hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE) + /* if no external trigger present enable software conversion of regular channels */ + if((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET) { /* Enable the selected ADC software conversion for regular group */ hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART; @@ -596,16 +687,13 @@ HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) else { /* if instance of handle correspond to ADC1 and no external trigger present enable software conversion of regular channels */ - if ((hadc->Instance == (ADC_TypeDef*)0x40012000) && (hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE)) + if((hadc->Instance == (ADC_TypeDef*)0x40012000) && ((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET)) { /* Enable the selected ADC software conversion for regular group */ hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART; } } - - /* Process unlocked */ - __HAL_UNLOCK(hadc); - + /* Return function status */ return HAL_OK; } @@ -627,7 +715,7 @@ HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc) /* Disable the ADC end of conversion interrupt for injected group */ __HAL_ADC_DISABLE_IT(hadc, ADC_CR1_JEOCIE); - /* Enable the Periphral */ + /* Enable the Peripheral */ __HAL_ADC_DISABLE(hadc); /* Change ADC state */ @@ -669,9 +757,9 @@ void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc) hadc->State = HAL_ADC_STATE_EOC_REG; } - if((hadc->Init.ContinuousConvMode == DISABLE) && (hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE)) + if((hadc->Init.ContinuousConvMode == DISABLE) && ((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET)) { - if(hadc->Init.EOCSelection == EOC_SEQ_CONV) + if(hadc->Init.EOCSelection == ADC_EOC_SEQ_CONV) { /* DISABLE the ADC end of conversion interrupt for regular group */ __HAL_ADC_DISABLE_IT(hadc, ADC_IT_EOC); @@ -784,7 +872,7 @@ void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc) */ HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length) { - uint16_t i = 0; + __IO uint32_t counter = 0; /* Check the parameters */ assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); @@ -813,7 +901,10 @@ HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, ui /* Change ADC state */ hadc->State = HAL_ADC_STATE_BUSY_REG; - + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + /* Check if ADC peripheral is disabled in order to enable it and wait during Tstab time the ADC's stabilization */ if((hadc->Instance->CR2 & ADC_CR2_ADON) != ADC_CR2_ADON) @@ -821,23 +912,22 @@ HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, ui /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); - /* Delay inserted to wait during Tstab time the ADC's stabilazation */ - for(; i <= 540; i++) + /* Delay for ADC stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) { - __NOP(); + counter--; } } /* if no external trigger present enable software conversion of regular channels */ - if (hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE) + if((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET) { /* Enable the selected ADC software conversion for regular group */ hadc->Instance->CR2 |= ADC_CR2_SWSTART; } - /* Process unlocked */ - __HAL_UNLOCK(hadc); - /* Return function status */ return HAL_OK; } @@ -850,7 +940,7 @@ HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, ui */ HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc) { - /* Disable the Periphral */ + /* Disable the Peripheral */ __HAL_ADC_DISABLE(hadc); /* Disable ADC overrun interrupt */ @@ -937,7 +1027,7 @@ __weak void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc) * @} */ -/** @defgroup ADC_Group3 Peripheral Control functions +/** @defgroup ADC_Exported_Functions_Group3 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -964,6 +1054,8 @@ __weak void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc) */ HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig) { + __IO uint32_t counter = 0; + /* Check the parameters */ assert_param(IS_ADC_CHANNEL(sConfig->Channel)); assert_param(IS_ADC_REGULAR_RANK(sConfig->Rank)); @@ -976,46 +1068,46 @@ HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConf if (sConfig->Channel > ADC_CHANNEL_9) { /* Clear the old sample time */ - hadc->Instance->SMPR1 &= ~__HAL_ADC_SMPR1(ADC_SMPR1_SMP10, sConfig->Channel); + hadc->Instance->SMPR1 &= ~ADC_SMPR1(ADC_SMPR1_SMP10, sConfig->Channel); /* Set the new sample time */ - hadc->Instance->SMPR1 |= __HAL_ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel); + hadc->Instance->SMPR1 |= ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel); } else /* ADC_Channel include in ADC_Channel_[0..9] */ { /* Clear the old sample time */ - hadc->Instance->SMPR2 &= ~__HAL_ADC_SMPR2(ADC_SMPR2_SMP0, sConfig->Channel); + hadc->Instance->SMPR2 &= ~ADC_SMPR2(ADC_SMPR2_SMP0, sConfig->Channel); /* Set the new sample time */ - hadc->Instance->SMPR2 |= __HAL_ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel); + hadc->Instance->SMPR2 |= ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel); } /* For Rank 1 to 6 */ if (sConfig->Rank < 7) { /* Clear the old SQx bits for the selected rank */ - hadc->Instance->SQR3 &= ~__HAL_ADC_SQR3_RK(ADC_SQR3_SQ1, sConfig->Rank); + hadc->Instance->SQR3 &= ~ADC_SQR3_RK(ADC_SQR3_SQ1, sConfig->Rank); /* Set the SQx bits for the selected rank */ - hadc->Instance->SQR3 |= __HAL_ADC_SQR3_RK(sConfig->Channel, sConfig->Rank); + hadc->Instance->SQR3 |= ADC_SQR3_RK(sConfig->Channel, sConfig->Rank); } /* For Rank 7 to 12 */ else if (sConfig->Rank < 13) { /* Clear the old SQx bits for the selected rank */ - hadc->Instance->SQR2 &= ~__HAL_ADC_SQR2_RK(ADC_SQR2_SQ7, sConfig->Rank); + hadc->Instance->SQR2 &= ~ADC_SQR2_RK(ADC_SQR2_SQ7, sConfig->Rank); /* Set the SQx bits for the selected rank */ - hadc->Instance->SQR2 |= __HAL_ADC_SQR2_RK(sConfig->Channel, sConfig->Rank); + hadc->Instance->SQR2 |= ADC_SQR2_RK(sConfig->Channel, sConfig->Rank); } /* For Rank 13 to 16 */ else { /* Clear the old SQx bits for the selected rank */ - hadc->Instance->SQR1 &= ~__HAL_ADC_SQR1_RK(ADC_SQR1_SQ13, sConfig->Rank); + hadc->Instance->SQR1 &= ~ADC_SQR1_RK(ADC_SQR1_SQ13, sConfig->Rank); /* Set the SQx bits for the selected rank */ - hadc->Instance->SQR1 |= __HAL_ADC_SQR1_RK(sConfig->Channel, sConfig->Rank); + hadc->Instance->SQR1 |= ADC_SQR1_RK(sConfig->Channel, sConfig->Rank); } /* if ADC1 Channel_18 is selected enable VBAT Channel */ @@ -1030,6 +1122,17 @@ HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConf { /* Enable the TSVREFE channel*/ ADC->CCR |= ADC_CCR_TSVREFE; + + if((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR)) + { + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) + { + counter--; + } + } } /* Process unlocked */ @@ -1059,7 +1162,7 @@ HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDG assert_param(IS_FUNCTIONAL_STATE(AnalogWDGConfig->ITMode)); #ifdef USE_FULL_ASSERT - tmp = __HAL_ADC_GET_RESOLUTION(hadc); + tmp = ADC_GET_RESOLUTION(hadc); assert_param(IS_ADC_RANGE(tmp, AnalogWDGConfig->HighThreshold)); assert_param(IS_ADC_RANGE(tmp, AnalogWDGConfig->LowThreshold)); #endif /* USE_FULL_ASSERT */ @@ -1094,7 +1197,7 @@ HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDG hadc->Instance->CR1 &= ~ADC_CR1_AWDCH; /* Set the Analog watchdog channel */ - hadc->Instance->CR1 |= AnalogWDGConfig->Channel; + hadc->Instance->CR1 |= (uint32_t)((uint16_t)(AnalogWDGConfig->Channel)); /* Process unlocked */ __HAL_UNLOCK(hadc); @@ -1107,7 +1210,7 @@ HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDG * @} */ -/** @defgroup ADC_Group4 ADC Peripheral State functions +/** @defgroup ADC_Exported_Functions_Group4 ADC Peripheral State functions * @brief ADC Peripheral State functions * @verbatim @@ -1150,6 +1253,10 @@ uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc) * @} */ +/** @addtogroup ADC_Private_Functions + * @{ + */ + /** * @brief Initializes the ADCx peripheral according to the specified parameters * in the ADC_InitStruct without initializing the ADC MSP. @@ -1159,7 +1266,6 @@ uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc) */ static void ADC_Init(ADC_HandleTypeDef* hadc) { - /* Set ADC parameters */ /* Set the ADC clock prescaler */ ADC->CCR &= ~(ADC_CCR_ADCPRE); @@ -1167,7 +1273,7 @@ static void ADC_Init(ADC_HandleTypeDef* hadc) /* Set ADC scan mode */ hadc->Instance->CR1 &= ~(ADC_CR1_SCAN); - hadc->Instance->CR1 |= __HAL_ADC_CR1_SCANCONV(hadc->Init.ScanConvMode); + hadc->Instance->CR1 |= ADC_CR1_SCANCONV(hadc->Init.ScanConvMode); /* Set ADC resolution */ hadc->Instance->CR1 &= ~(ADC_CR1_RES); @@ -1177,19 +1283,33 @@ static void ADC_Init(ADC_HandleTypeDef* hadc) hadc->Instance->CR2 &= ~(ADC_CR2_ALIGN); hadc->Instance->CR2 |= hadc->Init.DataAlign; - /* Select external trigger to start conversion */ - hadc->Instance->CR2 &= ~(ADC_CR2_EXTSEL); - hadc->Instance->CR2 |= hadc->Init.ExternalTrigConv; - - /* Select external trigger polarity */ - hadc->Instance->CR2 &= ~(ADC_CR2_EXTEN); - hadc->Instance->CR2 |= hadc->Init.ExternalTrigConvEdge; + /* Enable external trigger if trigger selection is different of software */ + /* start. */ + /* Note: This configuration keeps the hardware feature of parameter */ + /* ExternalTrigConvEdge "trigger edge none" equivalent to */ + /* software start. */ + if(hadc->Init.ExternalTrigConv != ADC_SOFTWARE_START) + { + /* Select external trigger to start conversion */ + hadc->Instance->CR2 &= ~(ADC_CR2_EXTSEL); + hadc->Instance->CR2 |= hadc->Init.ExternalTrigConv; + + /* Select external trigger polarity */ + hadc->Instance->CR2 &= ~(ADC_CR2_EXTEN); + hadc->Instance->CR2 |= hadc->Init.ExternalTrigConvEdge; + } + else + { + /* Reset the external trigger */ + hadc->Instance->CR2 &= ~(ADC_CR2_EXTSEL); + hadc->Instance->CR2 &= ~(ADC_CR2_EXTEN); + } /* Enable or disable ADC continuous conversion mode */ hadc->Instance->CR2 &= ~(ADC_CR2_CONT); - hadc->Instance->CR2 |= __HAL_ADC_CR2_CONTINUOUS(hadc->Init.ContinuousConvMode); + hadc->Instance->CR2 |= ADC_CR2_CONTINUOUS(hadc->Init.ContinuousConvMode); - if (hadc->Init.DiscontinuousConvMode != DISABLE) + if(hadc->Init.DiscontinuousConvMode != DISABLE) { assert_param(IS_ADC_REGULAR_DISC_NUMBER(hadc->Init.NbrOfDiscConversion)); @@ -1198,7 +1318,7 @@ static void ADC_Init(ADC_HandleTypeDef* hadc) /* Set the number of channels to be converted in discontinuous mode */ hadc->Instance->CR1 &= ~(ADC_CR1_DISCNUM); - hadc->Instance->CR1 |= __HAL_ADC_CR1_DISCONTINUOUS(hadc->Init.NbrOfDiscConversion); + hadc->Instance->CR1 |= ADC_CR1_DISCONTINUOUS(hadc->Init.NbrOfDiscConversion); } else { @@ -1208,15 +1328,15 @@ static void ADC_Init(ADC_HandleTypeDef* hadc) /* Set ADC number of conversion */ hadc->Instance->SQR1 &= ~(ADC_SQR1_L); - hadc->Instance->SQR1 |= __HAL_ADC_SQR1(hadc->Init.NbrOfConversion); + hadc->Instance->SQR1 |= ADC_SQR1(hadc->Init.NbrOfConversion); /* Enable or disable ADC DMA continuous request */ hadc->Instance->CR2 &= ~(ADC_CR2_DDS); - hadc->Instance->CR2 |= __HAL_ADC_CR2_DMAContReq(hadc->Init.DMAContinuousRequests); + hadc->Instance->CR2 |= ADC_CR2_DMAContReq(hadc->Init.DMAContinuousRequests); /* Enable or disable ADC end of conversion selection */ hadc->Instance->CR2 &= ~(ADC_CR2_EOCS); - hadc->Instance->CR2 |= __HAL_ADC_CR2_EOCSelection(hadc->Init.EOCSelection); + hadc->Instance->CR2 |= ADC_CR2_EOCSelection(hadc->Init.EOCSelection); } /** @@ -1241,7 +1361,7 @@ static void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma) hadc->State = HAL_ADC_STATE_EOC_REG; } - HAL_ADC_ConvCpltCallback(hadc); + HAL_ADC_ConvCpltCallback(hadc); } /** @@ -1252,9 +1372,9 @@ static void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma) */ static void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma) { - ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - /* Conversion complete callback */ - HAL_ADC_ConvHalfCpltCallback(hadc); + ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + /* Conversion complete callback */ + HAL_ADC_ConvHalfCpltCallback(hadc); } /** @@ -1265,13 +1385,16 @@ static void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma) */ static void ADC_DMAError(DMA_HandleTypeDef *hdma) { - ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - hadc->State= HAL_ADC_STATE_ERROR; - /* Set ADC error code to DMA error */ - hadc->ErrorCode |= HAL_ADC_ERROR_DMA; - HAL_ADC_ErrorCallback(hadc); + ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + hadc->State= HAL_ADC_STATE_ERROR; + /* Set ADC error code to DMA error */ + hadc->ErrorCode |= HAL_ADC_ERROR_DMA; + HAL_ADC_ErrorCallback(hadc); } +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.h index 18417614403..3590e769ab7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_adc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of ADC HAL extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,9 +55,12 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup ADC_Exported_Types ADC Exported Types + * @{ + */ /** - * @brief HAL State structures definition + * @brief HAL State structures definition */ typedef enum { @@ -78,7 +81,7 @@ typedef enum }HAL_ADC_StateTypeDef; /** - * @brief ADC Init structure definition + * @brief ADC Init structure definition */ typedef struct { @@ -108,14 +111,18 @@ typedef struct uint32_t NbrOfDiscConversion; /*!< Specifies the number of ADC discontinuous conversions that will be done using the sequencer for regular channel group. This parameter must be a number between Min_Data = 1 and Max_Data = 8. */ - uint32_t ExternalTrigConvEdge; /*!< Select the external trigger edge and enable the trigger of a regular group. - This parameter can be a value of @ref ADC_External_trigger_edge_Regular */ - uint32_t ExternalTrigConv; /*!< Select the external event used to trigger the start of conversion of a regular group. - This parameter can be a value of @ref ADC_External_trigger_Source_Regular */ + uint32_t ExternalTrigConv; /*!< Selects the external event used to trigger the conversion start of regular group. + If set to ADC_SOFTWARE_START, external triggers are disabled. + This parameter can be a value of @ref ADC_External_trigger_Source_Regular + Note: This parameter can be modified only if there is no conversion is ongoing. */ + uint32_t ExternalTrigConvEdge; /*!< Selects the external trigger edge of regular group. + If trigger is set to ADC_SOFTWARE_START, this parameter is discarded. + This parameter can be a value of @ref ADC_External_trigger_edge_Regular + Note: This parameter can be modified only if there is no conversion is ongoing. */ }ADC_InitTypeDef; /** - * @brief ADC handle Structure definition + * @brief ADC handle Structure definition */ typedef struct { @@ -135,7 +142,7 @@ typedef struct }ADC_HandleTypeDef; /** - * @brief ADC Configuration regular Channel structure definition + * @brief ADC Configuration regular Channel structure definition */ typedef struct { @@ -149,7 +156,7 @@ typedef struct }ADC_ChannelConfTypeDef; /** - * @brief ADC Configuration multi-mode structure definition + * @brief ADC Configuration multi-mode structure definition */ typedef struct { @@ -167,18 +174,18 @@ typedef struct This parameter can be set to ENABLE or DISABLE */ uint32_t WatchdogNumber; /*!< Reserved for future use, can be set to 0 */ }ADC_AnalogWDGConfTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ - -/** @defgroup ADC_Exported_Constants +/** @defgroup ADC_Exported_Constants ADC Exported Constants * @{ */ - -/** @defgroup ADC_Error_Code +/** @defgroup ADC_Error_Code ADC Error Code * @{ - */ - + */ #define HAL_ADC_ERROR_NONE ((uint32_t)0x00) /*!< No error */ #define HAL_ADC_ERROR_OVR ((uint32_t)0x01) /*!< OVR error */ #define HAL_ADC_ERROR_DMA ((uint32_t)0x02) /*!< DMA transfer error */ @@ -187,22 +194,18 @@ typedef struct */ -/** @defgroup ADC_ClockPrescaler +/** @defgroup ADC_ClockPrescaler ADC Clock Prescaler * @{ */ #define ADC_CLOCKPRESCALER_PCLK_DIV2 ((uint32_t)0x00000000) #define ADC_CLOCKPRESCALER_PCLK_DIV4 ((uint32_t)ADC_CCR_ADCPRE_0) #define ADC_CLOCKPRESCALER_PCLK_DIV6 ((uint32_t)ADC_CCR_ADCPRE_1) #define ADC_CLOCKPRESCALER_PCLK_DIV8 ((uint32_t)ADC_CCR_ADCPRE) -#define IS_ADC_CLOCKPRESCALER(ADC_CLOCK) (((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV2) || \ - ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV4) || \ - ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV6) || \ - ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV8)) /** * @} */ -/** @defgroup ADC_delay_between_2_sampling_phases +/** @defgroup ADC_delay_between_2_sampling_phases ADC Delay Between 2 Sampling Phases * @{ */ #define ADC_TWOSAMPLINGDELAY_5CYCLES ((uint32_t)0x00000000) @@ -221,62 +224,37 @@ typedef struct #define ADC_TWOSAMPLINGDELAY_18CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_2 | ADC_CCR_DELAY_0)) #define ADC_TWOSAMPLINGDELAY_19CYCLES ((uint32_t)(ADC_CCR_DELAY_3 | ADC_CCR_DELAY_2 | ADC_CCR_DELAY_1)) #define ADC_TWOSAMPLINGDELAY_20CYCLES ((uint32_t)ADC_CCR_DELAY) - -#define IS_ADC_SAMPLING_DELAY(DELAY) (((DELAY) == ADC_TWOSAMPLINGDELAY_5CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_6CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_7CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_8CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_9CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_10CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_11CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_12CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_13CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_14CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_15CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_16CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_17CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_18CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_19CYCLES) || \ - ((DELAY) == ADC_TWOSAMPLINGDELAY_20CYCLES)) /** * @} */ -/** @defgroup ADC_Resolution +/** @defgroup ADC_Resolution ADC Resolution * @{ */ -#define ADC_RESOLUTION12b ((uint32_t)0x00000000) -#define ADC_RESOLUTION10b ((uint32_t)ADC_CR1_RES_0) -#define ADC_RESOLUTION8b ((uint32_t)ADC_CR1_RES_1) -#define ADC_RESOLUTION6b ((uint32_t)ADC_CR1_RES) - -#define IS_ADC_RESOLUTION(RESOLUTION) (((RESOLUTION) == ADC_RESOLUTION12b) || \ - ((RESOLUTION) == ADC_RESOLUTION10b) || \ - ((RESOLUTION) == ADC_RESOLUTION8b) || \ - ((RESOLUTION) == ADC_RESOLUTION6b)) +#define ADC_RESOLUTION_12B ((uint32_t)0x00000000) +#define ADC_RESOLUTION_10B ((uint32_t)ADC_CR1_RES_0) +#define ADC_RESOLUTION_8B ((uint32_t)ADC_CR1_RES_1) +#define ADC_RESOLUTION_6B ((uint32_t)ADC_CR1_RES) /** * @} */ -/** @defgroup ADC_External_trigger_edge_Regular +/** @defgroup ADC_External_trigger_edge_Regular ADC External Trigger Edge Regular * @{ */ #define ADC_EXTERNALTRIGCONVEDGE_NONE ((uint32_t)0x00000000) #define ADC_EXTERNALTRIGCONVEDGE_RISING ((uint32_t)ADC_CR2_EXTEN_0) #define ADC_EXTERNALTRIGCONVEDGE_FALLING ((uint32_t)ADC_CR2_EXTEN_1) #define ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING ((uint32_t)ADC_CR2_EXTEN) - -#define IS_ADC_EXT_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGCONVEDGE_NONE) || \ - ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISING) || \ - ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_FALLING) || \ - ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING)) /** * @} */ -/** @defgroup ADC_External_trigger_Source_Regular +/** @defgroup ADC_External_trigger_Source_Regular ADC External Trigger Source Regular * @{ - */ + */ +/* Note: Parameter ADC_SOFTWARE_START is a software parameter used for */ +/* compatibility with other STM32 devices. */ #define ADC_EXTERNALTRIGCONV_T1_CC1 ((uint32_t)0x00000000) #define ADC_EXTERNALTRIGCONV_T1_CC2 ((uint32_t)ADC_CR2_EXTSEL_0) #define ADC_EXTERNALTRIGCONV_T1_CC3 ((uint32_t)ADC_CR2_EXTSEL_1) @@ -293,40 +271,21 @@ typedef struct #define ADC_EXTERNALTRIGCONV_T8_CC1 ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0)) #define ADC_EXTERNALTRIGCONV_T8_TRGO ((uint32_t)(ADC_CR2_EXTSEL_3 | ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1)) #define ADC_EXTERNALTRIGCONV_Ext_IT11 ((uint32_t)ADC_CR2_EXTSEL) - -#define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC3) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC4) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC1) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC1) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC2) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC3) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_CC1) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO) || \ - ((REGTRIG) == ADC_EXTERNALTRIGCONV_Ext_IT11)) +#define ADC_SOFTWARE_START ((uint32_t)ADC_CR2_EXTSEL + 1) /** * @} */ -/** @defgroup ADC_data_align +/** @defgroup ADC_data_align ADC Data Align * @{ */ #define ADC_DATAALIGN_RIGHT ((uint32_t)0x00000000) #define ADC_DATAALIGN_LEFT ((uint32_t)ADC_CR2_ALIGN) - -#define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DATAALIGN_RIGHT) || \ - ((ALIGN) == ADC_DATAALIGN_LEFT)) /** * @} */ -/** @defgroup ADC_channels +/** @defgroup ADC_channels ADC Common Channels * @{ */ #define ADC_CHANNEL_0 ((uint32_t)0x00000000) @@ -349,34 +308,13 @@ typedef struct #define ADC_CHANNEL_17 ((uint32_t)(ADC_CR1_AWDCH_4 | ADC_CR1_AWDCH_0)) #define ADC_CHANNEL_18 ((uint32_t)(ADC_CR1_AWDCH_4 | ADC_CR1_AWDCH_1)) -#define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_16) #define ADC_CHANNEL_VREFINT ((uint32_t)ADC_CHANNEL_17) -#define ADC_CHANNEL_VBAT ((uint32_t)ADC_CHANNEL_18) - -#define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_CHANNEL_0) || \ - ((CHANNEL) == ADC_CHANNEL_1) || \ - ((CHANNEL) == ADC_CHANNEL_2) || \ - ((CHANNEL) == ADC_CHANNEL_3) || \ - ((CHANNEL) == ADC_CHANNEL_4) || \ - ((CHANNEL) == ADC_CHANNEL_5) || \ - ((CHANNEL) == ADC_CHANNEL_6) || \ - ((CHANNEL) == ADC_CHANNEL_7) || \ - ((CHANNEL) == ADC_CHANNEL_8) || \ - ((CHANNEL) == ADC_CHANNEL_9) || \ - ((CHANNEL) == ADC_CHANNEL_10) || \ - ((CHANNEL) == ADC_CHANNEL_11) || \ - ((CHANNEL) == ADC_CHANNEL_12) || \ - ((CHANNEL) == ADC_CHANNEL_13) || \ - ((CHANNEL) == ADC_CHANNEL_14) || \ - ((CHANNEL) == ADC_CHANNEL_15) || \ - ((CHANNEL) == ADC_CHANNEL_16) || \ - ((CHANNEL) == ADC_CHANNEL_17) || \ - ((CHANNEL) == ADC_CHANNEL_18)) +#define ADC_CHANNEL_VBAT ((uint32_t)ADC_CHANNEL_18) /** * @} */ -/** @defgroup ADC_sampling_times +/** @defgroup ADC_sampling_times ADC Sampling Times * @{ */ #define ADC_SAMPLETIME_3CYCLES ((uint32_t)0x00000000) @@ -387,46 +325,30 @@ typedef struct #define ADC_SAMPLETIME_112CYCLES ((uint32_t)(ADC_SMPR1_SMP10_2 | ADC_SMPR1_SMP10_0)) #define ADC_SAMPLETIME_144CYCLES ((uint32_t)(ADC_SMPR1_SMP10_2 | ADC_SMPR1_SMP10_1)) #define ADC_SAMPLETIME_480CYCLES ((uint32_t)ADC_SMPR1_SMP10) - -#define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SAMPLETIME_3CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_15CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_28CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_56CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_84CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_112CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_144CYCLES) || \ - ((TIME) == ADC_SAMPLETIME_480CYCLES)) /** * @} */ - /** @defgroup ADC_EOCSelection + /** @defgroup ADC_EOCSelection ADC EOC Selection * @{ */ -#define EOC_SEQ_CONV ((uint32_t)0x00000000) -#define EOC_SINGLE_CONV ((uint32_t)0x00000001) -#define EOC_SINGLE_SEQ_CONV ((uint32_t)0x00000002) /*!< reserved for future use */ - -#define IS_ADC_EOCSelection(EOCSelection) (((EOCSelection) == EOC_SINGLE_CONV) || \ - ((EOCSelection) == EOC_SEQ_CONV) || \ - ((EOCSelection) == EOC_SINGLE_SEQ_CONV)) +#define ADC_EOC_SEQ_CONV ((uint32_t)0x00000000) +#define ADC_EOC_SINGLE_CONV ((uint32_t)0x00000001) +#define ADC_EOC_SINGLE_SEQ_CONV ((uint32_t)0x00000002) /*!< reserved for future use */ /** * @} */ -/** @defgroup ADC_Event_type +/** @defgroup ADC_Event_type ADC Event Type * @{ */ -#define AWD_EVENT ((uint32_t)ADC_FLAG_AWD) -#define OVR_EVENT ((uint32_t)ADC_FLAG_OVR) - -#define IS_ADC_EVENT_TYPE(EVENT) (((EVENT) == AWD_EVENT) || \ - ((EVENT) == OVR_EVENT)) +#define ADC_AWD_EVENT ((uint32_t)ADC_FLAG_AWD) +#define ADC_OVR_EVENT ((uint32_t)ADC_FLAG_OVR) /** * @} */ -/** @defgroup ADC_analog_watchdog_selection +/** @defgroup ADC_analog_watchdog_selection ADC Analog Watchdog Selection * @{ */ #define ADC_ANALOGWATCHDOG_SINGLE_REG ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_AWDEN)) @@ -436,33 +358,22 @@ typedef struct #define ADC_ANALOGWATCHDOG_ALL_INJEC ((uint32_t)ADC_CR1_JAWDEN) #define ADC_ANALOGWATCHDOG_ALL_REGINJEC ((uint32_t)(ADC_CR1_AWDEN | ADC_CR1_JAWDEN)) #define ADC_ANALOGWATCHDOG_NONE ((uint32_t)0x00000000) - -#define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REG) || \ - ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || \ - ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) || \ - ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REG) || \ - ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_INJEC) || \ - ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REGINJEC) || \ - ((WATCHDOG) == ADC_ANALOGWATCHDOG_NONE)) /** * @} */ -/** @defgroup ADC_interrupts_definition +/** @defgroup ADC_interrupts_definition ADC Interrupts Definition * @{ */ #define ADC_IT_EOC ((uint32_t)ADC_CR1_EOCIE) #define ADC_IT_AWD ((uint32_t)ADC_CR1_AWDIE) #define ADC_IT_JEOC ((uint32_t)ADC_CR1_JEOCIE) #define ADC_IT_OVR ((uint32_t)ADC_CR1_OVRIE) - -#define IS_ADC_IT(IT) (((IT) == ADC_IT_EOC) || ((IT) == ADC_IT_AWD) || \ - ((IT) == ADC_IT_JEOC)|| ((IT) == ADC_IT_OVR)) /** * @} */ -/** @defgroup ADC_flags_definition +/** @defgroup ADC_flags_definition ADC Flags Definition * @{ */ #define ADC_FLAG_AWD ((uint32_t)ADC_SR_AWD) @@ -475,96 +386,268 @@ typedef struct * @} */ -/** @defgroup ADC_channels_type +/** @defgroup ADC_channels_type ADC Channels Type * @{ */ -#define ALL_CHANNELS ((uint32_t)0x00000001) -#define REGULAR_CHANNELS ((uint32_t)0x00000002) /*!< reserved for future use */ -#define INJECTED_CHANNELS ((uint32_t)0x00000003) /*!< reserved for future use */ - -#define IS_ADC_CHANNELS_TYPE(CHANNEL_TYPE) (((CHANNEL_TYPE) == ALL_CHANNELS) || \ - ((CHANNEL_TYPE) == REGULAR_CHANNELS) || \ - ((CHANNEL_TYPE) == INJECTED_CHANNELS)) +#define ADC_ALL_CHANNELS ((uint32_t)0x00000001) +#define ADC_REGULAR_CHANNELS ((uint32_t)0x00000002) /*!< reserved for future use */ +#define ADC_INJECTED_CHANNELS ((uint32_t)0x00000003) /*!< reserved for future use */ /** * @} */ -/** @defgroup ADC_thresholds - * @{ - */ -#define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= ((uint32_t)0xFFF)) /** * @} */ -/** @defgroup ADC_regular_length +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup ADC_Exported_Macros ADC Exported Macros * @{ - */ -#define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)16))) + */ + +/** @brief Reset ADC handle state + * @param __HANDLE__: ADC handle + * @retval None + */ +#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ADC_STATE_RESET) + +/** + * @brief Enable the ADC peripheral. + * @param __HANDLE__: ADC handle + * @retval None + */ +#define __HAL_ADC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR2 |= ADC_CR2_ADON) + +/** + * @brief Disable the ADC peripheral. + * @param __HANDLE__: ADC handle + * @retval None + */ +#define __HAL_ADC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= ~ADC_CR2_ADON) + +/** + * @brief Enable the ADC end of conversion interrupt. + * @param __HANDLE__: specifies the ADC Handle. + * @param __INTERRUPT__: ADC Interrupt. + * @retval None + */ +#define __HAL_ADC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1) |= (__INTERRUPT__)) + +/** + * @brief Disable the ADC end of conversion interrupt. + * @param __HANDLE__: specifies the ADC Handle. + * @param __INTERRUPT__: ADC interrupt. + * @retval None + */ +#define __HAL_ADC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1) &= ~(__INTERRUPT__)) + +/** @brief Check if the specified ADC interrupt source is enabled or disabled. + * @param __HANDLE__: specifies the ADC Handle. + * @param __INTERRUPT__: specifies the ADC interrupt source to check. + * @retval The new state of __IT__ (TRUE or FALSE). + */ +#define __HAL_ADC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) + +/** + * @brief Clear the ADC's pending flags. + * @param __HANDLE__: specifies the ADC Handle. + * @param __FLAG__: ADC flag. + * @retval None + */ +#define __HAL_ADC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__)) + +/** + * @brief Get the selected ADC's flag status. + * @param __HANDLE__: specifies the ADC Handle. + * @param __FLAG__: ADC flag. + * @retval None + */ +#define __HAL_ADC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) + /** * @} - */ + */ -/** @defgroup ADC_regular_rank +/* Include ADC HAL Extension module */ +#include "stm32f4xx_hal_adc_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup ADC_Exported_Functions * @{ - */ -#define IS_ADC_REGULAR_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)16))) + */ + +/** @addtogroup ADC_Exported_Functions_Group1 + * @{ + */ +/* Initialization/de-initialization functions ***********************************/ +HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc); +void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc); +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc); /** * @} - */ + */ -/** @defgroup ADC_regular_discontinuous_mode_number +/** @addtogroup ADC_Exported_Functions_Group2 * @{ - */ -#define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= ((uint32_t)1)) && ((NUMBER) <= ((uint32_t)8))) + */ +/* I/O operation functions ******************************************************/ +HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout); + +HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout); + +HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc); + +void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc); + +HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length); +HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc); + +uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc); + +void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc); +void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc); +void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc); +void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc); /** * @} - */ + */ -/** @defgroup ADC_range_verification +/** @addtogroup ADC_Exported_Functions_Group3 * @{ - */ -#define IS_ADC_RANGE(RESOLUTION, ADC_VALUE) \ - ((((RESOLUTION) == ADC_RESOLUTION12b) && ((ADC_VALUE) <= ((uint32_t)0x0FFF))) || \ - (((RESOLUTION) == ADC_RESOLUTION10b) && ((ADC_VALUE) <= ((uint32_t)0x03FF))) || \ - (((RESOLUTION) == ADC_RESOLUTION8b) && ((ADC_VALUE) <= ((uint32_t)0x00FF))) || \ - (((RESOLUTION) == ADC_RESOLUTION6b) && ((ADC_VALUE) <= ((uint32_t)0x003F)))) + */ +/* Peripheral Control functions *************************************************/ +HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig); +HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig); /** * @} - */ - + */ + +/** @addtogroup ADC_Exported_Functions_Group4 + * @{ + */ +/* Peripheral State functions ***************************************************/ +HAL_ADC_StateTypeDef HAL_ADC_GetState(ADC_HandleTypeDef* hadc); +uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc); /** * @} - */ - -/* Exported macro ------------------------------------------------------------*/ - -/** @brief Reset ADC handle state - * @param __HANDLE__: ADC handle - * @retval None */ -#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ADC_STATE_RESET) /** - * @brief Enable the ADC peripheral. - * @param __HANDLE__: ADC handle - * @retval None + * @} */ -#define __HAL_ADC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR2 |= ADC_CR2_ADON) - +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup ADC_Private_Constants ADC Private Constants + * @{ + */ +/* Delay for ADC stabilization time. */ +/* Maximum delay is 1us (refer to device datasheet, parameter tSTAB). */ +/* Unit: us */ +#define ADC_STAB_DELAY_US ((uint32_t) 3) +/* Delay for temperature sensor stabilization time. */ +/* Maximum delay is 10us (refer to device datasheet, parameter tSTART). */ +/* Unit: us */ +#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 10) /** - * @brief Disable the ADC peripheral. - * @param __HANDLE__: ADC handle - * @retval None + * @} */ -#define __HAL_ADC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= ~ADC_CR2_ADON) + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup ADC_Private_Macros ADC Private Macros + * @{ + */ +#define IS_ADC_CLOCKPRESCALER(ADC_CLOCK) (((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV2) || \ + ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV4) || \ + ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV6) || \ + ((ADC_CLOCK) == ADC_CLOCKPRESCALER_PCLK_DIV8)) +#define IS_ADC_SAMPLING_DELAY(DELAY) (((DELAY) == ADC_TWOSAMPLINGDELAY_5CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_6CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_7CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_8CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_9CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_10CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_11CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_12CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_13CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_14CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_15CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_16CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_17CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_18CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_19CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_20CYCLES)) +#define IS_ADC_RESOLUTION(RESOLUTION) (((RESOLUTION) == ADC_RESOLUTION_12B) || \ + ((RESOLUTION) == ADC_RESOLUTION_10B) || \ + ((RESOLUTION) == ADC_RESOLUTION_8B) || \ + ((RESOLUTION) == ADC_RESOLUTION_6B)) +#define IS_ADC_EXT_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGCONVEDGE_NONE) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISING) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_FALLING) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING)) +#define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T5_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_Ext_IT11)|| \ + ((REGTRIG) == ADC_SOFTWARE_START)) +#define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DATAALIGN_RIGHT) || \ + ((ALIGN) == ADC_DATAALIGN_LEFT)) +#define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SAMPLETIME_3CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_15CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_28CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_56CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_84CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_112CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_144CYCLES) || \ + ((TIME) == ADC_SAMPLETIME_480CYCLES)) +#define IS_ADC_EOCSelection(EOCSelection) (((EOCSelection) == ADC_EOC_SINGLE_CONV) || \ + ((EOCSelection) == ADC_EOC_SEQ_CONV) || \ + ((EOCSelection) == ADC_EOC_SINGLE_SEQ_CONV)) +#define IS_ADC_EVENT_TYPE(EVENT) (((EVENT) == ADC_AWD_EVENT) || \ + ((EVENT) == ADC_OVR_EVENT)) +#define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REG) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REG) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_INJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REGINJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_NONE)) +#define IS_ADC_CHANNELS_TYPE(CHANNEL_TYPE) (((CHANNEL_TYPE) == ADC_ALL_CHANNELS) || \ + ((CHANNEL_TYPE) == ADC_REGULAR_CHANNELS) || \ + ((CHANNEL_TYPE) == ADC_INJECTED_CHANNELS)) +#define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= ((uint32_t)0xFFF)) + +#define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)16))) +#define IS_ADC_REGULAR_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)16))) +#define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= ((uint32_t)1)) && ((NUMBER) <= ((uint32_t)8))) +#define IS_ADC_RANGE(RESOLUTION, ADC_VALUE) \ + ((((RESOLUTION) == ADC_RESOLUTION_12B) && ((ADC_VALUE) <= ((uint32_t)0x0FFF))) || \ + (((RESOLUTION) == ADC_RESOLUTION_10B) && ((ADC_VALUE) <= ((uint32_t)0x03FF))) || \ + (((RESOLUTION) == ADC_RESOLUTION_8B) && ((ADC_VALUE) <= ((uint32_t)0x00FF))) || \ + (((RESOLUTION) == ADC_RESOLUTION_6B) && ((ADC_VALUE) <= ((uint32_t)0x003F)))) /** * @brief Set ADC Regular channel sequence length. * @param _NbrOfConversion_: Regular channel sequence length. * @retval None */ -#define __HAL_ADC_SQR1(_NbrOfConversion_) (((_NbrOfConversion_) - (uint8_t)1) << 20) +#define ADC_SQR1(_NbrOfConversion_) (((_NbrOfConversion_) - (uint8_t)1) << 20) /** * @brief Set the ADC's sample time for channel numbers between 10 and 18. @@ -572,7 +655,7 @@ typedef struct * @param _CHANNELNB_: Channel number. * @retval None */ -#define __HAL_ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((_CHANNELNB_) - 10))) +#define ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * (((uint32_t)((uint16_t)(_CHANNELNB_))) - 10))) /** * @brief Set the ADC's sample time for channel numbers between 0 and 9. @@ -580,7 +663,7 @@ typedef struct * @param _CHANNELNB_: Channel number. * @retval None */ -#define __HAL_ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * (_CHANNELNB_))) +#define ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3 * ((uint32_t)((uint16_t)(_CHANNELNB_))))) /** * @brief Set the selected regular channel rank for rank between 1 and 6. @@ -588,7 +671,7 @@ typedef struct * @param _RANKNB_: Rank number. * @retval None */ -#define __HAL_ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 1))) +#define ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * ((_RANKNB_) - 1))) /** * @brief Set the selected regular channel rank for rank between 7 and 12. @@ -596,7 +679,7 @@ typedef struct * @param _RANKNB_: Rank number. * @retval None */ -#define __HAL_ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 7))) +#define ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * ((_RANKNB_) - 7))) /** * @brief Set the selected regular channel rank for rank between 13 and 16. @@ -604,128 +687,62 @@ typedef struct * @param _RANKNB_: Rank number. * @retval None */ -#define __HAL_ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (5 * ((_RANKNB_) - 13))) +#define ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * ((_RANKNB_) - 13))) /** * @brief Enable ADC continuous conversion mode. * @param _CONTINUOUS_MODE_: Continuous mode. * @retval None */ -#define __HAL_ADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_) ((_CONTINUOUS_MODE_) << 1) +#define ADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_) ((_CONTINUOUS_MODE_) << 1) /** * @brief Configures the number of discontinuous conversions for the regular group channels. * @param _NBR_DISCONTINUOUSCONV_: Number of discontinuous conversions. * @retval None */ -#define __HAL_ADC_CR1_DISCONTINUOUS(_NBR_DISCONTINUOUSCONV_) (((_NBR_DISCONTINUOUSCONV_) - 1) << 13) +#define ADC_CR1_DISCONTINUOUS(_NBR_DISCONTINUOUSCONV_) (((_NBR_DISCONTINUOUSCONV_) - 1) << POSITION_VAL(ADC_CR1_DISCNUM)) /** * @brief Enable ADC scan mode. * @param _SCANCONV_MODE_: Scan conversion mode. * @retval None */ -#define __HAL_ADC_CR1_SCANCONV(_SCANCONV_MODE_) ((_SCANCONV_MODE_) << 8) +#define ADC_CR1_SCANCONV(_SCANCONV_MODE_) ((_SCANCONV_MODE_) << 8) /** * @brief Enable the ADC end of conversion selection. * @param _EOCSelection_MODE_: End of conversion selection mode. * @retval None */ -#define __HAL_ADC_CR2_EOCSelection(_EOCSelection_MODE_) ((_EOCSelection_MODE_) << 10) +#define ADC_CR2_EOCSelection(_EOCSelection_MODE_) ((_EOCSelection_MODE_) << 10) /** * @brief Enable the ADC DMA continuous request. * @param _DMAContReq_MODE_: DMA continuous request mode. * @retval None */ -#define __HAL_ADC_CR2_DMAContReq(_DMAContReq_MODE_) ((_DMAContReq_MODE_) << 9) +#define ADC_CR2_DMAContReq(_DMAContReq_MODE_) ((_DMAContReq_MODE_) << 9) /** - * @brief Enable the ADC end of conversion interrupt. - * @param __HANDLE__: specifies the ADC Handle. - * @param __INTERRUPT__: ADC Interrupt. + * @brief Return resolution bits in CR1 register. + * @param __HANDLE__: ADC handle * @retval None */ -#define __HAL_ADC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1) |= (__INTERRUPT__)) +#define ADC_GET_RESOLUTION(__HANDLE__) (((__HANDLE__)->Instance->CR1) & ADC_CR1_RES) /** - * @brief Disable the ADC end of conversion interrupt. - * @param __HANDLE__: specifies the ADC Handle. - * @param __INTERRUPT__: ADC interrupt. - * @retval None - */ -#define __HAL_ADC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR1) &= ~(__INTERRUPT__)) - -/** @brief Check if the specified ADC interrupt source is enabled or disabled. - * @param __HANDLE__: specifies the ADC Handle. - * @param __INTERRUPT__: specifies the ADC interrupt source to check. - * @retval The new state of __IT__ (TRUE or FALSE). + * @} */ -#define __HAL_ADC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) -/** - * @brief Clear the ADC's pending flags. - * @param __HANDLE__: specifies the ADC Handle. - * @param __FLAG__: ADC flag. - * @retval None - */ -#define __HAL_ADC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__)) - -/** - * @brief Get the selected ADC's flag status. - * @param __HANDLE__: specifies the ADC Handle. - * @param __FLAG__: ADC flag. - * @retval None +/* Private functions ---------------------------------------------------------*/ +/** @defgroup ADC_Private_Functions ADC Private Functions + * @{ */ -#define __HAL_ADC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) /** - * @brief Return resolution bits in CR1 register. - * @param __HANDLE__: ADC handle - * @retval None + * @} */ -#define __HAL_ADC_GET_RESOLUTION(__HANDLE__) (((__HANDLE__)->Instance->CR1) & ADC_CR1_RES) - -/* Include ADC HAL Extension module */ -#include "stm32f4xx_hal_adc_ex.h" - -/* Exported functions --------------------------------------------------------*/ -/* Initialization/de-initialization functions ***********************************/ -HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc); -HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc); -void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc); -void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc); - -/* I/O operation functions ******************************************************/ -HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc); -HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc); -HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout); - -HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout); - -HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc); -HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc); - -void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc); - -HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length); -HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc); - -uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc); - -void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc); -void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc); -void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc); -void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc); - -/* Peripheral Control functions *************************************************/ -HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig); -HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig); - -/* Peripheral State functions ***************************************************/ -HAL_ADC_StateTypeDef HAL_ADC_GetState(ADC_HandleTypeDef* hadc); -uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc); /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.c index 8497ee5c15d..2108d4a44c6 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_adc_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief This file provides firmware functions to manage the following * functionalities of the ADC extension peripheral: * + Extended features functions @@ -14,20 +14,20 @@ ============================================================================== [..] (#)Initialize the ADC low level resources by implementing the HAL_ADC_MspInit(): - (##) Enable the ADC interface clock using __ADC_CLK_ENABLE() + (##) Enable the ADC interface clock using __HAL_RCC_ADC_CLK_ENABLE() (##) ADC pins configuration (+++) Enable the clock for the ADC GPIOs using the following function: - __GPIOx_CLK_ENABLE() + __HAL_RCC_GPIOx_CLK_ENABLE() (+++) Configure these ADC pins in analog mode using HAL_GPIO_Init() (##) In case of using interrupts (e.g. HAL_ADC_Start_IT()) (+++) Configure the ADC interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the ADC IRQ handler using HAL_NVIC_EnableIRQ() (+++) In ADC IRQ handler, call HAL_ADC_IRQHandler() (##) In case of using DMA to control data transfer (e.g. HAL_ADC_Start_DMA()) - (+++) Enable the DMAx interface clock using __DMAx_CLK_ENABLE() + (+++) Enable the DMAx interface clock using __HAL_RCC_DMAx_CLK_ENABLE() (+++) Configure and enable two DMA streams stream for managing data transfer from peripheral to memory (output stream) - (+++) Associate the initilalized DMA handle to the ADC DMA handle + (+++) Associate the initialized DMA handle to the ADC DMA handle using __HAL_LINKDMA() (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the two DMA Streams. The output stream should have higher @@ -86,7 +86,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -120,7 +120,7 @@ * @{ */ -/** @defgroup ADCEx +/** @defgroup ADCEx ADCEx * @brief ADC Extended driver modules * @{ */ @@ -131,19 +131,25 @@ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup ADCEx_Private_Functions + * @{ + */ /* Private function prototypes -----------------------------------------------*/ static void ADC_MultiModeDMAConvCplt(DMA_HandleTypeDef *hdma); static void ADC_MultiModeDMAError(DMA_HandleTypeDef *hdma); static void ADC_MultiModeDMAHalfConvCplt(DMA_HandleTypeDef *hdma); -/* Private functions ---------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup ADCEx_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup ADCEx_Exported_Functions ADC Exported Functions * @{ - */ + */ -/** @defgroup ADCEx_Group1 Extended features functions - * @brief Extended features functions - * +/** @defgroup ADCEx_Exported_Functions_Group1 Extended features functions + * @brief Extended features functions + * @verbatim =============================================================================== ##### Extended features functions ##### @@ -170,7 +176,8 @@ static void ADC_MultiModeDMAHalfConvCplt(DMA_HandleTypeDef *hdma); */ HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) { - uint32_t i = 0, tmp1 = 0, tmp2 = 0; + __IO uint32_t counter = 0; + uint32_t tmp1 = 0, tmp2 = 0; /* Process locked */ __HAL_LOCK(hadc); @@ -194,10 +201,12 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); - /* Delay inserted to wait during Tstab time the ADC's stabilazation */ - for(; i <= 540; i++) + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) { - __NOP(); + counter--; } } @@ -239,7 +248,8 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) */ HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) { - uint32_t i = 0, tmp1 = 0, tmp2 =0; + __IO uint32_t counter = 0; + uint32_t tmp1 = 0, tmp2 =0; /* Process locked */ __HAL_LOCK(hadc); @@ -266,10 +276,12 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); - /* Delay inserted to wait during Tstab time the ADC's stabilazation */ - for(; i <= 540; i++) + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) { - __NOP(); + counter--; } } @@ -392,7 +404,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc) /* Disable the ADC end of conversion interrupt for injected group */ __HAL_ADC_DISABLE_IT(hadc, ADC_CR1_JEOCIE); - /* Enable the Periphral */ + /* Enable the Peripheral */ __HAL_ADC_DISABLE(hadc); /* Change ADC state */ @@ -466,7 +478,7 @@ uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRa */ HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length) { - uint16_t counter = 0; + __IO uint32_t counter = 0; /* Check the parameters */ assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); @@ -512,15 +524,17 @@ HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); - /* Delay inserted to wait during Tstab time the ADC's stabilazation */ - for(; counter <= 540; counter++) + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); + while(counter != 0) { - __NOP(); + counter--; } } /* if no external trigger present enable software conversion of regular channels */ - if (hadc->Init.ExternalTrigConvEdge == ADC_EXTERNALTRIGCONVEDGE_NONE) + if((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET) { /* Enable the selected ADC software conversion for regular group */ hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART; @@ -618,7 +632,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->InjectedDiscontinuousConvMode)); #ifdef USE_FULL_ASSERT - tmp = __HAL_ADC_GET_RESOLUTION(hadc); + tmp = ADC_GET_RESOLUTION(hadc); assert_param(IS_ADC_RANGE(tmp, sConfigInjected->InjectedOffset)); #endif /* USE_FULL_ASSERT */ @@ -629,31 +643,31 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I if (sConfigInjected->InjectedChannel > ADC_CHANNEL_9) { /* Clear the old sample time */ - hadc->Instance->SMPR1 &= ~__HAL_ADC_SMPR1(ADC_SMPR1_SMP10, sConfigInjected->InjectedChannel); + hadc->Instance->SMPR1 &= ~ADC_SMPR1(ADC_SMPR1_SMP10, sConfigInjected->InjectedChannel); /* Set the new sample time */ - hadc->Instance->SMPR1 |= __HAL_ADC_SMPR1(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel); + hadc->Instance->SMPR1 |= ADC_SMPR1(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel); } else /* ADC_Channel include in ADC_Channel_[0..9] */ { /* Clear the old sample time */ - hadc->Instance->SMPR2 &= ~__HAL_ADC_SMPR2(ADC_SMPR2_SMP0, sConfigInjected->InjectedChannel); + hadc->Instance->SMPR2 &= ~ADC_SMPR2(ADC_SMPR2_SMP0, sConfigInjected->InjectedChannel); /* Set the new sample time */ - hadc->Instance->SMPR2 |= __HAL_ADC_SMPR2(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel); + hadc->Instance->SMPR2 |= ADC_SMPR2(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel); } /*---------------------------- ADCx JSQR Configuration -----------------*/ hadc->Instance->JSQR &= ~(ADC_JSQR_JL); - hadc->Instance->JSQR |= __HAL_ADC_SQR1(sConfigInjected->InjectedNbrOfConversion); + hadc->Instance->JSQR |= ADC_SQR1(sConfigInjected->InjectedNbrOfConversion); /* Rank configuration */ /* Clear the old SQx bits for the selected rank */ - hadc->Instance->JSQR &= ~__HAL_ADC_JSQR(ADC_JSQR_JSQ1, sConfigInjected->InjectedRank,sConfigInjected->InjectedNbrOfConversion); + hadc->Instance->JSQR &= ~ADC_JSQR(ADC_JSQR_JSQ1, sConfigInjected->InjectedRank,sConfigInjected->InjectedNbrOfConversion); /* Set the SQx bits for the selected rank */ - hadc->Instance->JSQR |= __HAL_ADC_JSQR(sConfigInjected->InjectedChannel, sConfigInjected->InjectedRank,sConfigInjected->InjectedNbrOfConversion); + hadc->Instance->JSQR |= ADC_JSQR(sConfigInjected->InjectedChannel, sConfigInjected->InjectedRank,sConfigInjected->InjectedNbrOfConversion); /* Select external trigger to start conversion */ hadc->Instance->CR2 &= ~(ADC_CR2_JEXTSEL); diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.h index ed189bd8bfa..c9ba9aa2706 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_adc_ex.h @@ -1,14 +1,14 @@ /** ****************************************************************************** - * @file stm32f4xx_hal_adc.h + * @file stm32f4xx_hal_adc_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of ADC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,9 +55,12 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup ADCEx_Exported_Types ADC Exported Types + * @{ + */ /** - * @brief ADC Configuration injected Channel structure definition + * @brief ADC Configuration injected Channel structure definition */ typedef struct { @@ -83,7 +86,7 @@ typedef struct }ADC_InjectionConfTypeDef; /** - * @brief ADC Configuration multi-mode structure definition + * @brief ADC Configuration multi-mode structure definition */ typedef struct { @@ -95,14 +98,16 @@ typedef struct This parameter can be a value of @ref ADC_delay_between_2_sampling_phases */ }ADC_MultiModeTypeDef; -/* Exported constants --------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup ADCEx_Exported_Constants +/* Exported constants --------------------------------------------------------*/ +/** @defgroup ADCEx_Exported_Constants ADC Exported Constants * @{ */ - -/** @defgroup ADCEx_Common_mode +/** @defgroup ADCEx_Common_mode ADC Common Mode * @{ */ #define ADC_MODE_INDEPENDENT ((uint32_t)0x00000000) @@ -118,57 +123,33 @@ typedef struct #define ADC_TRIPLEMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1)) #define ADC_TRIPLEMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0)) #define ADC_TRIPLEMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0)) - -#define IS_ADC_MODE(MODE) (((MODE) == ADC_MODE_INDEPENDENT) || \ - ((MODE) == ADC_DUALMODE_REGSIMULT_INJECSIMULT) || \ - ((MODE) == ADC_DUALMODE_REGSIMULT_ALTERTRIG) || \ - ((MODE) == ADC_DUALMODE_INJECSIMULT) || \ - ((MODE) == ADC_DUALMODE_REGSIMULT) || \ - ((MODE) == ADC_DUALMODE_INTERL) || \ - ((MODE) == ADC_DUALMODE_ALTERTRIG) || \ - ((MODE) == ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT) || \ - ((MODE) == ADC_TRIPLEMODE_REGSIMULT_AlterTrig) || \ - ((MODE) == ADC_TRIPLEMODE_INJECSIMULT) || \ - ((MODE) == ADC_TRIPLEMODE_REGSIMULT) || \ - ((MODE) == ADC_TRIPLEMODE_INTERL) || \ - ((MODE) == ADC_TRIPLEMODE_ALTERTRIG)) /** * @} */ -/** @defgroup ADCEx_Direct_memory_access_mode_for_multi_mode +/** @defgroup ADCEx_Direct_memory_access_mode_for_multi_mode ADC Direct Memory Access Mode For Multi Mode * @{ */ #define ADC_DMAACCESSMODE_DISABLED ((uint32_t)0x00000000) /*!< DMA mode disabled */ #define ADC_DMAACCESSMODE_1 ((uint32_t)ADC_CCR_DMA_0) /*!< DMA mode 1 enabled (2 / 3 half-words one by one - 1 then 2 then 3)*/ #define ADC_DMAACCESSMODE_2 ((uint32_t)ADC_CCR_DMA_1) /*!< DMA mode 2 enabled (2 / 3 half-words by pairs - 2&1 then 1&3 then 3&2)*/ #define ADC_DMAACCESSMODE_3 ((uint32_t)ADC_CCR_DMA) /*!< DMA mode 3 enabled (2 / 3 bytes by pairs - 2&1 then 1&3 then 3&2) */ - -#define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAACCESSMODE_DISABLED) || \ - ((MODE) == ADC_DMAACCESSMODE_1) || \ - ((MODE) == ADC_DMAACCESSMODE_2) || \ - ((MODE) == ADC_DMAACCESSMODE_3)) /** * @} */ -/** @defgroup ADCEx_External_trigger_edge_Injected +/** @defgroup ADCEx_External_trigger_edge_Injected ADC External Trigger Edge Injected * @{ */ #define ADC_EXTERNALTRIGINJECCONVEDGE_NONE ((uint32_t)0x00000000) #define ADC_EXTERNALTRIGINJECCONVEDGE_RISING ((uint32_t)ADC_CR2_JEXTEN_0) #define ADC_EXTERNALTRIGINJECCONVEDGE_FALLING ((uint32_t)ADC_CR2_JEXTEN_1) #define ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING ((uint32_t)ADC_CR2_JEXTEN) - -#define IS_ADC_EXT_INJEC_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_NONE) || \ - ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISING) || \ - ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_FALLING) || \ - ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING)) /** * @} */ -/** @defgroup ADCEx_External_trigger_Source_Injected +/** @defgroup ADCEx_External_trigger_Source_Injected ADC External Trigger Source Injected * @{ */ #define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ((uint32_t)0x00000000) @@ -187,89 +168,170 @@ typedef struct #define ADC_EXTERNALTRIGINJECCONV_T8_CC3 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0)) #define ADC_EXTERNALTRIGINJECCONV_T8_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1)) #define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ((uint32_t)ADC_CR2_JEXTSEL) - -#define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC2) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC1) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC2) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_CC4) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_TRGO) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC3) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ - ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15)) /** * @} */ -/** @defgroup ADCEx_injected_channel_selection +/** @defgroup ADCEx_injected_channel_selection ADC Injected Channel Selection * @{ */ #define ADC_INJECTED_RANK_1 ((uint32_t)0x00000001) #define ADC_INJECTED_RANK_2 ((uint32_t)0x00000002) #define ADC_INJECTED_RANK_3 ((uint32_t)0x00000003) #define ADC_INJECTED_RANK_4 ((uint32_t)0x00000004) - /** * @} */ - -/** @defgroup ADCEx_injected_length - * @{ - */ -#define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)4))) -/** - * @} - */ -/** @defgroup ADCEx_injected_rank +/** @defgroup ADCEx_channels ADC Specific Channels * @{ - */ -#define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)4))) + */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_16) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +#define ADC_CHANNEL_DIFFERENCIATION_TEMPSENSOR_VBAT ((uint32_t)0x10000000) /* Dummy bit for driver internal usage, not used in ADC channel setting registers CR1 or SQRx */ +#define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_18 | ADC_CHANNEL_DIFFERENCIATION_TEMPSENSOR_VBAT) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** * @} */ - + + /** * @} */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup ADC_Exported_Macros ADC Exported Macros + * @{ + */ /** - * @brief Set the selected injected Channel rank. - * @param _CHANNELNB_: Channel number. - * @param _RANKNB_: Rank number. - * @param _JSQR_JL_: Sequence length. - * @retval None - */ -#define __HAL_ADC_JSQR(_CHANNELNB_, _RANKNB_,_JSQR_JL_) \ -((_CHANNELNB_) << (5 * (uint8_t)(((_RANKNB_) + 3) - (_JSQR_JL_)))) + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup ADCEx_Exported_Functions + * @{ + */ + +/** @addtogroup ADCEx_Exported_Functions_Group1 + * @{ + */ /* I/O operation functions ******************************************************/ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc); HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc); HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout); -HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc); -HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc); HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc); -uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank); +HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc); +uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank); HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length); HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc); -uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc); -void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc); +uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc); +void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc); /* Peripheral Control functions *************************************************/ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected); HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_MultiModeTypeDef* multimode); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup ADCEx_Private_Constants ADC Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup ADCEx_Private_Macros ADC Private Macros + * @{ + */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#define IS_ADC_CHANNEL(CHANNEL) ((CHANNEL) <= ADC_CHANNEL_18) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +#define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) <= ADC_CHANNEL_18) || \ + ((CHANNEL) == ADC_CHANNEL_TEMPSENSOR)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +#define IS_ADC_MODE(MODE) (((MODE) == ADC_MODE_INDEPENDENT) || \ + ((MODE) == ADC_DUALMODE_REGSIMULT_INJECSIMULT) || \ + ((MODE) == ADC_DUALMODE_REGSIMULT_ALTERTRIG) || \ + ((MODE) == ADC_DUALMODE_INJECSIMULT) || \ + ((MODE) == ADC_DUALMODE_REGSIMULT) || \ + ((MODE) == ADC_DUALMODE_INTERL) || \ + ((MODE) == ADC_DUALMODE_ALTERTRIG) || \ + ((MODE) == ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT) || \ + ((MODE) == ADC_TRIPLEMODE_REGSIMULT_AlterTrig) || \ + ((MODE) == ADC_TRIPLEMODE_INJECSIMULT) || \ + ((MODE) == ADC_TRIPLEMODE_REGSIMULT) || \ + ((MODE) == ADC_TRIPLEMODE_INTERL) || \ + ((MODE) == ADC_TRIPLEMODE_ALTERTRIG)) +#define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAACCESSMODE_DISABLED) || \ + ((MODE) == ADC_DMAACCESSMODE_1) || \ + ((MODE) == ADC_DMAACCESSMODE_2) || \ + ((MODE) == ADC_DMAACCESSMODE_3)) +#define IS_ADC_EXT_INJEC_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_NONE) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISING) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_FALLING) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING)) +#define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15)) +#define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)4))) +#define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)4))) + +/** + * @brief Set the selected injected Channel rank. + * @param _CHANNELNB_: Channel number. + * @param _RANKNB_: Rank number. + * @param _JSQR_JL_: Sequence length. + * @retval None + */ +#define ADC_JSQR(_CHANNELNB_, _RANKNB_, _JSQR_JL_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * (uint8_t)(((_RANKNB_) + 3) - (_JSQR_JL_)))) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup ADCEx_Private_Functions ADC Private Functions + * @{ + */ + +/** + * @} + */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.c index 053c9560b71..83528249f83 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_can.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief This file provides firmware functions to manage the following * functionalities of the Controller Area Network (CAN) peripheral: * + Initialization and de-initialization functions @@ -17,7 +17,7 @@ ============================================================================== [..] (#) Enable the CAN controller interface clock using - __CAN1_CLK_ENABLE() for CAN1 and __CAN1_CLK_ENABLE() for CAN2 + __HAL_RCC_CAN1_CLK_ENABLE() for CAN1 and __HAL_RCC_CAN2_CLK_ENABLE() for CAN2 -@- In case you are using CAN2 only, you have to enable the CAN1 clock. (#) CAN pins configuration @@ -26,11 +26,11 @@ (++) Connect and configure the involved CAN pins to AF9 using the following function HAL_GPIO_Init() - (#) Initialise and configure the CAN using CAN_Init() function. + (#) Initialize and configure the CAN using CAN_Init() function. (#) Transmit the desired CAN frame using HAL_CAN_Transmit() function. - (#) Receive a CAN frame using HAL_CAN_Recieve() function. + (#) Receive a CAN frame using HAL_CAN_Receive() function. *** Polling mode IO operation *** ================================= @@ -72,7 +72,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -106,30 +106,44 @@ * @{ */ -/** @defgroup CAN +/** @defgroup CAN CAN * @brief CAN driver modules * @{ */ #ifdef HAL_CAN_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup CAN_Private_Constants + * @{ + */ #define CAN_TIMEOUT_VALUE 10 +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup CAN_Private_Functions + * @{ + */ static HAL_StatusTypeDef CAN_Receive_IT(CAN_HandleTypeDef* hcan, uint8_t FIFONumber); static HAL_StatusTypeDef CAN_Transmit_IT(CAN_HandleTypeDef* hcan); -/* Private functions ---------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup CAN_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup CAN_Exported_Functions CAN Exported Functions * @{ */ -/** @defgroup CAN_Group1 Initialization and de-initialization functions +/** @defgroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -179,6 +193,8 @@ HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef* hcan) if(hcan->State == HAL_CAN_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hcan->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_CAN_MspInit(hcan); } @@ -498,7 +514,7 @@ __weak void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan) * @} */ -/** @defgroup CAN_Group2 IO operation functions +/** @defgroup CAN_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -641,7 +657,10 @@ HAL_StatusTypeDef HAL_CAN_Transmit(CAN_HandleTypeDef* hcan, uint32_t Timeout) { /* Change CAN state */ hcan->State = HAL_CAN_STATE_ERROR; - + + /* Process unlocked */ + __HAL_UNLOCK(hcan); + /* Return function status */ return HAL_ERROR; } @@ -969,6 +988,9 @@ HAL_StatusTypeDef HAL_CAN_Sleep(CAN_HandleTypeDef* hcan) /* Sleep mode status */ if ((hcan->Instance->MSR & (CAN_MSR_SLAK|CAN_MSR_INAK)) != CAN_MSR_SLAK) { + /* Process unlocked */ + __HAL_UNLOCK(hcan); + /* Return function status */ return HAL_ERROR; } @@ -1034,6 +1056,9 @@ HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef* hcan) } if((hcan->Instance->MSR & CAN_MSR_SLAK) == CAN_MSR_SLAK) { + /* Process unlocked */ + __HAL_UNLOCK(hcan); + /* Return function status */ return HAL_ERROR; } @@ -1219,7 +1244,7 @@ __weak void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan) * @} */ -/** @defgroup CAN_Group3 Peripheral State and Error functions +/** @defgroup CAN_Exported_Functions_Group3 Peripheral State and Error functions * @brief CAN Peripheral State functions * @verbatim @@ -1399,7 +1424,7 @@ static HAL_StatusTypeDef CAN_Receive_IT(CAN_HandleTypeDef* hcan, uint8_t FIFONum /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ #endif /* HAL_CAN_MODULE_ENABLED */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.h index bb286008471..a020cc6e909 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_can.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_can.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of CAN HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,9 @@ extern "C" { #endif -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" @@ -56,52 +58,55 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup CAN_Exported_Types CAN Exported Types + * @{ + */ -/** - * @brief HAL State structures definition - */ +/** + * @brief HAL State structures definition + */ typedef enum { HAL_CAN_STATE_RESET = 0x00, /*!< CAN not yet initialized or disabled */ - HAL_CAN_STATE_READY = 0x01, /*!< CAN initialized and ready for use */ - HAL_CAN_STATE_BUSY = 0x02, /*!< CAN process is ongoing */ - HAL_CAN_STATE_BUSY_TX = 0x12, /*!< CAN process is ongoing */ - HAL_CAN_STATE_BUSY_RX = 0x22, /*!< CAN process is ongoing */ + HAL_CAN_STATE_READY = 0x01, /*!< CAN initialized and ready for use */ + HAL_CAN_STATE_BUSY = 0x02, /*!< CAN process is ongoing */ + HAL_CAN_STATE_BUSY_TX = 0x12, /*!< CAN process is ongoing */ + HAL_CAN_STATE_BUSY_RX = 0x22, /*!< CAN process is ongoing */ HAL_CAN_STATE_BUSY_TX_RX = 0x32, /*!< CAN process is ongoing */ HAL_CAN_STATE_TIMEOUT = 0x03, /*!< Timeout state */ - HAL_CAN_STATE_ERROR = 0x04 /*!< CAN error state */ + HAL_CAN_STATE_ERROR = 0x04 /*!< CAN error state */ }HAL_CAN_StateTypeDef; -/** +/** * @brief CAN init structure definition */ typedef struct { - uint32_t Prescaler; /*!< Specifies the length of a time quantum. + uint32_t Prescaler; /*!< Specifies the length of a time quantum. This parameter must be a number between Min_Data = 1 and Max_Data = 1024 */ - + uint32_t Mode; /*!< Specifies the CAN operating mode. This parameter can be a value of @ref CAN_operating_mode */ - uint32_t SJW; /*!< Specifies the maximum number of time quanta - the CAN hardware is allowed to lengthen or + uint32_t SJW; /*!< Specifies the maximum number of time quanta + the CAN hardware is allowed to lengthen or shorten a bit to perform resynchronization. This parameter can be a value of @ref CAN_synchronisation_jump_width */ - uint32_t BS1; /*!< Specifies the number of time quanta in Bit Segment 1. + uint32_t BS1; /*!< Specifies the number of time quanta in Bit Segment 1. This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */ - + uint32_t BS2; /*!< Specifies the number of time quanta in Bit Segment 2. This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */ - + uint32_t TTCM; /*!< Enable or disable the time triggered communication mode. This parameter can be set to ENABLE or DISABLE. */ - + uint32_t ABOM; /*!< Enable or disable the automatic bus-off management. This parameter can be set to ENABLE or DISABLE */ - uint32_t AWUM; /*!< Enable or disable the automatic wake-up mode. + uint32_t AWUM; /*!< Enable or disable the automatic wake-up mode. This parameter can be set to ENABLE or DISABLE */ uint32_t NART; /*!< Enable or disable the non-automatic retransmission mode. @@ -114,33 +119,33 @@ typedef struct This parameter can be set to ENABLE or DISABLE */ }CAN_InitTypeDef; -/** +/** * @brief CAN filter configuration structure definition */ typedef struct { uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit configuration, first one for a 16-bit configuration). - This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ - + This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit configuration, second one for a 16-bit configuration). - This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number, according to the mode (MSBs for a 32-bit configuration, first one for a 16-bit configuration). - This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number, according to the mode (LSBs for a 32-bit configuration, second one for a 16-bit configuration). - This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1) which will be assigned to the filter. This parameter can be a value of @ref CAN_filter_FIFO */ - - uint32_t FilterNumber; /*!< Specifies the filter which will be initialized. + + uint32_t FilterNumber; /*!< Specifies the filter which will be initialized. This parameter must be a number between Min_Data = 0 and Max_Data = 27 */ uint32_t FilterMode; /*!< Specifies the filter mode to be initialized. @@ -151,50 +156,50 @@ typedef struct uint32_t FilterActivation; /*!< Enable or disable the filter. This parameter can be set to ENABLE or DISABLE. */ - + uint32_t BankNumber; /*!< Select the start slave bank filter. - This parameter must be a number between Min_Data = 0 and Max_Data = 28 */ - + This parameter must be a number between Min_Data = 0 and Max_Data = 28 */ + }CAN_FilterConfTypeDef; -/** - * @brief CAN Tx message structure definition +/** + * @brief CAN Tx message structure definition */ typedef struct { uint32_t StdId; /*!< Specifies the standard identifier. - This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF */ - + This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF */ + uint32_t ExtId; /*!< Specifies the extended identifier. - This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF */ - + This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF */ + uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted. - This parameter can be a value of @ref CAN_identifier_type */ + This parameter can be a value of @ref CAN_Identifier_Type */ uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted. - This parameter can be a value of @ref CAN_remote_transmission_request */ + This parameter can be a value of @ref CAN_remote_transmission_request */ uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 8 */ - uint32_t Data[8]; /*!< Contains the data to be transmitted. + uint8_t Data[8]; /*!< Contains the data to be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF */ - + }CanTxMsgTypeDef; -/** - * @brief CAN Rx message structure definition +/** + * @brief CAN Rx message structure definition */ typedef struct { uint32_t StdId; /*!< Specifies the standard identifier. - This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF */ + This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF */ uint32_t ExtId; /*!< Specifies the extended identifier. - This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF */ + This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF */ - uint32_t IDE; /*!< Specifies the type of identifier for the message that will be received. - This parameter can be a value of @ref CAN_identifier_type */ + uint32_t IDE; /*!< Specifies the type of identifier for the message that will be received. + This parameter can be a value of @ref CAN_Identifier_Type */ uint32_t RTR; /*!< Specifies the type of frame for the received message. This parameter can be a value of @ref CAN_remote_transmission_request */ @@ -202,49 +207,52 @@ typedef struct uint32_t DLC; /*!< Specifies the length of the frame that will be received. This parameter must be a number between Min_Data = 0 and Max_Data = 8 */ - uint32_t Data[8]; /*!< Contains the data to be received. + uint8_t Data[8]; /*!< Contains the data to be received. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF */ uint32_t FMI; /*!< Specifies the index of the filter the message stored in the mailbox passes through. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF */ - - uint32_t FIFONumber; /*!< Specifies the receive FIFO number. + + uint32_t FIFONumber; /*!< Specifies the receive FIFO number. This parameter can be CAN_FIFO0 or CAN_FIFO1 */ - + }CanRxMsgTypeDef; -/** - * @brief CAN handle Structure definition - */ +/** + * @brief CAN handle Structure definition + */ typedef struct { CAN_TypeDef *Instance; /*!< Register base address */ - + CAN_InitTypeDef Init; /*!< CAN required parameters */ - + CanTxMsgTypeDef* pTxMsg; /*!< Pointer to transmit structure */ CanRxMsgTypeDef* pRxMsg; /*!< Pointer to reception structure */ - + __IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */ - + HAL_LockTypeDef Lock; /*!< CAN locking object */ - + __IO uint32_t ErrorCode; /*!< CAN Error code */ - + }CAN_HandleTypeDef; -/* Exported constants --------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup CAN_Exported_Constants +/* Exported constants --------------------------------------------------------*/ +/** @defgroup CAN_Exported_Constants CAN Exported Constants * @{ */ -/** @defgroup HAL CAN Error Code +/** @defgroup HAL_CAN_Error_Code HAL CAN Error Code * @{ */ #define HAL_CAN_ERROR_NONE 0x00 /*!< No error */ -#define HAL_CAN_ERROR_EWG 0x01 /*!< EWG error */ +#define HAL_CAN_ERROR_EWG 0x01 /*!< EWG error */ #define HAL_CAN_ERROR_EPV 0x02 /*!< EPV error */ #define HAL_CAN_ERROR_BOF 0x04 /*!< BOF error */ #define HAL_CAN_ERROR_STF 0x08 /*!< Stuff error */ @@ -255,10 +263,9 @@ typedef struct #define HAL_CAN_ERROR_CRC 0x100 /*!< LEC transfer error */ /** * @} - */ - + */ -/** @defgroup CAN_InitStatus +/** @defgroup CAN_InitStatus CAN InitStatus * @{ */ #define CAN_INITSTATUS_FAILED ((uint8_t)0x00) /*!< CAN initialization failed */ @@ -267,38 +274,29 @@ typedef struct * @} */ -/** @defgroup CAN_operating_mode +/** @defgroup CAN_operating_mode CAN Operating Mode * @{ */ #define CAN_MODE_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */ #define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /*!< Loopback mode */ #define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /*!< Silent mode */ #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with silent mode */ - -#define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \ - ((MODE) == CAN_MODE_LOOPBACK)|| \ - ((MODE) == CAN_MODE_SILENT) || \ - ((MODE) == CAN_MODE_SILENT_LOOPBACK)) /** * @} */ - -/** @defgroup CAN_synchronisation_jump_width +/** @defgroup CAN_synchronisation_jump_width CAN Synchronisation Jump Width * @{ */ #define CAN_SJW_1TQ ((uint32_t)0x00000000) /*!< 1 time quantum */ #define CAN_SJW_2TQ ((uint32_t)CAN_BTR_SJW_0) /*!< 2 time quantum */ #define CAN_SJW_3TQ ((uint32_t)CAN_BTR_SJW_1) /*!< 3 time quantum */ #define CAN_SJW_4TQ ((uint32_t)CAN_BTR_SJW) /*!< 4 time quantum */ - -#define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ)|| \ - ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ)) /** * @} */ -/** @defgroup CAN_time_quantum_in_bit_segment_1 +/** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in bit segment 1 * @{ */ #define CAN_BS1_1TQ ((uint32_t)0x00000000) /*!< 1 time quantum */ @@ -317,13 +315,11 @@ typedef struct #define CAN_BS1_14TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 14 time quantum */ #define CAN_BS1_15TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 15 time quantum */ #define CAN_BS1_16TQ ((uint32_t)CAN_BTR_TS1) /*!< 16 time quantum */ - -#define IS_CAN_BS1(BS1) ((BS1) <= CAN_BS1_16TQ) /** * @} */ -/** @defgroup CAN_time_quantum_in_bit_segment_2 +/** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in bit segment 2 * @{ */ #define CAN_BS2_1TQ ((uint32_t)0x00000000) /*!< 1 time quantum */ @@ -334,138 +330,70 @@ typedef struct #define CAN_BS2_6TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0)) /*!< 6 time quantum */ #define CAN_BS2_7TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1)) /*!< 7 time quantum */ #define CAN_BS2_8TQ ((uint32_t)CAN_BTR_TS2) /*!< 8 time quantum */ - -#define IS_CAN_BS2(BS2) ((BS2) <= CAN_BS2_8TQ) /** * @} */ -/** @defgroup CAN_clock_prescaler - * @{ - */ -#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1) && ((PRESCALER) <= 1024)) -/** - * @} - */ - -/** @defgroup CAN_filter_number - * @{ - */ -#define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27) -/** - * @} - */ - -/** @defgroup CAN_filter_mode +/** @defgroup CAN_filter_mode CAN Filter Mode * @{ */ #define CAN_FILTERMODE_IDMASK ((uint8_t)0x00) /*!< Identifier mask mode */ #define CAN_FILTERMODE_IDLIST ((uint8_t)0x01) /*!< Identifier list mode */ - -#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \ - ((MODE) == CAN_FILTERMODE_IDLIST)) /** * @} */ -/** @defgroup CAN_filter_scale +/** @defgroup CAN_filter_scale CAN Filter Scale * @{ */ #define CAN_FILTERSCALE_16BIT ((uint8_t)0x00) /*!< Two 16-bit filters */ #define CAN_FILTERSCALE_32BIT ((uint8_t)0x01) /*!< One 32-bit filter */ - -#define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \ - ((SCALE) == CAN_FILTERSCALE_32BIT)) /** * @} */ -/** @defgroup CAN_filter_FIFO +/** @defgroup CAN_filter_FIFO CAN Filter FIFO * @{ */ #define CAN_FILTER_FIFO0 ((uint8_t)0x00) /*!< Filter FIFO 0 assignment for filter x */ #define CAN_FILTER_FIFO1 ((uint8_t)0x01) /*!< Filter FIFO 1 assignment for filter x */ - -#define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \ - ((FIFO) == CAN_FILTER_FIFO1)) - -/* Legacy defines */ -#define CAN_FilterFIFO0 CAN_FILTER_FIFO0 -#define CAN_FilterFIFO1 CAN_FILTER_FIFO1 -/** - * @} - */ - -/** @defgroup CAN_Start_bank_filter_for_slave_CAN - * @{ - */ -#define IS_CAN_BANKNUMBER(BANKNUMBER) ((BANKNUMBER) <= 28) /** * @} */ -/** @defgroup CAN_Tx - * @{ - */ -#define IS_CAN_TRANSMITMAILBOX(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= ((uint8_t)0x02)) -#define IS_CAN_STDID(STDID) ((STDID) <= ((uint32_t)0x7FF)) -#define IS_CAN_EXTID(EXTID) ((EXTID) <= ((uint32_t)0x1FFFFFFF)) -#define IS_CAN_DLC(DLC) ((DLC) <= ((uint8_t)0x08)) -/** - * @} - */ - -/** @defgroup CAN_identifier_type +/** @defgroup CAN_Identifier_Type CAN Identifier Type * @{ */ #define CAN_ID_STD ((uint32_t)0x00000000) /*!< Standard Id */ #define CAN_ID_EXT ((uint32_t)0x00000004) /*!< Extended Id */ -#define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \ - ((IDTYPE) == CAN_ID_EXT)) /** * @} */ -/** @defgroup CAN_remote_transmission_request +/** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request * @{ */ #define CAN_RTR_DATA ((uint32_t)0x00000000) /*!< Data frame */ #define CAN_RTR_REMOTE ((uint32_t)0x00000002) /*!< Remote frame */ -#define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE)) - /** * @} */ -/** @defgroup CAN_transmit_constants - * @{ - */ -#define CAN_TXSTATUS_FAILED ((uint8_t)0x00) /*!< CAN transmission failed */ -#define CAN_TXSTATUS_OK ((uint8_t)0x01) /*!< CAN transmission succeeded */ -#define CAN_TXSTATUS_PENDING ((uint8_t)0x02) /*!< CAN transmission pending */ -#define CAN_TXSTATUS_NOMAILBOX ((uint8_t)0x04) /*!< CAN cell did not provide CAN_TxStatus_NoMailBox */ - -/** - * @} - */ - -/** @defgroup CAN_receive_FIFO_number_constants +/** @defgroup CAN_receive_FIFO_number_constants CAN Receive FIFO Number Constants * @{ */ #define CAN_FIFO0 ((uint8_t)0x00) /*!< CAN FIFO 0 used to receive */ #define CAN_FIFO1 ((uint8_t)0x01) /*!< CAN FIFO 1 used to receive */ - -#define IS_CAN_FIFO(FIFO) (((FIFO) == CAN_FIFO0) || ((FIFO) == CAN_FIFO1)) /** * @} */ -/** @defgroup CAN_flags +/** @defgroup CAN_flags CAN Flags * @{ */ /* If the flag is 0x3XXXXXXX, it means that it can be used with CAN_GetFlagStatus() and CAN_ClearFlag() functions. */ -/* If the flag is 0x1XXXXXXX, it means that it can only be used with +/* If the flag is 0x1XXXXXXX, it means that it can only be used with CAN_GetFlagStatus() function. */ /* Transmit Flags */ @@ -490,35 +418,20 @@ typedef struct #define CAN_FLAG_WKU ((uint32_t)0x00000103) /*!< Wake up flag */ #define CAN_FLAG_SLAK ((uint32_t)0x00000101) /*!< Sleep acknowledge flag */ #define CAN_FLAG_SLAKI ((uint32_t)0x00000104) /*!< Sleep acknowledge flag */ -/* @note When SLAK interrupt is disabled (SLKIE=0), no polling on SLAKI is possible. +/* @note When SLAK interrupt is disabled (SLKIE=0), no polling on SLAKI is possible. In this case the SLAK bit can be polled.*/ /* Error Flags */ #define CAN_FLAG_EWG ((uint32_t)0x00000300) /*!< Error warning flag */ #define CAN_FLAG_EPV ((uint32_t)0x00000301) /*!< Error passive flag */ #define CAN_FLAG_BOF ((uint32_t)0x00000302) /*!< Bus-Off flag */ - -#define IS_CAN_GET_FLAG(FLAG) (((FLAG) == CAN_FLAG_RQCP2) || ((FLAG) == CAN_FLAG_BOF) || \ - ((FLAG) == CAN_FLAG_EPV) || ((FLAG) == CAN_FLAG_EWG) || \ - ((FLAG) == CAN_FLAG_WKU) || ((FLAG) == CAN_FLAG_FOV0) || \ - ((FLAG) == CAN_FLAG_FF0) || ((FLAG) == CAN_FLAG_SLAK) || \ - ((FLAG) == CAN_FLAG_FOV1) || ((FLAG) == CAN_FLAG_FF1) || \ - ((FLAG) == CAN_FLAG_RQCP1) || ((FLAG) == CAN_FLAG_RQCP0)) - - -#define IS_CAN_CLEAR_FLAG(FLAG)(((FLAG) == CAN_FLAG_SLAK) || ((FLAG) == CAN_FLAG_RQCP2) || \ - ((FLAG) == CAN_FLAG_RQCP1) || ((FLAG) == CAN_FLAG_RQCP0) || \ - ((FLAG) == CAN_FLAG_FF0) || ((FLAG) == CAN_FLAG_FOV0) || \ - ((FLAG) == CAN_FLAG_FF1) || ((FLAG) == CAN_FLAG_FOV1) || \ - ((FLAG) == CAN_FLAG_WKU)) /** * @} */ - -/** @defgroup CAN_interrupts +/** @defgroup CAN_Interrupts CAN Interrupts * @{ - */ + */ #define CAN_IT_TME ((uint32_t)CAN_IER_TMEIE) /*!< Transmit mailbox empty interrupt */ /* Receive Interrupts */ @@ -539,45 +452,28 @@ typedef struct #define CAN_IT_BOF ((uint32_t)CAN_IER_BOFIE) /*!< Bus-off interrupt */ #define CAN_IT_LEC ((uint32_t)CAN_IER_LECIE) /*!< Last error code interrupt */ #define CAN_IT_ERR ((uint32_t)CAN_IER_ERRIE) /*!< Error Interrupt */ - -/* Flags named as Interrupts : kept only for FW compatibility */ -#define CAN_IT_RQCP0 CAN_IT_TME -#define CAN_IT_RQCP1 CAN_IT_TME -#define CAN_IT_RQCP2 CAN_IT_TME - -#define IS_CAN_IT(IT) (((IT) == CAN_IT_TME) || ((IT) == CAN_IT_FMP0) ||\ - ((IT) == CAN_IT_FF0) || ((IT) == CAN_IT_FOV0) ||\ - ((IT) == CAN_IT_FMP1) || ((IT) == CAN_IT_FF1) ||\ - ((IT) == CAN_IT_FOV1) || ((IT) == CAN_IT_EWG) ||\ - ((IT) == CAN_IT_EPV) || ((IT) == CAN_IT_BOF) ||\ - ((IT) == CAN_IT_LEC) || ((IT) == CAN_IT_ERR) ||\ - ((IT) == CAN_IT_WKU) || ((IT) == CAN_IT_SLK)) - -#define IS_CAN_CLEAR_IT(IT) (((IT) == CAN_IT_TME) || ((IT) == CAN_IT_FF0) ||\ - ((IT) == CAN_IT_FOV0)|| ((IT) == CAN_IT_FF1) ||\ - ((IT) == CAN_IT_FOV1)|| ((IT) == CAN_IT_EWG) ||\ - ((IT) == CAN_IT_EPV) || ((IT) == CAN_IT_BOF) ||\ - ((IT) == CAN_IT_LEC) || ((IT) == CAN_IT_ERR) ||\ - ((IT) == CAN_IT_WKU) || ((IT) == CAN_IT_SLK)) /** * @} */ -/* Time out for INAK bit */ -#define INAK_TIMEOUT ((uint32_t)0x0000FFFF) -/* Time out for SLAK bit */ -#define SLAK_TIMEOUT ((uint32_t)0x0000FFFF) - -/* Mailboxes definition */ +/** @defgroup CAN_Mailboxes_Definition CAN Mailboxes Definition + * @{ + */ #define CAN_TXMAILBOX_0 ((uint8_t)0x00) #define CAN_TXMAILBOX_1 ((uint8_t)0x01) #define CAN_TXMAILBOX_2 ((uint8_t)0x02) +/** + * @} + */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup CAN_Exported_Macros CAN Exported Macros + * @{ + */ /** @brief Reset CAN handle state * @param __HANDLE__: specifies the CAN Handle. @@ -637,7 +533,6 @@ typedef struct * @arg CAN_FLAG_BOF: Bus-Off Flag * @retval The new state of __FLAG__ (TRUE or FALSE). */ -#define CAN_FLAG_MASK ((uint32_t)0x000000FF) #define __HAL_CAN_GET_FLAG(__HANDLE__, __FLAG__) \ ((((__FLAG__) >> 8) == 5)? ((((__HANDLE__)->Instance->TSR) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8) == 2)? ((((__HANDLE__)->Instance->RF0R) & (1 << ((__FLAG__) & CAN_FLAG_MASK))) == (1 << ((__FLAG__) & CAN_FLAG_MASK))): \ @@ -684,7 +579,7 @@ typedef struct * @param __INTERRUPT__: specifies the CAN interrupt source to check. * This parameter can be one of the following values: * @arg CAN_IT_TME: Transmit mailbox empty interrupt enable - * @arg CAN_IT_FMP0: FIFO0 message pending interrupt enablev + * @arg CAN_IT_FMP0: FIFO0 message pending interrupt enable * @arg CAN_IT_FMP1: FIFO1 message pending interrupt enable * @retval The new state of __IT__ (TRUE or FALSE). */ @@ -701,8 +596,6 @@ typedef struct ((__TRANSMITMAILBOX__) == CAN_TXMAILBOX_1)? ((((__HANDLE__)->Instance->TSR) & (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1)) == (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1)) :\ ((((__HANDLE__)->Instance->TSR) & (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2)) == (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2))) - - /** * @brief Release the specified receive FIFO. * @param __HANDLE__: CAN handle @@ -710,7 +603,7 @@ typedef struct * @retval None */ #define __HAL_CAN_FIFO_RELEASE(__HANDLE__, __FIFONUMBER__) (((__FIFONUMBER__) == CAN_FIFO0)? \ -((__HANDLE__)->Instance->RF0R |= CAN_RF0R_RFOM0) : ((__HANDLE__)->Instance->RF1R |= CAN_RF1R_RFOM1)) +((__HANDLE__)->Instance->RF0R |= CAN_RF0R_RFOM0) : ((__HANDLE__)->Instance->RF1R |= CAN_RF1R_RFOM1)) /** * @brief Cancel a transmit request. @@ -726,24 +619,40 @@ typedef struct /** * @brief Enable or disable the DBG Freeze for CAN. * @param __HANDLE__: CAN Handle - * @param __NEWSTATE__: new state of the CAN peripheral. + * @param __NEWSTATE__: new state of the CAN peripheral. * This parameter can be: ENABLE (CAN reception/transmission is frozen - * during debug. Reception FIFOs can still be accessed/controlled normally) + * during debug. Reception FIFOs can still be accessed/controlled normally) * or DISABLE (CAN is working during debug). * @retval None */ #define __HAL_CAN_DBG_FREEZE(__HANDLE__, __NEWSTATE__) (((__NEWSTATE__) == ENABLE)? \ -((__HANDLE__)->Instance->MCR |= CAN_MCR_DBF) : ((__HANDLE__)->Instance->MCR &= ~CAN_MCR_DBF)) - -/* Exported functions --------------------------------------------------------*/ +((__HANDLE__)->Instance->MCR |= CAN_MCR_DBF) : ((__HANDLE__)->Instance->MCR &= ~CAN_MCR_DBF)) + +/** + * @} + */ -/* Initialization/de-initialization functions ***********************************/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup CAN_Exported_Functions + * @{ + */ + +/** @addtogroup CAN_Exported_Functions_Group1 + * @{ + */ +/* Initialization/de-initialization functions ***********************************/ HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef* hcan); HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef* hcan, CAN_FilterConfTypeDef* sFilterConfig); HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef* hcan); void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan); void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan); +/** + * @} + */ +/** @addtogroup CAN_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions ******************************************************/ HAL_StatusTypeDef HAL_CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout); HAL_StatusTypeDef HAL_CAN_Transmit_IT(CAN_HandleTypeDef *hcan); @@ -751,17 +660,102 @@ HAL_StatusTypeDef HAL_CAN_Receive(CAN_HandleTypeDef *hcan, uint8_t FIFONumber, u HAL_StatusTypeDef HAL_CAN_Receive_IT(CAN_HandleTypeDef *hcan, uint8_t FIFONumber); HAL_StatusTypeDef HAL_CAN_Sleep(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan); +void HAL_CAN_IRQHandler(CAN_HandleTypeDef* hcan); +void HAL_CAN_TxCpltCallback(CAN_HandleTypeDef* hcan); +void HAL_CAN_RxCpltCallback(CAN_HandleTypeDef* hcan); +void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan); +/** + * @} + */ +/** @addtogroup CAN_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions ***************************************************/ -void HAL_CAN_IRQHandler(CAN_HandleTypeDef* hcan); uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan); HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef* hcan); +/** + * @} + */ -void HAL_CAN_TxCpltCallback(CAN_HandleTypeDef* hcan); -void HAL_CAN_RxCpltCallback(CAN_HandleTypeDef* hcan); -void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan); +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/** @defgroup CAN_Private_Types CAN Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup CAN_Private_Variables CAN Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup CAN_Private_Constants CAN Private Constants + * @{ + */ +#define CAN_TXSTATUS_NOMAILBOX ((uint8_t)0x04) /*!< CAN cell did not provide CAN_TxStatus_NoMailBox */ +#define CAN_FLAG_MASK ((uint32_t)0x000000FF) +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CAN_Private_Macros CAN Private Macros + * @{ + */ +#define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \ + ((MODE) == CAN_MODE_LOOPBACK)|| \ + ((MODE) == CAN_MODE_SILENT) || \ + ((MODE) == CAN_MODE_SILENT_LOOPBACK)) +#define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ)|| \ + ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ)) +#define IS_CAN_BS1(BS1) ((BS1) <= CAN_BS1_16TQ) +#define IS_CAN_BS2(BS2) ((BS2) <= CAN_BS2_8TQ) +#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1) && ((PRESCALER) <= 1024)) +#define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27) +#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \ + ((MODE) == CAN_FILTERMODE_IDLIST)) +#define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \ + ((SCALE) == CAN_FILTERSCALE_32BIT)) +#define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \ + ((FIFO) == CAN_FILTER_FIFO1)) +#define IS_CAN_BANKNUMBER(BANKNUMBER) ((BANKNUMBER) <= 28) + +#define IS_CAN_TRANSMITMAILBOX(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= ((uint8_t)0x02)) +#define IS_CAN_STDID(STDID) ((STDID) <= ((uint32_t)0x7FF)) +#define IS_CAN_EXTID(EXTID) ((EXTID) <= ((uint32_t)0x1FFFFFFF)) +#define IS_CAN_DLC(DLC) ((DLC) <= ((uint8_t)0x08)) + +#define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \ + ((IDTYPE) == CAN_ID_EXT)) +#define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE)) +#define IS_CAN_FIFO(FIFO) (((FIFO) == CAN_FIFO0) || ((FIFO) == CAN_FIFO1)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup CAN_Private_Functions CAN Private Functions + * @{ + */ + +/** + * @} + */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.c new file mode 100644 index 00000000000..c3742baa1c5 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.c @@ -0,0 +1,1112 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_cec.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief CEC HAL module driver. + * + * This file provides firmware functions to manage the following + * functionalities of the High Definition Multimedia Interface + * Consumer Electronics Control Peripheral (CEC). + * + Initialization and de-initialization functions + * + IO operation functions + * + Peripheral Control functions + * + * + @verbatim + =============================================================================== + ##### How to use this driver ##### + =============================================================================== + [..] + The CEC HAL driver can be used as follow: + + (#) Declare a CEC_HandleTypeDef handle structure. + (#) Initialize the CEC low level resources by implementing the HAL_CEC_MspInit ()API: + (##) Enable the CEC interface clock. + (##) CEC pins configuration: + (+) Enable the clock for the CEC GPIOs. + (+) Configure these CEC pins as alternate function pull-up. + (##) NVIC configuration if you need to use interrupt process (HAL_CEC_Transmit_IT() + and HAL_CEC_Receive_IT() APIs): + (+) Configure the CEC interrupt priority. + (+) Enable the NVIC CEC IRQ handle. + (@) The specific CEC interrupts (Transmission complete interrupt, + RXNE interrupt and Error Interrupts) will be managed using the macros + __HAL_CEC_ENABLE_IT() and __HAL_CEC_DISABLE_IT() inside the transmit + and receive process. + + (#) Program the Signal Free Time (SFT) and SFT option, Tolerance, reception stop in + in case of Bit Rising Error, Error-Bit generation conditions, device logical + address and Listen mode in the hcec Init structure. + + (#) Initialize the CEC registers by calling the HAL_CEC_Init() API. + + (@) This API (HAL_CEC_Init()) configures also the low level Hardware GPIO, CLOCK, CORTEX...etc) + by calling the customed HAL_CEC_MspInit() API. + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @defgroup CEC CEC + * @brief HAL CEC module driver + * @{ + */ +#ifdef HAL_CEC_MODULE_ENABLED + +#if defined(STM32F446xx) + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup CEC_Private_Constants CEC Private Constants + * @{ + */ +#define CEC_CFGR_FIELDS (CEC_CFGR_SFT | CEC_CFGR_RXTOL | CEC_CFGR_BRESTP \ + | CEC_CFGR_BREGEN | CEC_CFGR_LBPEGEN | CEC_CFGR_SFTOPT \ + | CEC_CFGR_BRDNOGEN | CEC_CFGR_OAR | CEC_CFGR_LSTN) +/** + * @} + */ + +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @defgroup CEC_Private_Functions CEC Private Functions + * @{ + */ +static HAL_StatusTypeDef CEC_Transmit_IT(CEC_HandleTypeDef *hcec); +static HAL_StatusTypeDef CEC_Receive_IT(CEC_HandleTypeDef *hcec); +/** + * @} + */ + +/* Exported functions ---------------------------------------------------------*/ +/** @defgroup CEC_Exported_Functions CEC Exported Functions + * @{ + */ + +/** @defgroup CEC_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim +=============================================================================== + ##### Initialization and Configuration functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to initialize the CEC + (+) The following parameters need to be configured: + (++) SignalFreeTime + (++) Tolerance + (++) BRERxStop (RX stopped or not upon Bit Rising Error) + (++) BREErrorBitGen (Error-Bit generation in case of Bit Rising Error) + (++) LBPEErrorBitGen (Error-Bit generation in case of Long Bit Period Error) + (++) BroadcastMsgNoErrorBitGen (Error-bit generation in case of broadcast message error) + (++) SignalFreeTimeOption (SFT Timer start definition) + (++) OwnAddress (CEC device address) + (++) ListenMode + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the CEC mode according to the specified + * parameters in the CEC_InitTypeDef and creates the associated handle . + * @param hcec: CEC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CEC_Init(CEC_HandleTypeDef *hcec) +{ + uint32_t tmpreg = 0x0; + + /* Check the CEC handle allocation */ + if(hcec == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_CEC_ALL_INSTANCE(hcec->Instance)); + assert_param(IS_CEC_SIGNALFREETIME(hcec->Init.SignalFreeTime)); + assert_param(IS_CEC_TOLERANCE(hcec->Init.Tolerance)); + assert_param(IS_CEC_BRERXSTOP(hcec->Init.BRERxStop)); + assert_param(IS_CEC_BREERRORBITGEN(hcec->Init.BREErrorBitGen)); + assert_param(IS_CEC_LBPEERRORBITGEN(hcec->Init.LBPEErrorBitGen)); + assert_param(IS_CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION(hcec->Init.BroadcastMsgNoErrorBitGen)); + assert_param(IS_CEC_SFTOP(hcec->Init.SignalFreeTimeOption)); + assert_param(IS_CEC_OAR_ADDRESS(hcec->Init.OwnAddress)); + assert_param(IS_CEC_LISTENING_MODE(hcec->Init.ListenMode)); + assert_param(IS_CEC_ADDRESS(hcec->Init.InitiatorAddress)); + + + if(hcec->State == HAL_CEC_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hcec->Lock = HAL_UNLOCKED; + /* Init the low level hardware : GPIO, CLOCK */ + HAL_CEC_MspInit(hcec); + } + + hcec->State = HAL_CEC_STATE_BUSY; + + /* Disable the Peripheral */ + __HAL_CEC_DISABLE(hcec); + + tmpreg = hcec->Init.SignalFreeTime; + tmpreg |= hcec->Init.Tolerance; + tmpreg |= hcec->Init.BRERxStop; + tmpreg |= hcec->Init.BREErrorBitGen; + tmpreg |= hcec->Init.LBPEErrorBitGen; + tmpreg |= hcec->Init.BroadcastMsgNoErrorBitGen; + tmpreg |= hcec->Init.SignalFreeTimeOption; + tmpreg |= (hcec->Init.OwnAddress << CEC_CFGR_OAR_LSB_POS); + tmpreg |= hcec->Init.ListenMode; + + /* Write to CEC Control Register */ + MODIFY_REG(hcec->Instance->CFGR, CEC_CFGR_FIELDS, tmpreg); + + /* Enable the Peripheral */ + __HAL_CEC_ENABLE(hcec); + + hcec->State = HAL_CEC_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the CEC peripheral + * @param hcec: CEC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CEC_DeInit(CEC_HandleTypeDef *hcec) +{ + /* Check the CEC handle allocation */ + if(hcec == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_CEC_ALL_INSTANCE(hcec->Instance)); + + hcec->State = HAL_CEC_STATE_BUSY; + + /* DeInit the low level hardware */ + HAL_CEC_MspDeInit(hcec); + /* Disable the Peripheral */ + __HAL_CEC_DISABLE(hcec); + + hcec->ErrorCode = HAL_CEC_ERROR_NONE; + hcec->State = HAL_CEC_STATE_RESET; + + /* Process Unlock */ + __HAL_UNLOCK(hcec); + + return HAL_OK; +} + +/** + * @brief CEC MSP Init + * @param hcec: CEC handle + * @retval None + */ + __weak void HAL_CEC_MspInit(CEC_HandleTypeDef *hcec) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_CEC_MspInit can be implemented in the user file + */ +} + +/** + * @brief CEC MSP DeInit + * @param hcec: CEC handle + * @retval None + */ + __weak void HAL_CEC_MspDeInit(CEC_HandleTypeDef *hcec) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_CEC_MspDeInit can be implemented in the user file + */ +} +/** + * @} + */ + +/** @defgroup CEC_Exported_Functions_Group2 Input and Output operation functions + * @brief CEC Transmit/Receive functions + * +@verbatim + =============================================================================== + ##### I/O operation functions ##### + =============================================================================== + This subsection provides a set of functions allowing to manage the CEC data transfers. + + (#) The CEC handle must contain the initiator (TX side) and the destination (RX side) + logical addresses (4-bit long addresses, 0xF for broadcast messages destination) + + (#) There are two mode of transfer: + (+) Blocking mode: The communication is performed in polling mode. + The HAL status of all data processing is returned by the same function + after finishing transfer. + (+) No-Blocking mode: The communication is performed using Interrupts. + These API's return the HAL status. + The end of the data processing will be indicated through the + dedicated CEC IRQ when using Interrupt mode. + The HAL_CEC_TxCpltCallback(), HAL_CEC_RxCpltCallback() user callbacks + will be executed respectivelly at the end of the transmit or Receive process + The HAL_CEC_ErrorCallback()user callback will be executed when a communication + error is detected + + (#) Blocking mode API's are : + (+) HAL_CEC_Transmit() + (+) HAL_CEC_Receive() + + (#) Non-Blocking mode API's with Interrupt are : + (+) HAL_CEC_Transmit_IT() + (+) HAL_CEC_Receive_IT() + (+) HAL_CEC_IRQHandler() + + (#) A set of Transfer Complete Callbacks are provided in No_Blocking mode: + (+) HAL_CEC_TxCpltCallback() + (+) HAL_CEC_RxCpltCallback() + (+) HAL_CEC_ErrorCallback() + +@endverbatim + * @{ + */ + +/** + * @brief Send data in blocking mode + * @param hcec: CEC handle + * @param DestinationAddress: destination logical address + * @param pData: pointer to input byte data buffer + * @param Size: amount of data to be sent in bytes (without counting the header). + * 0 means only the header is sent (ping operation). + * Maximum TX size is 15 bytes (1 opcode and up to 14 operands). + * @param Timeout: Timeout duration. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CEC_Transmit(CEC_HandleTypeDef *hcec, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size, uint32_t Timeout) +{ + uint8_t temp = 0; + uint32_t tempisr = 0; + uint32_t tickstart = 0; + + if((hcec->State == HAL_CEC_STATE_READY) && (__HAL_CEC_GET_TRANSMISSION_START_FLAG(hcec) == RESET)) + { + hcec->ErrorCode = HAL_CEC_ERROR_NONE; + if((pData == NULL ) && (Size > 0)) + { + hcec->State = HAL_CEC_STATE_ERROR; + return HAL_ERROR; + } + + assert_param(IS_CEC_ADDRESS(DestinationAddress)); + assert_param(IS_CEC_MSGSIZE(Size)); + + /* Process Locked */ + __HAL_LOCK(hcec); + + hcec->State = HAL_CEC_STATE_BUSY_TX; + + hcec->TxXferCount = Size; + + /* case no data to be sent, sender is only pinging the system */ + if (Size == 0) + { + /* Set TX End of Message (TXEOM) bit, must be set before writing data to TXDR */ + __HAL_CEC_LAST_BYTE_TX_SET(hcec); + } + + /* send header block */ + temp = ((uint32_t)hcec->Init.InitiatorAddress << CEC_INITIATOR_LSB_POS) | DestinationAddress; + hcec->Instance->TXDR = temp; + /* Set TX Start of Message (TXSOM) bit */ + __HAL_CEC_FIRST_BYTE_TX_SET(hcec); + + while (hcec->TxXferCount > 0) + { + hcec->TxXferCount--; + + tickstart = HAL_GetTick(); + while(HAL_IS_BIT_CLR(hcec->Instance->ISR, CEC_FLAG_TXBR)) + { + if(Timeout != HAL_MAX_DELAY) + { + if((HAL_GetTick() - tickstart) > Timeout) + { + hcec->State = HAL_CEC_STATE_TIMEOUT; + /* Process Unlocked */ + __HAL_UNLOCK(hcec); + return HAL_TIMEOUT; + } + } + + /* check whether error occured while waiting for TXBR to be set: + * has Tx underrun occurred ? + * has Tx error occurred ? + * has Tx Missing Acknowledge error occurred ? + * has Arbitration Loss error occurred ? */ + tempisr = hcec->Instance->ISR; + if ((tempisr & (CEC_FLAG_TXUDR|CEC_FLAG_TXERR|CEC_FLAG_TXACKE|CEC_FLAG_ARBLST)) != 0) + { + /* copy ISR for error handling purposes */ + hcec->ErrorCode = tempisr; + /* clear all error flags by default */ + __HAL_CEC_CLEAR_FLAG(hcec, (CEC_FLAG_TXUDR|CEC_FLAG_TXERR|CEC_FLAG_TXACKE|CEC_FLAG_ARBLST)); + hcec->State = HAL_CEC_STATE_ERROR; + __HAL_UNLOCK(hcec); + return HAL_ERROR; + } + } + /* TXBR to clear BEFORE writing TXDR register */ + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXBR); + if (hcec->TxXferCount == 0) + { + /* if last byte transmission, set TX End of Message (TXEOM) bit */ + __HAL_CEC_LAST_BYTE_TX_SET(hcec); + } + hcec->Instance->TXDR = *pData++; + + /* error check after TX byte write up */ + tempisr = hcec->Instance->ISR; + if ((tempisr & (CEC_FLAG_TXUDR|CEC_FLAG_TXERR|CEC_FLAG_TXACKE|CEC_FLAG_ARBLST)) != 0) + { + /* copy ISR for error handling purposes */ + hcec->ErrorCode = tempisr; + /* clear all error flags by default */ + __HAL_CEC_CLEAR_FLAG(hcec, (CEC_FLAG_TXUDR|CEC_FLAG_TXERR|CEC_FLAG_TXACKE|CEC_FLAG_ARBLST)); + hcec->State = HAL_CEC_STATE_ERROR; + __HAL_UNLOCK(hcec); + return HAL_ERROR; + } + } /* end while (while (hcec->TxXferCount > 0)) */ + + + /* if no error up to this point, check that transmission is + * complete, that is wait until TXEOM is reset */ + tickstart = HAL_GetTick(); + + while (HAL_IS_BIT_SET(hcec->Instance->CR, CEC_CR_TXEOM)) + { + if(Timeout != HAL_MAX_DELAY) + { + if((HAL_GetTick() - tickstart) > Timeout) + { + hcec->State = HAL_CEC_STATE_ERROR; + __HAL_UNLOCK(hcec); + return HAL_TIMEOUT; + } + } + } + + /* Final error check once all bytes have been transmitted */ + tempisr = hcec->Instance->ISR; + if ((tempisr & (CEC_FLAG_TXUDR|CEC_FLAG_TXERR|CEC_FLAG_TXACKE)) != 0) + { + /* copy ISR for error handling purposes */ + hcec->ErrorCode = tempisr; + /* clear all error flags by default */ + __HAL_CEC_CLEAR_FLAG(hcec, (CEC_FLAG_TXUDR|CEC_FLAG_TXERR|CEC_FLAG_TXACKE)); + hcec->State = HAL_CEC_STATE_ERROR; + __HAL_UNLOCK(hcec); + return HAL_ERROR; + } + + hcec->State = HAL_CEC_STATE_READY; + __HAL_UNLOCK(hcec); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive data in blocking mode. Must be invoked when RXBR has been set. + * @param hcec: CEC handle + * @param pData: pointer to received data buffer. + * @param Timeout: Timeout duration. + * Note that the received data size is not known beforehand, the latter is known + * when the reception is complete and is stored in hcec->RxXferSize. + * hcec->RxXferSize is the sum of opcodes + operands (0 to 14 operands max). + * If only a header is received, hcec->RxXferSize = 0 + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CEC_Receive(CEC_HandleTypeDef *hcec, uint8_t *pData, uint32_t Timeout) +{ + uint32_t temp; + uint32_t tickstart = 0; + + if (hcec->State == HAL_CEC_STATE_READY) + { + hcec->ErrorCode = HAL_CEC_ERROR_NONE; + if (pData == NULL ) + { + hcec->State = HAL_CEC_STATE_ERROR; + return HAL_ERROR; + } + + hcec->RxXferSize = 0; + /* Process Locked */ + __HAL_LOCK(hcec); + + + /* Rx loop until CEC_ISR_RXEND is set */ + while (HAL_IS_BIT_CLR(hcec->Instance->ISR, CEC_FLAG_RXEND)) + { + tickstart = HAL_GetTick(); + /* Wait for next byte to be received */ + while (HAL_IS_BIT_CLR(hcec->Instance->ISR, CEC_FLAG_RXBR)) + { + if(Timeout != HAL_MAX_DELAY) + { + if((HAL_GetTick() - tickstart) > Timeout) + { + hcec->State = HAL_CEC_STATE_TIMEOUT; + __HAL_UNLOCK(hcec); + return HAL_TIMEOUT; + } + } + /* any error so far ? + * has Rx Missing Acknowledge occurred ? + * has Rx Long Bit Period error occurred ? + * has Rx Short Bit Period error occurred ? + * has Rx Bit Rising error occurred ? + * has Rx Overrun error occurred ? */ + temp = (uint32_t) (hcec->Instance->ISR); + if ((temp & (CEC_FLAG_RXACKE|CEC_FLAG_LBPE|CEC_FLAG_SBPE|CEC_FLAG_BRE|CEC_FLAG_RXOVR)) != 0) + { + /* copy ISR for error handling purposes */ + hcec->ErrorCode = temp; + /* clear all error flags by default */ + __HAL_CEC_CLEAR_FLAG(hcec,(CEC_FLAG_RXACKE|CEC_FLAG_LBPE|CEC_FLAG_SBPE|CEC_FLAG_BRE|CEC_FLAG_RXOVR)); + hcec->State = HAL_CEC_STATE_ERROR; + __HAL_UNLOCK(hcec); + return HAL_ERROR; + } + } /* while (HAL_IS_BIT_CLR(hcec->Instance->ISR, CEC_ISR_RXBR)) */ + + + /* read received data */ + *pData++ = hcec->Instance->RXDR; + temp = (uint32_t) (hcec->Instance->ISR); + /* end of message ? */ + if ((temp & CEC_ISR_RXEND) != 0) + { + assert_param(IS_CEC_MSGSIZE(hcec->RxXferSize)); + __HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_RXEND); + hcec->State = HAL_CEC_STATE_READY; + __HAL_UNLOCK(hcec); + return HAL_OK; + } + + /* clear Rx-Byte Received flag */ + __HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_RXBR); + /* increment payload byte counter */ + hcec->RxXferSize++; + } /* while (HAL_IS_BIT_CLR(hcec->Instance->ISR, CEC_ISR_RXEND)) */ + + /* if the instructions below are executed, it means RXEND was set when RXBR was + * set for the first time: + * the code within the "while (HAL_IS_BIT_CLR(hcec->Instance->ISR, CEC_ISR_RXEND))" + * loop has not been executed and this means a single byte has been sent */ + *pData++ = hcec->Instance->RXDR; + /* only one header is received: RxXferSize is set to 0 (no operand, no opcode) */ + hcec->RxXferSize = 0; + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_RXEND); + + hcec->State = HAL_CEC_STATE_READY; + __HAL_UNLOCK(hcec); + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Send data in interrupt mode + * @param hcec: CEC handle + * @param DestinationAddress: destination logical address + * @param pData: pointer to input byte data buffer + * @param Size: amount of data to be sent in bytes (without counting the header). + * 0 means only the header is sent (ping operation). + * Maximum TX size is 15 bytes (1 opcode and up to 14 operands). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CEC_Transmit_IT(CEC_HandleTypeDef *hcec, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size) +{ + uint8_t temp = 0; + /* if the IP isn't already busy and if there is no previous transmission + already pending due to arbitration lost */ + if (((hcec->State == HAL_CEC_STATE_READY) || (hcec->State == HAL_CEC_STATE_STANDBY_RX)) + && (__HAL_CEC_GET_TRANSMISSION_START_FLAG(hcec) == RESET)) + { + if((pData == NULL) && (Size > 0)) + { + hcec->State = HAL_CEC_STATE_ERROR; + return HAL_ERROR; + } + + assert_param(IS_CEC_ADDRESS(DestinationAddress)); + assert_param(IS_CEC_MSGSIZE(Size)); + + /* Process Locked */ + __HAL_LOCK(hcec); + hcec->pTxBuffPtr = pData; + hcec->State = HAL_CEC_STATE_BUSY_TX; + hcec->ErrorCode = HAL_CEC_ERROR_NONE; + + /* Disable Peripheral to write CEC_IER register */ + __HAL_CEC_DISABLE(hcec); + + /* Enable the following two CEC Transmission interrupts as + * well as the following CEC Transmission Errors interrupts: + * Tx Byte Request IT + * End of Transmission IT + * Tx Missing Acknowledge IT + * Tx-Error IT + * Tx-Buffer Underrun IT + * Tx arbitration lost */ + __HAL_CEC_ENABLE_IT(hcec, CEC_IT_TXBR|CEC_IT_TXEND|CEC_IER_TX_ALL_ERR); + + /* Enable the Peripheral */ + __HAL_CEC_ENABLE(hcec); + + /* initialize the number of bytes to send, + * 0 means only one header is sent (ping operation) */ + hcec->TxXferCount = Size; + + /* Process Unlocked */ + __HAL_UNLOCK(hcec); + + /* in case of no payload (Size = 0), sender is only pinging the system; + * Set TX End of Message (TXEOM) bit, must be set before writing data to TXDR */ + if (Size == 0) + { + __HAL_CEC_LAST_BYTE_TX_SET(hcec); + } + + /* send header block */ + temp = (uint8_t)((uint32_t)(hcec->Init.InitiatorAddress) << CEC_INITIATOR_LSB_POS) | DestinationAddress; + hcec->Instance->TXDR = temp; + /* Set TX Start of Message (TXSOM) bit */ + __HAL_CEC_FIRST_BYTE_TX_SET(hcec); + + return HAL_OK; + } + /* if the IP is already busy or if there is a previous transmission + already pending due to arbitration loss */ + else if ((hcec->State == HAL_CEC_STATE_BUSY_TX) + || (__HAL_CEC_GET_TRANSMISSION_START_FLAG(hcec) != RESET)) + { + __HAL_LOCK(hcec); + /* set state to BUSY TX, in case it wasn't set already (case + * of transmission new attempt after arbitration loss) */ + if (hcec->State != HAL_CEC_STATE_BUSY_TX) + { + hcec->State = HAL_CEC_STATE_BUSY_TX; + } + + /* if all data have been sent */ + if(hcec->TxXferCount == 0) + { + /* Disable Peripheral to write CEC_IER register */ + __HAL_CEC_DISABLE(hcec); + + /* Disable the CEC Transmission Interrupts */ + __HAL_CEC_DISABLE_IT(hcec, CEC_IT_TXBR|CEC_IT_TXEND); + /* Disable the CEC Transmission Error Interrupts */ + __HAL_CEC_DISABLE_IT(hcec, CEC_IER_TX_ALL_ERR); + + /* Enable the Peripheral */ + __HAL_CEC_ENABLE(hcec); + + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXBR|CEC_FLAG_TXEND); + + hcec->State = HAL_CEC_STATE_READY; + /* Call the Process Unlocked before calling the Tx call back API to give the possibility to + start again the Transmission under the Tx call back API */ + __HAL_UNLOCK(hcec); + + HAL_CEC_TxCpltCallback(hcec); + + return HAL_OK; + } + else + { + if (hcec->TxXferCount == 1) + { + /* if this is the last byte transmission, set TX End of Message (TXEOM) bit */ + __HAL_CEC_LAST_BYTE_TX_SET(hcec); + } + /* clear Tx-Byte request flag */ + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXBR); + hcec->Instance->TXDR = *hcec->pTxBuffPtr++; + hcec->TxXferCount--; + + /* Process Unlocked */ + __HAL_UNLOCK(hcec); + + return HAL_OK; + } + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive data in interrupt mode. + * @param hcec: CEC handle + * @param pData: pointer to received data buffer. + * Note that the received data size is not known beforehand, the latter is known + * when the reception is complete and is stored in hcec->RxXferSize. + * hcec->RxXferSize is the sum of opcodes + operands (0 to 14 operands max). + * If only a header is received, hcec->RxXferSize = 0 + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CEC_Receive_IT(CEC_HandleTypeDef *hcec, uint8_t *pData) +{ + if(hcec->State == HAL_CEC_STATE_READY) + { + if(pData == NULL) + { + hcec->State = HAL_CEC_STATE_ERROR; + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hcec); + hcec->RxXferSize = 0; + hcec->pRxBuffPtr = pData; + hcec->ErrorCode = HAL_CEC_ERROR_NONE; + /* the IP is moving to a ready to receive state */ + hcec->State = HAL_CEC_STATE_STANDBY_RX; + + /* Disable Peripheral to write CEC_IER register */ + __HAL_CEC_DISABLE(hcec); + + /* Enable the following CEC Reception Error Interrupts: + * Rx overrun + * Rx bit rising error + * Rx short bit period error + * Rx long bit period error + * Rx missing acknowledge */ + __HAL_CEC_ENABLE_IT(hcec, CEC_IER_RX_ALL_ERR); + + /* Process Unlocked */ + __HAL_UNLOCK(hcec); + + /* Enable the following two CEC Reception interrupts: + * Rx Byte Received IT + * End of Reception IT */ + __HAL_CEC_ENABLE_IT(hcec, CEC_IT_RXBR|CEC_IT_RXEND); + + __HAL_CEC_ENABLE(hcec); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Get size of the received frame. + * @param hcec: CEC handle + * @retval Frame size + */ +uint32_t HAL_CEC_GetReceivedFrameSize(CEC_HandleTypeDef *hcec) +{ + return hcec->RxXferSize; +} + +/** + * @brief This function handles CEC interrupt requests. + * @param hcec: CEC handle + * @retval None + */ +void HAL_CEC_IRQHandler(CEC_HandleTypeDef *hcec) +{ + /* save interrupts register for further error or interrupts handling purposes */ + hcec->ErrorCode = hcec->Instance->ISR; + /* CEC TX missing acknowledge error interrupt occurred -------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_TXACKE) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_TXACKE) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXACKE); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC transmit error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_TXERR) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_TXERR) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXERR); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC TX underrun error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_TXUDR) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_TXUDR) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_TXUDR); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC TX arbitration error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_ARBLST) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_ARBLST) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_ARBLST); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC RX overrun error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_RXOVR) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_RXOVR) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_RXOVR); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC RX bit rising error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_BRE) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_BRE) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_BRE); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC RX short bit period error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_SBPE) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_SBPE) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_SBPE); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC RX long bit period error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_LBPE) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_LBPE) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_LBPE); + hcec->State = HAL_CEC_STATE_ERROR; + } + + /* CEC RX missing acknowledge error interrupt occured --------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_RXACKE) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_RXACKE) != RESET)) + { + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_RXACKE); + hcec->State = HAL_CEC_STATE_ERROR; + } + + if ((hcec->ErrorCode & CEC_ISR_ALL_ERROR) != 0) + { + HAL_CEC_ErrorCallback(hcec); + } + + /* CEC RX byte received interrupt ---------------------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_RXBR) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_RXBR) != RESET)) + { + /* RXBR IT is cleared during HAL_CEC_Transmit_IT processing */ + CEC_Receive_IT(hcec); + } + + /* CEC RX end received interrupt ---------------------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_RXEND) != RESET) && (__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_RXEND) != RESET)) + { + /* RXBR IT is cleared during HAL_CEC_Transmit_IT processing */ + CEC_Receive_IT(hcec); + } + + + /* CEC TX byte request interrupt ------------------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_TXBR) != RESET) &&(__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_TXBR) != RESET)) + { + /* TXBR IT is cleared during HAL_CEC_Transmit_IT processing */ + CEC_Transmit_IT(hcec); + } + + /* CEC TX end interrupt ------------------------------------------------*/ + if((__HAL_CEC_GET_FLAG(hcec, CEC_FLAG_TXEND) != RESET) &&(__HAL_CEC_GET_IT_SOURCE(hcec, CEC_IT_TXEND) != RESET)) + { + /* TXEND IT is cleared during HAL_CEC_Transmit_IT processing */ + CEC_Transmit_IT(hcec); + } +} + +/** + * @brief Tx Transfer completed callback + * @param hcec: CEC handle + * @retval None + */ + __weak void HAL_CEC_TxCpltCallback(CEC_HandleTypeDef *hcec) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_CEC_TxCpltCallback can be implemented in the user file + */ +} + +/** + * @brief Rx Transfer completed callback + * @param hcec: CEC handle + * @retval None + */ +__weak void HAL_CEC_RxCpltCallback(CEC_HandleTypeDef *hcec) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_CEC_TxCpltCallback can be implemented in the user file + */ +} + +/** + * @brief CEC error callbacks + * @param hcec: CEC handle + * @retval None + */ + __weak void HAL_CEC_ErrorCallback(CEC_HandleTypeDef *hcec) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_CEC_ErrorCallback can be implemented in the user file + */ +} +/** + * @} + */ + +/** @defgroup CEC_Exported_Functions_Group3 Peripheral Control function + * @brief CEC control functions + * +@verbatim + =============================================================================== + ##### Peripheral Control function ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to control the CEC. + (+) HAL_CEC_GetState() API can be helpful to check in run-time the state of the CEC peripheral. +@endverbatim + * @{ + */ +/** + * @brief return the CEC state + * @param hcec: CEC handle + * @retval HAL state + */ +HAL_CEC_StateTypeDef HAL_CEC_GetState(CEC_HandleTypeDef *hcec) +{ + return hcec->State; +} + +/** +* @brief Return the CEC error code +* @param hcec : pointer to a CEC_HandleTypeDef structure that contains + * the configuration information for the specified CEC. +* @retval CEC Error Code +*/ +uint32_t HAL_CEC_GetError(CEC_HandleTypeDef *hcec) +{ + return hcec->ErrorCode; +} + +/** + * @} + */ + +/** + * @brief Send data in interrupt mode + * @param hcec: CEC handle. + * Function called under interruption only, once + * interruptions have been enabled by HAL_CEC_Transmit_IT() + * @retval HAL status + */ +static HAL_StatusTypeDef CEC_Transmit_IT(CEC_HandleTypeDef *hcec) +{ + /* if the IP is already busy or if there is a previous transmission + already pending due to arbitration loss */ + if ((hcec->State == HAL_CEC_STATE_BUSY_TX) + || (__HAL_CEC_GET_TRANSMISSION_START_FLAG(hcec) != RESET)) + { + __HAL_LOCK(hcec); + /* set state to BUSY TX, in case it wasn't set already (case + * of transmission new attempt after arbitration loss) */ + if (hcec->State != HAL_CEC_STATE_BUSY_TX) + { + hcec->State = HAL_CEC_STATE_BUSY_TX; + } + + /* if all data have been sent */ + if(hcec->TxXferCount == 0) + { + /* Disable Peripheral to write CEC_IER register */ + __HAL_CEC_DISABLE(hcec); + + /* Disable the CEC Transmission Interrupts */ + __HAL_CEC_DISABLE_IT(hcec, CEC_IT_TXBR|CEC_IT_TXEND); + /* Disable the CEC Transmission Error Interrupts */ + __HAL_CEC_DISABLE_IT(hcec, CEC_IER_TX_ALL_ERR); + + /* Enable the Peripheral */ + __HAL_CEC_ENABLE(hcec); + + __HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_TXBR|CEC_FLAG_TXEND); + + hcec->State = HAL_CEC_STATE_READY; + /* Call the Process Unlocked before calling the Tx call back API to give the possibility to + start again the Transmission under the Tx call back API */ + __HAL_UNLOCK(hcec); + + HAL_CEC_TxCpltCallback(hcec); + + return HAL_OK; + } + else + { + if (hcec->TxXferCount == 1) + { + /* if this is the last byte transmission, set TX End of Message (TXEOM) bit */ + __HAL_CEC_LAST_BYTE_TX_SET(hcec); + } + /* clear Tx-Byte request flag */ + __HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_TXBR); + hcec->Instance->TXDR = *hcec->pTxBuffPtr++; + hcec->TxXferCount--; + + /* Process Unlocked */ + __HAL_UNLOCK(hcec); + + return HAL_OK; + } + } + else + { + return HAL_BUSY; + } +} + + +/** + * @brief Receive data in interrupt mode. + * @param hcec: CEC handle. + * Function called under interruption only, once + * interruptions have been enabled by HAL_CEC_Receive_IT() + * @retval HAL status + */ +static HAL_StatusTypeDef CEC_Receive_IT(CEC_HandleTypeDef *hcec) +{ + uint32_t tempisr; + + /* Three different conditions are tested to carry out the RX IT processing: + * - the IP is in reception stand-by (the IP state is HAL_CEC_STATE_STANDBY_RX) and + * the reception of the first byte is starting + * - a message reception is already on-going (the IP state is HAL_CEC_STATE_BUSY_RX) + * and a new byte is being received + * - a transmission has just been started (the IP state is HAL_CEC_STATE_BUSY_TX) + * but has been interrupted by a new message reception or discarded due to + * arbitration loss: the reception of the first or higher priority message + * (the arbitration winner) is starting */ + if ((hcec->State == HAL_CEC_STATE_STANDBY_RX) + || (hcec->State == HAL_CEC_STATE_BUSY_RX) + || (hcec->State == HAL_CEC_STATE_BUSY_TX)) + { + /* reception is starting */ + hcec->State = HAL_CEC_STATE_BUSY_RX; + tempisr = (uint32_t) (hcec->Instance->ISR); + if ((tempisr & CEC_FLAG_RXBR) != 0) + { + /* Process Locked */ + __HAL_LOCK(hcec); + /* read received byte */ + *hcec->pRxBuffPtr++ = hcec->Instance->RXDR; + /* if last byte has been received */ + if ((tempisr & CEC_FLAG_RXEND) != 0) + { + /* clear IT */ + __HAL_CEC_CLEAR_FLAG(hcec,CEC_FLAG_RXBR|CEC_FLAG_RXEND); + /* RX interrupts are not disabled at this point. + * Indeed, to disable the IT, the IP must be disabled first + * which resets the TXSOM flag. In case of arbitration loss, + * this leads to a transmission abort. + * Therefore, RX interruptions disabling if so required, + * is done in HAL_CEC_RxCpltCallback */ + + /* IP state is moved to READY. + * If the IP must remain in standby mode to listen + * any new message, it is up to HAL_CEC_RxCpltCallback + * to move it again to HAL_CEC_STATE_STANDBY_RX */ + hcec->State = HAL_CEC_STATE_READY; + + /* Call the Process Unlocked before calling the Rx call back API */ + __HAL_UNLOCK(hcec); + HAL_CEC_RxCpltCallback(hcec); + + return HAL_OK; + } + __HAL_CEC_CLEAR_FLAG(hcec, CEC_FLAG_RXBR); + + hcec->RxXferSize++; + /* Process Unlocked */ + __HAL_UNLOCK(hcec); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } + } + else + { + return HAL_BUSY; + } +} +/** + * @} + */ + +#endif /* STM32F446xx */ + +#endif /* HAL_CEC_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.h new file mode 100644 index 00000000000..4c0d5e7fb71 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cec.h @@ -0,0 +1,681 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_cec.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of CEC HAL module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CEC_H +#define __STM32F4xx_HAL_CEC_H + +#ifdef __cplusplus + extern "C" { +#endif + +#if defined(STM32F446xx) +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup CEC + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup CEC_Exported_Types CEC Exported Types + * @{ + */ + +/** + * @brief CEC Init Structure definition + */ +typedef struct +{ + uint32_t SignalFreeTime; /*!< Set SFT field, specifies the Signal Free Time. + It can be one of @ref CEC_Signal_Free_Time + and belongs to the set {0,...,7} where + 0x0 is the default configuration + else means 0.5 + (SignalFreeTime - 1) nominal data bit periods */ + + uint32_t Tolerance; /*!< Set RXTOL bit, specifies the tolerance accepted on the received waveforms, + it can be a value of @ref CEC_Tolerance : it is either CEC_STANDARD_TOLERANCE + or CEC_EXTENDED_TOLERANCE */ + + uint32_t BRERxStop; /*!< Set BRESTP bit @ref CEC_BRERxStop : specifies whether or not a Bit Rising Error stops the reception. + CEC_NO_RX_STOP_ON_BRE: reception is not stopped. + CEC_RX_STOP_ON_BRE: reception is stopped. */ + + uint32_t BREErrorBitGen; /*!< Set BREGEN bit @ref CEC_BREErrorBitGen : specifies whether or not an Error-Bit is generated on the + CEC line upon Bit Rising Error detection. + CEC_BRE_ERRORBIT_NO_GENERATION: no error-bit generation. + CEC_BRE_ERRORBIT_GENERATION: error-bit generation if BRESTP is set. */ + + uint32_t LBPEErrorBitGen; /*!< Set LBPEGEN bit @ref CEC_LBPEErrorBitGen : specifies whether or not an Error-Bit is generated on the + CEC line upon Long Bit Period Error detection. + CEC_LBPE_ERRORBIT_NO_GENERATION: no error-bit generation. + CEC_LBPE_ERRORBIT_GENERATION: error-bit generation. */ + + uint32_t BroadcastMsgNoErrorBitGen; /*!< Set BRDNOGEN bit @ref CEC_BroadCastMsgErrorBitGen : allows to avoid an Error-Bit generation on the CEC line + upon an error detected on a broadcast message. + + It supersedes BREGEN and LBPEGEN bits for a broadcast message error handling. It can take two values: + + 1) CEC_BROADCASTERROR_ERRORBIT_GENERATION. + a) BRE detection: error-bit generation on the CEC line if BRESTP=CEC_RX_STOP_ON_BRE + and BREGEN=CEC_BRE_ERRORBIT_NO_GENERATION. + b) LBPE detection: error-bit generation on the CEC line + if LBPGEN=CEC_LBPE_ERRORBIT_NO_GENERATION. + + 2) CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION. + no error-bit generation in case neither a) nor b) are satisfied. Additionally, + there is no error-bit generation in case of Short Bit Period Error detection in + a broadcast message while LSTN bit is set. */ + + uint32_t SignalFreeTimeOption; /*!< Set SFTOP bit @ref CEC_SFT_Option : specifies when SFT timer starts. + CEC_SFT_START_ON_TXSOM SFT: timer starts when TXSOM is set by software. + CEC_SFT_START_ON_TX_RX_END: SFT timer starts automatically at the end of message transmission/reception. */ + + uint32_t OwnAddress; /*!< Set OAR field, specifies CEC device address within a 15-bit long field */ + + uint32_t ListenMode; /*!< Set LSTN bit @ref CEC_Listening_Mode : specifies device listening mode. It can take two values: + + CEC_REDUCED_LISTENING_MODE: CEC peripheral receives only message addressed to its + own address (OAR). Messages addressed to different destination are ignored. + Broadcast messages are always received. + + CEC_FULL_LISTENING_MODE: CEC peripheral receives messages addressed to its own + address (OAR) with positive acknowledge. Messages addressed to different destination + are received, but without interfering with the CEC bus: no acknowledge sent. */ + + uint8_t InitiatorAddress; /* Initiator address (source logical address, sent in each header) */ + +}CEC_InitTypeDef; + +/** + * @brief HAL CEC State structures definition + */ +typedef enum +{ + HAL_CEC_STATE_RESET = 0x00, /*!< Peripheral Reset state */ + HAL_CEC_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */ + HAL_CEC_STATE_BUSY = 0x02, /*!< an internal process is ongoing */ + HAL_CEC_STATE_BUSY_TX = 0x03, /*!< Data Transmission process is ongoing */ + HAL_CEC_STATE_BUSY_RX = 0x04, /*!< Data Reception process is ongoing */ + HAL_CEC_STATE_STANDBY_RX = 0x05, /*!< IP ready to receive, doesn't prevent IP to transmit */ + HAL_CEC_STATE_TIMEOUT = 0x06, /*!< Timeout state */ + HAL_CEC_STATE_ERROR = 0x07 /*!< State Error */ +}HAL_CEC_StateTypeDef; + +/** + * @brief CEC handle Structure definition + */ +typedef struct +{ + CEC_TypeDef *Instance; /* CEC registers base address */ + + CEC_InitTypeDef Init; /* CEC communication parameters */ + + uint8_t *pTxBuffPtr; /* Pointer to CEC Tx transfer Buffer */ + + uint16_t TxXferCount; /* CEC Tx Transfer Counter */ + + uint8_t *pRxBuffPtr; /* Pointer to CEC Rx transfer Buffer */ + + uint16_t RxXferSize; /* CEC Rx Transfer size, 0: header received only */ + + uint32_t ErrorCode; /* For errors handling purposes, copy of ISR register + in case error is reported */ + + HAL_LockTypeDef Lock; /* Locking object */ + + HAL_CEC_StateTypeDef State; /* CEC communication state */ + +}CEC_HandleTypeDef; +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup CEC_Exported_Constants CEC Exported Constants + * @{ + */ + +/** @defgroup CEC_Error_Code CEC Error Code + * @{ + */ +#define HAL_CEC_ERROR_NONE (uint32_t) 0x0 /*!< no error */ +#define HAL_CEC_ERROR_RXOVR CEC_ISR_RXOVR /*!< CEC Rx-Overrun */ +#define HAL_CEC_ERROR_BRE CEC_ISR_BRE /*!< CEC Rx Bit Rising Error */ +#define HAL_CEC_ERROR_SBPE CEC_ISR_SBPE /*!< CEC Rx Short Bit period Error */ +#define HAL_CEC_ERROR_LBPE CEC_ISR_LBPE /*!< CEC Rx Long Bit period Error */ +#define HAL_CEC_ERROR_RXACKE CEC_ISR_RXACKE /*!< CEC Rx Missing Acknowledge */ +#define HAL_CEC_ERROR_ARBLST CEC_ISR_ARBLST /*!< CEC Arbitration Lost */ +#define HAL_CEC_ERROR_TXUDR CEC_ISR_TXUDR /*!< CEC Tx-Buffer Underrun */ +#define HAL_CEC_ERROR_TXERR CEC_ISR_TXERR /*!< CEC Tx-Error */ +#define HAL_CEC_ERROR_TXACKE CEC_ISR_TXACKE /*!< CEC Tx Missing Acknowledge */ +/** + * @} + */ + +/** @defgroup CEC_Signal_Free_Time CEC Signal Free Time setting parameter + * @{ + */ +#define CEC_DEFAULT_SFT ((uint32_t)0x00000000) +#define CEC_0_5_BITPERIOD_SFT ((uint32_t)0x00000001) +#define CEC_1_5_BITPERIOD_SFT ((uint32_t)0x00000002) +#define CEC_2_5_BITPERIOD_SFT ((uint32_t)0x00000003) +#define CEC_3_5_BITPERIOD_SFT ((uint32_t)0x00000004) +#define CEC_4_5_BITPERIOD_SFT ((uint32_t)0x00000005) +#define CEC_5_5_BITPERIOD_SFT ((uint32_t)0x00000006) +#define CEC_6_5_BITPERIOD_SFT ((uint32_t)0x00000007) +/** + * @} + */ + +/** @defgroup CEC_Tolerance CEC Receiver Tolerance + * @{ + */ +#define CEC_STANDARD_TOLERANCE ((uint32_t)0x00000000) +#define CEC_EXTENDED_TOLERANCE ((uint32_t)CEC_CFGR_RXTOL) +/** + * @} + */ + +/** @defgroup CEC_BRERxStop CEC Reception Stop on Error + * @{ + */ +#define CEC_NO_RX_STOP_ON_BRE ((uint32_t)0x00000000) +#define CEC_RX_STOP_ON_BRE ((uint32_t)CEC_CFGR_BRESTP) +/** + * @} + */ + +/** @defgroup CEC_BREErrorBitGen CEC Error Bit Generation if Bit Rise Error reported + * @{ + */ +#define CEC_BRE_ERRORBIT_NO_GENERATION ((uint32_t)0x00000000) +#define CEC_BRE_ERRORBIT_GENERATION ((uint32_t)CEC_CFGR_BREGEN) +/** + * @} + */ + +/** @defgroup CEC_LBPEErrorBitGen CEC Error Bit Generation if Long Bit Period Error reported + * @{ + */ +#define CEC_LBPE_ERRORBIT_NO_GENERATION ((uint32_t)0x00000000) +#define CEC_LBPE_ERRORBIT_GENERATION ((uint32_t)CEC_CFGR_LBPEGEN) +/** + * @} + */ + +/** @defgroup CEC_BroadCastMsgErrorBitGen CEC Error Bit Generation on Broadcast message + * @{ + */ +#define CEC_BROADCASTERROR_ERRORBIT_GENERATION ((uint32_t)0x00000000) +#define CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION ((uint32_t)CEC_CFGR_BRDNOGEN) +/** + * @} + */ + +/** @defgroup CEC_SFT_Option CEC Signal Free Time start option + * @{ + */ +#define CEC_SFT_START_ON_TXSOM ((uint32_t)0x00000000) +#define CEC_SFT_START_ON_TX_RX_END ((uint32_t)CEC_CFGR_SFTOPT) +/** + * @} + */ + +/** @defgroup CEC_Listening_Mode CEC Listening mode option + * @{ + */ +#define CEC_REDUCED_LISTENING_MODE ((uint32_t)0x00000000) +#define CEC_FULL_LISTENING_MODE ((uint32_t)CEC_CFGR_LSTN) +/** + * @} + */ + +/** @defgroup CEC_OAR_Position CEC Device Own Address position in CEC CFGR register + * @{ + */ +#define CEC_CFGR_OAR_LSB_POS ((uint32_t) 16) +/** + * @} + */ + +/** @defgroup CEC_Initiator_Position CEC Initiator logical address position in message header + * @{ + */ +#define CEC_INITIATOR_LSB_POS ((uint32_t) 4) +/** + * @} + */ + +/** @defgroup CEC_Interrupts_Definitions CEC Interrupts definition + * @{ + */ +#define CEC_IT_TXACKE CEC_IER_TXACKEIE +#define CEC_IT_TXERR CEC_IER_TXERRIE +#define CEC_IT_TXUDR CEC_IER_TXUDRIE +#define CEC_IT_TXEND CEC_IER_TXENDIE +#define CEC_IT_TXBR CEC_IER_TXBRIE +#define CEC_IT_ARBLST CEC_IER_ARBLSTIE +#define CEC_IT_RXACKE CEC_IER_RXACKEIE +#define CEC_IT_LBPE CEC_IER_LBPEIE +#define CEC_IT_SBPE CEC_IER_SBPEIE +#define CEC_IT_BRE CEC_IER_BREIE +#define CEC_IT_RXOVR CEC_IER_RXOVRIE +#define CEC_IT_RXEND CEC_IER_RXENDIE +#define CEC_IT_RXBR CEC_IER_RXBRIE +/** + * @} + */ + +/** @defgroup CEC_Flags_Definitions CEC Flags definition + * @{ + */ +#define CEC_FLAG_TXACKE CEC_ISR_TXACKE +#define CEC_FLAG_TXERR CEC_ISR_TXERR +#define CEC_FLAG_TXUDR CEC_ISR_TXUDR +#define CEC_FLAG_TXEND CEC_ISR_TXEND +#define CEC_FLAG_TXBR CEC_ISR_TXBR +#define CEC_FLAG_ARBLST CEC_ISR_ARBLST +#define CEC_FLAG_RXACKE CEC_ISR_RXACKE +#define CEC_FLAG_LBPE CEC_ISR_LBPE +#define CEC_FLAG_SBPE CEC_ISR_SBPE +#define CEC_FLAG_BRE CEC_ISR_BRE +#define CEC_FLAG_RXOVR CEC_ISR_RXOVR +#define CEC_FLAG_RXEND CEC_ISR_RXEND +#define CEC_FLAG_RXBR CEC_ISR_RXBR +/** + * @} + */ + +/** @defgroup CEC_ALL_ERROR CEC all RX or TX errors flags + * @{ + */ +#define CEC_ISR_ALL_ERROR ((uint32_t)CEC_ISR_RXOVR|CEC_ISR_BRE|CEC_ISR_SBPE|CEC_ISR_LBPE|CEC_ISR_RXACKE|\ + CEC_ISR_ARBLST|CEC_ISR_TXUDR|CEC_ISR_TXERR|CEC_ISR_TXACKE) +/** + * @} + */ + +/** @defgroup CEC_IER_ALL_RX CEC all RX errors interrupts enabling flag + * @{ + */ +#define CEC_IER_RX_ALL_ERR ((uint32_t)CEC_IER_RXACKEIE|CEC_IER_LBPEIE|CEC_IER_SBPEIE|CEC_IER_BREIE|CEC_IER_RXOVRIE) +/** + * @} + */ + +/** @defgroup CEC_IER_ALL_TX CEC all TX errors interrupts enabling flag + * @{ + */ +#define CEC_IER_TX_ALL_ERR ((uint32_t)CEC_IER_TXACKEIE|CEC_IER_TXERRIE|CEC_IER_TXUDRIE|CEC_IER_ARBLSTIE) +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup CEC_Exported_Macros CEC Exported Macros + * @{ + */ + +/** @brief Reset CEC handle state + * @param __HANDLE__: CEC handle. + * @retval None + */ +#define __HAL_CEC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CEC_STATE_RESET) + +/** @brief Checks whether or not the specified CEC interrupt flag is set. + * @param __HANDLE__: specifies the CEC Handle. + * @param __FLAG__: specifies the interrupt to check. + * @arg CEC_FLAG_TXACKE: Tx Missing acknowledge Error + * @arg CEC_FLAG_TXERR: Tx Error. + * @arg CEC_FLAG_TXUDR: Tx-Buffer Underrun. + * @arg CEC_FLAG_TXEND: End of transmission (successful transmission of the last byte). + * @arg CEC_FLAG_TXBR: Tx-Byte Request. + * @arg CEC_FLAG_ARBLST: Arbitration Lost + * @arg CEC_FLAG_RXACKE: Rx-Missing Acknowledge + * @arg CEC_FLAG_LBPE: Rx Long period Error + * @arg CEC_FLAG_SBPE: Rx Short period Error + * @arg CEC_FLAG_BRE: Rx Bit Rissing Error + * @arg CEC_FLAG_RXOVR: Rx Overrun. + * @arg CEC_FLAG_RXEND: End Of Reception. + * @arg CEC_FLAG_RXBR: Rx-Byte Received. + * @retval ITStatus + */ +#define __HAL_CEC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__)) + +/** @brief Clears the interrupt or status flag when raised (write at 1) + * @param __HANDLE__: specifies the CEC Handle. + * @param __FLAG__: specifies the interrupt/status flag to clear. + * This parameter can be one of the following values: + * @arg CEC_FLAG_TXACKE: Tx Missing acknowledge Error + * @arg CEC_FLAG_TXERR: Tx Error. + * @arg CEC_FLAG_TXUDR: Tx-Buffer Underrun. + * @arg CEC_FLAG_TXEND: End of transmission (successful transmission of the last byte). + * @arg CEC_FLAG_TXBR: Tx-Byte Request. + * @arg CEC_FLAG_ARBLST: Arbitration Lost + * @arg CEC_FLAG_RXACKE: Rx-Missing Acknowledge + * @arg CEC_FLAG_LBPE: Rx Long period Error + * @arg CEC_FLAG_SBPE: Rx Short period Error + * @arg CEC_FLAG_BRE: Rx Bit Rissing Error + * @arg CEC_FLAG_RXOVR: Rx Overrun. + * @arg CEC_FLAG_RXEND: End Of Reception. + * @arg CEC_FLAG_RXBR: Rx-Byte Received. + * @retval none + */ +#define __HAL_CEC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR |= (__FLAG__)) + +/** @brief Enables the specified CEC interrupt. + * @param __HANDLE__: specifies the CEC Handle. + * @param __INTERRUPT__: specifies the CEC interrupt to enable. + * This parameter can be one of the following values: + * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error IT Enable + * @arg CEC_IT_TXERR: Tx Error IT Enable + * @arg CEC_IT_TXUDR: Tx-Buffer Underrun IT Enable + * @arg CEC_IT_TXEND: End of transmission IT Enable + * @arg CEC_IT_TXBR: Tx-Byte Request IT Enable + * @arg CEC_IT_ARBLST: Arbitration Lost IT Enable + * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge IT Enable + * @arg CEC_IT_LBPE: Rx Long period Error IT Enable + * @arg CEC_IT_SBPE: Rx Short period Error IT Enable + * @arg CEC_IT_BRE: Rx Bit Rising Error IT Enable + * @arg CEC_IT_RXOVR: Rx Overrun IT Enable + * @arg CEC_IT_RXEND: End Of Reception IT Enable + * @arg CEC_IT_RXBR: Rx-Byte Received IT Enable + * @retval none + */ +#define __HAL_CEC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__)) + +/** @brief Disables the specified CEC interrupt. + * @param __HANDLE__: specifies the CEC Handle. + * @param __INTERRUPT__: specifies the CEC interrupt to disable. + * This parameter can be one of the following values: + * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error IT Enable + * @arg CEC_IT_TXERR: Tx Error IT Enable + * @arg CEC_IT_TXUDR: Tx-Buffer Underrun IT Enable + * @arg CEC_IT_TXEND: End of transmission IT Enable + * @arg CEC_IT_TXBR: Tx-Byte Request IT Enable + * @arg CEC_IT_ARBLST: Arbitration Lost IT Enable + * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge IT Enable + * @arg CEC_IT_LBPE: Rx Long period Error IT Enable + * @arg CEC_IT_SBPE: Rx Short period Error IT Enable + * @arg CEC_IT_BRE: Rx Bit Rising Error IT Enable + * @arg CEC_IT_RXOVR: Rx Overrun IT Enable + * @arg CEC_IT_RXEND: End Of Reception IT Enable + * @arg CEC_IT_RXBR: Rx-Byte Received IT Enable + * @retval none + */ +#define __HAL_CEC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= (~(__INTERRUPT__))) + +/** @brief Checks whether or not the specified CEC interrupt is enabled. + * @param __HANDLE__: specifies the CEC Handle. + * @param __INTERRUPT__: specifies the CEC interrupt to check. + * This parameter can be one of the following values: + * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error IT Enable + * @arg CEC_IT_TXERR: Tx Error IT Enable + * @arg CEC_IT_TXUDR: Tx-Buffer Underrun IT Enable + * @arg CEC_IT_TXEND: End of transmission IT Enable + * @arg CEC_IT_TXBR: Tx-Byte Request IT Enable + * @arg CEC_IT_ARBLST: Arbitration Lost IT Enable + * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge IT Enable + * @arg CEC_IT_LBPE: Rx Long period Error IT Enable + * @arg CEC_IT_SBPE: Rx Short period Error IT Enable + * @arg CEC_IT_BRE: Rx Bit Rising Error IT Enable + * @arg CEC_IT_RXOVR: Rx Overrun IT Enable + * @arg CEC_IT_RXEND: End Of Reception IT Enable + * @arg CEC_IT_RXBR: Rx-Byte Received IT Enable + * @retval FlagStatus + */ +#define __HAL_CEC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__)) + +/** @brief Enables the CEC device + * @param __HANDLE__: specifies the CEC Handle. + * @retval none + */ +#define __HAL_CEC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CEC_CR_CECEN) + +/** @brief Disables the CEC device + * @param __HANDLE__: specifies the CEC Handle. + * @retval none + */ +#define __HAL_CEC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~CEC_CR_CECEN) + +/** @brief Set Transmission Start flag + * @param __HANDLE__: specifies the CEC Handle. + * @retval none + */ +#define __HAL_CEC_FIRST_BYTE_TX_SET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CEC_CR_TXSOM) + +/** @brief Set Transmission End flag + * @param __HANDLE__: specifies the CEC Handle. + * @retval none + * If the CEC message consists of only one byte, TXEOM must be set before of TXSOM. + */ +#define __HAL_CEC_LAST_BYTE_TX_SET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CEC_CR_TXEOM) + +/** @brief Get Transmission Start flag + * @param __HANDLE__: specifies the CEC Handle. + * @retval FlagStatus + */ +#define __HAL_CEC_GET_TRANSMISSION_START_FLAG(__HANDLE__) ((__HANDLE__)->Instance->CR & CEC_CR_TXSOM) + +/** @brief Get Transmission End flag + * @param __HANDLE__: specifies the CEC Handle. + * @retval FlagStatus + */ +#define __HAL_CEC_GET_TRANSMISSION_END_FLAG(__HANDLE__) ((__HANDLE__)->Instance->CR & CEC_CR_TXEOM) + +/** @brief Clear OAR register + * @param __HANDLE__: specifies the CEC Handle. + * @retval none + */ +#define __HAL_CEC_CLEAR_OAR(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CFGR, CEC_CFGR_OAR) + +/** @brief Set OAR register (without resetting previously set address in case of multi-address mode) + * To reset OAR, __HAL_CEC_CLEAR_OAR() needs to be called beforehand + * @param __HANDLE__: specifies the CEC Handle. + * @param __ADDRESS__: Own Address value (CEC logical address is identified by bit position) + * @retval none + */ +#define __HAL_CEC_SET_OAR(__HANDLE__,__ADDRESS__) SET_BIT((__HANDLE__)->Instance->CFGR, (__ADDRESS__)<< CEC_CFGR_OAR_LSB_POS) + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup CEC_Exported_Functions + * @{ + */ + +/** @addtogroup CEC_Exported_Functions_Group1 + * @{ + */ +/* Initialization and de-initialization functions ****************************/ +HAL_StatusTypeDef HAL_CEC_Init(CEC_HandleTypeDef *hcec); +HAL_StatusTypeDef HAL_CEC_DeInit(CEC_HandleTypeDef *hcec); +void HAL_CEC_MspInit(CEC_HandleTypeDef *hcec); +void HAL_CEC_MspDeInit(CEC_HandleTypeDef *hcec); +/** + * @} + */ + +/** @addtogroup CEC_Exported_Functions_Group2 + * @{ + */ +/* I/O operation functions ***************************************************/ +HAL_StatusTypeDef HAL_CEC_Transmit(CEC_HandleTypeDef *hcec, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_CEC_Receive(CEC_HandleTypeDef *hcec, uint8_t *pData, uint32_t Timeout); +HAL_StatusTypeDef HAL_CEC_Transmit_IT(CEC_HandleTypeDef *hcec, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size); +HAL_StatusTypeDef HAL_CEC_Receive_IT(CEC_HandleTypeDef *hcec, uint8_t *pData); +uint32_t HAL_CEC_GetReceivedFrameSize(CEC_HandleTypeDef *hcec); +void HAL_CEC_IRQHandler(CEC_HandleTypeDef *hcec); +void HAL_CEC_TxCpltCallback(CEC_HandleTypeDef *hcec); +void HAL_CEC_RxCpltCallback(CEC_HandleTypeDef *hcec); +void HAL_CEC_ErrorCallback(CEC_HandleTypeDef *hcec); +/** + * @} + */ + +/** @addtogroup CEC_Exported_Functions_Group3 + * @{ + */ +/* Peripheral State functions ************************************************/ +HAL_CEC_StateTypeDef HAL_CEC_GetState(CEC_HandleTypeDef *hcec); +uint32_t HAL_CEC_GetError(CEC_HandleTypeDef *hcec); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/** @defgroup CEC_Private_Types CEC Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup CEC_Private_Variables CEC Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup CEC_Private_Constants CEC Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CEC_Private_Macros CEC Private Macros + * @{ + */ + +#define IS_CEC_SIGNALFREETIME(__SFT__) ((__SFT__) <= CEC_CFGR_SFT) + +#define IS_CEC_TOLERANCE(__RXTOL__) (((__RXTOL__) == CEC_STANDARD_TOLERANCE) || \ + ((__RXTOL__) == CEC_EXTENDED_TOLERANCE)) + +#define IS_CEC_BRERXSTOP(__BRERXSTOP__) (((__BRERXSTOP__) == CEC_NO_RX_STOP_ON_BRE) || \ + ((__BRERXSTOP__) == CEC_RX_STOP_ON_BRE)) + +#define IS_CEC_BREERRORBITGEN(__ERRORBITGEN__) (((__ERRORBITGEN__) == CEC_BRE_ERRORBIT_NO_GENERATION) || \ + ((__ERRORBITGEN__) == CEC_BRE_ERRORBIT_GENERATION)) + +#define IS_CEC_LBPEERRORBITGEN(__ERRORBITGEN__) (((__ERRORBITGEN__) == CEC_LBPE_ERRORBIT_NO_GENERATION) || \ + ((__ERRORBITGEN__) == CEC_LBPE_ERRORBIT_GENERATION)) + +#define IS_CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION(__ERRORBITGEN__) (((__ERRORBITGEN__) == CEC_BROADCASTERROR_ERRORBIT_GENERATION) || \ + ((__ERRORBITGEN__) == CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION)) + +#define IS_CEC_SFTOP(__SFTOP__) (((__SFTOP__) == CEC_SFT_START_ON_TXSOM) || \ + ((__SFTOP__) == CEC_SFT_START_ON_TX_RX_END)) + +#define IS_CEC_LISTENING_MODE(__MODE__) (((__MODE__) == CEC_REDUCED_LISTENING_MODE) || \ + ((__MODE__) == CEC_FULL_LISTENING_MODE)) + +/** @brief Check CEC device Own Address Register (OAR) setting. + * OAR address is written in a 15-bit field within CEC_CFGR register. + * @param __ADDRESS__: CEC own address. + * @retval Test result (TRUE or FALSE). + */ +#define IS_CEC_OAR_ADDRESS(__ADDRESS__) ((__ADDRESS__) <= 0x07FFF) + +/** @brief Check CEC initiator or destination logical address setting. + * Initiator and destination addresses are coded over 4 bits. + * @param __ADDRESS__: CEC initiator or logical address. + * @retval Test result (TRUE or FALSE). + */ +#define IS_CEC_ADDRESS(__ADDRESS__) ((__ADDRESS__) <= 0xF) + +/** @brief Check CEC message size. + * The message size is the payload size: without counting the header, + * it varies from 0 byte (ping operation, one header only, no payload) to + * 15 bytes (1 opcode and up to 14 operands following the header). + * @param __SIZE__: CEC message size. + * @retval Test result (TRUE or FALSE). + */ +#define IS_CEC_MSGSIZE(__SIZE__) ((__SIZE__) <= 0xF) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup CEC_Private_Functions CEC Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CEC_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_conf.h deleted file mode 100644 index eb86cd59ae1..00000000000 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,407 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -#define HAL_CAN_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_CRYP_MODULE_ENABLED -#define HAL_DAC_MODULE_ENABLED -#define HAL_DCMI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_DMA2D_MODULE_ENABLED -#define HAL_ETH_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_NAND_MODULE_ENABLED -#define HAL_NOR_MODULE_ENABLED -#define HAL_PCCARD_MODULE_ENABLED -#define HAL_SRAM_MODULE_ENABLED -#define HAL_SDRAM_MODULE_ENABLED -#define HAL_HASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -#define HAL_IWDG_MODULE_ENABLED -#define HAL_LTDC_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -#define HAL_SAI_MODULE_ENABLED -#define HAL_SD_MODULE_ENABLED -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -#define HAL_IRDA_MODULE_ENABLED -#define HAL_SMARTCARD_MODULE_ENABLED -#define HAL_WWDG_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_PCD_MODULE_ENABLED -#define HAL_HCD_MODULE_ENABLED - - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)500) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 -#define INSTRUCTION_CACHE_ENABLE 1 -#define DATA_CACHE_ENABLE 1 - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1 */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) - -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ - -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ - -#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ -#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ - -#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ -#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ - -#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ -#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0) -#endif /* USE_FULL_ASSERT */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.c index af8b992c408..afc749119de 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_cortex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief CORTEX HAL module driver. * This file provides firmware functions to manage the following * functionalities of the CORTEX: @@ -28,11 +28,11 @@ (#) Enable the selected IRQ Channels using HAL_NVIC_EnableIRQ(). (#) please refer to programing manual for details in how to configure priority. - -@- When the NVIC_PRIORITYGROUP_0 is selected, IRQ pre-emption is no more possible. + -@- When the NVIC_PRIORITYGROUP_0 is selected, IRQ preemption is no more possible. The pending IRQ priority will be managed only by the sub priority. -@- IRQ priority order (sorted by highest to lowest priority): - (+@) Lowest pre-emption priority + (+@) Lowest preemption priority (+@) Lowest sub priority (+@) Lowest hardware priority (IRQ number) @@ -70,7 +70,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -104,26 +104,26 @@ * @{ */ -/** @defgroup CORTEX +/** @defgroup CORTEX CORTEX * @brief CORTEX HAL module driver * @{ */ #ifdef HAL_CORTEX_MODULE_ENABLED -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ -/** @defgroup CORTEX_Private_Functions +/** @defgroup CORTEX_Exported_Functions CORTEX Exported Functions * @{ */ -/** @defgroup CORTEX_Group1 Initialization and de-initialization functions +/** @defgroup CORTEX_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -140,21 +140,21 @@ /** - * @brief Sets the priority grouping field (pre-emption priority and subpriority) + * @brief Sets the priority grouping field (preemption priority and subpriority) * using the required unlock sequence. * @param PriorityGroup: The priority grouping bits length. * This parameter can be one of the following values: - * @arg NVIC_PRIORITYGROUP_0: 0 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_0: 0 bits for preemption priority * 4 bits for subpriority - * @arg NVIC_PRIORITYGROUP_1: 1 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_1: 1 bits for preemption priority * 3 bits for subpriority - * @arg NVIC_PRIORITYGROUP_2: 2 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_2: 2 bits for preemption priority * 2 bits for subpriority - * @arg NVIC_PRIORITYGROUP_3: 3 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_3: 3 bits for preemption priority * 1 bits for subpriority - * @arg NVIC_PRIORITYGROUP_4: 4 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_4: 4 bits for preemption priority * 0 bits for subpriority - * @note When the NVIC_PriorityGroup_0 is selected, IRQ pre-emption is no more possible. + * @note When the NVIC_PriorityGroup_0 is selected, IRQ preemption is no more possible. * The pending IRQ priority will be managed only by the subpriority. * @retval None */ @@ -171,8 +171,8 @@ void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup) * @brief Sets the priority of an interrupt. * @param IRQn: External interrupt number. * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) - * @param PreemptPriority: The pre-emption priority for the IRQn channel. + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) + * @param PreemptPriority: The preemption priority for the IRQn channel. * This parameter can be a value between 0 and 15 * A lower priority value indicates a higher priority * @param SubPriority: the subpriority level for the IRQ channel. @@ -199,11 +199,14 @@ void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t Sub * function should be called before. * @param IRQn External interrupt number. * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @retval None */ void HAL_NVIC_EnableIRQ(IRQn_Type IRQn) { + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + /* Enable interrupt */ NVIC_EnableIRQ(IRQn); } @@ -212,18 +215,20 @@ void HAL_NVIC_EnableIRQ(IRQn_Type IRQn) * @brief Disables a device specific interrupt in the NVIC interrupt controller. * @param IRQn External interrupt number. * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @retval None */ void HAL_NVIC_DisableIRQ(IRQn_Type IRQn) { + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + /* Disable interrupt */ NVIC_DisableIRQ(IRQn); } /** * @brief Initiates a system reset request to reset the MCU. - * @param None * @retval None */ void HAL_NVIC_SystemReset(void) @@ -247,7 +252,7 @@ uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb) * @} */ -/** @defgroup CORTEX_Group2 Peripheral Control functions +/** @defgroup CORTEX_Exported_Functions_Group2 Peripheral Control functions * @brief Cortex control functions * @verbatim @@ -265,7 +270,6 @@ uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb) /** * @brief Gets the priority grouping field from the NVIC Interrupt Controller. - * @param None * @retval Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field) */ uint32_t HAL_NVIC_GetPriorityGrouping(void) @@ -278,18 +282,18 @@ uint32_t HAL_NVIC_GetPriorityGrouping(void) * @brief Gets the priority of an interrupt. * @param IRQn: External interrupt number. * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @param PriorityGroup: the priority grouping bits length. * This parameter can be one of the following values: - * @arg NVIC_PRIORITYGROUP_0: 0 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_0: 0 bits for preemption priority * 4 bits for subpriority - * @arg NVIC_PRIORITYGROUP_1: 1 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_1: 1 bits for preemption priority * 3 bits for subpriority - * @arg NVIC_PRIORITYGROUP_2: 2 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_2: 2 bits for preemption priority * 2 bits for subpriority - * @arg NVIC_PRIORITYGROUP_3: 3 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_3: 3 bits for preemption priority * 1 bits for subpriority - * @arg NVIC_PRIORITYGROUP_4: 4 bits for pre-emption priority + * @arg NVIC_PRIORITYGROUP_4: 4 bits for preemption priority * 0 bits for subpriority * @param pPreemptPriority: Pointer on the Preemptive priority value (starting from 0). * @param pSubPriority: Pointer on the Subpriority value (starting from 0). @@ -306,12 +310,15 @@ void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t *pPre /** * @brief Sets Pending bit of an external interrupt. * @param IRQn External interrupt number - * This parameter can be an enumerator of @ref IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @retval None */ void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ +{ + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + /* Set interrupt pending */ NVIC_SetPendingIRQ(IRQn); } @@ -321,12 +328,15 @@ void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn) * and returns the pending bit for the specified interrupt). * @param IRQn External interrupt number. * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @retval status: - 0 Interrupt status is not pending. * - 1 Interrupt status is pending. */ uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ +{ + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + /* Return 1 if pending else 0 */ return NVIC_GetPendingIRQ(IRQn); } @@ -335,11 +345,14 @@ uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn) * @brief Clears the pending bit of an external interrupt. * @param IRQn External interrupt number. * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @retval None */ void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ +{ + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + /* Clear pending interrupt */ NVIC_ClearPendingIRQ(IRQn); } @@ -348,12 +361,15 @@ void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn) * @brief Gets active interrupt ( reads the active register in NVIC and returns the active bit). * @param IRQn External interrupt number * This parameter can be an enumerator of IRQn_Type enumeration - * (For the complete STM32 Devices IRQ Channels list, please refer to stm32f4xx.h file) + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h)) * @retval status: - 0 Interrupt status is not pending. * - 1 Interrupt status is pending. */ uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn) -{ +{ + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + /* Return 1 if active else 0 */ return NVIC_GetActive(IRQn); } @@ -382,7 +398,6 @@ void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource) /** * @brief This function handles SYSTICK interrupt request. - * @param None * @retval None */ void HAL_SYSTICK_IRQHandler(void) @@ -392,7 +407,6 @@ void HAL_SYSTICK_IRQHandler(void) /** * @brief SYSTICK callback. - * @param None * @retval None */ __weak void HAL_SYSTICK_Callback(void) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.h index 7e1ea0c2960..5305f12698b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cortex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_cortex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of CORTEX HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -56,15 +56,13 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -/** @defgroup CORTEX_Exported_Constants +/** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants * @{ */ - -/** @defgroup CORTEX_Preemption_Priority_Group +/** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group * @{ */ - #define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bits for pre-emption priority 4 bits for subpriority */ #define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bits for pre-emption priority @@ -75,33 +73,29 @@ 1 bits for subpriority */ #define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority 0 bits for subpriority */ - -#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \ - ((GROUP) == NVIC_PRIORITYGROUP_1) || \ - ((GROUP) == NVIC_PRIORITYGROUP_2) || \ - ((GROUP) == NVIC_PRIORITYGROUP_3) || \ - ((GROUP) == NVIC_PRIORITYGROUP_4)) - -#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) - -#define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) - /** * @} */ -/** @defgroup CORTEX_SysTick_clock_source +/** @defgroup CORTEX_SysTick_clock_source CORTEX _SysTick clock source * @{ */ #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000) #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004) -#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \ - ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8)) + /** * @} */ +/** + * @} + */ + + /* Exported Macros -----------------------------------------------------------*/ +/** @defgroup CORTEX_Exported_Macros CORTEX Exported Macros + * @{ + */ /** @brief Configures the SysTick clock source. * @param __CLKSRC__: specifies the SysTick clock source. @@ -119,22 +113,33 @@ else \ SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK; \ } while(0) - /** * @} */ -/* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ -/* Initialization and de-initialization functions *******************************/ +/** @addtogroup CORTEX_Exported_Functions + * @{ + */ + +/** @addtogroup CORTEX_Exported_Functions_Group1 + * @{ + */ +/* Initialization and de-initialization functions *****************************/ void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup); void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority); void HAL_NVIC_EnableIRQ(IRQn_Type IRQn); void HAL_NVIC_DisableIRQ(IRQn_Type IRQn); void HAL_NVIC_SystemReset(void); uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb); +/** + * @} + */ -/* Peripheral Control functions *************************************************/ +/** @addtogroup CORTEX_Exported_Functions_Group2 + * @{ + */ +/* Peripheral Control functions ***********************************************/ uint32_t HAL_NVIC_GetPriorityGrouping(void); void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority); uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn); @@ -144,6 +149,38 @@ uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn); void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource); void HAL_SYSTICK_IRQHandler(void); void HAL_SYSTICK_Callback(void); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CORTEX_Private_Macros CORTEX Private Macros + * @{ + */ +#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \ + ((GROUP) == NVIC_PRIORITYGROUP_1) || \ + ((GROUP) == NVIC_PRIORITYGROUP_2) || \ + ((GROUP) == NVIC_PRIORITYGROUP_3) || \ + ((GROUP) == NVIC_PRIORITYGROUP_4)) + +#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) + +#define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) + +#define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00) + +#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \ + ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8)) +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.c index a1401ac3830..bba9be2657e 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_crc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief CRC HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Cyclic Redundancy Check (CRC) peripheral: @@ -18,7 +18,7 @@ [..] The CRC HAL driver can be used as follows: - (#) Enable CRC AHB clock using __CRC_CLK_ENABLE(); + (#) Enable CRC AHB clock using __HAL_RCC_CRC_CLK_ENABLE(); (#) Use HAL_CRC_Accumulate() function to compute the CRC value of a 32-bit data buffer using combination of the previous CRC value @@ -32,7 +32,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -66,8 +66,7 @@ * @{ */ -/** @defgroup CRC - * @brief CRC HAL module driver. +/** @addtogroup CRC * @{ */ @@ -79,15 +78,16 @@ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ -/** @defgroup CRC_Private_Functions +/** @addtogroup CRC_Exported_Functions * @{ */ -/** @defgroup CRC_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions. +/** @addtogroup CRC_Exported_Functions_Group1 + * @brief Initialization and de-initialization functions * -@verbatim +@verbatim ============================================================================== ##### Initialization and de-initialization functions ##### ============================================================================== @@ -122,6 +122,8 @@ HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc) if(hcrc->State == HAL_CRC_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hcrc->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_CRC_MspInit(hcrc); } @@ -197,12 +199,12 @@ __weak void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc) /** * @} - */ + */ -/** @defgroup CRC_Group2 Peripheral Control functions - * @brief management functions. +/** @addtogroup CRC_Exported_Functions_Group2 + * @brief Peripheral Control functions * -@verbatim +@verbatim ============================================================================== ##### Peripheral Control functions ##### ============================================================================== @@ -291,10 +293,11 @@ uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t /** * @} - */ + */ -/** @defgroup CRC_Group3 Peripheral State functions - * @brief Peripheral State functions. + +/** @addtogroup CRC_Exported_Functions_Group3 + * @brief Peripheral State functions * @verbatim ============================================================================== diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.h index 8abea9c59aa..b086c371418 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_crc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_crc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of CRC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -50,15 +50,19 @@ * @{ */ -/** @addtogroup CRC +/** @defgroup CRC CRC + * @brief CRC HAL module driver * @{ - */ + */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup CRC_Exported_Types CRC Exported Types + * @{ + */ -/** - * @brief CRC HAL State Structure definition - */ +/** @defgroup CRC_Exported_Types_Group1 CRC State Structure definition + * @{ + */ typedef enum { HAL_CRC_STATE_RESET = 0x00, /*!< CRC not yet initialized or disabled */ @@ -68,9 +72,12 @@ typedef enum HAL_CRC_STATE_ERROR = 0x04 /*!< CRC error state */ }HAL_CRC_StateTypeDef; - /** - * @brief CRC handle Structure definition + * @} + */ + +/** @defgroup CRC_Exported_Types_Group2 CRC Handle Structure definition + * @{ */ typedef struct { @@ -81,11 +88,21 @@ typedef struct __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ }CRC_HandleTypeDef; +/** + * @} + */ + +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup CRC_Exported_Macros CRC Exported Macros + * @{ + */ -/** @brief Reset CRC handle state +/** @brief Resets CRC handle state * @param __HANDLE__: CRC handle * @retval None */ @@ -101,7 +118,7 @@ typedef struct /** * @brief Stores a 8-bit data in the Independent Data(ID) register. * @param __HANDLE__: CRC handle - * @param __VALUE: 8-bit value to be stored in the ID register + * @param __VALUE__: 8-bit value to be stored in the ID register * @retval None */ #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (MODIFY_REG((__HANDLE__)->Instance->IDR, CRC_IDR_IDR, (__VALUE__)) @@ -112,30 +129,117 @@ typedef struct * @retval 8-bit value of the ID register */ #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @defgroup CRC_Exported_Functions CRC Exported Functions + * @{ + */ -/* Initialization/de-initialization functions **********************************/ +/** @defgroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc); HAL_StatusTypeDef HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc); void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc); void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc); +/** + * @} + */ -/* Peripheral Control functions ************************************************/ +/** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions + * @{ + */ uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); +/** + * @} + */ -/* Peripheral State functions **************************************************/ +/** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions + * @{ + */ HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/** @defgroup CRC_Private_Types CRC Private Types + * @{ + */ + +/** + * @} + */ + +/* Private defines -----------------------------------------------------------*/ +/** @defgroup CRC_Private_Defines CRC Private Defines + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup CRC_Private_Variables CRC Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup CRC_Private_Constants CRC Private Constants + * @{ + */ /** * @} */ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CRC_Private_Macros CRC Private Macros + * @{ + */ + /** * @} */ - + +/* Private functions prototypes ----------------------------------------------*/ +/** @defgroup CRC_Private_Functions_Prototypes CRC Private Functions Prototypes + * @{ + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup CRC_Private_Functions CRC Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.c index 5666e258045..a459fe3b7a9 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_cryp.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief CRYP HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Cryptography (CRYP) peripheral: @@ -23,7 +23,7 @@ The CRYP HAL driver can be used as follows: (#)Initialize the CRYP low level resources by implementing the HAL_CRYP_MspInit(): - (##) Enable the CRYP interface clock using __CRYP_CLK_ENABLE() + (##) Enable the CRYP interface clock using __HAL_RCC_CRYP_CLK_ENABLE() (##) In case of using interrupts (e.g. HAL_CRYP_AESECB_Encrypt_IT()) (+++) Configure the CRYP interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the CRYP IRQ handler using HAL_NVIC_EnableIRQ() @@ -33,7 +33,7 @@ (+++) Configure and enable two DMA streams one for managing data transfer from memory to peripheral (input stream) and another stream for managing data transfer from peripheral to memory (output stream) - (+++) Associate the initilalized DMA handle to the CRYP DMA handle + (+++) Associate the initialized DMA handle to the CRYP DMA handle using __HAL_LINKDMA() (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the two DMA Streams. The output stream should have higher @@ -70,7 +70,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -104,7 +104,7 @@ * @{ */ -/** @defgroup CRYP +/** @defgroup CRYP CRYP * @brief CRYP HAL module driver. * @{ */ @@ -115,10 +115,20 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup CRYP_Private_define + * @{ + */ #define CRYP_TIMEOUT_VALUE 1 +/** + * @} + */ + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup CRYP_Private_Functions_prototypes + * @{ + */ static void CRYP_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector, uint32_t IVSize); static void CRYP_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize); static HAL_StatusTypeDef CRYP_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint8_t* Output, uint32_t Timeout); @@ -131,438 +141,614 @@ static void CRYP_SetTDESECBMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction); static void CRYP_SetTDESCBCMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction); static void CRYP_SetDESECBMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction); static void CRYP_SetDESCBCMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction); - +/** + * @} + */ + + /* Private functions ---------------------------------------------------------*/ -/** @defgroup CRYP_Private_Functions +/** @addtogroup CRYP_Private_Functions * @{ */ -/** @defgroup CRYP_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions. - * -@verbatim - ============================================================================== - ##### Initialization and de-initialization functions ##### - ============================================================================== - [..] This section provides functions allowing to: - (+) Initialize the CRYP according to the specified parameters - in the CRYP_InitTypeDef and creates the associated handle - (+) DeInitialize the CRYP peripheral - (+) Initialize the CRYP MSP - (+) DeInitialize CRYP MSP - -@endverbatim - * @{ - */ /** - * @brief Initializes the CRYP according to the specified - * parameters in the CRYP_InitTypeDef and creates the associated handle. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @retval HAL status + * @brief DMA CRYP Input Data process complete callback. + * @param hdma: DMA handle + * @retval None */ -HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp) -{ - /* Check the CRYP handle allocation */ - if(hcryp == HAL_NULL) - { - return HAL_ERROR; - } - - /* Check the parameters */ - assert_param(IS_CRYP_KEYSIZE(hcryp->Init.KeySize)); - assert_param(IS_CRYP_DATATYPE(hcryp->Init.DataType)); - - if(hcryp->State == HAL_CRYP_STATE_RESET) - { - /* Init the low level hardware */ - HAL_CRYP_MspInit(hcryp); - } - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; - - /* Set the key size and data type*/ - CRYP->CR = (uint32_t) (hcryp->Init.KeySize | hcryp->Init.DataType); - - /* Reset CrypInCount and CrypOutCount */ - hcryp->CrypInCount = 0; - hcryp->CrypOutCount = 0; - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; +static void CRYP_DMAInCplt(DMA_HandleTypeDef *hdma) +{ + CRYP_HandleTypeDef* hcryp = (CRYP_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - /* Set the default CRYP phase */ - hcryp->Phase = HAL_CRYP_PHASE_READY; + /* Disable the DMA transfer for input FIFO request by resetting the DIEN bit + in the DMACR register */ + hcryp->Instance->DMACR &= (uint32_t)(~CRYP_DMACR_DIEN); - /* Return function status */ - return HAL_OK; + /* Call input data transfer complete callback */ + HAL_CRYP_InCpltCallback(hcryp); } /** - * @brief DeInitializes the CRYP peripheral. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @retval HAL status + * @brief DMA CRYP Output Data process complete callback. + * @param hdma: DMA handle + * @retval None */ -HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp) +static void CRYP_DMAOutCplt(DMA_HandleTypeDef *hdma) { - /* Check the CRYP handle allocation */ - if(hcryp == HAL_NULL) - { - return HAL_ERROR; - } - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; - - /* Set the default CRYP phase */ - hcryp->Phase = HAL_CRYP_PHASE_READY; + CRYP_HandleTypeDef* hcryp = (CRYP_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - /* Reset CrypInCount and CrypOutCount */ - hcryp->CrypInCount = 0; - hcryp->CrypOutCount = 0; + /* Disable the DMA transfer for output FIFO request by resetting the DOEN bit + in the DMACR register */ + hcryp->Instance->DMACR &= (uint32_t)(~CRYP_DMACR_DOEN); - /* Disable the CRYP Peripheral Clock */ - __HAL_CRYP_DISABLE(); + /* Disable CRYP */ + __HAL_CRYP_DISABLE(hcryp); - /* DeInit the low level hardware: CLOCK, NVIC.*/ - HAL_CRYP_MspDeInit(hcryp); + /* Change the CRYP state to ready */ + hcryp->State = HAL_CRYP_STATE_READY; - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_RESET; - - /* Release Lock */ - __HAL_UNLOCK(hcryp); - - /* Return function status */ - return HAL_OK; + /* Call output data transfer complete callback */ + HAL_CRYP_OutCpltCallback(hcryp); } /** - * @brief Initializes the CRYP MSP. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module + * @brief DMA CRYP communication error callback. + * @param hdma: DMA handle * @retval None */ -__weak void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp) +static void CRYP_DMAError(DMA_HandleTypeDef *hdma) { - /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_CRYP_MspInit could be implemented in the user file - */ + CRYP_HandleTypeDef* hcryp = (CRYP_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + hcryp->State= HAL_CRYP_STATE_READY; + HAL_CRYP_ErrorCallback(hcryp); } /** - * @brief DeInitializes CRYP MSP. + * @brief Writes the Key in Key registers. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module + * @param Key: Pointer to Key buffer + * @param KeySize: Size of Key * @retval None */ -__weak void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp) +static void CRYP_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize) { - /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_CRYP_MspDeInit could be implemented in the user file - */ + uint32_t keyaddr = (uint32_t)Key; + + switch(KeySize) + { + case CRYP_KEYSIZE_256B: + /* Key Initialisation */ + hcryp->Instance->K0LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K0RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K1LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K1RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3RR = __REV(*(uint32_t*)(keyaddr)); + break; + case CRYP_KEYSIZE_192B: + hcryp->Instance->K1LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K1RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3RR = __REV(*(uint32_t*)(keyaddr)); + break; + case CRYP_KEYSIZE_128B: + hcryp->Instance->K2LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3RR = __REV(*(uint32_t*)(keyaddr)); + break; + default: + break; + } } /** - * @} - */ - -/** @defgroup CRYP_Group2 AES processing functions - * @brief processing functions. - * -@verbatim - ============================================================================== - ##### AES processing functions ##### - ============================================================================== - [..] This section provides functions allowing to: - (+) Encrypt plaintext using AES-128/192/256 using chaining modes - (+) Decrypt cyphertext using AES-128/192/256 using chaining modes - [..] Three processing functions are available: - (+) Polling mode - (+) Interrupt mode - (+) DMA mode - -@endverbatim - * @{ + * @brief Writes the InitVector/InitCounter in IV registers. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param InitVector: Pointer to InitVector/InitCounter buffer + * @param IVSize: Size of the InitVector/InitCounter + * @retval None */ +static void CRYP_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector, uint32_t IVSize) +{ + uint32_t ivaddr = (uint32_t)InitVector; + + switch(IVSize) + { + case CRYP_KEYSIZE_128B: + hcryp->Instance->IV0LR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV0RR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV1LR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV1RR = __REV(*(uint32_t*)(ivaddr)); + break; + /* Whatever key size 192 or 256, Init vector is written in IV0LR and IV0RR */ + case CRYP_KEYSIZE_192B: + hcryp->Instance->IV0LR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV0RR = __REV(*(uint32_t*)(ivaddr)); + break; + case CRYP_KEYSIZE_256B: + hcryp->Instance->IV0LR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV0RR = __REV(*(uint32_t*)(ivaddr)); + break; + default: + break; + } +} /** - * @brief Initializes the CRYP peripheral in AES ECB encryption mode - * then encrypt pPlainData. The cypher data are available in pCypherData + * @brief Process Data: Writes Input data in polling mode and read the output data * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. - * @param pCypherData: Pointer to the cyphertext buffer - * @param Timeout: Specify Timeout value - * @retval HAL status + * @param Input: Pointer to the Input buffer + * @param Ilength: Length of the Input buffer, must be a multiple of 16. + * @param Output: Pointer to the returned buffer + * @param Timeout: Timeout value + * * @retval None */ -HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +static HAL_StatusTypeDef CRYP_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint8_t* Output, uint32_t Timeout) { - /* Process Locked */ - __HAL_LOCK(hcryp); + uint32_t tickstart = 0; - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + uint32_t i = 0; + uint32_t inputaddr = (uint32_t)Input; + uint32_t outputaddr = (uint32_t)Output; - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) + for(i=0; (i < Ilength); i+=16) { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_ECB); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } - - /* Write Plain Data and Get Cypher Data */ - if(CRYP_ProcessData(hcryp,pPlainData, Size, pCypherData, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_OFNE)) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } } - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - + /* Read the Output block from the Output FIFO */ + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + } /* Return function status */ return HAL_OK; } /** - * @brief Initializes the CRYP peripheral in AES CBC encryption mode - * then encrypt pPlainData. The cypher data are available in pCypherData + * @brief Process Data: Write Input data in polling mode. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. - * @param pCypherData: Pointer to the cyphertext buffer + * @param Input: Pointer to the Input buffer + * @param Ilength: Length of the Input buffer, must be a multiple of 8 + * @param Output: Pointer to the returned buffer * @param Timeout: Specify Timeout value - * @retval HAL status + * @retval None */ -HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +static HAL_StatusTypeDef CRYP_ProcessData2Words(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint8_t* Output, uint32_t Timeout) { - /* Process Locked */ - __HAL_LOCK(hcryp); + uint32_t tickstart = 0; - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + uint32_t i = 0; + uint32_t inputaddr = (uint32_t)Input; + uint32_t outputaddr = (uint32_t)Output; - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) + for(i=0; (i < Ilength); i+=8) { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CBC); - - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + /* Get tick */ + tickstart = HAL_GetTick(); - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } - - /* Write Plain Data and Get Cypher Data */ - if(CRYP_ProcessData(hcryp,pPlainData, Size, pCypherData, Timeout) != HAL_OK) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_OFNE)) { - return HAL_TIMEOUT; + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } } - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - + /* Read the Output block from the Output FIFO */ + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + } /* Return function status */ return HAL_OK; } /** - * @brief Initializes the CRYP peripheral in AES CTR encryption mode - * then encrypt pPlainData. The cypher data are available in pCypherData + * @brief Set the DMA configuration and start the DMA transfer * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. - * @param pCypherData: Pointer to the cyphertext buffer - * @param Timeout: Specify Timeout value - * @retval HAL status + * @param inputaddr: address of the Input buffer + * @param Size: Size of the Input buffer, must be a multiple of 16. + * @param outputaddr: address of the Output buffer + * @retval None */ -HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) -{ - /* Process Locked */ - __HAL_LOCK(hcryp); +static void CRYP_SetDMAConfig(CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr) +{ + /* Set the CRYP DMA transfer complete callback */ + hcryp->hdmain->XferCpltCallback = CRYP_DMAInCplt; + /* Set the DMA error callback */ + hcryp->hdmain->XferErrorCallback = CRYP_DMAError; - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + /* Set the CRYP DMA transfer complete callback */ + hcryp->hdmaout->XferCpltCallback = CRYP_DMAOutCplt; + /* Set the DMA error callback */ + hcryp->hdmaout->XferErrorCallback = CRYP_DMAError; + + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); + + /* Enable the DMA In DMA Stream */ + HAL_DMA_Start_IT(hcryp->hdmain, inputaddr, (uint32_t)&hcryp->Instance->DR, Size/4); + + /* Enable In DMA request */ + hcryp->Instance->DMACR = (CRYP_DMACR_DIEN); + + /* Enable the DMA Out DMA Stream */ + HAL_DMA_Start_IT(hcryp->hdmaout, (uint32_t)&hcryp->Instance->DOUT, outputaddr, Size/4); + /* Enable Out DMA request */ + hcryp->Instance->DMACR |= CRYP_DMACR_DOEN; + +} + +/** + * @brief Sets the CRYP peripheral in DES ECB mode. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param Direction: Encryption or decryption + * @retval None + */ +static void CRYP_SetDESECBMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) +{ /* Check if initialization phase has already been performed */ if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CTR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_DES_ECB | Direction); - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + /* Set the key */ + hcryp->Instance->K1LR = __REV(*(uint32_t*)(hcryp->Init.pKey)); + hcryp->Instance->K1RR = __REV(*(uint32_t*)(hcryp->Init.pKey+4)); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - - /* Write Plain Data and Get Cypher Data */ - if(CRYP_ProcessData(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; - } - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - /* Return function status */ - return HAL_OK; } - - /** - * @brief Initializes the CRYP peripheral in AES ECB decryption mode - * then decrypted pCypherData. The cypher data are available in pPlainData + * @brief Sets the CRYP peripheral in DES CBC mode. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pCypherData: Pointer to the cyphertext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. - * @param pPlainData: Pointer to the plaintext buffer - * @param Timeout: Specify Timeout value - * @retval HAL status + * @param Direction: Encryption or decryption + * @retval None */ -HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout) +static void CRYP_SetDESCBCMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) { - uint32_t tickstart = 0; - - /* Process Locked */ - __HAL_LOCK(hcryp); - - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; - /* Check if initialization phase has already been performed */ if(hcryp->Phase == HAL_CRYP_PHASE_READY) { + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_DES_CBC | Direction); + /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + hcryp->Instance->K1LR = __REV(*(uint32_t*)(hcryp->Init.pKey)); + hcryp->Instance->K1RR = __REV(*(uint32_t*)(hcryp->Init.pKey+4)); - /* Set the CRYP peripheral in AES Key mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_256B); - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); - /* Get tick */ - tickstart = HAL_GetTick(); + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } +} - while(HAL_IS_BIT_SET(CRYP->SR, CRYP_FLAG_BUSY)) - { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) - { - if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - } - - /* Disable CRYP */ - __HAL_CRYP_DISABLE(); +/** + * @brief Sets the CRYP peripheral in TDES ECB mode. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param Direction: Encryption or decryption + * @retval None + */ +static void CRYP_SetTDESECBMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) +{ + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_TDES_ECB | Direction); - /* Reset the ALGOMODE bits*/ - CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, CRYP_KEYSIZE_192B); - /* Set the CRYP peripheral in AES ECB decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_ECB | CRYP_CR_ALGODIR); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - - /* Write Plain Data and Get Cypher Data */ - if(CRYP_ProcessData(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; - } +} + +/** + * @brief Sets the CRYP peripheral in TDES CBC mode + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param Direction: Encryption or decryption + * @retval None + */ +static void CRYP_SetTDESCBCMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) +{ + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /* Set the CRYP peripheral in AES CBC mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_TDES_CBC | Direction); + + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, CRYP_KEYSIZE_192B); + + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_256B); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } +} + +/** + * @} + */ + + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup CRYP_Exported_Functions + * @{ + */ + +/** @defgroup CRYP_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions. + * +@verbatim + ============================================================================== + ##### Initialization and de-initialization functions ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) Initialize the CRYP according to the specified parameters + in the CRYP_InitTypeDef and creates the associated handle + (+) DeInitialize the CRYP peripheral + (+) Initialize the CRYP MSP + (+) DeInitialize CRYP MSP + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the CRYP according to the specified + * parameters in the CRYP_InitTypeDef and creates the associated handle. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp) +{ + /* Check the CRYP handle allocation */ + if(hcryp == HAL_NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_CRYP_KEYSIZE(hcryp->Init.KeySize)); + assert_param(IS_CRYP_DATATYPE(hcryp->Init.DataType)); + + if(hcryp->State == HAL_CRYP_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hcryp->Lock = HAL_UNLOCKED; + /* Init the low level hardware */ + HAL_CRYP_MspInit(hcryp); + } + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Set the key size and data type*/ + CRYP->CR = (uint32_t) (hcryp->Init.KeySize | hcryp->Init.DataType); + + /* Reset CrypInCount and CrypOutCount */ + hcryp->CrypInCount = 0; + hcryp->CrypOutCount = 0; /* Change the CRYP state */ hcryp->State = HAL_CRYP_STATE_READY; - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); + /* Set the default CRYP phase */ + hcryp->Phase = HAL_CRYP_PHASE_READY; /* Return function status */ return HAL_OK; } /** - * @brief Initializes the CRYP peripheral in AES ECB decryption mode - * then decrypted pCypherData. The cypher data are available in pPlainData + * @brief DeInitializes the CRYP peripheral. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pCypherData: Pointer to the cyphertext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. - * @param pPlainData: Pointer to the plaintext buffer - * @param Timeout: Specify Timeout value * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout) +HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp) { - uint32_t tickstart = 0; + /* Check the CRYP handle allocation */ + if(hcryp == HAL_NULL) + { + return HAL_ERROR; + } + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Set the default CRYP phase */ + hcryp->Phase = HAL_CRYP_PHASE_READY; + + /* Reset CrypInCount and CrypOutCount */ + hcryp->CrypInCount = 0; + hcryp->CrypOutCount = 0; + + /* Disable the CRYP Peripheral Clock */ + __HAL_CRYP_DISABLE(hcryp); + + /* DeInit the low level hardware: CLOCK, NVIC.*/ + HAL_CRYP_MspDeInit(hcryp); + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(hcryp); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Initializes the CRYP MSP. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @retval None + */ +__weak void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CRYP_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes CRYP MSP. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @retval None + */ +__weak void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CRYP_MspDeInit could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup CRYP_Exported_Functions_Group2 AES processing functions + * @brief processing functions. + * +@verbatim + ============================================================================== + ##### AES processing functions ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) Encrypt plaintext using AES-128/192/256 using chaining modes + (+) Decrypt cyphertext using AES-128/192/256 using chaining modes + [..] Three processing functions are available: + (+) Polling mode + (+) Interrupt mode + (+) DMA mode + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the CRYP peripheral in AES ECB encryption mode + * then encrypt pPlainData. The cypher data are available in pCypherData + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pCypherData: Pointer to the cyphertext buffer + * @param Timeout: Specify Timeout value + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +{ /* Process Locked */ __HAL_LOCK(hcryp); @@ -575,54 +761,21 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pC /* Set the key */ CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Set the CRYP peripheral in AES Key mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); - - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_SET(CRYP->SR, CRYP_FLAG_BUSY)) - { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) - { - if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - } - - /* Reset the ALGOMODE bits*/ - CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); - - /* Set the CRYP peripheral in AES CBC decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CBC | CRYP_CR_ALGODIR); - - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_ECB); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } /* Write Plain Data and Get Cypher Data */ - if(CRYP_ProcessData(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) + if(CRYP_ProcessData(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) { return HAL_TIMEOUT; } @@ -638,48 +791,48 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pC } /** - * @brief Initializes the CRYP peripheral in AES CTR decryption mode - * then decrypted pCypherData. The cypher data are available in pPlainData + * @brief Initializes the CRYP peripheral in AES CBC encryption mode + * then encrypt pPlainData. The cypher data are available in pCypherData * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pCypherData: Pointer to the cyphertext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pCypherData: Pointer to the cyphertext buffer * @param Timeout: Specify Timeout value * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout) -{ +HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +{ /* Process Locked */ __HAL_LOCK(hcryp); + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + /* Check if initialization phase has already been performed */ if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; - /* Set the key */ CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Set the CRYP peripheral in AES CTR mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CTR | CRYP_CR_ALGODIR); + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CBC); /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } /* Write Plain Data and Get Cypher Data */ - if(CRYP_ProcessData(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) + if(CRYP_ProcessData(hcryp,pPlainData, Size, pCypherData, Timeout) != HAL_OK) { return HAL_TIMEOUT; } @@ -695,326 +848,309 @@ HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pC } /** - * @brief Initializes the CRYP peripheral in AES ECB encryption mode using Interrupt. + * @brief Initializes the CRYP peripheral in AES CTR encryption mode + * then encrypt pPlainData. The cypher data are available in pCypherData * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes + * @param Size: Length of the plaintext buffer, must be a multiple of 16. * @param pCypherData: Pointer to the cyphertext buffer + * @param Timeout: Specify Timeout value * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) -{ - uint32_t inputaddr; - uint32_t outputaddr; +HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +{ + /* Process Locked */ + __HAL_LOCK(hcryp); - if(hcryp->State == HAL_CRYP_STATE_READY) + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - /* Process Locked */ - __HAL_LOCK(hcryp); - - hcryp->CrypInCount = Size; - hcryp->pCrypInBuffPtr = pPlainData; - hcryp->pCrypOutBuffPtr = pCypherData; - hcryp->CrypOutCount = Size; + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CTR); - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_ECB); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); - /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); - /* Return function status */ - return HAL_OK; - } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) - { - inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - hcryp->pCrypInBuffPtr += 16; - hcryp->CrypInCount -= 16; - if(hcryp->CrypInCount == 0) - { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); - /* Call the Input data transfer complete callback */ - HAL_CRYP_InCpltCallback(hcryp); - } + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) - { - outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; - /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - hcryp->pCrypOutBuffPtr += 16; - hcryp->CrypOutCount -= 16; - if(hcryp->CrypOutCount == 0) + + /* Write Plain Data and Get Cypher Data */ + if(CRYP_ProcessData(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); - /* Process Locked */ - __HAL_UNLOCK(hcryp); - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; - /* Call Input transfer complete callback */ - HAL_CRYP_OutCpltCallback(hcryp); + return HAL_TIMEOUT; } - } + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); /* Return function status */ return HAL_OK; } + + /** - * @brief Initializes the CRYP peripheral in AES CBC encryption mode using Interrupt. + * @brief Initializes the CRYP peripheral in AES ECB decryption mode + * then decrypted pCypherData. The cypher data are available in pPlainData * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes * @param pCypherData: Pointer to the cyphertext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pPlainData: Pointer to the plaintext buffer + * @param Timeout: Specify Timeout value * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout) { - uint32_t inputaddr; - uint32_t outputaddr; + uint32_t tickstart = 0; - if(hcryp->State == HAL_CRYP_STATE_READY) + /* Process Locked */ + __HAL_LOCK(hcryp); + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - /* Process Locked */ - __HAL_LOCK(hcryp); + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - hcryp->CrypInCount = Size; - hcryp->pCrypInBuffPtr = pPlainData; - hcryp->pCrypOutBuffPtr = pCypherData; - hcryp->CrypOutCount = Size; + /* Set the CRYP peripheral in AES Key mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES CBC mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CBC); - - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_SET(hcryp->Instance->SR, CRYP_FLAG_BUSY)) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } } - /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + + /* Disable CRYP */ + __HAL_CRYP_DISABLE(hcryp); + + /* Reset the ALGOMODE bits*/ + CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); + + /* Set the CRYP peripheral in AES ECB decryption mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_ECB | CRYP_CR_ALGODIR); + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); - /* Return function status */ - return HAL_OK; - } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) - { - inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - hcryp->pCrypInBuffPtr += 16; - hcryp->CrypInCount -= 16; - if(hcryp->CrypInCount == 0) - { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); - /* Call the Input data transfer complete callback */ - HAL_CRYP_InCpltCallback(hcryp); - } + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) - { - outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; - /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - hcryp->pCrypOutBuffPtr += 16; - hcryp->CrypOutCount -= 16; - if(hcryp->CrypOutCount == 0) + + /* Write Plain Data and Get Cypher Data */ + if(CRYP_ProcessData(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); - /* Process Locked */ - __HAL_UNLOCK(hcryp); - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; - /* Call Input transfer complete callback */ - HAL_CRYP_OutCpltCallback(hcryp); + return HAL_TIMEOUT; } - } + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); /* Return function status */ return HAL_OK; } /** - * @brief Initializes the CRYP peripheral in AES CTR encryption mode using Interrupt. + * @brief Initializes the CRYP peripheral in AES ECB decryption mode + * then decrypted pCypherData. The cypher data are available in pPlainData * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes * @param pCypherData: Pointer to the cyphertext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pPlainData: Pointer to the plaintext buffer + * @param Timeout: Specify Timeout value * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout) { - uint32_t inputaddr; - uint32_t outputaddr; + uint32_t tickstart = 0; - if(hcryp->State == HAL_CRYP_STATE_READY) + /* Process Locked */ + __HAL_LOCK(hcryp); + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - /* Process Locked */ - __HAL_LOCK(hcryp); + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - hcryp->CrypInCount = Size; - hcryp->pCrypInBuffPtr = pPlainData; - hcryp->pCrypOutBuffPtr = pCypherData; - hcryp->CrypOutCount = Size; + /* Set the CRYP peripheral in AES Key mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_SET(hcryp->Instance->SR, CRYP_FLAG_BUSY)) { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES CTR mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CTR); - - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } } - /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + + /* Reset the ALGOMODE bits*/ + CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); + + /* Set the CRYP peripheral in AES CBC decryption mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CBC | CRYP_CR_ALGODIR); + + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); - /* Return function status */ - return HAL_OK; + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) - { - inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - hcryp->pCrypInBuffPtr += 16; - hcryp->CrypInCount -= 16; - if(hcryp->CrypInCount == 0) + + /* Write Plain Data and Get Cypher Data */ + if(CRYP_ProcessData(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); - /* Call the Input data transfer complete callback */ - HAL_CRYP_InCpltCallback(hcryp); + return HAL_TIMEOUT; } - } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Initializes the CRYP peripheral in AES CTR decryption mode + * then decrypted pCypherData. The cypher data are available in pPlainData + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param pCypherData: Pointer to the cyphertext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pPlainData: Pointer to the plaintext buffer + * @param Timeout: Specify Timeout value + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout) +{ + /* Process Locked */ + __HAL_LOCK(hcryp); + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; - /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - hcryp->pCrypOutBuffPtr += 16; - hcryp->CrypOutCount -= 16; - if(hcryp->CrypOutCount == 0) + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES CTR mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CTR | CRYP_CR_ALGODIR); + + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } + + /* Write Plain Data and Get Cypher Data */ + if(CRYP_ProcessData(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_READY; - /* Call Input transfer complete callback */ - HAL_CRYP_OutCpltCallback(hcryp); + return HAL_TIMEOUT; } - } + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); /* Return function status */ return HAL_OK; } - /** - * @brief Initializes the CRYP peripheral in AES ECB decryption mode using Interrupt. + * @brief Initializes the CRYP peripheral in AES ECB encryption mode using Interrupt. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pCypherData: Pointer to the cyphertext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes + * @param pCypherData: Pointer to the cyphertext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) +HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) { - uint32_t tickstart = 0; - uint32_t inputaddr; uint32_t outputaddr; @@ -1024,101 +1160,75 @@ HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t __HAL_LOCK(hcryp); hcryp->CrypInCount = Size; - hcryp->pCrypInBuffPtr = pCypherData; - hcryp->pCrypOutBuffPtr = pPlainData; + hcryp->pCrypInBuffPtr = pPlainData; + hcryp->pCrypOutBuffPtr = pCypherData; hcryp->CrypOutCount = Size; /* Change the CRYP state */ hcryp->State = HAL_CRYP_STATE_BUSY; - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES Key mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); - - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_SET(CRYP->SR, CRYP_FLAG_BUSY)) + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) { - /* Check for the Timeout */ - if((HAL_GetTick() - tickstart ) > CRYP_TIMEOUT_VALUE) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - - /* Reset the ALGOMODE bits*/ - CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); - - /* Set the CRYP peripheral in AES ECB decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_ECB | CRYP_CR_ALGODIR); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_ECB); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } - + } + /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); - /* Process Unlocked */ + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); + /* Process Locked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ hcryp->State = HAL_CRYP_STATE_READY; @@ -1132,18 +1242,16 @@ HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t } /** - * @brief Initializes the CRYP peripheral in AES CBC decryption mode using IT. + * @brief Initializes the CRYP peripheral in AES CBC encryption mode using Interrupt. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pCypherData: Pointer to the cyphertext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes + * @param pCypherData: Pointer to the cyphertext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) +HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) { - - uint32_t tickstart = 0; uint32_t inputaddr; uint32_t outputaddr; @@ -1152,10 +1260,9 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t /* Process Locked */ __HAL_LOCK(hcryp); - /* Get the buffer addresses and sizes */ hcryp->CrypInCount = Size; - hcryp->pCrypInBuffPtr = pCypherData; - hcryp->pCrypOutBuffPtr = pPlainData; + hcryp->pCrypInBuffPtr = pPlainData; + hcryp->pCrypOutBuffPtr = pCypherData; hcryp->CrypOutCount = Size; /* Change the CRYP state */ @@ -1163,99 +1270,68 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t /* Check if initialization phase has already been performed */ if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { + { /* Set the key */ CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Set the CRYP peripheral in AES Key mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + /* Set the CRYP peripheral in AES CBC mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CBC); - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_SET(CRYP->SR, CRYP_FLAG_BUSY)) - { - /* Check for the Timeout */ - if((HAL_GetTick() - tickstart ) > CRYP_TIMEOUT_VALUE) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - - /* Reset the ALGOMODE bits*/ - CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); - - /* Set the CRYP peripheral in AES CBC decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CBC | CRYP_CR_ALGODIR); - /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); - + /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_FIFO_FLUSH(hcryp); - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); - /* Process Unlocked */ + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); + /* Process Locked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ hcryp->State = HAL_CRYP_STATE_READY; @@ -1269,15 +1345,15 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t } /** - * @brief Initializes the CRYP peripheral in AES CTR decryption mode using Interrupt. + * @brief Initializes the CRYP peripheral in AES CTR encryption mode using Interrupt. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pCypherData: Pointer to the cyphertext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes + * @param pCypherData: Pointer to the cyphertext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) +HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) { uint32_t inputaddr; uint32_t outputaddr; @@ -1287,10 +1363,9 @@ HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t /* Process Locked */ __HAL_LOCK(hcryp); - /* Get the buffer addresses and sizes */ hcryp->CrypInCount = Size; - hcryp->pCrypInBuffPtr = pCypherData; - hcryp->pCrypOutBuffPtr = pPlainData; + hcryp->pCrypInBuffPtr = pPlainData; + hcryp->pCrypOutBuffPtr = pCypherData; hcryp->CrypOutCount = Size; /* Change the CRYP state */ @@ -1303,63 +1378,62 @@ HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CTR mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CTR | CRYP_CR_ALGODIR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CTR); /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } - + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -1373,177 +1447,549 @@ HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t return HAL_OK; } + /** - * @brief Initializes the CRYP peripheral in AES ECB encryption mode using DMA. + * @brief Initializes the CRYP peripheral in AES ECB decryption mode using Interrupt. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes * @param pCypherData: Pointer to the cyphertext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pPlainData: Pointer to the plaintext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) { + uint32_t tickstart = 0; + uint32_t inputaddr; uint32_t outputaddr; - if((hcryp->State == HAL_CRYP_STATE_READY) || (hcryp->Phase == HAL_CRYP_PHASE_PROCESS)) + if(hcryp->State == HAL_CRYP_STATE_READY) { /* Process Locked */ __HAL_LOCK(hcryp); - inputaddr = (uint32_t)pPlainData; - outputaddr = (uint32_t)pCypherData; + hcryp->CrypInCount = Size; + hcryp->pCrypInBuffPtr = pCypherData; + hcryp->pCrypOutBuffPtr = pPlainData; + hcryp->CrypOutCount = Size; /* Change the CRYP state */ hcryp->State = HAL_CRYP_STATE_BUSY; - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES Key mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); + + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_SET(hcryp->Instance->SR, CRYP_FLAG_BUSY)) { - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_ECB); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + /* Check for the Timeout */ + if((HAL_GetTick() - tickstart ) > CRYP_TIMEOUT_VALUE) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } } - /* Set the input and output addresses and start DMA transfer */ - CRYP_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); + /* Reset the ALGOMODE bits*/ + CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); + + /* Set the CRYP peripheral in AES ECB decryption mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_ECB | CRYP_CR_ALGODIR); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } + /* Enable Interrupts */ + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); + + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); + /* Return function status */ return HAL_OK; } - else + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { - return HAL_ERROR; + inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + hcryp->pCrypInBuffPtr += 16; + hcryp->CrypInCount -= 16; + if(hcryp->CrypInCount == 0) + { + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); + /* Call the Input data transfer complete callback */ + HAL_CRYP_InCpltCallback(hcryp); + } + } + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) + { + outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; + /* Read the Output block from the Output FIFO */ + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + hcryp->pCrypOutBuffPtr += 16; + hcryp->CrypOutCount -= 16; + if(hcryp->CrypOutCount == 0) + { + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + /* Call Input transfer complete callback */ + HAL_CRYP_OutCpltCallback(hcryp); + } } + + /* Return function status */ + return HAL_OK; } /** - * @brief Initializes the CRYP peripheral in AES CBC encryption mode using DMA. + * @brief Initializes the CRYP peripheral in AES CBC decryption mode using IT. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. * @param pCypherData: Pointer to the cyphertext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 + * @param pPlainData: Pointer to the plaintext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) { + + uint32_t tickstart = 0; uint32_t inputaddr; uint32_t outputaddr; - if((hcryp->State == HAL_CRYP_STATE_READY) || (hcryp->Phase == HAL_CRYP_PHASE_PROCESS)) + if(hcryp->State == HAL_CRYP_STATE_READY) { /* Process Locked */ __HAL_LOCK(hcryp); - inputaddr = (uint32_t)pPlainData; - outputaddr = (uint32_t)pCypherData; + /* Get the buffer addresses and sizes */ + hcryp->CrypInCount = Size; + hcryp->pCrypInBuffPtr = pCypherData; + hcryp->pCrypOutBuffPtr = pPlainData; + hcryp->CrypOutCount = Size; /* Change the CRYP state */ hcryp->State = HAL_CRYP_STATE_BUSY; - + /* Check if initialization phase has already been performed */ if(hcryp->Phase == HAL_CRYP_PHASE_READY) { /* Set the key */ CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CBC); + /* Set the CRYP peripheral in AES Key mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); + + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_SET(hcryp->Instance->SR, CRYP_FLAG_BUSY)) + { + /* Check for the Timeout */ + if((HAL_GetTick() - tickstart ) > CRYP_TIMEOUT_VALUE) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } + + /* Reset the ALGOMODE bits*/ + CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); + + /* Set the CRYP peripheral in AES CBC decryption mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CBC | CRYP_CR_ALGODIR); + /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); - + /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } - /* Set the input and output addresses and start DMA transfer */ - CRYP_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - /* Return function status */ - return HAL_OK; + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } + + /* Enable Interrupts */ + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); + + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); + + /* Return function status */ + return HAL_OK; } - else + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { - return HAL_ERROR; + inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + hcryp->pCrypInBuffPtr += 16; + hcryp->CrypInCount -= 16; + if(hcryp->CrypInCount == 0) + { + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); + /* Call the Input data transfer complete callback */ + HAL_CRYP_InCpltCallback(hcryp); + } + } + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) + { + outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; + /* Read the Output block from the Output FIFO */ + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + hcryp->pCrypOutBuffPtr += 16; + hcryp->CrypOutCount -= 16; + if(hcryp->CrypOutCount == 0) + { + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + /* Call Input transfer complete callback */ + HAL_CRYP_OutCpltCallback(hcryp); + } } + + /* Return function status */ + return HAL_OK; } /** - * @brief Initializes the CRYP peripheral in AES CTR encryption mode using DMA. + * @brief Initializes the CRYP peripheral in AES CTR decryption mode using Interrupt. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16. * @param pCypherData: Pointer to the cyphertext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 + * @param pPlainData: Pointer to the plaintext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) { uint32_t inputaddr; uint32_t outputaddr; - if((hcryp->State == HAL_CRYP_STATE_READY) || (hcryp->Phase == HAL_CRYP_PHASE_PROCESS)) + if(hcryp->State == HAL_CRYP_STATE_READY) { /* Process Locked */ __HAL_LOCK(hcryp); - inputaddr = (uint32_t)pPlainData; - outputaddr = (uint32_t)pCypherData; + /* Get the buffer addresses and sizes */ + hcryp->CrypInCount = Size; + hcryp->pCrypInBuffPtr = pCypherData; + hcryp->pCrypOutBuffPtr = pPlainData; + hcryp->CrypOutCount = Size; + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; - /* Change the CRYP state */ - hcryp->State = HAL_CRYP_STATE_BUSY; - /* Check if initialization phase has already been performed */ if(hcryp->Phase == HAL_CRYP_PHASE_READY) { /* Set the key */ CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CTR); + /* Set the CRYP peripheral in AES CTR mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CTR | CRYP_CR_ALGODIR); /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } - /* Set the input and output addresses and start DMA transfer */ - CRYP_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); + /* Enable Interrupts */ + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); + /* Enable CRYP */ + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { - return HAL_ERROR; - } -} + inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + hcryp->pCrypInBuffPtr += 16; + hcryp->CrypInCount -= 16; + if(hcryp->CrypInCount == 0) + { + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); + /* Call the Input data transfer complete callback */ + HAL_CRYP_InCpltCallback(hcryp); + } + } + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) + { + outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; + /* Read the Output block from the Output FIFO */ + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + hcryp->pCrypOutBuffPtr += 16; + hcryp->CrypOutCount -= 16; + if(hcryp->CrypOutCount == 0) + { + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_READY; + /* Call Input transfer complete callback */ + HAL_CRYP_OutCpltCallback(hcryp); + } + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Initializes the CRYP peripheral in AES ECB encryption mode using DMA. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 bytes + * @param pCypherData: Pointer to the cyphertext buffer + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +{ + uint32_t inputaddr; + uint32_t outputaddr; + + if((hcryp->State == HAL_CRYP_STATE_READY) || (hcryp->Phase == HAL_CRYP_PHASE_PROCESS)) + { + /* Process Locked */ + __HAL_LOCK(hcryp); + + inputaddr = (uint32_t)pPlainData; + outputaddr = (uint32_t)pCypherData; + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_ECB); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } + /* Set the input and output addresses and start DMA transfer */ + CRYP_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + /* Return function status */ + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Initializes the CRYP peripheral in AES CBC encryption mode using DMA. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pCypherData: Pointer to the cyphertext buffer + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +{ + uint32_t inputaddr; + uint32_t outputaddr; + + if((hcryp->State == HAL_CRYP_STATE_READY) || (hcryp->Phase == HAL_CRYP_PHASE_PROCESS)) + { + /* Process Locked */ + __HAL_LOCK(hcryp); + + inputaddr = (uint32_t)pPlainData; + outputaddr = (uint32_t)pCypherData; + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CBC); + + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } + /* Set the input and output addresses and start DMA transfer */ + CRYP_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + /* Return function status */ + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Initializes the CRYP peripheral in AES CTR encryption mode using DMA. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16. + * @param pCypherData: Pointer to the cyphertext buffer + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +{ + uint32_t inputaddr; + uint32_t outputaddr; + + if((hcryp->State == HAL_CRYP_STATE_READY) || (hcryp->Phase == HAL_CRYP_PHASE_PROCESS)) + { + /* Process Locked */ + __HAL_LOCK(hcryp); + + inputaddr = (uint32_t)pPlainData; + outputaddr = (uint32_t)pCypherData; + + /* Change the CRYP state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /* Set the key */ + CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES ECB mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CTR); + + /* Set the Initialization Vector */ + CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; + } + + /* Set the input and output addresses and start DMA transfer */ + CRYP_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + /* Return function status */ + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} /** * @brief Initializes the CRYP peripheral in AES ECB decryption mode using DMA. @@ -1578,15 +2024,15 @@ HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES Key mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_SET(CRYP->SR, CRYP_FLAG_BUSY)) + while(HAL_IS_BIT_SET(hcryp->Instance->SR, CRYP_FLAG_BUSY)) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYP_TIMEOUT_VALUE) @@ -1605,10 +2051,10 @@ HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); /* Set the CRYP peripheral in AES ECB decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_ECB | CRYP_CR_ALGODIR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_ECB | CRYP_CR_ALGODIR); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1662,15 +2108,15 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES Key mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_KEY | CRYP_CR_ALGODIR); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_SET(CRYP->SR, CRYP_FLAG_BUSY)) + while(HAL_IS_BIT_SET(hcryp->Instance->SR, CRYP_FLAG_BUSY)) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYP_TIMEOUT_VALUE) @@ -1689,13 +2135,13 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t CRYP->CR &= (uint32_t)(~CRYP_CR_ALGOMODE); /* Set the CRYP peripheral in AES CBC decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CBC | CRYP_CR_ALGODIR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CBC | CRYP_CR_ALGODIR); /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1748,13 +2194,13 @@ HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CTR mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CTR | CRYP_CR_ALGODIR); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CTR | CRYP_CR_ALGODIR); /* Set the Initialization Vector */ CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1779,7 +2225,8 @@ HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t /** * @} */ -/** @defgroup CRYP_Group3 DES processing functions + +/** @defgroup CRYP_Exported_Functions_Group3 DES processing functions * @brief processing functions. * @verbatim @@ -1820,7 +2267,7 @@ HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pP CRYP_SetDESECBMode(hcryp, 0); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Plain Data and Get Cypher Data */ if(CRYP_ProcessData2Words(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) @@ -1860,7 +2307,7 @@ HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pP CRYP_SetDESECBMode(hcryp, CRYP_CR_ALGODIR); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Plain Data and Get Cypher Data */ if(CRYP_ProcessData2Words(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) @@ -1900,7 +2347,7 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pP CRYP_SetDESCBCMode(hcryp, 0); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Plain Data and Get Cypher Data */ if(CRYP_ProcessData2Words(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) @@ -1940,7 +2387,7 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pP CRYP_SetDESCBCMode(hcryp, CRYP_CR_ALGODIR); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Plain Data and Get Cypher Data */ if(CRYP_ProcessData2Words(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) @@ -1989,47 +2436,47 @@ HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetDESECBMode(hcryp, 0); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { /* Disable IT */ - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2074,48 +2521,48 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetDESCBCMode(hcryp, 0); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { /* Disable IT */ - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2160,47 +2607,47 @@ HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetDESECBMode(hcryp, CRYP_CR_ALGODIR); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { /* Disable IT */ - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2245,47 +2692,47 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetDESCBCMode(hcryp, CRYP_CR_ALGODIR); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { /* Disable IT */ - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2394,7 +2841,7 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t * @param pCypherData: Pointer to the cyphertext buffer * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData) +HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData) { uint32_t inputaddr; uint32_t outputaddr; @@ -2475,7 +2922,7 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t * @} */ -/** @defgroup CRYP_Group4 TDES processing functions +/** @defgroup CRYP_Exported_Functions_Group4 TDES processing functions * @brief processing functions. * @verbatim @@ -2517,7 +2964,7 @@ HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *p CRYP_SetTDESECBMode(hcryp, 0); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Plain Data and Get Cypher Data */ if(CRYP_ProcessData2Words(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) @@ -2558,7 +3005,7 @@ HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *p CRYP_SetTDESECBMode(hcryp, CRYP_CR_ALGODIR); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Cypher Data and Get Plain Data */ if(CRYP_ProcessData2Words(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) @@ -2599,7 +3046,7 @@ HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *p CRYP_SetTDESCBCMode(hcryp, 0); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Plain Data and Get Cypher Data */ if(CRYP_ProcessData2Words(hcryp, pPlainData, Size, pCypherData, Timeout) != HAL_OK) @@ -2640,7 +3087,7 @@ HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *p CRYP_SetTDESCBCMode(hcryp, CRYP_CR_ALGODIR); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write Cypher Data and Get Plain Data */ if(CRYP_ProcessData2Words(hcryp, pCypherData, Size, pPlainData, Timeout) != HAL_OK) @@ -2689,47 +3136,47 @@ HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetTDESECBMode(hcryp, 0); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { /* Disable IT */ - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2774,46 +3221,46 @@ HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetTDESCBCMode(hcryp, 0); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2858,46 +3305,46 @@ HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetTDESECBMode(hcryp, CRYP_CR_ALGODIR); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -2942,46 +3389,46 @@ HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t CRYP_SetTDESCBCMode(hcryp, CRYP_CR_ALGODIR); /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable CRYP */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if(__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 8; hcryp->CrypInCount -= 8; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if(__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if(__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 8; hcryp->CrypOutCount -= 8; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Disable CRYP */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP state */ @@ -3171,7 +3618,7 @@ HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_ * @} */ -/** @defgroup CRYP_Group5 DMA callback functions +/** @defgroup CRYP_Exported_Functions_Group5 DMA callback functions * @brief DMA callback functions. * @verbatim @@ -3230,7 +3677,7 @@ __weak void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp) * @} */ -/** @defgroup CRYP_Group6 CRYP IRQ handler management +/** @defgroup CRYP_Exported_Functions_Group6 CRYP IRQ handler management * @brief CRYP IRQ handler. * @verbatim @@ -3302,11 +3749,11 @@ void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp) break; case CRYP_CR_ALGOMODE_AES_CTR_ENCRYPT: - HAL_CRYP_AESCTR_Encrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); + HAL_CRYP_AESCTR_Encrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); break; case CRYP_CR_ALGOMODE_AES_CTR_DECRYPT: - HAL_CRYP_AESCTR_Decrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); + HAL_CRYP_AESCTR_Decrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); break; default: @@ -3318,7 +3765,7 @@ void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp) * @} */ -/** @defgroup CRYP_Group7 Peripheral State functions +/** @defgroup CRYP_Exported_Functions_Group7 Peripheral State functions * @brief Peripheral State functions. * @verbatim @@ -3347,424 +3794,6 @@ HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp) * @} */ -/** - * @brief DMA CRYP Input Data process complete callback. - * @param hdma: DMA handle - * @retval None - */ -static void CRYP_DMAInCplt(DMA_HandleTypeDef *hdma) -{ - CRYP_HandleTypeDef* hcryp = (CRYP_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - - /* Disable the DMA transfer for input FIFO request by resetting the DIEN bit - in the DMACR register */ - CRYP->DMACR &= (uint32_t)(~CRYP_DMACR_DIEN); - - /* Call input data transfer complete callback */ - HAL_CRYP_InCpltCallback(hcryp); -} - -/** - * @brief DMA CRYP Output Data process complete callback. - * @param hdma: DMA handle - * @retval None - */ -static void CRYP_DMAOutCplt(DMA_HandleTypeDef *hdma) -{ - CRYP_HandleTypeDef* hcryp = (CRYP_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - - /* Disable the DMA transfer for output FIFO request by resetting the DOEN bit - in the DMACR register */ - CRYP->DMACR &= (uint32_t)(~CRYP_DMACR_DOEN); - - /* Disable CRYP */ - __HAL_CRYP_DISABLE(); - - /* Change the CRYP state to ready */ - hcryp->State = HAL_CRYP_STATE_READY; - - /* Call output data transfer complete callback */ - HAL_CRYP_OutCpltCallback(hcryp); -} - -/** - * @brief DMA CRYP communication error callback. - * @param hdma: DMA handle - * @retval None - */ -static void CRYP_DMAError(DMA_HandleTypeDef *hdma) -{ - CRYP_HandleTypeDef* hcryp = (CRYP_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - hcryp->State= HAL_CRYP_STATE_READY; - HAL_CRYP_ErrorCallback(hcryp); -} - -/** - * @brief Writes the Key in Key registers. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Key: Pointer to Key buffer - * @param KeySize: Size of Key - * @retval None - */ -static void CRYP_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize) -{ - uint32_t keyaddr = (uint32_t)Key; - - switch(KeySize) - { - case CRYP_KEYSIZE_256B: - /* Key Initialisation */ - CRYP->K0LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K0RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K1LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K1RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3RR = __REV(*(uint32_t*)(keyaddr)); - break; - case CRYP_KEYSIZE_192B: - CRYP->K1LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K1RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3RR = __REV(*(uint32_t*)(keyaddr)); - break; - case CRYP_KEYSIZE_128B: - CRYP->K2LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3RR = __REV(*(uint32_t*)(keyaddr)); - break; - default: - break; - } -} - -/** - * @brief Writes the InitVector/InitCounter in IV registers. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param InitVector: Pointer to InitVector/InitCounter buffer - * @param IVSize: Size of the InitVector/InitCounter - * @retval None - */ -static void CRYP_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector, uint32_t IVSize) -{ - uint32_t ivaddr = (uint32_t)InitVector; - - switch(IVSize) - { - case CRYP_KEYSIZE_128B: - CRYP->IV0LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV0RR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV1LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV1RR = __REV(*(uint32_t*)(ivaddr)); - break; - /* Whatever key size 192 or 256, Init vector is written in IV0LR and IV0RR */ - case CRYP_KEYSIZE_192B: - CRYP->IV0LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV0RR = __REV(*(uint32_t*)(ivaddr)); - break; - case CRYP_KEYSIZE_256B: - CRYP->IV0LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV0RR = __REV(*(uint32_t*)(ivaddr)); - break; - default: - break; - } -} - -/** - * @brief Process Data: Writes Input data in polling mode and read the output data - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Input: Pointer to the Input buffer - * @param Ilength: Length of the Input buffer, must be a multiple of 16. - * @param Output: Pointer to the returned buffer - * @retval None - */ -static HAL_StatusTypeDef CRYP_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint8_t* Output, uint32_t Timeout) -{ - uint32_t tickstart = 0; - - uint32_t i = 0; - uint32_t inputaddr = (uint32_t)Input; - uint32_t outputaddr = (uint32_t)Output; - - for(i=0; (i < Ilength); i+=16) - { - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_OFNE)) - { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) - { - if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - } - /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - } - /* Return function status */ - return HAL_OK; -} - -/** - * @brief Process Data: Write Input data in polling mode. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Input: Pointer to the Input buffer - * @param Ilength: Length of the Input buffer, must be a multiple of 8 - * @param Output: Pointer to the returned buffer - * @param Timeout: Specify Timeout value - * @retval None - */ -static HAL_StatusTypeDef CRYP_ProcessData2Words(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint8_t* Output, uint32_t Timeout) -{ - uint32_t tickstart = 0; - - uint32_t i = 0; - uint32_t inputaddr = (uint32_t)Input; - uint32_t outputaddr = (uint32_t)Output; - - for(i=0; (i < Ilength); i+=8) - { - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_OFNE)) - { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) - { - if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - } - /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - } - /* Return function status */ - return HAL_OK; -} - -/** - * @brief Set the DMA configuration and start the DMA transfer - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param inputaddr: address of the Input buffer - * @param Size: Size of the Input buffer, must be a multiple of 16. - * @param outputaddr: address of the Output buffer - * @retval None - */ -static void CRYP_SetDMAConfig(CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr) -{ - /* Set the CRYP DMA transfer complete callback */ - hcryp->hdmain->XferCpltCallback = CRYP_DMAInCplt; - /* Set the DMA error callback */ - hcryp->hdmain->XferErrorCallback = CRYP_DMAError; - - /* Set the CRYP DMA transfer complete callback */ - hcryp->hdmaout->XferCpltCallback = CRYP_DMAOutCplt; - /* Set the DMA error callback */ - hcryp->hdmaout->XferErrorCallback = CRYP_DMAError; - - /* Enable CRYP */ - __HAL_CRYP_ENABLE(); - - /* Enable the DMA In DMA Stream */ - HAL_DMA_Start_IT(hcryp->hdmain, inputaddr, (uint32_t)&CRYP->DR, Size/4); - - /* Enable In DMA request */ - CRYP->DMACR = (CRYP_DMACR_DIEN); - - /* Enable the DMA Out DMA Stream */ - HAL_DMA_Start_IT(hcryp->hdmaout, (uint32_t)&CRYP->DOUT, outputaddr, Size/4); - - /* Enable Out DMA request */ - CRYP->DMACR |= CRYP_DMACR_DOEN; - -} - -/** - * @brief Sets the CRYP peripheral in DES ECB mode. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Direction: Encryption or decryption - * @retval None - */ -static void CRYP_SetDESECBMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) -{ - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_DES_ECB | Direction); - - /* Set the key */ - CRYP->K1LR = __REV(*(uint32_t*)(hcryp->Init.pKey)); - CRYP->K1RR = __REV(*(uint32_t*)(hcryp->Init.pKey+4)); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } -} - -/** - * @brief Sets the CRYP peripheral in DES CBC mode. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Direction: Encryption or decryption - * @retval None - */ -static void CRYP_SetDESCBCMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) -{ - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_DES_CBC | Direction); - - /* Set the key */ - CRYP->K1LR = __REV(*(uint32_t*)(hcryp->Init.pKey)); - CRYP->K1RR = __REV(*(uint32_t*)(hcryp->Init.pKey+4)); - - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_256B); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } -} - -/** - * @brief Sets the CRYP peripheral in TDES ECB mode. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Direction: Encryption or decryption - * @retval None - */ -static void CRYP_SetTDESECBMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) -{ - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the CRYP peripheral in AES ECB mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_TDES_ECB | Direction); - - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, CRYP_KEYSIZE_192B); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } -} - -/** - * @brief Sets the CRYP peripheral in TDES CBC mode - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Direction: Encryption or decryption - * @retval None - */ -static void CRYP_SetTDESCBCMode(CRYP_HandleTypeDef *hcryp, uint32_t Direction) -{ - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) - { - /* Set the CRYP peripheral in AES CBC mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_TDES_CBC | Direction); - - /* Set the key */ - CRYP_SetKey(hcryp, hcryp->Init.pKey, CRYP_KEYSIZE_192B); - - /* Set the Initialization Vector */ - CRYP_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_256B); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } -} /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.h index 3dbafea22da..e1e39c6a5ec 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_cryp.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of CRYP HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -57,16 +57,21 @@ /* Exported types ------------------------------------------------------------*/ -/** - * @brief CRYP Configuration Structure definition +/** @defgroup CRYP_Exported_Types CRYP Exported Types + * @{ + */ + +/** @defgroup CRYP_Exported_Types_Group1 CRYP Configuration Structure definition + * @{ */ + typedef struct { uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string. - This parameter can be a value of @ref CRYP_Data_Type */ + This parameter can be a value of @ref CRYP CRYP_Data_Type */ uint32_t KeySize; /*!< Used only in AES mode only : 128, 192 or 256 bit key length. - This parameter can be a value of @ref CRYP_Key_Size */ + This parameter can be a value of @ref CRYP CRYP_Key_Size */ uint8_t* pKey; /*!< The key used for encryption/decryption */ @@ -83,15 +88,21 @@ typedef struct uint8_t* Header; /*!< The header used in GCM and CCM modes */ - uint16_t HeaderSize; /*!< The size of header buffer in bytes */ + uint32_t HeaderSize; /*!< The size of header buffer in bytes */ uint8_t* pScratch; /*!< Scratch buffer used to append the header. It's size must be equal to header size + 21 bytes. This parameter is used only in AES-128/192/256 encryption/decryption CCM mode */ }CRYP_InitTypeDef; /** - * @brief HAL CRYP State structures definition + * @} + */ + +/** @defgroup CRYP_Exported_Types_Group2 CRYP State structures definition + * @{ */ + + typedef enum { HAL_CRYP_STATE_RESET = 0x00, /*!< CRYP not yet initialized or disabled */ @@ -102,8 +113,14 @@ typedef enum }HAL_CRYP_STATETypeDef; /** - * @brief HAL CRYP phase structures definition + * @} */ + +/** @defgroup CRYP_Exported_Types_Group3 CRYP phase structures definition + * @{ + */ + + typedef enum { HAL_CRYP_PHASE_READY = 0x01, /*!< CRYP peripheral is ready for initialization. */ @@ -113,10 +130,17 @@ typedef enum }HAL_PhaseTypeDef; /** - * @brief CRYP handle Structure definition - */ + * @} + */ + +/** @defgroup CRYP_Exported_Types_Group4 CRYP handle Structure definition + * @{ + */ + typedef struct { + CRYP_TypeDef *Instance; /*!< CRYP registers base address */ + CRYP_InitTypeDef Init; /*!< CRYP required parameters */ uint8_t *pCrypInBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ @@ -125,7 +149,7 @@ typedef struct __IO uint16_t CrypInCount; /*!< Counter of inputed data */ - __IO uint16_t CrypOutCount; /*!< Counter of outputed data */ + __IO uint16_t CrypOutCount; /*!< Counter of outputted data */ HAL_StatusTypeDef Status; /*!< CRYP peripheral status */ @@ -140,45 +164,43 @@ typedef struct __IO HAL_CRYP_STATETypeDef State; /*!< CRYP peripheral state */ }CRYP_HandleTypeDef; -/* Exported constants --------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup CRYP_Exported_Constants +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup CRYP_Exported_Constants CRYP Exported Constants * @{ */ -/** @defgroup CRYP_Key_Size +/** @defgroup CRYP_Exported_Constants_Group1 CRYP CRYP_Key_Size * @{ */ #define CRYP_KEYSIZE_128B ((uint32_t)0x00000000) #define CRYP_KEYSIZE_192B CRYP_CR_KEYSIZE_0 #define CRYP_KEYSIZE_256B CRYP_CR_KEYSIZE_1 - -#define IS_CRYP_KEYSIZE(KEYSIZE) (((KEYSIZE) == CRYP_KEYSIZE_128B) || \ - ((KEYSIZE) == CRYP_KEYSIZE_192B) || \ - ((KEYSIZE) == CRYP_KEYSIZE_256B)) -/** +/** * @} */ -/** @defgroup CRYP_Data_Type +/** @defgroup CRYP_Exported_Constants_Group2 CRYP CRYP_Data_Type * @{ */ #define CRYP_DATATYPE_32B ((uint32_t)0x00000000) #define CRYP_DATATYPE_16B CRYP_CR_DATATYPE_0 #define CRYP_DATATYPE_8B CRYP_CR_DATATYPE_1 #define CRYP_DATATYPE_1B CRYP_CR_DATATYPE - -#define IS_CRYP_DATATYPE(DATATYPE) (((DATATYPE) == CRYP_DATATYPE_32B) || \ - ((DATATYPE) == CRYP_DATATYPE_16B) || \ - ((DATATYPE) == CRYP_DATATYPE_8B) || \ - ((DATATYPE) == CRYP_DATATYPE_1B)) -/** +/** * @} */ -/** @defgroup CRYP_AlgoModeDirection +/** @defgroup CRYP_Exported_Constants_Group3 CRYP CRYP_AlgoModeDirection * @{ - */ + */ #define CRYP_CR_ALGOMODE_DIRECTION ((uint32_t)0x0008003C) #define CRYP_CR_ALGOMODE_TDES_ECB_ENCRYPT ((uint32_t)0x00000000) #define CRYP_CR_ALGOMODE_TDES_ECB_DECRYPT ((uint32_t)0x00000004) @@ -198,7 +220,7 @@ typedef struct * @} */ -/** @defgroup CRYP_Interrupt +/** @defgroup CRYP_Exported_Constants_Group4 CRYP CRYP_Interrupt * @{ */ #define CRYP_IT_INI ((uint32_t)CRYP_IMSCR_INIM) /*!< Input FIFO Interrupt */ @@ -207,10 +229,9 @@ typedef struct * @} */ -/** @defgroup CRYP_Flags +/** @defgroup CRYP_Exported_Constants_Group5 CRYP CRYP_Flags * @{ */ - #define CRYP_FLAG_BUSY ((uint32_t)0x00000010) /*!< The CRYP core is currently processing a block of data or a key preparation (for @@ -232,7 +253,10 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup CRYP_Exported_Macros CRYP Exported Macros + * @{ + */ + /** @brief Reset CRYP handle state * @param __HANDLE__: specifies the CRYP handle. * @retval None @@ -241,27 +265,29 @@ typedef struct /** * @brief Enable/Disable the CRYP peripheral. - * @param None + * @param __HANDLE__: specifies the CRYP handle. * @retval None */ -#define __HAL_CRYP_ENABLE() (CRYP->CR |= CRYP_CR_CRYPEN) -#define __HAL_CRYP_DISABLE() (CRYP->CR &= ~CRYP_CR_CRYPEN) +#define __HAL_CRYP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRYP_CR_CRYPEN) +#define __HAL_CRYP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~CRYP_CR_CRYPEN) /** * @brief Flush the data FIFO. - * @param None + * @param __HANDLE__: specifies the CRYP handle. * @retval None */ -#define __HAL_CRYP_FIFO_FLUSH() (CRYP->CR |= CRYP_CR_FFLUSH) +#define __HAL_CRYP_FIFO_FLUSH(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRYP_CR_FFLUSH) /** * @brief Set the algorithm mode: AES-ECB, AES-CBC, AES-CTR, DES-ECB, DES-CBC. + * @param __HANDLE__: specifies the CRYP handle. * @param MODE: The algorithm mode. * @retval None */ -#define __HAL_CRYP_SET_MODE(MODE) CRYP->CR |= (uint32_t)(MODE) +#define __HAL_CRYP_SET_MODE(__HANDLE__, MODE) ((__HANDLE__)->Instance->CR |= (uint32_t)(MODE)) /** @brief Check whether the specified CRYP flag is set or not. + * @param __HANDLE__: specifies the CRYP handle. * @param __FLAG__: specifies the flag to check. * This parameter can be one of the following values: * @arg CRYP_FLAG_BUSY: The CRYP core is currently processing a block of data @@ -274,41 +300,62 @@ typedef struct * @arg CRYP_FLAG_OUTRIS: Input FIFO service raw interrupt is pending * @retval The new state of __FLAG__ (TRUE or FALSE). */ -#define CRYP_FLAG_MASK ((uint32_t)0x0000001F) -#define __HAL_CRYP_GET_FLAG(__FLAG__) ((((uint8_t)((__FLAG__) >> 24)) == 0x01)?(((CRYP->RISR) & ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK)): \ - (((CRYP->RISR) & ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK))) + +#define __HAL_CRYP_GET_FLAG(__HANDLE__, __FLAG__) ((((uint8_t)((__FLAG__) >> 24)) == 0x01)?((((__HANDLE__)->Instance->RISR) & ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK)): \ + ((((__HANDLE__)->Instance->RISR) & ((__FLAG__) & CRYP_FLAG_MASK)) == ((__FLAG__) & CRYP_FLAG_MASK))) /** @brief Check whether the specified CRYP interrupt is set or not. + * @param __HANDLE__: specifies the CRYP handle. * @param __INTERRUPT__: specifies the interrupt to check. * This parameter can be one of the following values: * @arg CRYP_IT_INRIS: Input FIFO service raw interrupt is pending * @arg CRYP_IT_OUTRIS: Output FIFO service raw interrupt is pending * @retval The new state of __INTERRUPT__ (TRUE or FALSE). */ -#define __HAL_CRYP_GET_IT(__INTERRUPT__) ((CRYP->MISR & (__INTERRUPT__)) == (__INTERRUPT__)) +#define __HAL_CRYP_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->MISR & (__INTERRUPT__)) == (__INTERRUPT__)) /** * @brief Enable the CRYP interrupt. + * @param __HANDLE__: specifies the CRYP handle. * @param __INTERRUPT__: CRYP Interrupt. * @retval None */ -#define __HAL_CRYP_ENABLE_IT(__INTERRUPT__) ((CRYP->IMSCR) |= (__INTERRUPT__)) +#define __HAL_CRYP_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) |= (__INTERRUPT__)) /** * @brief Disable the CRYP interrupt. + * @param __HANDLE__: specifies the CRYP handle. * @param __INTERRUPT__: CRYP interrupt. * @retval None */ -#define __HAL_CRYP_DISABLE_IT(__INTERRUPT__) ((CRYP->IMSCR) &= ~(__INTERRUPT__)) +#define __HAL_CRYP_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IMSCR) &= ~(__INTERRUPT__)) +/** + * @} + */ + /* Include CRYP HAL Extension module */ #include "stm32f4xx_hal_cryp_ex.h" /* Exported functions --------------------------------------------------------*/ -/* Initialization/de-initialization functions ********************************/ +/** @defgroup CRYP_Exported_Functions CRYP Exported Functions + * @{ + */ + +/** @addtogroup CRYP_Exported_Functions_Group1 + * @{ + */ HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp); HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp); +void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); +void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); +/** + * @} + */ +/** @addtogroup CRYP_Exported_Functions_Group2 + * @{ + */ /* AES encryption/decryption using polling ***********************************/ HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); @@ -332,7 +379,13 @@ HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); +/** + * @} + */ +/** @addtogroup CRYP_Exported_Functions_Group3 + * @{ + */ /* DES encryption/decryption using polling ***********************************/ HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); @@ -347,10 +400,16 @@ HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t /* DES encryption/decryption using DMA ***************************************/ HAL_StatusTypeDef HAL_CRYP_DESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); -HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); +HAL_StatusTypeDef HAL_CRYP_DESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); HAL_StatusTypeDef HAL_CRYP_DESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); HAL_StatusTypeDef HAL_CRYP_DESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); +/** + * @} + */ +/** @addtogroup CRYP_Exported_Functions_Group4 + * @{ + */ /* TDES encryption/decryption using polling **********************************/ HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); @@ -368,22 +427,96 @@ HAL_StatusTypeDef HAL_CRYP_TDESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_ HAL_StatusTypeDef HAL_CRYP_TDESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); HAL_StatusTypeDef HAL_CRYP_TDESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); HAL_StatusTypeDef HAL_CRYP_TDESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); +/** + * @} + */ -/* Processing functions ******************************************************/ +/** @addtogroup CRYP_Exported_Functions_Group5 + * @{ + */ +void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); +void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); +void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); +/** + * @} + */ + +/** @addtogroup CRYP_Exported_Functions_Group6 + * @{ + */ void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp); +/** + * @} + */ -/* Peripheral State functions ************************************************/ +/** @addtogroup CRYP_Exported_Functions_Group7 + * @{ + */ HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp); +/** + * @} + */ + +/** + * @} + */ -/* MSP functions *************************************************************/ -void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); -void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); +/* Private types -------------------------------------------------------------*/ +/** @defgroup CRYP_Private_Types CRYP Private Types + * @{ + */ -/* CallBack functions ********************************************************/ -void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); -void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); -void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup CRYP_Private_Variables CRYP Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup CRYP_Private_Constants CRYP Private Constants + * @{ + */ +#define CRYP_FLAG_MASK ((uint32_t)0x0000001F) +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CRYP_Private_Macros CRYP Private Macros + * @{ + */ + +#define IS_CRYP_KEYSIZE(__KEYSIZE__) (((__KEYSIZE__) == CRYP_KEYSIZE_128B) || \ + ((__KEYSIZE__) == CRYP_KEYSIZE_192B) || \ + ((__KEYSIZE__) == CRYP_KEYSIZE_256B)) + +#define IS_CRYP_DATATYPE(__DATATYPE__) (((__DATATYPE__) == CRYP_DATATYPE_32B) || \ + ((__DATATYPE__) == CRYP_DATATYPE_16B) || \ + ((__DATATYPE__) == CRYP_DATATYPE_8B) || \ + ((__DATATYPE__) == CRYP_DATATYPE_1B)) + + + /** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup CRYP_Private_Functions CRYP Private Functions + * @{ + */ + +/** + * @} + */ + #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.c index bc4b7bf4a5b..ac900e8b4a8 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_cryp_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Extended CRYP HAL module driver * This file provides firmware functions to manage the following * functionalities of CRYP extension peripheral: @@ -16,7 +16,7 @@ [..] The CRYP Extension HAL driver can be used as follows: (#)Initialize the CRYP low level resources by implementing the HAL_CRYP_MspInit(): - (##) Enable the CRYP interface clock using __CRYP_CLK_ENABLE() + (##) Enable the CRYP interface clock using __HAL_RCC_CRYP_CLK_ENABLE() (##) In case of using interrupts (e.g. HAL_CRYPEx_AESGCM_Encrypt_IT()) (+++) Configure the CRYP interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the CRYP IRQ handler using HAL_NVIC_EnableIRQ() @@ -26,7 +26,7 @@ (+++) Configure and enable two DMA streams one for managing data transfer from memory to peripheral (input stream) and another stream for managing data transfer from peripheral to memory (output stream) - (+++) Associate the initilalized DMA handle to the CRYP DMA handle + (+++) Associate the initialized DMA handle to the CRYP DMA handle using __HAL_LINKDMA() (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the two DMA Streams. The output stream should have higher @@ -60,13 +60,16 @@ Call those functions after the processing ones (polling, interrupt or DMA). e.g. in AES-CCM mode call HAL_CRYPEx_AESCCM_Encrypt() to encrypt the plain data then call HAL_CRYPEx_AESCCM_Finish() to get the authentication message + @note: For CCM Encrypt/Decrypt API's, only DataType = 8-bit is supported by this version. + @note: The HAL_CRYPEx_AESGCM_xxxx() implementation is limited to 32bits inputs data length + (Plain/Cyphertext, Header) compared with GCM standards specifications (800-38D). (#)Call HAL_CRYP_DeInit() to deinitialize the CRYP peripheral. @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -100,7 +103,7 @@ * @{ */ -/** @defgroup CRYPEx +/** @defgroup CRYPEx CRYPEx * @brief CRYP Extension HAL module driver. * @{ */ @@ -111,11 +114,21 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup CRYPEx_Private_define + * @{ + */ #define CRYPEx_TIMEOUT_VALUE 1 +/** + * @} + */ + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -static void CRYPEx_GCMCCM_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector, uint32_t IVSize); +/** @defgroup CRYPEx_Private_Functions_prototypes CRYP Private Functions Prototypes + * @{ + */ +static void CRYPEx_GCMCCM_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector); static void CRYPEx_GCMCCM_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize); static HAL_StatusTypeDef CRYPEx_GCMCCM_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t *Input, uint16_t Ilength, uint8_t *Output, uint32_t Timeout); static HAL_StatusTypeDef CRYPEx_GCMCCM_SetHeaderPhase(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint32_t Timeout); @@ -123,116 +136,441 @@ static void CRYPEx_GCMCCM_DMAInCplt(DMA_HandleTypeDef *hdma); static void CRYPEx_GCMCCM_DMAOutCplt(DMA_HandleTypeDef *hdma); static void CRYPEx_GCMCCM_DMAError(DMA_HandleTypeDef *hdma); static void CRYPEx_GCMCCM_SetDMAConfig(CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr); - +/** + * @} + */ + /* Private functions ---------------------------------------------------------*/ - -/** @defgroup CRYPEx_Private_Functions +/** @addtogroup CRYPEx_Private_Functions * @{ */ -/** @defgroup CRYPEx_Group1 Extended AES processing functions - * @brief Extended processing functions. - * -@verbatim - ============================================================================== - ##### Extended AES processing functions ##### - ============================================================================== - [..] This section provides functions allowing to: - (+) Encrypt plaintext using AES-128/192/256 using GCM and CCM chaining modes - (+) Decrypt cyphertext using AES-128/192/256 using GCM and CCM chaining modes - (+) Finish the processing. This function is available only for GCM and CCM - [..] Three processing methods are available: - (+) Polling mode - (+) Interrupt mode - (+) DMA mode +/** + * @brief DMA CRYP Input Data process complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void CRYPEx_GCMCCM_DMAInCplt(DMA_HandleTypeDef *hdma) +{ + CRYP_HandleTypeDef* hcryp = ( CRYP_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Disable the DMA transfer for input Fifo request by resetting the DIEN bit + in the DMACR register */ + hcryp->Instance->DMACR &= (uint32_t)(~CRYP_DMACR_DIEN); + + /* Call input data transfer complete callback */ + HAL_CRYP_InCpltCallback(hcryp); +} -@endverbatim - * @{ +/** + * @brief DMA CRYP Output Data process complete callback. + * @param hdma: DMA handle + * @retval None */ +static void CRYPEx_GCMCCM_DMAOutCplt(DMA_HandleTypeDef *hdma) +{ + CRYP_HandleTypeDef* hcryp = ( CRYP_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Disable the DMA transfer for output Fifo request by resetting the DOEN bit + in the DMACR register */ + hcryp->Instance->DMACR &= (uint32_t)(~CRYP_DMACR_DOEN); + + /* Enable the CRYP peripheral */ + __HAL_CRYP_DISABLE(hcryp); + + /* Change the CRYP peripheral state */ + hcryp->State = HAL_CRYP_STATE_READY; + + /* Call output data transfer complete callback */ + HAL_CRYP_OutCpltCallback(hcryp); +} +/** + * @brief DMA CRYP communication error callback. + * @param hdma: DMA handle + * @retval None + */ +static void CRYPEx_GCMCCM_DMAError(DMA_HandleTypeDef *hdma) +{ + CRYP_HandleTypeDef* hcryp = ( CRYP_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + hcryp->State= HAL_CRYP_STATE_READY; + HAL_CRYP_ErrorCallback(hcryp); +} /** - * @brief Initializes the CRYP peripheral in AES CCM encryption mode then - * encrypt pPlainData. The cypher data are available in pCypherData. + * @brief Writes the Key in Key registers. * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param pPlainData: Pointer to the plaintext buffer - * @param Size: Length of the plaintext buffer, must be a multiple of 16 - * @param pCypherData: Pointer to the cyphertext buffer - * @param Timeout: Timeout duration - * @retval HAL status + * @param Key: Pointer to Key buffer + * @param KeySize: Size of Key + * @retval None */ -HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +static void CRYPEx_GCMCCM_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize) { - uint32_t tickstart = 0; - uint32_t headersize = hcryp->Init.HeaderSize; - uint32_t headeraddr = (uint32_t)hcryp->Init.Header; - uint32_t loopcounter = 0; - uint32_t bufferidx = 0; - uint8_t blockb0[16] = {0};/* Block B0 */ - uint8_t ctr[16] = {0}; /* Counter */ - uint32_t b0addr = (uint32_t)blockb0; + uint32_t keyaddr = (uint32_t)Key; - /* Process Locked */ - __HAL_LOCK(hcryp); + switch(KeySize) + { + case CRYP_KEYSIZE_256B: + /* Key Initialisation */ + hcryp->Instance->K0LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K0RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K1LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K1RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3RR = __REV(*(uint32_t*)(keyaddr)); + break; + case CRYP_KEYSIZE_192B: + hcryp->Instance->K1LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K1RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3RR = __REV(*(uint32_t*)(keyaddr)); + break; + case CRYP_KEYSIZE_128B: + hcryp->Instance->K2LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K2RR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3LR = __REV(*(uint32_t*)(keyaddr)); + keyaddr+=4; + hcryp->Instance->K3RR = __REV(*(uint32_t*)(keyaddr)); + break; + default: + break; + } +} + +/** + * @brief Writes the InitVector/InitCounter in IV registers. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param InitVector: Pointer to InitVector/InitCounter buffer + * @retval None + */ +static void CRYPEx_GCMCCM_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector) +{ + uint32_t ivaddr = (uint32_t)InitVector; - /* Change the CRYP peripheral state */ - hcryp->State = HAL_CRYP_STATE_BUSY; + hcryp->Instance->IV0LR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV0RR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV1LR = __REV(*(uint32_t*)(ivaddr)); + ivaddr+=4; + hcryp->Instance->IV1RR = __REV(*(uint32_t*)(ivaddr)); +} + +/** + * @brief Process Data: Writes Input data in polling mode and read the Output data. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param Input: Pointer to the Input buffer. + * @param Ilength: Length of the Input buffer, must be a multiple of 16 + * @param Output: Pointer to the returned buffer + * @param Timeout: Timeout value + * @retval None + */ +static HAL_StatusTypeDef CRYPEx_GCMCCM_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t *Input, uint16_t Ilength, uint8_t *Output, uint32_t Timeout) +{ + uint32_t tickstart = 0; + uint32_t i = 0; + uint32_t inputaddr = (uint32_t)Input; + uint32_t outputaddr = (uint32_t)Output; - /* Check if initialization phase has already been performed */ - if(hcryp->Phase == HAL_CRYP_PHASE_READY) + for(i=0; (i < Ilength); i+=16) { - /************************ Formatting the header block *********************/ - if(headersize != 0) + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + hcryp->Instance->DR = *(uint32_t*)(inputaddr); + inputaddr+=4; + + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_OFNE)) { - /* Check that the associated data (or header) length is lower than 2^16 - 2^8 = 65536 - 256 = 65280 */ - if(headersize < 65280) - { - hcryp->Init.pScratch[bufferidx++] = (uint8_t) ((headersize >> 8) & 0xFF); - hcryp->Init.pScratch[bufferidx++] = (uint8_t) ((headersize) & 0xFF); - headersize += 2; - } - else - { - /* Header is encoded as 0xff || 0xfe || [headersize]32, i.e., six octets */ - hcryp->Init.pScratch[bufferidx++] = 0xFF; - hcryp->Init.pScratch[bufferidx++] = 0xFE; - hcryp->Init.pScratch[bufferidx++] = headersize & 0xff000000; - hcryp->Init.pScratch[bufferidx++] = headersize & 0x00ff0000; - hcryp->Init.pScratch[bufferidx++] = headersize & 0x0000ff00; - hcryp->Init.pScratch[bufferidx++] = headersize & 0x000000ff; - headersize += 6; - } - /* Copy the header buffer in internal buffer "hcryp->Init.pScratch" */ - for(loopcounter = 0; loopcounter < headersize; loopcounter++) - { - hcryp->Init.pScratch[bufferidx++] = hcryp->Init.Header[loopcounter]; - } - /* Check if the header size is modulo 16 */ - if ((headersize % 16) != 0) + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) { - /* Padd the header buffer with 0s till the hcryp->Init.pScratch length is modulo 16 */ - for(loopcounter = headersize; loopcounter <= ((headersize/16) + 1) * 16; loopcounter++) + if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) { - hcryp->Init.pScratch[loopcounter] = 0; + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; } - /* Set the header size to modulo 16 */ - headersize = ((headersize/16) + 1) * 16; } - /* Set the pointer headeraddr to hcryp->Init.pScratch */ - headeraddr = (uint32_t)hcryp->Init.pScratch; - } - /*********************** Formatting the block B0 **************************/ - if(headersize != 0) - { - blockb0[0] = 0x40; } - /* Flags byte */ - /* blockb0[0] |= 0u | (((( (uint8_t) hcryp->Init.TagSize - 2) / 2) & 0x07 ) << 3 ) | ( ( (uint8_t) (15 - hcryp->Init.IVSize) - 1) & 0x07) */ - blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)(((uint8_t)(hcryp->Init.TagSize - (uint8_t)(2))) >> 1) & (uint8_t)0x07 ) << 3); - blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)((uint8_t)(15) - hcryp->Init.IVSize) - (uint8_t)1) & (uint8_t)0x07); - - for (loopcounter = 0; loopcounter < hcryp->Init.IVSize; loopcounter++) + /* Read the Output block from the OUT FIFO */ + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; + outputaddr+=4; + } + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Sets the header phase + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param Input: Pointer to the Input buffer. + * @param Ilength: Length of the Input buffer, must be a multiple of 16 + * @param Timeout: Timeout value + * @retval None + */ +static HAL_StatusTypeDef CRYPEx_GCMCCM_SetHeaderPhase(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint32_t Timeout) +{ + uint32_t tickstart = 0; + uint32_t loopcounter = 0; + uint32_t headeraddr = (uint32_t)Input; + + /***************************** Header phase *********************************/ + if(hcryp->Init.HeaderSize != 0) + { + /* Select header phase */ + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); + /* Enable the CRYP peripheral */ + __HAL_CRYP_ENABLE(hcryp); + + for(loopcounter = 0; (loopcounter < hcryp->Init.HeaderSize); loopcounter+=16) + { + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } + } + /* Write the Input block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + } + + /* Wait until the complete message has been processed */ + + /* Get tick */ + tickstart = HAL_GetTick(); + + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } + } + } + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Sets the DMA configuration and start the DMA transfer. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param inputaddr: Address of the Input buffer + * @param Size: Size of the Input buffer, must be a multiple of 16 + * @param outputaddr: Address of the Output buffer + * @retval None + */ +static void CRYPEx_GCMCCM_SetDMAConfig(CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr) +{ + /* Set the CRYP DMA transfer complete callback */ + hcryp->hdmain->XferCpltCallback = CRYPEx_GCMCCM_DMAInCplt; + /* Set the DMA error callback */ + hcryp->hdmain->XferErrorCallback = CRYPEx_GCMCCM_DMAError; + + /* Set the CRYP DMA transfer complete callback */ + hcryp->hdmaout->XferCpltCallback = CRYPEx_GCMCCM_DMAOutCplt; + /* Set the DMA error callback */ + hcryp->hdmaout->XferErrorCallback = CRYPEx_GCMCCM_DMAError; + + /* Enable the CRYP peripheral */ + __HAL_CRYP_ENABLE(hcryp); + + /* Enable the DMA In DMA Stream */ + HAL_DMA_Start_IT(hcryp->hdmain, inputaddr, (uint32_t)&hcryp->Instance->DR, Size/4); + + /* Enable In DMA request */ + hcryp->Instance->DMACR = CRYP_DMACR_DIEN; + + /* Enable the DMA Out DMA Stream */ + HAL_DMA_Start_IT(hcryp->hdmaout, (uint32_t)&hcryp->Instance->DOUT, outputaddr, Size/4); + + /* Enable Out DMA request */ + hcryp->Instance->DMACR |= CRYP_DMACR_DOEN; +} + +/** + * @} + */ + +/* Exported functions---------------------------------------------------------*/ +/** @addtogroup CRYPEx_Exported_Functions + * @{ + */ + +/** @defgroup CRYPEx_Exported_Functions_Group1 Extended AES processing functions + * @brief Extended processing functions. + * +@verbatim + ============================================================================== + ##### Extended AES processing functions ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) Encrypt plaintext using AES-128/192/256 using GCM and CCM chaining modes + (+) Decrypt cyphertext using AES-128/192/256 using GCM and CCM chaining modes + (+) Finish the processing. This function is available only for GCM and CCM + [..] Three processing methods are available: + (+) Polling mode + (+) Interrupt mode + (+) DMA mode + +@endverbatim + * @{ + */ + + +/** + * @brief Initializes the CRYP peripheral in AES CCM encryption mode then + * encrypt pPlainData. The cypher data are available in pCypherData. + * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * the configuration information for CRYP module + * @param pPlainData: Pointer to the plaintext buffer + * @param Size: Length of the plaintext buffer, must be a multiple of 16 + * @param pCypherData: Pointer to the cyphertext buffer + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout) +{ + uint32_t tickstart = 0; + uint32_t headersize = hcryp->Init.HeaderSize; + uint32_t headeraddr = (uint32_t)hcryp->Init.Header; + uint32_t loopcounter = 0; + uint32_t bufferidx = 0; + uint8_t blockb0[16] = {0};/* Block B0 */ + uint8_t ctr[16] = {0}; /* Counter */ + uint32_t b0addr = (uint32_t)blockb0; + + /* Process Locked */ + __HAL_LOCK(hcryp); + + /* Change the CRYP peripheral state */ + hcryp->State = HAL_CRYP_STATE_BUSY; + + /* Check if initialization phase has already been performed */ + if(hcryp->Phase == HAL_CRYP_PHASE_READY) + { + /************************ Formatting the header block *********************/ + if(headersize != 0) + { + /* Check that the associated data (or header) length is lower than 2^16 - 2^8 = 65536 - 256 = 65280 */ + if(headersize < 65280) + { + hcryp->Init.pScratch[bufferidx++] = (uint8_t) ((headersize >> 8) & 0xFF); + hcryp->Init.pScratch[bufferidx++] = (uint8_t) ((headersize) & 0xFF); + headersize += 2; + } + else + { + /* Header is encoded as 0xff || 0xfe || [headersize]32, i.e., six octets */ + hcryp->Init.pScratch[bufferidx++] = 0xFF; + hcryp->Init.pScratch[bufferidx++] = 0xFE; + hcryp->Init.pScratch[bufferidx++] = headersize & 0xff000000; + hcryp->Init.pScratch[bufferidx++] = headersize & 0x00ff0000; + hcryp->Init.pScratch[bufferidx++] = headersize & 0x0000ff00; + hcryp->Init.pScratch[bufferidx++] = headersize & 0x000000ff; + headersize += 6; + } + /* Copy the header buffer in internal buffer "hcryp->Init.pScratch" */ + for(loopcounter = 0; loopcounter < headersize; loopcounter++) + { + hcryp->Init.pScratch[bufferidx++] = hcryp->Init.Header[loopcounter]; + } + /* Check if the header size is modulo 16 */ + if ((headersize % 16) != 0) + { + /* Padd the header buffer with 0s till the hcryp->Init.pScratch length is modulo 16 */ + for(loopcounter = headersize; loopcounter <= ((headersize/16) + 1) * 16; loopcounter++) + { + hcryp->Init.pScratch[loopcounter] = 0; + } + /* Set the header size to modulo 16 */ + headersize = ((headersize/16) + 1) * 16; + } + /* Set the pointer headeraddr to hcryp->Init.pScratch */ + headeraddr = (uint32_t)hcryp->Init.pScratch; + } + /*********************** Formatting the block B0 **************************/ + if(headersize != 0) + { + blockb0[0] = 0x40; + } + /* Flags byte */ + /* blockb0[0] |= 0u | (((( (uint8_t) hcryp->Init.TagSize - 2) / 2) & 0x07 ) << 3 ) | ( ( (uint8_t) (15 - hcryp->Init.IVSize) - 1) & 0x07) */ + blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)(((uint8_t)(hcryp->Init.TagSize - (uint8_t)(2))) >> 1) & (uint8_t)0x07 ) << 3); + blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)((uint8_t)(15) - hcryp->Init.IVSize) - (uint8_t)1) & (uint8_t)0x07); + + for (loopcounter = 0; loopcounter < hcryp->Init.IVSize; loopcounter++) { blockb0[loopcounter+1] = hcryp->Init.pInitVect[loopcounter]; } @@ -264,26 +602,26 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t * CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, ctr, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, ctr); /* Select init phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_INIT); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_INIT); b0addr = (uint32_t)blockb0; /* Write the blockb0 block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -309,17 +647,17 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t * if(headersize != 0) { /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) { /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) { { /* Check for the Timeout */ @@ -339,20 +677,20 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t * } } /* Write the header block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; } /* Get tick */ tickstart = HAL_GetTick(); - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -379,13 +717,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t * hcryp->Init.pScratch[15] &= 0xfe; /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -435,16 +773,16 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t * CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES GCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -474,16 +812,16 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t * } /* Disable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -533,16 +871,16 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES GCM decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_GCM_DECRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_GCM_DECRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -571,13 +909,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * return HAL_TIMEOUT; } /* Disable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -608,11 +946,11 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * * @param Timeout: Timeout duration * @retval HAL status */ -HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish(CRYP_HandleTypeDef *hcryp, uint16_t Size, uint8_t *AuthTag, uint32_t Timeout) +HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish(CRYP_HandleTypeDef *hcryp, uint32_t Size, uint8_t *AuthTag, uint32_t Timeout) { uint32_t tickstart = 0; - uint32_t headerlength = hcryp->Init.HeaderSize * 8; /* Header length in bits */ - uint32_t inputlength = Size * 8; /* input length in bits */ + uint64_t headerlength = hcryp->Init.HeaderSize * 8; /* Header length in bits */ + uint64_t inputlength = Size * 8; /* input length in bits */ uint32_t tagaddr = (uint32_t)AuthTag; /* Process Locked */ @@ -628,48 +966,48 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish(CRYP_HandleTypeDef *hcryp, uint16_t S hcryp->Phase = HAL_CRYP_PHASE_FINAL; /* Disable CRYP to start the final phase */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select final phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_FINAL); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_FINAL); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write the number of bits in header (64 bits) followed by the number of bits in the payload */ if(hcryp->Init.DataType == CRYP_DATATYPE_1B) { - CRYP->DR = 0; - CRYP->DR = __RBIT(headerlength); - CRYP->DR = 0; - CRYP->DR = __RBIT(inputlength); + hcryp->Instance->DR = __RBIT(headerlength >> 32); + hcryp->Instance->DR = __RBIT(headerlength); + hcryp->Instance->DR = __RBIT(inputlength >> 32); + hcryp->Instance->DR = __RBIT(inputlength); } else if(hcryp->Init.DataType == CRYP_DATATYPE_8B) { - CRYP->DR = 0; - CRYP->DR = __REV(headerlength); - CRYP->DR = 0; - CRYP->DR = __REV(inputlength); + hcryp->Instance->DR = __REV(headerlength >> 32); + hcryp->Instance->DR = __REV(headerlength); + hcryp->Instance->DR = __REV(inputlength >> 32); + hcryp->Instance->DR = __REV(inputlength); } else if(hcryp->Init.DataType == CRYP_DATATYPE_16B) { - CRYP->DR = 0; - CRYP->DR = __REV16(headerlength); - CRYP->DR = 0; - CRYP->DR = __REV16(inputlength); + hcryp->Instance->DR = __ROR((uint32_t)(headerlength >> 32), 16); + hcryp->Instance->DR = __ROR((uint32_t)headerlength, 16); + hcryp->Instance->DR = __ROR((uint32_t)(inputlength >> 32), 16); + hcryp->Instance->DR = __ROR((uint32_t)inputlength, 16); } else if(hcryp->Init.DataType == CRYP_DATATYPE_32B) { - CRYP->DR = 0; - CRYP->DR = (uint32_t)(headerlength); - CRYP->DR = 0; - CRYP->DR = (uint32_t)(inputlength); + hcryp->Instance->DR = (uint32_t)(headerlength >> 32); + hcryp->Instance->DR = (uint32_t)(headerlength); + hcryp->Instance->DR = (uint32_t)(inputlength >> 32); + hcryp->Instance->DR = (uint32_t)(inputlength); } /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_OFNE)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_OFNE)) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -688,13 +1026,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish(CRYP_HandleTypeDef *hcryp, uint16_t S } /* Read the Auth TAG in the IN FIFO */ - *(uint32_t*)(tagaddr) = CRYP->DOUT; + *(uint32_t*)(tagaddr) = hcryp->Instance->DOUT; tagaddr+=4; - *(uint32_t*)(tagaddr) = CRYP->DOUT; + *(uint32_t*)(tagaddr) = hcryp->Instance->DOUT; tagaddr+=4; - *(uint32_t*)(tagaddr) = CRYP->DOUT; + *(uint32_t*)(tagaddr) = hcryp->Instance->DOUT; tagaddr+=4; - *(uint32_t*)(tagaddr) = CRYP->DOUT; + *(uint32_t*)(tagaddr) = hcryp->Instance->DOUT; } /* Change the CRYP peripheral state */ @@ -737,27 +1075,27 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Finish(CRYP_HandleTypeDef *hcryp, uint8_t *A hcryp->Phase = HAL_CRYP_PHASE_FINAL; /* Disable CRYP to start the final phase */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select final phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_FINAL); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_FINAL); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Write the counter block in the IN FIFO */ - CRYP->DR = *(uint32_t*)ctraddr; + hcryp->Instance->DR = *(uint32_t*)ctraddr; ctraddr+=4; - CRYP->DR = *(uint32_t*)ctraddr; + hcryp->Instance->DR = *(uint32_t*)ctraddr; ctraddr+=4; - CRYP->DR = *(uint32_t*)ctraddr; + hcryp->Instance->DR = *(uint32_t*)ctraddr; ctraddr+=4; - CRYP->DR = *(uint32_t*)ctraddr; + hcryp->Instance->DR = *(uint32_t*)ctraddr; /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_OFNE)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_OFNE)) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -776,10 +1114,10 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Finish(CRYP_HandleTypeDef *hcryp, uint8_t *A } /* Read the Auth TAG in the IN FIFO */ - temptag[0] = CRYP->DOUT; - temptag[1] = CRYP->DOUT; - temptag[2] = CRYP->DOUT; - temptag[3] = CRYP->DOUT; + temptag[0] = hcryp->Instance->DOUT; + temptag[1] = hcryp->Instance->DOUT; + temptag[2] = hcryp->Instance->DOUT; + temptag[3] = hcryp->Instance->DOUT; } /* Copy temporary authentication TAG in user TAG buffer */ @@ -912,26 +1250,26 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CCM_DECRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CCM_DECRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, ctr, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, ctr); /* Select init phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_INIT); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_INIT); b0addr = (uint32_t)blockb0; /* Write the blockb0 block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -957,17 +1295,17 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * if(headersize != 0) { /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); /* Enable Crypto processor */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) { /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -985,20 +1323,20 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * } } /* Write the header block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; } /* Get tick */ tickstart = HAL_GetTick(); - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -1024,13 +1362,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t * /* Reset bit 0 */ hcryp->Init.pScratch[15] &= 0xfe; /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1088,16 +1426,16 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES GCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP to start the init phase */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -1125,13 +1463,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ return HAL_TIMEOUT; } /* Disable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1140,9 +1478,9 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ if(Size != 0) { /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); } else { @@ -1154,42 +1492,42 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ /* Return function status */ return HAL_OK; } - else if (__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if (__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP peripheral state */ @@ -1324,26 +1662,26 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, ctr, hcryp->Init.KeySize); + CRYPEx_GCMCCM_SetInitVector(hcryp, ctr); /* Select init phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_INIT); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_INIT); b0addr = (uint32_t)blockb0; /* Write the blockb0 block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -1366,17 +1704,17 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ if(headersize != 0) { /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); /* Enable Crypto processor */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) { /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) @@ -1391,20 +1729,20 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ } } /* Write the header block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; } /* Get tick */ tickstart = HAL_GetTick(); - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) @@ -1428,10 +1766,10 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ hcryp->Init.pScratch[15] &= 0xfe; /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1440,9 +1778,9 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ if(Size != 0) { /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); } else { @@ -1453,42 +1791,42 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ /* Return function status */ return HAL_OK; } - else if (__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call Input transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if (__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP peripheral state */ @@ -1538,16 +1876,16 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES GCM decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_GCM_DECRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_GCM_DECRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP to start the init phase */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -1573,10 +1911,10 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ return HAL_TIMEOUT; } /* Disable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -1585,9 +1923,9 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ if(Size != 0) { /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); } else { @@ -1600,42 +1938,42 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ /* Return function status */ return HAL_OK; } - else if (__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if (__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP peripheral state */ @@ -1770,26 +2108,26 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CCM_DECRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CCM_DECRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, ctr, hcryp->Init.KeySize); + CRYPEx_GCMCCM_SetInitVector(hcryp, ctr); /* Select init phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_INIT); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_INIT); b0addr = (uint32_t)blockb0; /* Write the blockb0 block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -1812,17 +2150,17 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ if(headersize != 0) { /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); /* Enable Crypto processor */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) { /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) @@ -1837,20 +2175,20 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ } } /* Write the header block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; } /* Get tick */ tickstart = HAL_GetTick(); - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) @@ -1873,60 +2211,60 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_ /* Reset bit 0 */ hcryp->Init.pScratch[15] &= 0xfe; /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } /* Enable Interrupts */ - __HAL_CRYP_ENABLE_IT(CRYP_IT_INI | CRYP_IT_OUTI); + __HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_INI | CRYP_IT_OUTI); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Return function status */ return HAL_OK; } - else if (__HAL_CRYP_GET_IT(CRYP_IT_INI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_INI)) { inputaddr = (uint32_t)hcryp->pCrypInBuffPtr; /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); + hcryp->Instance->DR = *(uint32_t*)(inputaddr); hcryp->pCrypInBuffPtr += 16; hcryp->CrypInCount -= 16; if(hcryp->CrypInCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_INI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_INI); /* Call the Input data transfer complete callback */ HAL_CRYP_InCpltCallback(hcryp); } } - else if (__HAL_CRYP_GET_IT(CRYP_IT_OUTI)) + else if (__HAL_CRYP_GET_IT(hcryp, CRYP_IT_OUTI)) { outputaddr = (uint32_t)hcryp->pCrypOutBuffPtr; /* Read the Output block from the Output FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; + *(uint32_t*)(outputaddr) = hcryp->Instance->DOUT; hcryp->pCrypOutBuffPtr += 16; hcryp->CrypOutCount -= 16; if(hcryp->CrypOutCount == 0) { - __HAL_CRYP_DISABLE_IT(CRYP_IT_OUTI); + __HAL_CRYP_DISABLE_IT(hcryp, CRYP_IT_OUTI); /* Process Unlocked */ __HAL_UNLOCK(hcryp); /* Change the CRYP peripheral state */ @@ -1973,16 +2311,16 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES GCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Enable CRYP to start the init phase */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -2002,7 +2340,7 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 } } /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the header phase */ if(CRYPEx_GCMCCM_SetHeaderPhase(hcryp, hcryp->Init.Header, hcryp->Init.HeaderSize, 1) != HAL_OK) @@ -2010,13 +2348,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 return HAL_TIMEOUT; } /* Disable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -2163,26 +2501,26 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES CCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, ctr, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, ctr); /* Select init phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_INIT); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_INIT); b0addr = (uint32_t)blockb0; /* Write the blockb0 block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); + hcryp->Instance->DR = *(uint32_t*)(b0addr); /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -2205,17 +2543,17 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 if(headersize != 0) { /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); /* Enable Crypto processor */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) { /* Get tick */ tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) @@ -2230,20 +2568,20 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 } } /* Write the header block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); + hcryp->Instance->DR = *(uint32_t*)(headeraddr); headeraddr+=4; } /* Get tick */ tickstart = HAL_GetTick(); - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) @@ -2267,10 +2605,10 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 hcryp->Init.pScratch[15] &= 0xfe; /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); + __HAL_CRYP_FIFO_FLUSH(hcryp); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -2324,13 +2662,13 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); /* Set the CRYP peripheral in AES GCM decryption mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_GCM_DECRYPT); + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_GCM_DECRYPT); /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect, CRYP_KEYSIZE_128B); + CRYPEx_GCMCCM_SetInitVector(hcryp, hcryp->Init.pInitVect); /* Enable CRYP to start the init phase */ - __HAL_CRYP_ENABLE(); + __HAL_CRYP_ENABLE(hcryp); /* Get tick */ tickstart = HAL_GetTick(); @@ -2356,10 +2694,10 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 return HAL_TIMEOUT; } /* Disable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); + __HAL_CRYP_DISABLE(hcryp); /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); /* Set the phase */ hcryp->Phase = HAL_CRYP_PHASE_PROCESS; @@ -2463,400 +2801,78 @@ HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 headersize = ((headersize/16) + 1) * 16; } /* Set the pointer headeraddr to hcryp->Init.pScratch */ - headeraddr = (uint32_t)hcryp->Init.pScratch; - } - /*********************** Formatting the block B0 ************************/ - if(headersize != 0) - { - blockb0[0] = 0x40; - } - /* Flags byte */ - /* blockb0[0] |= 0u | (((( (uint8_t) hcryp->Init.TagSize - 2) / 2) & 0x07 ) << 3 ) | ( ( (uint8_t) (15 - hcryp->Init.IVSize) - 1) & 0x07) */ - blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)(((uint8_t)(hcryp->Init.TagSize - (uint8_t)(2))) >> 1) & (uint8_t)0x07 ) << 3); - blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)((uint8_t)(15) - hcryp->Init.IVSize) - (uint8_t)1) & (uint8_t)0x07); - - for (loopcounter = 0; loopcounter < hcryp->Init.IVSize; loopcounter++) - { - blockb0[loopcounter+1] = hcryp->Init.pInitVect[loopcounter]; - } - for ( ; loopcounter < 13; loopcounter++) - { - blockb0[loopcounter+1] = 0; - } - - blockb0[14] = (Size >> 8); - blockb0[15] = (Size & 0xFF); - - /************************* Formatting the initial counter ***************/ - /* Byte 0: - Bits 7 and 6 are reserved and shall be set to 0 - Bits 3, 4, and 5 shall also be set to 0, to ensure that all the counter - blocks are distinct from B0 - Bits 0, 1, and 2 contain the same encoding of q as in B0 - */ - ctr[0] = blockb0[0] & 0x07; - /* byte 1 to NonceSize is the IV (Nonce) */ - for(loopcounter = 1; loopcounter < hcryp->Init.IVSize + 1; loopcounter++) - { - ctr[loopcounter] = blockb0[loopcounter]; - } - /* Set the LSB to 1 */ - ctr[15] |= 0x01; - - /* Set the key */ - CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); - - /* Set the CRYP peripheral in AES CCM mode */ - __HAL_CRYP_SET_MODE(CRYP_CR_ALGOMODE_AES_CCM_DECRYPT); - - /* Set the Initialization Vector */ - CRYPEx_GCMCCM_SetInitVector(hcryp, ctr, CRYP_KEYSIZE_128B); - - /* Select init phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_INIT); - - b0addr = (uint32_t)blockb0; - /* Write the blockb0 block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(b0addr); - b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); - b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); - b0addr+=4; - CRYP->DR = *(uint32_t*)(b0addr); - - /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); - - /* Get tick */ - tickstart = HAL_GetTick(); - - while((CRYP->CR & CRYP_CR_CRYPEN) == CRYP_CR_CRYPEN) - { - /* Check for the Timeout */ - - if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - - } - } - /***************************** Header phase *****************************/ - if(headersize != 0) - { - /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); - - /* Enable Crypto processor */ - __HAL_CRYP_ENABLE(); - - for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) - { - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) - { - /* Check for the Timeout */ - if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - /* Write the header block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - } - - /* Get tick */ - tickstart = HAL_GetTick(); - - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) - { - /* Check for the Timeout */ - if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } - } - } - /* Save formatted counter into the scratch buffer pScratch */ - for(loopcounter = 0; (loopcounter < 16); loopcounter++) - { - hcryp->Init.pScratch[loopcounter] = ctr[loopcounter]; - } - /* Reset bit 0 */ - hcryp->Init.pScratch[15] &= 0xfe; - /* Select payload phase once the header phase is performed */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_PAYLOAD); - - /* Flush FIFO */ - __HAL_CRYP_FIFO_FLUSH(); - - /* Set the phase */ - hcryp->Phase = HAL_CRYP_PHASE_PROCESS; - } - /* Set the input and output addresses and start DMA transfer */ - CRYPEx_GCMCCM_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); - - /* Unlock process */ - __HAL_UNLOCK(hcryp); - - /* Return function status */ - return HAL_OK; - } - else - { - return HAL_ERROR; - } -} - -/** - * @brief This function handles CRYP interrupt request. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @retval None - */ -void HAL_CRYPEx_GCMCCM_IRQHandler(CRYP_HandleTypeDef *hcryp) -{ - switch(CRYP->CR & CRYP_CR_ALGOMODE_DIRECTION) - { - case CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT: - HAL_CRYPEx_AESGCM_Encrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); - break; - - case CRYP_CR_ALGOMODE_AES_GCM_DECRYPT: - HAL_CRYPEx_AESGCM_Decrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); - break; - - case CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT: - HAL_CRYPEx_AESCCM_Encrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); - break; - - case CRYP_CR_ALGOMODE_AES_CCM_DECRYPT: - HAL_CRYPEx_AESCCM_Decrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); - break; - - default: - break; - } -} - -/** - * @} - */ - -/** - * @brief DMA CRYP Input Data process complete callback. - * @param hdma: DMA handle - * @retval None - */ -static void CRYPEx_GCMCCM_DMAInCplt(DMA_HandleTypeDef *hdma) -{ - CRYP_HandleTypeDef* hcryp = ( CRYP_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - /* Disable the DMA transfer for input Fifo request by resetting the DIEN bit - in the DMACR register */ - CRYP->DMACR &= (uint32_t)(~CRYP_DMACR_DIEN); - - /* Call input data transfer complete callback */ - HAL_CRYP_InCpltCallback(hcryp); -} - -/** - * @brief DMA CRYP Output Data process complete callback. - * @param hdma: DMA handle - * @retval None - */ -static void CRYPEx_GCMCCM_DMAOutCplt(DMA_HandleTypeDef *hdma) -{ - CRYP_HandleTypeDef* hcryp = ( CRYP_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - /* Disable the DMA transfer for output Fifo request by resetting the DOEN bit - in the DMACR register */ - CRYP->DMACR &= (uint32_t)(~CRYP_DMACR_DOEN); - - /* Enable the CRYP peripheral */ - __HAL_CRYP_DISABLE(); - - /* Change the CRYP peripheral state */ - hcryp->State = HAL_CRYP_STATE_READY; - - /* Call output data transfer complete callback */ - HAL_CRYP_OutCpltCallback(hcryp); -} - -/** - * @brief DMA CRYP communication error callback. - * @param hdma: DMA handle - * @retval None - */ -static void CRYPEx_GCMCCM_DMAError(DMA_HandleTypeDef *hdma) -{ - CRYP_HandleTypeDef* hcryp = ( CRYP_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - hcryp->State= HAL_CRYP_STATE_READY; - HAL_CRYP_ErrorCallback(hcryp); -} - -/** - * @brief Writes the Key in Key registers. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Key: Pointer to Key buffer - * @param KeySize: Size of Key - * @retval None - */ -static void CRYPEx_GCMCCM_SetKey(CRYP_HandleTypeDef *hcryp, uint8_t *Key, uint32_t KeySize) -{ - uint32_t keyaddr = (uint32_t)Key; - - switch(KeySize) - { - case CRYP_KEYSIZE_256B: - /* Key Initialisation */ - CRYP->K0LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K0RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K1LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K1RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3RR = __REV(*(uint32_t*)(keyaddr)); - break; - case CRYP_KEYSIZE_192B: - CRYP->K1LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K1RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3RR = __REV(*(uint32_t*)(keyaddr)); - break; - case CRYP_KEYSIZE_128B: - CRYP->K2LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K2RR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3LR = __REV(*(uint32_t*)(keyaddr)); - keyaddr+=4; - CRYP->K3RR = __REV(*(uint32_t*)(keyaddr)); - break; - default: - break; - } -} - -/** - * @brief Writes the InitVector/InitCounter in IV registers. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param InitVector: Pointer to InitVector/InitCounter buffer - * @param IVSize: Size of the InitVector/InitCounter - * @retval None - */ -static void CRYPEx_GCMCCM_SetInitVector(CRYP_HandleTypeDef *hcryp, uint8_t *InitVector, uint32_t IVSize) -{ - uint32_t ivaddr = (uint32_t)InitVector; - - switch(IVSize) - { - case CRYP_KEYSIZE_128B: - CRYP->IV0LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV0RR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV1LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV1RR = __REV(*(uint32_t*)(ivaddr)); - break; - /* Whatever key size 192 or 256, Init vector is written in IV0LR and IV0RR */ - case CRYP_KEYSIZE_192B: - CRYP->IV0LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV0RR = __REV(*(uint32_t*)(ivaddr)); - break; - case CRYP_KEYSIZE_256B: - CRYP->IV0LR = __REV(*(uint32_t*)(ivaddr)); - ivaddr+=4; - CRYP->IV0RR = __REV(*(uint32_t*)(ivaddr)); - break; - default: - break; - } -} - -/** - * @brief Process Data: Writes Input data in polling mode and read the Output data. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Input: Pointer to the Input buffer. - * @param Ilength: Length of the Input buffer, must be a multiple of 16 - * @param Output: Pointer to the returned buffer - * @param Timeout: Timeout value - * @retval None - */ -static HAL_StatusTypeDef CRYPEx_GCMCCM_ProcessData(CRYP_HandleTypeDef *hcryp, uint8_t *Input, uint16_t Ilength, uint8_t *Output, uint32_t Timeout) -{ - uint32_t tickstart = 0; - uint32_t i = 0; - uint32_t inputaddr = (uint32_t)Input; - uint32_t outputaddr = (uint32_t)Output; - - for(i=0; (i < Ilength); i+=16) - { - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - CRYP->DR = *(uint32_t*)(inputaddr); - inputaddr+=4; - - /* Get tick */ - tickstart = HAL_GetTick(); + headeraddr = (uint32_t)hcryp->Init.pScratch; + } + /*********************** Formatting the block B0 ************************/ + if(headersize != 0) + { + blockb0[0] = 0x40; + } + /* Flags byte */ + /* blockb0[0] |= 0u | (((( (uint8_t) hcryp->Init.TagSize - 2) / 2) & 0x07 ) << 3 ) | ( ( (uint8_t) (15 - hcryp->Init.IVSize) - 1) & 0x07) */ + blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)(((uint8_t)(hcryp->Init.TagSize - (uint8_t)(2))) >> 1) & (uint8_t)0x07 ) << 3); + blockb0[0] |= (uint8_t)((uint8_t)((uint8_t)((uint8_t)(15) - hcryp->Init.IVSize) - (uint8_t)1) & (uint8_t)0x07); + + for (loopcounter = 0; loopcounter < hcryp->Init.IVSize; loopcounter++) + { + blockb0[loopcounter+1] = hcryp->Init.pInitVect[loopcounter]; + } + for ( ; loopcounter < 13; loopcounter++) + { + blockb0[loopcounter+1] = 0; + } + + blockb0[14] = (Size >> 8); + blockb0[15] = (Size & 0xFF); + + /************************* Formatting the initial counter ***************/ + /* Byte 0: + Bits 7 and 6 are reserved and shall be set to 0 + Bits 3, 4, and 5 shall also be set to 0, to ensure that all the counter + blocks are distinct from B0 + Bits 0, 1, and 2 contain the same encoding of q as in B0 + */ + ctr[0] = blockb0[0] & 0x07; + /* byte 1 to NonceSize is the IV (Nonce) */ + for(loopcounter = 1; loopcounter < hcryp->Init.IVSize + 1; loopcounter++) + { + ctr[loopcounter] = blockb0[loopcounter]; + } + /* Set the LSB to 1 */ + ctr[15] |= 0x01; + + /* Set the key */ + CRYPEx_GCMCCM_SetKey(hcryp, hcryp->Init.pKey, hcryp->Init.KeySize); + + /* Set the CRYP peripheral in AES CCM mode */ + __HAL_CRYP_SET_MODE(hcryp, CRYP_CR_ALGOMODE_AES_CCM_DECRYPT); + + /* Set the Initialization Vector */ + CRYPEx_GCMCCM_SetInitVector(hcryp, ctr); + + /* Select init phase */ + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_INIT); + + b0addr = (uint32_t)blockb0; + /* Write the blockb0 block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(b0addr); + b0addr+=4; + hcryp->Instance->DR = *(uint32_t*)(b0addr); + b0addr+=4; + hcryp->Instance->DR = *(uint32_t*)(b0addr); + b0addr+=4; + hcryp->Instance->DR = *(uint32_t*)(b0addr); + + /* Enable the CRYP peripheral */ + __HAL_CRYP_ENABLE(hcryp); + + /* Get tick */ + tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_OFNE)) - { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) + while((CRYP->CR & CRYP_CR_CRYPEN) == CRYP_CR_CRYPEN) { + /* Check for the Timeout */ + if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) { /* Change state */ @@ -2866,57 +2882,55 @@ static HAL_StatusTypeDef CRYPEx_GCMCCM_ProcessData(CRYP_HandleTypeDef *hcryp, ui __HAL_UNLOCK(hcryp); return HAL_TIMEOUT; + } } - } - /* Read the Output block from the OUT FIFO */ - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - *(uint32_t*)(outputaddr) = CRYP->DOUT; - outputaddr+=4; - } - /* Return function status */ - return HAL_OK; -} - -/** - * @brief Sets the header phase - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains - * the configuration information for CRYP module - * @param Input: Pointer to the Input buffer. - * @param Ilength: Length of the Input buffer, must be a multiple of 16 - * @param Timeout: Timeout value - * @retval None - */ -static HAL_StatusTypeDef CRYPEx_GCMCCM_SetHeaderPhase(CRYP_HandleTypeDef *hcryp, uint8_t* Input, uint16_t Ilength, uint32_t Timeout) -{ - uint32_t tickstart = 0; - uint32_t loopcounter = 0; - uint32_t headeraddr = (uint32_t)Input; - - /***************************** Header phase *********************************/ - if(hcryp->Init.HeaderSize != 0) - { - /* Select header phase */ - __HAL_CRYP_SET_PHASE(CRYP_PHASE_HEADER); - /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); - - for(loopcounter = 0; (loopcounter < hcryp->Init.HeaderSize); loopcounter+=16) - { - /* Get tick */ - tickstart = HAL_GetTick(); - - while(HAL_IS_BIT_CLR(CRYP->SR, CRYP_FLAG_IFEM)) + /***************************** Header phase *****************************/ + if(headersize != 0) { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) + /* Select header phase */ + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); + + /* Enable Crypto processor */ + __HAL_CRYP_ENABLE(hcryp); + + for(loopcounter = 0; (loopcounter < headersize); loopcounter+=16) { - if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + /* Get tick */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_CLR(hcryp->Instance->SR, CRYP_FLAG_IFEM)) + { + /* Check for the Timeout */ + if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) + { + /* Change state */ + hcryp->State = HAL_CRYP_STATE_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hcryp); + + return HAL_TIMEOUT; + } + } + /* Write the header block in the IN FIFO */ + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + hcryp->Instance->DR = *(uint32_t*)(headeraddr); + headeraddr+=4; + } + + /* Get tick */ + tickstart = HAL_GetTick(); + + while((hcryp->Instance->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) + { + /* Check for the Timeout */ + if((HAL_GetTick() - tickstart ) > CRYPEx_TIMEOUT_VALUE) { /* Change state */ hcryp->State = HAL_CRYP_STATE_TIMEOUT; @@ -2928,81 +2942,90 @@ static HAL_StatusTypeDef CRYPEx_GCMCCM_SetHeaderPhase(CRYP_HandleTypeDef *hcryp, } } } - /* Write the Input block in the IN FIFO */ - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - CRYP->DR = *(uint32_t*)(headeraddr); - headeraddr+=4; - } - - /* Wait until the complete message has been processed */ - - /* Get tick */ - tickstart = HAL_GetTick(); - - while((CRYP->SR & CRYP_FLAG_BUSY) == CRYP_FLAG_BUSY) - { - /* Check for the Timeout */ - if(Timeout != HAL_MAX_DELAY) + /* Save formatted counter into the scratch buffer pScratch */ + for(loopcounter = 0; (loopcounter < 16); loopcounter++) { - if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) - { - /* Change state */ - hcryp->State = HAL_CRYP_STATE_TIMEOUT; - - /* Process Unlocked */ - __HAL_UNLOCK(hcryp); - - return HAL_TIMEOUT; - } + hcryp->Init.pScratch[loopcounter] = ctr[loopcounter]; } + /* Reset bit 0 */ + hcryp->Init.pScratch[15] &= 0xfe; + /* Select payload phase once the header phase is performed */ + __HAL_CRYP_SET_PHASE(hcryp, CRYP_PHASE_PAYLOAD); + + /* Flush FIFO */ + __HAL_CRYP_FIFO_FLUSH(hcryp); + + /* Set the phase */ + hcryp->Phase = HAL_CRYP_PHASE_PROCESS; } + /* Set the input and output addresses and start DMA transfer */ + CRYPEx_GCMCCM_SetDMAConfig(hcryp, inputaddr, Size, outputaddr); + + /* Unlock process */ + __HAL_UNLOCK(hcryp); + + /* Return function status */ + return HAL_OK; + } + else + { + return HAL_ERROR; } - /* Return function status */ - return HAL_OK; } /** - * @brief Sets the DMA configuration and start the DMA transfert. - * @param hcryp: pointer to a CRYP_HandleTypeDef structure that contains + * @} + */ + +/** @defgroup CRYPEx_Exported_Functions_Group2 CRYPEx IRQ handler management + * @brief CRYPEx IRQ handler. + * +@verbatim + ============================================================================== + ##### CRYPEx IRQ handler management ##### + ============================================================================== +[..] This section provides CRYPEx IRQ handler function. + +@endverbatim + * @{ + */ + +/** + * @brief This function handles CRYPEx interrupt request. + * @param hcryp: pointer to a CRYPEx_HandleTypeDef structure that contains * the configuration information for CRYP module - * @param inputaddr: Address of the Input buffer - * @param Size: Size of the Input buffer, must be a multiple of 16 - * @param outputaddr: Address of the Output buffer * @retval None */ -static void CRYPEx_GCMCCM_SetDMAConfig(CRYP_HandleTypeDef *hcryp, uint32_t inputaddr, uint16_t Size, uint32_t outputaddr) + +void HAL_CRYPEx_GCMCCM_IRQHandler(CRYP_HandleTypeDef *hcryp) { - /* Set the CRYP DMA transfer complete callback */ - hcryp->hdmain->XferCpltCallback = CRYPEx_GCMCCM_DMAInCplt; - /* Set the DMA error callback */ - hcryp->hdmain->XferErrorCallback = CRYPEx_GCMCCM_DMAError; - - /* Set the CRYP DMA transfer complete callback */ - hcryp->hdmaout->XferCpltCallback = CRYPEx_GCMCCM_DMAOutCplt; - /* Set the DMA error callback */ - hcryp->hdmaout->XferErrorCallback = CRYPEx_GCMCCM_DMAError; - - /* Enable the CRYP peripheral */ - __HAL_CRYP_ENABLE(); - - /* Enable the DMA In DMA Stream */ - HAL_DMA_Start_IT(hcryp->hdmain, inputaddr, (uint32_t)&CRYP->DR, Size/4); - - /* Enable In DMA request */ - CRYP->DMACR = CRYP_DMACR_DIEN; - - /* Enable the DMA Out DMA Stream */ - HAL_DMA_Start_IT(hcryp->hdmaout, (uint32_t)&CRYP->DOUT, outputaddr, Size/4); - - /* Enable Out DMA request */ - CRYP->DMACR |= CRYP_DMACR_DOEN; + switch(CRYP->CR & CRYP_CR_ALGOMODE_DIRECTION) + { + case CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT: + HAL_CRYPEx_AESGCM_Encrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); + break; + + case CRYP_CR_ALGOMODE_AES_GCM_DECRYPT: + HAL_CRYPEx_AESGCM_Decrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); + break; + + case CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT: + HAL_CRYPEx_AESCCM_Encrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); + break; + + case CRYP_CR_ALGOMODE_AES_CCM_DECRYPT: + HAL_CRYPEx_AESCCM_Decrypt_IT(hcryp, HAL_NULL, 0, HAL_NULL); + break; + + default: + break; + } } +/** + * @} + */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.h index 29d4935555d..60beecc8dce 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_cryp_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_cryp_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of CRYP HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -58,23 +58,24 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -/** @defgroup CRYPEx_Exported_Constants +/** @defgroup CRYPEx_Exported_Constants CRYPEx Exported Constants * @{ */ -/** @defgroup CRYPEx_AlgoModeDirection +/** @defgroup CRYPEx_Exported_Constants_Group1 CRYP AlgoModeDirection * @{ */ #define CRYP_CR_ALGOMODE_AES_GCM_ENCRYPT ((uint32_t)0x00080000) #define CRYP_CR_ALGOMODE_AES_GCM_DECRYPT ((uint32_t)0x00080004) #define CRYP_CR_ALGOMODE_AES_CCM_ENCRYPT ((uint32_t)0x00080008) #define CRYP_CR_ALGOMODE_AES_CCM_DECRYPT ((uint32_t)0x0008000C) + /** * @} */ -/** @defgroup CRYPEx_PhaseConfig - * The phases are relevant only to AES-GCM and AES-CCM +/** @defgroup CRYPEx_Exported_Constants_Group3 CRYP PhaseConfig + * @brief The phases are relevant only to AES-GCM and AES-CCM * @{ */ #define CRYP_PHASE_INIT ((uint32_t)0x00000000) @@ -90,24 +91,38 @@ */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup CRYPEx_Exported_Macros CRYP Exported Macros + * @{ + */ + /** * @brief Set the phase: Init, header, payload, final. * This is relevant only for GCM and CCM modes. - * @param PHASE: The phase. + * @param __HANDLE__: specifies the CRYP handle. + * @param __PHASE__: The phase. * @retval None */ -#define __HAL_CRYP_SET_PHASE(PHASE) do{CRYP->CR &= (uint32_t)(~CRYP_CR_GCM_CCMPH);\ - CRYP->CR |= (uint32_t)(PHASE);\ - }while(0) +#define __HAL_CRYP_SET_PHASE(__HANDLE__, __PHASE__) do{(__HANDLE__)->Instance->CR &= (uint32_t)(~CRYP_CR_GCM_CCMPH);\ + (__HANDLE__)->Instance->CR |= (uint32_t)(__PHASE__);\ + }while(0) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @defgroup CRYPEx_Exported_Functions CRYPEx Exported Functions + * @{ + */ +/** @addtogroup CRYPEx_Exported_Functions_Group1 + * @{ + */ + /* AES encryption/decryption using polling ***********************************/ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); -HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish(CRYP_HandleTypeDef *hcryp, uint16_t Size, uint8_t *AuthTag, uint32_t Timeout); +HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Finish(CRYP_HandleTypeDef *hcryp, uint32_t Size, uint8_t *AuthTag, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Finish(CRYP_HandleTypeDef *hcryp, uint8_t *AuthTag, uint32_t Timeout); @@ -124,10 +139,70 @@ HAL_StatusTypeDef HAL_CRYPEx_AESGCM_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8 HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); HAL_StatusTypeDef HAL_CRYPEx_AESCCM_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); - -/* Processing functions ********************************************************/ +/** + * @} + */ + +/** @addtogroup CRYPEx_Exported_Functions_Group2 + * @{ + */ + void HAL_CRYPEx_GCMCCM_IRQHandler(CRYP_HandleTypeDef *hcryp); +/** + * @} + */ + + /** + * @} + */ + + + /* Private types -------------------------------------------------------------*/ +/** @defgroup CRYPEx_Private_Types CRYPEx Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup CRYPEx_Private_Variables CRYPEx Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup CRYPEx_Private_Constants CRYPEx Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CRYPEx_Private_Macros CRYPEx Private Macros + * @{ + */ + + /** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup CRYPEx_Private_Functions CRYPEx Private Functions + * @{ + */ + +/** + * @} + */ + #endif /* STM32F437xx || STM32F439xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.c index 34161a6b86e..42341847826 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_dac.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief DAC HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Digital to Analog Converter (DAC) peripheral: @@ -29,17 +29,17 @@ *** DAC Triggers *** ==================== [..] - Digital to Analog conversion can be non-triggered using DAC_Trigger_None + Digital to Analog conversion can be non-triggered using DAC_TRIGGER_NONE and DAC_OUT1/DAC_OUT2 is available once writing to DHRx register. [..] Digital to Analog conversion can be triggered by: - (#) External event: EXTI Line 9 (any GPIOx_Pin9) using DAC_Trigger_Ext_IT9. + (#) External event: EXTI Line 9 (any GPIOx_Pin9) using DAC_TRIGGER_EXT_IT9. The used pin (GPIOx_Pin9) must be configured in input mode. (#) Timers TRGO: TIM2, TIM4, TIM5, TIM6, TIM7 and TIM8 - (DAC_Trigger_T2_TRGO, DAC_Trigger_T4_TRGO...) + (DAC_TRIGGER_T2_TRGO, DAC_TRIGGER_T4_TRGO...) - (#) Software using DAC_Trigger_Software + (#) Software using DAC_TRIGGER_SOFTWARE *** DAC Buffer mode feature *** =============================== @@ -48,7 +48,7 @@ reduce the output impedance, and to drive external loads directly without having to add an external operational amplifier. To enable, the output buffer use - sConfig.DAC_OutputBuffer = DAC_OutputBuffer_Enable; + sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE; [..] (@) Refer to the device datasheet for more details about output impedance value with and without output buffer. @@ -109,7 +109,7 @@ ================================= [..] (+) Start the DAC peripheral using HAL_DAC_Start() - (+) To read the DAC last data output value value, use the HAL_DAC_GetValue() function. + (+) To read the DAC last data output value, use the HAL_DAC_GetValue() function. (+) Stop the DAC peripheral using HAL_DAC_Stop() *** DMA mode IO operation *** @@ -141,7 +141,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -176,30 +176,37 @@ * @{ */ -/** @defgroup DAC +/** @defgroup DAC DAC * @brief DAC driver modules * @{ */ #ifdef HAL_DAC_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup DAC_Private_Functions + * @{ + */ /* Private function prototypes -----------------------------------------------*/ static void DAC_DMAConvCpltCh1(DMA_HandleTypeDef *hdma); static void DAC_DMAErrorCh1(DMA_HandleTypeDef *hdma); static void DAC_DMAHalfConvCpltCh1(DMA_HandleTypeDef *hdma); +/** + * @} + */ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup DAC_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup DAC_Exported_Functions DAC Exported Functions * @{ */ -/** @defgroup DAC_Group1 Initialization and de-initialization functions +/** @defgroup DAC_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -233,6 +240,8 @@ HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac) if(hdac->State == HAL_DAC_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hdac->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_DAC_MspInit(hdac); } @@ -316,7 +325,7 @@ __weak void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac) * @} */ -/** @defgroup DAC_Group2 IO operation functions +/** @defgroup DAC_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -346,8 +355,6 @@ __weak void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac) */ HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel) { - uint32_t tmp1 = 0, tmp2 = 0; - /* Check the parameters */ assert_param(IS_DAC_CHANNEL(Channel)); @@ -357,32 +364,9 @@ HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel) /* Change DAC state */ hdac->State = HAL_DAC_STATE_BUSY; - /* Enable the Peripharal */ + /* Enable the Peripheral */ __HAL_DAC_ENABLE(hdac, Channel); - if(Channel == DAC_CHANNEL_1) - { - tmp1 = hdac->Instance->CR & DAC_CR_TEN1; - tmp2 = hdac->Instance->CR & DAC_CR_TSEL1; - /* Check if software trigger enabled */ - if((tmp1 == DAC_CR_TEN1) && (tmp2 == DAC_CR_TSEL1)) - { - /* Enable the selected DAC software conversion */ - hdac->Instance->SWTRIGR |= (uint32_t)DAC_SWTRIGR_SWTRIG1; - } - } - else - { - tmp1 = hdac->Instance->CR & DAC_CR_TEN2; - tmp2 = hdac->Instance->CR & DAC_CR_TSEL2; - /* Check if software trigger enabled */ - if((tmp1 == DAC_CR_TEN2) && (tmp2 == DAC_CR_TSEL2)) - { - /* Enable the selected DAC software conversion*/ - hdac->Instance->SWTRIGR |= (uint32_t)DAC_SWTRIGR_SWTRIG2; - } - } - /* Change DAC state */ hdac->State = HAL_DAC_STATE_READY; @@ -410,7 +394,7 @@ HAL_StatusTypeDef HAL_DAC_Stop(DAC_HandleTypeDef* hdac, uint32_t Channel) /* Disable the Peripheral */ __HAL_DAC_DISABLE(hdac, Channel); - + /* Change DAC state */ hdac->State = HAL_DAC_STATE_READY; @@ -534,7 +518,7 @@ HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, u HAL_DMA_Start_IT(hdac->DMA_Handle2, (uint32_t)pData, tmpreg, Length); } - /* Enable the Peripharal */ + /* Enable the Peripheral */ __HAL_DAC_ENABLE(hdac, Channel); /* Process Unlocked */ @@ -564,7 +548,7 @@ HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel) /* Disable the selected DAC channel DMA request */ hdac->Instance->CR &= ~(DAC_CR_DMAEN1 << Channel); - /* Disable the Peripharal */ + /* Disable the Peripheral */ __HAL_DAC_DISABLE(hdac, Channel); /* Disable the DMA Channel */ @@ -579,9 +563,9 @@ HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel) } /* Check if DMA Channel effectively disabled */ - if(status == HAL_ERROR) + if(status != HAL_OK) { - /* Update ADC state machine to error */ + /* Update DAC state machine to error */ hdac->State = HAL_DAC_STATE_ERROR; } else @@ -628,13 +612,13 @@ uint32_t HAL_DAC_GetValue(DAC_HandleTypeDef* hdac, uint32_t Channel) */ void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac) { - /* Check Overrun flag */ + /* Check underrun channel 1 flag */ if(__HAL_DAC_GET_FLAG(hdac, DAC_FLAG_DMAUDR1)) { /* Change DAC state to error state */ hdac->State = HAL_DAC_STATE_ERROR; - /* Set DAC error code to chanel1 DMA underrun error */ + /* Set DAC error code to channel1 DMA underrun error */ hdac->ErrorCode |= HAL_DAC_ERROR_DMAUNDERRUNCH1; /* Clear the underrun flag */ @@ -646,7 +630,8 @@ void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac) /* Error callback */ HAL_DAC_DMAUnderrunCallbackCh1(hdac); } - else + /* Check underrun channel 2 flag */ + if(__HAL_DAC_GET_FLAG(hdac, DAC_FLAG_DMAUDR2)) { /* Change DAC state to error state */ hdac->State = HAL_DAC_STATE_ERROR; @@ -700,7 +685,7 @@ __weak void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac) __weak void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_DAC_ErrorCallback could be implemented in the user file + the HAL_DAC_ErrorCallbackCh1 could be implemented in the user file */ } @@ -721,7 +706,7 @@ __weak void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac) * @} */ -/** @defgroup DAC_Group3 Peripheral Control functions +/** @defgroup DAC_Exported_Functions_Group3 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -763,7 +748,7 @@ HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConf hdac->State = HAL_DAC_STATE_BUSY; /* Get the DAC CR value */ - tmpreg1 = DAC->CR; + tmpreg1 = hdac->Instance->CR; /* Clear BOFFx, TENx, TSELx, WAVEx and MAMPx bits */ tmpreg1 &= ~(((uint32_t)(DAC_CR_MAMP1 | DAC_CR_WAVE1 | DAC_CR_TSEL1 | DAC_CR_TEN1 | DAC_CR_BOFF1)) << Channel); /* Configure for the selected DAC channel: buffer output, trigger */ @@ -773,9 +758,9 @@ HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConf /* Calculate CR register value depending on DAC_Channel */ tmpreg1 |= tmpreg2 << Channel; /* Write to DAC CR */ - DAC->CR = tmpreg1; + hdac->Instance->CR = tmpreg1; /* Disable wave generation */ - DAC->CR &= ~(DAC_CR_WAVE1 << Channel); + hdac->Instance->CR &= ~(DAC_CR_WAVE1 << Channel); /* Change DAC state */ hdac->State = HAL_DAC_STATE_READY; @@ -815,11 +800,11 @@ HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, ui tmp = (uint32_t)hdac->Instance; if(Channel == DAC_CHANNEL_1) { - tmp += __HAL_DHR12R1_ALIGNEMENT(Alignment); + tmp += DAC_DHR12R1_ALIGNMENT(Alignment); } else { - tmp += __HAL_DHR12R2_ALIGNEMENT(Alignment); + tmp += DAC_DHR12R2_ALIGNMENT(Alignment); } /* Set the DAC channel1 selected data holding register */ @@ -833,7 +818,7 @@ HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, ui * @} */ -/** @defgroup DAC_Group4 Peripheral State and Errors functions +/** @defgroup DAC_Exported_Functions_Group4 Peripheral State and Errors functions * @brief Peripheral State and Errors functions * @verbatim @@ -926,7 +911,10 @@ static void DAC_DMAErrorCh1(DMA_HandleTypeDef *hdma) /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx + */ #endif /* HAL_DAC_MODULE_ENABLED */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.h index e5fe640e1f3..1f03737f977 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_dac.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of DAC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,9 @@ extern "C" { #endif -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" @@ -57,9 +59,12 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup DAC_Exported_Types DAC Exported Types + * @{ + */ /** - * @brief HAL State structures definition + * @brief HAL State structures definition */ typedef enum { @@ -71,7 +76,7 @@ typedef enum }HAL_DAC_StateTypeDef; /** - * @brief DAC handle Structure definition + * @brief DAC handle Structure definition */ typedef struct { @@ -90,7 +95,7 @@ typedef struct }DAC_HandleTypeDef; /** - * @brief DAC Configuration regular Channel structure definition + * @brief DAC Configuration regular Channel structure definition */ typedef struct { @@ -100,10 +105,16 @@ typedef struct uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. This parameter can be a value of @ref DAC_output_buffer */ }DAC_ChannelConfTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ +/** @defgroup DAC_Exported_Constants DAC Exported Constants + * @{ + */ -/** @defgroup DAC_Error_Code +/** @defgroup DAC_Error_Code DAC Error Code * @{ */ #define HAL_DAC_ERROR_NONE 0x00 /*!< No error */ @@ -114,7 +125,7 @@ typedef struct * @} */ -/** @defgroup DAC_trigger_selection +/** @defgroup DAC_trigger_selection DAC Trigger Selection * @{ */ @@ -129,91 +140,64 @@ typedef struct #define DAC_TRIGGER_EXT_IT9 ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */ - -#define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ - ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ - ((TRIGGER) == DAC_TRIGGER_T8_TRGO) || \ - ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ - ((TRIGGER) == DAC_TRIGGER_T5_TRGO) || \ - ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ - ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \ - ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ - ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) /** * @} */ -/** @defgroup DAC_output_buffer +/** @defgroup DAC_output_buffer DAC Output Buffer * @{ */ #define DAC_OUTPUTBUFFER_ENABLE ((uint32_t)0x00000000) #define DAC_OUTPUTBUFFER_DISABLE ((uint32_t)DAC_CR_BOFF1) - -#define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OUTPUTBUFFER_ENABLE) || \ - ((STATE) == DAC_OUTPUTBUFFER_DISABLE)) /** * @} */ -/** @defgroup DAC_Channel_selection +/** @defgroup DAC_Channel_selection DAC Channel Selection * @{ */ #define DAC_CHANNEL_1 ((uint32_t)0x00000000) #define DAC_CHANNEL_2 ((uint32_t)0x00000010) - -#define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \ - ((CHANNEL) == DAC_CHANNEL_2)) /** * @} */ -/** @defgroup DAC_data_alignement +/** @defgroup DAC_data_alignment DAC Data Alignment * @{ */ #define DAC_ALIGN_12B_R ((uint32_t)0x00000000) #define DAC_ALIGN_12B_L ((uint32_t)0x00000004) #define DAC_ALIGN_8B_R ((uint32_t)0x00000008) - -#define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_ALIGN_12B_R) || \ - ((ALIGN) == DAC_ALIGN_12B_L) || \ - ((ALIGN) == DAC_ALIGN_8B_R)) -/** - * @} - */ - -/** @defgroup DAC_data - * @{ - */ -#define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0) /** * @} */ -/** @defgroup DAC_flags_definition +/** @defgroup DAC_flags_definition DAC Flags Definition * @{ */ #define DAC_FLAG_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) #define DAC_FLAG_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) - -#define IS_DAC_FLAG(FLAG) (((FLAG) == DAC_FLAG_DMAUDR1) || \ - ((FLAG) == DAC_FLAG_DMAUDR2)) /** * @} */ -/** @defgroup DAC_IT_definition +/** @defgroup DAC_IT_definition DAC IT Definition * @{ */ #define DAC_IT_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) #define DAC_IT_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) +/** + * @} + */ -#define IS_DAC_IT(IT) (((IT) == DAC_IT_DMAUDR1) || \ - ((IT) == DAC_IT_DMAUDR2)) /** * @} */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup DAC_Exported_Macros DAC Exported Macros + * @{ + */ /** @brief Reset DAC handle state * @param __HANDLE__: specifies the DAC handle. @@ -226,34 +210,14 @@ typedef struct * @param __DAC_Channel__: specifies the DAC channel * @retval None */ -#define __HAL_DAC_ENABLE(__HANDLE__, __DAC_Channel__) \ -((__HANDLE__)->Instance->CR |= (DAC_CR_EN1 << (__DAC_Channel__))) +#define __HAL_DAC_ENABLE(__HANDLE__, __DAC_Channel__) ((__HANDLE__)->Instance->CR |= (DAC_CR_EN1 << (__DAC_Channel__))) /** @brief Disable the DAC channel * @param __HANDLE__: specifies the DAC handle * @param __DAC_Channel__: specifies the DAC channel. * @retval None */ -#define __HAL_DAC_DISABLE(__HANDLE__, __DAC_Channel__) \ -((__HANDLE__)->Instance->CR &= ~(DAC_CR_EN1 << (__DAC_Channel__))) - -/** @brief Set DHR12R1 alignment - * @param __ALIGNEMENT__: specifies the DAC alignement - * @retval None - */ -#define __HAL_DHR12R1_ALIGNEMENT(__ALIGNEMENT__) (((uint32_t)0x00000008) + (__ALIGNEMENT__)) - -/** @brief Set DHR12R2 alignment - * @param __ALIGNEMENT__: specifies the DAC alignement - * @retval None - */ -#define __HAL_DHR12R2_ALIGNEMENT(__ALIGNEMENT__) (((uint32_t)0x00000014) + (__ALIGNEMENT__)) - -/** @brief Set DHR12RD alignment - * @param __ALIGNEMENT__: specifies the DAC alignement - * @retval None - */ -#define __HAL_DHR12RD_ALIGNEMENT(__ALIGNEMENT__) (((uint32_t)0x00000020) + (__ALIGNEMENT__)) +#define __HAL_DAC_DISABLE(__HANDLE__, __DAC_Channel__) ((__HANDLE__)->Instance->CR &= ~(DAC_CR_EN1 << (__DAC_Channel__))) /** @brief Enable the DAC interrupt * @param __HANDLE__: specifies the DAC handle @@ -269,39 +233,85 @@ typedef struct */ #define __HAL_DAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) &= ~(__INTERRUPT__)) +/** @brief Checks if the specified DAC interrupt source is enabled or disabled. + * @param __HANDLE__: DAC handle + * @param __INTERRUPT__: DAC interrupt source to check + * This parameter can be any combination of the following values: + * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt + * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt + * @retval State of interruption (SET or RESET) + */ +#define __HAL_DAC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR & (__INTERRUPT__)) == (__INTERRUPT__)) + /** @brief Get the selected DAC's flag status. * @param __HANDLE__: specifies the DAC handle. + * @param __FLAG__: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg DAC_FLAG_DMAUDR1: DMA underrun 1 flag + * @arg DAC_FLAG_DMAUDR2: DMA underrun 2 flag * @retval None */ #define __HAL_DAC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) /** @brief Clear the DAC's flag. * @param __HANDLE__: specifies the DAC handle. + * @param __FLAG__: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg DAC_FLAG_DMAUDR1: DMA underrun 1 flag + * @arg DAC_FLAG_DMAUDR2: DMA underrun 2 flag * @retval None */ #define __HAL_DAC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = (__FLAG__)) +/** + * @} + */ /* Include DAC HAL Extension module */ #include "stm32f4xx_hal_dac_ex.h" /* Exported functions --------------------------------------------------------*/ +/** @addtogroup DAC_Exported_Functions + * @{ + */ + +/** @addtogroup DAC_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions *********************************/ HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac); HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac); void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac); void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac); +/** + * @} + */ +/** @addtogroup DAC_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions ****************************************************/ HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_Stop(DAC_HandleTypeDef* hdac, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t* pData, uint32_t Length, uint32_t Alignment); HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel); uint32_t HAL_DAC_GetValue(DAC_HandleTypeDef* hdac, uint32_t Channel); +/** + * @} + */ +/** @addtogroup DAC_Exported_Functions_Group3 + * @{ + */ /* Peripheral Control functions ***********************************************/ HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConfTypeDef* sConfig, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Alignment, uint32_t Data); +/** + * @} + */ +/** @addtogroup DAC_Exported_Functions_Group4 + * @{ + */ /* Peripheral State functions *************************************************/ HAL_DAC_StateTypeDef HAL_DAC_GetState(DAC_HandleTypeDef* hdac); void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac); @@ -311,8 +321,79 @@ void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac); void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac); void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac); void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup DAC_Private_Constants DAC Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup DAC_Private_Macros DAC Private Macros + * @{ + */ +#define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0) +#define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_ALIGN_12B_R) || \ + ((ALIGN) == DAC_ALIGN_12B_L) || \ + ((ALIGN) == DAC_ALIGN_8B_R)) +#define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \ + ((CHANNEL) == DAC_CHANNEL_2)) +#define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OUTPUTBUFFER_ENABLE) || \ + ((STATE) == DAC_OUTPUTBUFFER_DISABLE)) -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ + ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ + ((TRIGGER) == DAC_TRIGGER_T8_TRGO) || \ + ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ + ((TRIGGER) == DAC_TRIGGER_T5_TRGO) || \ + ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ + ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \ + ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ + ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) + +/** @brief Set DHR12R1 alignment + * @param __ALIGNMENT__: specifies the DAC alignment + * @retval None + */ +#define DAC_DHR12R1_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000008) + (__ALIGNMENT__)) + +/** @brief Set DHR12R2 alignment + * @param __ALIGNMENT__: specifies the DAC alignment + * @retval None + */ +#define DAC_DHR12R2_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000014) + (__ALIGNMENT__)) + +/** @brief Set DHR12RD alignment + * @param __ALIGNMENT__: specifies the DAC alignment + * @retval None + */ +#define DAC_DHR12RD_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000020) + (__ALIGNMENT__)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup DAC_Private_Functions DAC Private Functions + * @{ + */ +/** + * @} + */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.c index f9c3304c8e9..61c191c5e29 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_dac_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief DAC HAL module driver. * This file provides firmware functions to manage the following * functionalities of DAC extension peripheral: @@ -25,7 +25,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -60,27 +60,28 @@ * @{ */ -/** @defgroup DACEx +/** @defgroup DACEx DACEx * @brief DAC driver modules * @{ */ #ifdef HAL_DAC_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup DACEx_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup DACEx_Exported_Functions DAC Exported Functions * @{ */ -/** @defgroup DACEx_Group1 Extended features functions +/** @defgroup DACEx_Exported_Functions_Group1 Extended features functions * @brief Extended features functions * @verbatim @@ -153,7 +154,7 @@ HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32 hdac->State = HAL_DAC_STATE_BUSY; /* Enable the selected wave generation for the selected DAC channel */ - hdac->Instance->CR |= (DAC_WAVE_TRIANGLE | Amplitude) << Channel; + MODIFY_REG(hdac->Instance->CR, (DAC_CR_WAVE1 | DAC_CR_MAMP1) << Channel, (DAC_CR_WAVE1_1 | Amplitude) << Channel); /* Change DAC state */ hdac->State = HAL_DAC_STATE_READY; @@ -201,7 +202,7 @@ HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t hdac->State = HAL_DAC_STATE_BUSY; /* Enable the selected wave generation for the selected DAC channel */ - hdac->Instance->CR |= (DAC_WAVE_NOISE | Amplitude) << Channel; + MODIFY_REG(hdac->Instance->CR, (DAC_CR_WAVE1 | DAC_CR_MAMP1) << Channel, (DAC_CR_WAVE1_0 | Amplitude) << Channel); /* Change DAC state */ hdac->State = HAL_DAC_STATE_READY; @@ -248,7 +249,7 @@ HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Align } tmp = (uint32_t)hdac->Instance; - tmp += __HAL_DHR12RD_ALIGNEMENT(Alignment); + tmp += DAC_DHR12RD_ALIGNMENT(Alignment); /* Set the dual DAC selected data holding register */ *(__IO uint32_t *)tmp = data; @@ -363,7 +364,10 @@ void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma) * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx + */ #endif /* HAL_DAC_MODULE_ENABLED */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.h index 6356e88619f..c742651c78a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dac_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_dac.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of DAC HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,9 @@ extern "C" { #endif -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" @@ -57,28 +59,12 @@ */ /* Exported types ------------------------------------------------------------*/ - -/** - * @brief HAL State structures definition - */ - /* Exported constants --------------------------------------------------------*/ - -/** @defgroup DACEx_wave_generation +/** @defgroup DACEx_Exported_Constants DAC Exported Constants * @{ */ -#define DAC_WAVEGENERATION_NONE ((uint32_t)0x00000000) -#define DAC_WAVEGENERATION_NOISE ((uint32_t)DAC_CR_WAVE1_0) -#define DAC_WAVEGENERATION_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) -#define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WAVEGENERATION_NONE) || \ - ((WAVE) == DAC_WAVEGENERATION_NOISE) || \ - ((WAVE) == DAC_WAVEGENERATION_TRIANGLE)) -/** - * @} - */ - -/** @defgroup DACEx_lfsrunmask_triangleamplitude +/** @defgroup DACEx_lfsrunmask_triangleamplitude DAC LFS Run Mask Triangle Amplitude * @{ */ #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ @@ -105,7 +91,55 @@ #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */ #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */ #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup DACEx_Exported_Functions + * @{ + */ +/** @addtogroup DACEx_Exported_Functions_Group1 + * @{ + */ +/* Extension features functions ***********************************************/ +uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); +HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); +HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); +HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); + +void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); +void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); +void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); +void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup DACEx_Private_Constants DAC Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup DACEx_Private_Macros DAC Private Macros + * @{ + */ #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \ ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \ ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \ @@ -134,37 +168,19 @@ * @} */ -/** @defgroup DACEx_wave_generation +/* Private functions ---------------------------------------------------------*/ +/** @defgroup DACEx_Private_Functions DAC Private Functions * @{ */ -#define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0) -#define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) - -#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NOISE) || \ - ((WAVE) == DAC_WAVE_TRIANGLE)) -/** - * @} - */ - -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions --------------------------------------------------------*/ - -/* Extension features functions ***********************************************/ -uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); -HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); -HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); -HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); - -void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); -void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); -void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); -void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); - void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma); void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma); void DAC_DMAHalfConvCpltCh2(DMA_HandleTypeDef *hdma); - -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/** + * @} + */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.c index c0a798bc56c..419dd5f9bc9 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_dcmi.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief DCMI HAL module driver * This file provides firmware functions to manage the following * functionalities of the Digital Camera Interface (DCMI) peripheral: @@ -63,7 +63,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -96,14 +96,15 @@ /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @defgroup DCMI +/** @defgroup DCMI DCMI * @brief DCMI HAL module driver * @{ */ #ifdef HAL_DCMI_MODULE_ENABLED -#if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\ + defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ #define HAL_TIMEOUT_DCMI_STOP ((uint32_t)1000) /* 1s */ @@ -113,13 +114,13 @@ static void DCMI_DMAConvCplt(DMA_HandleTypeDef *hdma); static void DCMI_DMAError(DMA_HandleTypeDef *hdma); -/* Private functions ---------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ -/** @defgroup DCMI_Private_Functions +/** @defgroup DCMI_Exported_Functions DCMI Exported Functions * @{ */ -/** @defgroup DCMI_Group1 Initialization and Configuration functions +/** @defgroup DCMI_Exported_Functions_Group1 Initialization and Configuration functions * @brief Initialization and Configuration functions * @verbatim @@ -141,10 +142,10 @@ static void DCMI_DMAError(DMA_HandleTypeDef *hdma); * the configuration information for DCMI. * @retval HAL status */ -HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi) +__weak HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi) { /* Check the DCMI peripheral state */ - if(hdcmi == HAL_NULL) + if(hdcmi == NULL) { return HAL_ERROR; } @@ -161,13 +162,14 @@ HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi) if(hdcmi->State == HAL_DCMI_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hdcmi->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_DCMI_MspInit(hdcmi); } /* Change the DCMI state */ hdcmi->State = HAL_DCMI_STATE_BUSY; - /* Configures the HS, VS, DE and PC polarity */ hdcmi->Instance->CR &= ~(DCMI_CR_PCKPOL | DCMI_CR_HSPOL | DCMI_CR_VSPOL | DCMI_CR_EDM_0 | DCMI_CR_EDM_1 | DCMI_CR_FCRC_0 | DCMI_CR_FCRC_1 | DCMI_CR_JPEG | @@ -183,6 +185,7 @@ HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi) ((uint32_t)hdcmi->Init.SyncroCode.LineStartCode << 8)| ((uint32_t)hdcmi->Init.SyncroCode.LineEndCode << 16) | ((uint32_t)hdcmi->Init.SyncroCode.FrameEndCode << 24)); + } /* Enable the Line interrupt */ @@ -266,7 +269,7 @@ __weak void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi) /** * @} */ -/** @defgroup DCMI_Group2 IO operation functions +/** @defgroup DCMI_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -294,7 +297,7 @@ __weak void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi) */ HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length) { - /* Initialise the second memory address */ + /* Initialize the second memory address */ uint32_t SecondMemAddress = 0; /* Check function parameters */ @@ -329,7 +332,7 @@ HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mo /* Set the DMA memory1 conversion complete callback */ hdcmi->DMA_Handle->XferM1CpltCallback = DCMI_DMAConvCplt; - /* Initialise transfer parameters */ + /* Initialize transfer parameters */ hdcmi->XferCount = 1; hdcmi->XferSize = Length; hdcmi->pBuffPtr = pData; @@ -585,7 +588,7 @@ __weak void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi) * @} */ -/** @defgroup DCMI_Group3 Peripheral Control functions +/** @defgroup DCMI_Exported_Functions_Group3 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -620,9 +623,9 @@ HAL_StatusTypeDef HAL_DCMI_ConfigCROP(DCMI_HandleTypeDef *hdcmi, uint32_t X0, ui /* Check the parameters */ assert_param(IS_DCMI_WINDOW_COORDINATE(X0)); - assert_param(IS_DCMI_WINDOW_COORDINATE(Y0)); + assert_param(IS_DCMI_WINDOW_COORDINATE(YSize)); assert_param(IS_DCMI_WINDOW_COORDINATE(XSize)); - assert_param(IS_DCMI_WINDOW_HEIGHT(YSize)); + assert_param(IS_DCMI_WINDOW_HEIGHT(Y0)); /* Configure CROP */ DCMI->CWSIZER = (XSize | (YSize << 16)); @@ -693,7 +696,7 @@ HAL_StatusTypeDef HAL_DCMI_EnableCROP(DCMI_HandleTypeDef *hdcmi) * @} */ -/** @defgroup DCMI_Group4 Peripheral State functions +/** @defgroup DCMI_Exported_Functions_Group4 Peripheral State functions * @brief Peripheral State functions * @verbatim @@ -734,7 +737,11 @@ uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi) /** * @} */ - +/* Private functions ---------------------------------------------------------*/ +/** @defgroup DCMI_Private_Functions DCMI Private Functions + * @{ + */ + /** * @brief DMA conversion complete callback. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains @@ -805,7 +812,12 @@ static void DCMI_DMAError(DMA_HandleTypeDef *hdma) /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +/** + * @} + */ +#endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ + STM32F429xx || STM32F439xx || STM32F446xx */ #endif /* HAL_DCMI_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.h index e6cfa31e2e4..dceea95c2a2 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_dcmi.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of DCMI HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,21 +43,28 @@ extern "C" { #endif -#if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\ + defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" +/* Include DCMI HAL Extended module */ +/* (include on top of file since DCMI structures are defined in extended file) */ +#include "stm32f4xx_hal_dcmi_ex.h" /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @addtogroup DCMI +/** @addtogroup DCMI DCMI + * @brief DCMI HAL module driver * @{ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup DCMI_Exported_Types DCMI Exported Types + * @{ + */ /** * @brief DCMI Error source */ @@ -67,46 +74,6 @@ typedef enum DCMI_OVERRUN = 2, /*!< DCMI Overrun */ }DCMI_ErrorTypeDef; -/** - * @brief DCMI Embedded Synchronisation CODE Init structure definition - */ -typedef struct -{ - uint8_t FrameStartCode; /*!< Specifies the code of the frame start delimiter. */ - uint8_t LineStartCode; /*!< Specifies the code of the line start delimiter. */ - uint8_t LineEndCode; /*!< Specifies the code of the line end delimiter. */ - uint8_t FrameEndCode; /*!< Specifies the code of the frame end delimiter. */ -}DCMI_CodesInitTypeDef; - -/** - * @brief DCMI Init structure definition - */ -typedef struct -{ - uint32_t SynchroMode; /*!< Specifies the Synchronization Mode: Hardware or Embedded. - This parameter can be a value of @ref DCMI_Synchronization_Mode */ - - uint32_t PCKPolarity; /*!< Specifies the Pixel clock polarity: Falling or Rising. - This parameter can be a value of @ref DCMI_PIXCK_Polarity */ - - uint32_t VSPolarity; /*!< Specifies the Vertical synchronization polarity: High or Low. - This parameter can be a value of @ref DCMI_VSYNC_Polarity */ - - uint32_t HSPolarity; /*!< Specifies the Horizontal synchronization polarity: High or Low. - This parameter can be a value of @ref DCMI_HSYNC_Polarity */ - - uint32_t CaptureRate; /*!< Specifies the frequency of frame capture: All, 1/2 or 1/4. - This parameter can be a value of @ref DCMI_Capture_Rate */ - - uint32_t ExtendedDataMode; /*!< Specifies the data width: 8-bit, 10-bit, 12-bit or 14-bit. - This parameter can be a value of @ref DCMI_Extended_Data_Mode */ - - DCMI_CodesInitTypeDef SyncroCode; /*!< Specifies the code of the frame start delimiter. */ - - uint32_t JPEGMode; /*!< Enable or Disable the JPEG mode. - This parameter can be a value of @ref DCMI_MODE_JPEG */ - -}DCMI_InitTypeDef; /** * @brief HAL DCMI State structures definition @@ -146,14 +113,16 @@ typedef struct __IO uint32_t ErrorCode; /*!< DCMI Error code */ }DCMI_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ - -/** @defgroup DCMI_Exported_Constants +/** @defgroup DCMI_Exported_Constants DCMI Exported Constants * @{ */ -/** @defgroup DCMI_Error_Code +/** @defgroup DCMI_Error_Code DCMI Error Code * @{ */ #define HAL_DCMI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ @@ -164,21 +133,18 @@ typedef struct * @} */ -/** @defgroup DCMI_Capture_Mode +/** @defgroup DCMI_Capture_Mode DCMI Capture Mode * @{ */ #define DCMI_MODE_CONTINUOUS ((uint32_t)0x00000000) /*!< The received data are transferred continuously into the destination memory through the DMA */ #define DCMI_MODE_SNAPSHOT ((uint32_t)DCMI_CR_CM) /*!< Once activated, the interface waits for the start of frame and then transfers a single frame through the DMA */ - -#define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \ - ((MODE) == DCMI_MODE_SNAPSHOT)) /** * @} */ -/** @defgroup DCMI_Synchronization_Mode +/** @defgroup DCMI_Synchronization_Mode DCMI Synchronization Mode * @{ */ #define DCMI_SYNCHRO_HARDWARE ((uint32_t)0x00000000) /*!< Hardware synchronization data capture (frame/line start/stop) @@ -186,75 +152,62 @@ typedef struct #define DCMI_SYNCHRO_EMBEDDED ((uint32_t)DCMI_CR_ESS) /*!< Embedded synchronization data capture is synchronized with synchronization codes embedded in the data flow */ -#define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \ - ((MODE) == DCMI_SYNCHRO_EMBEDDED)) /** * @} */ -/** @defgroup DCMI_PIXCK_Polarity +/** @defgroup DCMI_PIXCK_Polarity DCMI PIXCK Polarity * @{ */ #define DCMI_PCKPOLARITY_FALLING ((uint32_t)0x00000000) /*!< Pixel clock active on Falling edge */ #define DCMI_PCKPOLARITY_RISING ((uint32_t)DCMI_CR_PCKPOL) /*!< Pixel clock active on Rising edge */ -#define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \ - ((POLARITY) == DCMI_PCKPOLARITY_RISING)) /** * @} */ - -/** @defgroup DCMI_VSYNC_Polarity + +/** @defgroup DCMI_VSYNC_Polarity DCMI VSYNC Polarity * @{ */ #define DCMI_VSPOLARITY_LOW ((uint32_t)0x00000000) /*!< Vertical synchronization active Low */ #define DCMI_VSPOLARITY_HIGH ((uint32_t)DCMI_CR_VSPOL) /*!< Vertical synchronization active High */ -#define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \ - ((POLARITY) == DCMI_VSPOLARITY_HIGH)) /** * @} */ -/** @defgroup DCMI_HSYNC_Polarity +/** @defgroup DCMI_HSYNC_Polarity DCMI HSYNC Polarity * @{ */ #define DCMI_HSPOLARITY_LOW ((uint32_t)0x00000000) /*!< Horizontal synchronization active Low */ #define DCMI_HSPOLARITY_HIGH ((uint32_t)DCMI_CR_HSPOL) /*!< Horizontal synchronization active High */ -#define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \ - ((POLARITY) == DCMI_HSPOLARITY_HIGH)) /** * @} */ -/** @defgroup DCMI_MODE_JPEG +/** @defgroup DCMI_MODE_JPEG DCMI MODE JPEG * @{ */ #define DCMI_JPEG_DISABLE ((uint32_t)0x00000000) /*!< Mode JPEG Disabled */ #define DCMI_JPEG_ENABLE ((uint32_t)DCMI_CR_JPEG) /*!< Mode JPEG Enabled */ -#define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \ - ((JPEG_MODE) == DCMI_JPEG_ENABLE)) /** * @} */ -/** @defgroup DCMI_Capture_Rate +/** @defgroup DCMI_Capture_Rate DCMI Capture Rate * @{ */ #define DCMI_CR_ALL_FRAME ((uint32_t)0x00000000) /*!< All frames are captured */ #define DCMI_CR_ALTERNATE_2_FRAME ((uint32_t)DCMI_CR_FCRC_0) /*!< Every alternate frame captured */ #define DCMI_CR_ALTERNATE_4_FRAME ((uint32_t)DCMI_CR_FCRC_1) /*!< One frame in 4 frames captured */ -#define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \ - ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \ - ((RATE) == DCMI_CR_ALTERNATE_4_FRAME)) /** * @} */ -/** @defgroup DCMI_Extended_Data_Mode +/** @defgroup DCMI_Extended_Data_Mode DCMI Extended Data Mode * @{ */ #define DCMI_EXTEND_DATA_8B ((uint32_t)0x00000000) /*!< Interface captures 8-bit data on every pixel clock */ @@ -262,35 +215,29 @@ typedef struct #define DCMI_EXTEND_DATA_12B ((uint32_t)DCMI_CR_EDM_1) /*!< Interface captures 12-bit data on every pixel clock */ #define DCMI_EXTEND_DATA_14B ((uint32_t)(DCMI_CR_EDM_0 | DCMI_CR_EDM_1)) /*!< Interface captures 14-bit data on every pixel clock */ -#define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \ - ((DATA) == DCMI_EXTEND_DATA_10B) || \ - ((DATA) == DCMI_EXTEND_DATA_12B) || \ - ((DATA) == DCMI_EXTEND_DATA_14B)) /** * @} */ -/** @defgroup DCMI_Window_Coordinate +/** @defgroup DCMI_Window_Coordinate DCMI Window Coordinate * @{ */ #define DCMI_WINDOW_COORDINATE ((uint32_t)0x3FFF) /*!< Window coordinate */ -#define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE) /** * @} */ -/** @defgroup DCMI_Window_Height +/** @defgroup DCMI_Window_Height DCMI Window Height * @{ */ #define DCMI_WINDOW_HEIGHT ((uint32_t)0x1FFF) /*!< Window Height */ -#define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT) /** * @} */ -/** @defgroup DCMI_interrupt_sources +/** @defgroup DCMI_interrupt_sources DCMI interrupt sources * @{ */ #define DCMI_IT_FRAME ((uint32_t)DCMI_IER_FRAME_IE) @@ -298,19 +245,11 @@ typedef struct #define DCMI_IT_ERR ((uint32_t)DCMI_IER_ERR_IE) #define DCMI_IT_VSYNC ((uint32_t)DCMI_IER_VSYNC_IE) #define DCMI_IT_LINE ((uint32_t)DCMI_IER_LINE_IE) - -#define IS_DCMI_CONFIG_IT(IT) ((((IT) & (uint16_t)0xFFE0) == 0x0000) && ((IT) != 0x0000)) - -#define IS_DCMI_GET_IT(IT) (((IT) == DCMI_IT_FRAME) || \ - ((IT) == DCMI_IT_OVF) || \ - ((IT) == DCMI_IT_ERR) || \ - ((IT) == DCMI_IT_VSYNC) || \ - ((IT) == DCMI_IT_LINE)) /** * @} */ -/** @defgroup DCMI_Flags +/** @defgroup DCMI_Flags DCMI Flags * @{ */ @@ -336,21 +275,6 @@ typedef struct #define DCMI_FLAG_ERRMI ((uint32_t)0x1004) #define DCMI_FLAG_VSYNCMI ((uint32_t)0x1008) #define DCMI_FLAG_LINEMI ((uint32_t)0x1010) -#define IS_DCMI_GET_FLAG(FLAG) (((FLAG) == DCMI_FLAG_HSYNC) || \ - ((FLAG) == DCMI_FLAG_VSYNC) || \ - ((FLAG) == DCMI_FLAG_FNE) || \ - ((FLAG) == DCMI_FLAG_FRAMERI) || \ - ((FLAG) == DCMI_FLAG_OVFRI) || \ - ((FLAG) == DCMI_FLAG_ERRRI) || \ - ((FLAG) == DCMI_FLAG_VSYNCRI) || \ - ((FLAG) == DCMI_FLAG_LINERI) || \ - ((FLAG) == DCMI_FLAG_FRAMEMI) || \ - ((FLAG) == DCMI_FLAG_OVFMI) || \ - ((FLAG) == DCMI_FLAG_ERRMI) || \ - ((FLAG) == DCMI_FLAG_VSYNCMI) || \ - ((FLAG) == DCMI_FLAG_LINEMI)) - -#define IS_DCMI_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFE0) == 0x0000) && ((FLAG) != 0x0000)) /** * @} */ @@ -358,9 +282,12 @@ typedef struct /** * @} */ - + /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup DCMI_Exported_Macros DCMI Exported Macros + * @{ + */ + /** @brief Reset DCMI handle state * @param __HANDLE__: specifies the DCMI handle. * @retval None @@ -453,15 +380,33 @@ typedef struct * @retval The state of INTERRUPT. */ #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__)) - + +/** + * @} + */ + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup DCMI_Exported_Functions + * @{ + */ +/** @addtogroup DCMI_Exported_Functions_Group1 + * @{ + */ + /* Initialization and de-initialization functions *****************************/ HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi); HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi); void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi); - +/** + * @} + */ + +/** @addtogroup DCMI_Exported_Functions_Group2 + * @{ + */ + /* IO operation functions *****************************************************/ HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length); HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi); @@ -469,22 +414,94 @@ void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi); -void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi); - +void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi); +/** + * @} + */ + +/** @addtogroup DCMI_Exported_Functions_Group3 + * @{ + */ /* Peripheral Control functions ***********************************************/ HAL_StatusTypeDef HAL_DCMI_ConfigCROP(DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize); HAL_StatusTypeDef HAL_DCMI_EnableCROP(DCMI_HandleTypeDef *hdcmi); HAL_StatusTypeDef HAL_DCMI_DisableCROP(DCMI_HandleTypeDef *hdcmi); - +/** + * @} + */ + +/** @addtogroup DCMI_Exported_Functions_Group4 + * @{ + */ /* Peripheral State functions *************************************************/ HAL_DCMI_StateTypeDef HAL_DCMI_GetState(DCMI_HandleTypeDef *hdcmi); uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi); +/** + * @} + */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ /** * @} - */ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/** @defgroup DCMI_Private_Macros DCMI Private Macros + * @{ + */ +#define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_MODE_CONTINUOUS) || \ + ((MODE) == DCMI_MODE_SNAPSHOT)) + +#define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SYNCHRO_HARDWARE) || \ + ((MODE) == DCMI_SYNCHRO_EMBEDDED)) + +#define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPOLARITY_FALLING) || \ + ((POLARITY) == DCMI_PCKPOLARITY_RISING)) + +#define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPOLARITY_LOW) || \ + ((POLARITY) == DCMI_VSPOLARITY_HIGH)) + +#define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPOLARITY_LOW) || \ + ((POLARITY) == DCMI_HSPOLARITY_HIGH)) + +#define IS_DCMI_MODE_JPEG(JPEG_MODE)(((JPEG_MODE) == DCMI_JPEG_DISABLE) || \ + ((JPEG_MODE) == DCMI_JPEG_ENABLE)) + +#define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CR_ALL_FRAME) || \ + ((RATE) == DCMI_CR_ALTERNATE_2_FRAME) || \ + ((RATE) == DCMI_CR_ALTERNATE_4_FRAME)) + +#define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_EXTEND_DATA_8B) || \ + ((DATA) == DCMI_EXTEND_DATA_10B) || \ + ((DATA) == DCMI_EXTEND_DATA_12B) || \ + ((DATA) == DCMI_EXTEND_DATA_14B)) + +#define IS_DCMI_WINDOW_COORDINATE(COORDINATE) ((COORDINATE) <= DCMI_WINDOW_COORDINATE) + +#define IS_DCMI_WINDOW_HEIGHT(HEIGHT) ((HEIGHT) <= DCMI_WINDOW_HEIGHT) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @addtogroup DCMI_Private_Functions DCMI Private Functions + * @{ + */ + +/** + * @} + */ + +#endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ + STM32F429xx || STM32F439xx || STM32F446xx */ + +/** + * @} + */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.c new file mode 100644 index 00000000000..fe31c919d6d --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.c @@ -0,0 +1,212 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_dcmi_ex.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief DCMI Extension HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of DCMI extension peripheral: + * + Extension features functions + * + @verbatim + ============================================================================== + ##### DCMI peripheral extension features ##### + ============================================================================== + + [..] Comparing to other previous devices, the DCMI interface for STM32F446xx + devices contains the following additional features : + + (+) Support of Black and White cameras + + ##### How to use this driver ##### + ============================================================================== + [..] This driver provides functions to manage the Black and White feature + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ +/** @defgroup DCMI DCMI + * @brief DCMI HAL module driver + * @{ + */ + +#ifdef HAL_DCMI_MODULE_ENABLED + +#if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup DCMIEx_Exported_Functions DCMI Extended Exported Functions + * @{ + */ + +/** @defgroup DCMIEx_Exported_Functions_Group1 Initialization and Configuration functions + * @brief Initialization and Configuration functions + * +@verbatim + =============================================================================== + ##### Initialization and Configuration functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Initialize and configure the DCMI + (+) De-initialize the DCMI + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the DCMI according to the specified + * parameters in the DCMI_InitTypeDef and create the associated handle. + * @param hdcmi: pointer to a DCMI_HandleTypeDef structure that contains + * the configuration information for DCMI. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi) +{ + /* Check the DCMI peripheral state */ + if(hdcmi == NULL) + { + return HAL_ERROR; + } + + /* Check function parameters */ + assert_param(IS_DCMI_ALL_INSTANCE(hdcmi->Instance)); + assert_param(IS_DCMI_PCKPOLARITY(hdcmi->Init.PCKPolarity)); + assert_param(IS_DCMI_VSPOLARITY(hdcmi->Init.VSPolarity)); + assert_param(IS_DCMI_HSPOLARITY(hdcmi->Init.HSPolarity)); + assert_param(IS_DCMI_SYNCHRO(hdcmi->Init.SynchroMode)); + assert_param(IS_DCMI_CAPTURE_RATE(hdcmi->Init.CaptureRate)); + assert_param(IS_DCMI_EXTENDED_DATA(hdcmi->Init.ExtendedDataMode)); + assert_param(IS_DCMI_MODE_JPEG(hdcmi->Init.JPEGMode)); +#if defined(STM32F446xx) + assert_param(IS_DCMI_BYTE_SELECT_MODE(hdcmi->Init.ByteSelectMode)); + assert_param(IS_DCMI_BYTE_SELECT_START(hdcmi->Init.ByteSelectStart)); + assert_param(IS_DCMI_LINE_SELECT_MODE(hdcmi->Init.LineSelectMode)); + assert_param(IS_DCMI_LINE_SELECT_START(hdcmi->Init.LineSelectStart)); +#endif + if(hdcmi->State == HAL_DCMI_STATE_RESET) + { + /* Init the low level hardware */ + HAL_DCMI_MspInit(hdcmi); + } + + /* Change the DCMI state */ + hdcmi->State = HAL_DCMI_STATE_BUSY; + /* Configures the HS, VS, DE and PC polarity */ + hdcmi->Instance->CR &= ~(DCMI_CR_PCKPOL | DCMI_CR_HSPOL | DCMI_CR_VSPOL | DCMI_CR_EDM_0 |\ + DCMI_CR_EDM_1 | DCMI_CR_FCRC_0 | DCMI_CR_FCRC_1 | DCMI_CR_JPEG |\ + DCMI_CR_ESS +#if defined(STM32F446xx) + | DCMI_CR_BSM_0 | DCMI_CR_BSM_1 | DCMI_CR_OEBS |\ + DCMI_CR_LSM | DCMI_CR_OELS +#endif + ); + hdcmi->Instance->CR |= (uint32_t)(hdcmi->Init.SynchroMode | hdcmi->Init.CaptureRate |\ + hdcmi->Init.VSPolarity | hdcmi->Init.HSPolarity |\ + hdcmi->Init.PCKPolarity | hdcmi->Init.ExtendedDataMode |\ + hdcmi->Init.JPEGMode +#if defined(STM32F446xx) + | hdcmi->Init.ByteSelectMode |\ + hdcmi->Init.ByteSelectStart | hdcmi->Init.LineSelectMode |\ + hdcmi->Init.LineSelectStart +#endif + ); + if(hdcmi->Init.SynchroMode == DCMI_SYNCHRO_EMBEDDED) + { + DCMI->ESCR = (((uint32_t)hdcmi->Init.SyncroCode.FrameStartCode) | + ((uint32_t)hdcmi->Init.SyncroCode.LineStartCode << 8)| + ((uint32_t)hdcmi->Init.SyncroCode.LineEndCode << 16) | + ((uint32_t)hdcmi->Init.SyncroCode.FrameEndCode << 24)); + + } + + /* Enable the Line interrupt */ + __HAL_DCMI_ENABLE_IT(hdcmi, DCMI_IT_LINE); + + /* Enable the VSYNC interrupt */ + __HAL_DCMI_ENABLE_IT(hdcmi, DCMI_IT_VSYNC); + + /* Enable the Frame capture complete interrupt */ + __HAL_DCMI_ENABLE_IT(hdcmi, DCMI_IT_FRAME); + + /* Enable the Synchronization error interrupt */ + __HAL_DCMI_ENABLE_IT(hdcmi, DCMI_IT_ERR); + + /* Enable the Overflow interrupt */ + __HAL_DCMI_ENABLE_IT(hdcmi, DCMI_IT_OVF); + + /* Enable DCMI by setting DCMIEN bit */ + __HAL_DCMI_ENABLE(hdcmi); + + /* Update error code */ + hdcmi->ErrorCode = HAL_DCMI_ERROR_NONE; + + /* Initialize the DCMI state*/ + hdcmi->State = HAL_DCMI_STATE_READY; + + return HAL_OK; +} + + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +#endif /* HAL_DCMI_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.h new file mode 100644 index 00000000000..7c6ca943baf --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dcmi_ex.h @@ -0,0 +1,221 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_dcmi_ex.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of DCMI Extension HAL module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_DCMI_EX_H +#define __STM32F4xx_HAL_DCMI_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +#if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\ + defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup DCMIEx DCMI Extended + * @brief DCMI HAL module driver + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup DCMIEx_Exported_Types DCMI Extende Exported Types + * @{ + */ +/** + * @brief DCMIEx Embedded Synchronisation CODE Init structure definition + */ +typedef struct +{ + uint8_t FrameStartCode; /*!< Specifies the code of the frame start delimiter. */ + uint8_t LineStartCode; /*!< Specifies the code of the line start delimiter. */ + uint8_t LineEndCode; /*!< Specifies the code of the line end delimiter. */ + uint8_t FrameEndCode; /*!< Specifies the code of the frame end delimiter. */ +}DCMI_CodesInitTypeDef; + +/** + * @brief DCMI Init structure definition + */ +typedef struct +{ + uint32_t SynchroMode; /*!< Specifies the Synchronization Mode: Hardware or Embedded. + This parameter can be a value of @ref DCMI_Synchronization_Mode */ + + uint32_t PCKPolarity; /*!< Specifies the Pixel clock polarity: Falling or Rising. + This parameter can be a value of @ref DCMI_PIXCK_Polarity */ + + uint32_t VSPolarity; /*!< Specifies the Vertical synchronization polarity: High or Low. + This parameter can be a value of @ref DCMI_VSYNC_Polarity */ + + uint32_t HSPolarity; /*!< Specifies the Horizontal synchronization polarity: High or Low. + This parameter can be a value of @ref DCMI_HSYNC_Polarity */ + + uint32_t CaptureRate; /*!< Specifies the frequency of frame capture: All, 1/2 or 1/4. + This parameter can be a value of @ref DCMI_Capture_Rate */ + + uint32_t ExtendedDataMode; /*!< Specifies the data width: 8-bit, 10-bit, 12-bit or 14-bit. + This parameter can be a value of @ref DCMI_Extended_Data_Mode */ + + DCMI_CodesInitTypeDef SyncroCode; /*!< Specifies the code of the frame start delimiter. */ + + uint32_t JPEGMode; /*!< Enable or Disable the JPEG mode. + This parameter can be a value of @ref DCMI_MODE_JPEG */ +#if defined(STM32F446xx) + uint32_t ByteSelectMode; /*!< Specifies the data to be captured by the interface + This parameter can be a value of @ref DCMIEx_Byte_Select_Mode */ + + uint32_t ByteSelectStart; /*!< Specifies if the data to be captured by the interface is even or odd + This parameter can be a value of @ref DCMIEx_Byte_Select_Start */ + + uint32_t LineSelectMode; /*!< Specifies the line of data to be captured by the interface + This parameter can be a value of @ref DCMIEx_Line_Select_Mode */ + + uint32_t LineSelectStart; /*!< Specifies if the line of data to be captured by the interface is even or odd + This parameter can be a value of @ref DCMIEx_Line_Select_Start */ + +#endif /* STM32F446xx */ +}DCMI_InitTypeDef; + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +#if defined(STM32F446xx) +/** @defgroup DCMIEx_Exported_Constants DCMI Exported Constants + * @{ + */ + +/** @defgroup DCMIEx_Byte_Select_Mode DCMI Byte Select Mode + * @{ + */ +#define DCMI_BSM_ALL ((uint32_t)0x00000000) /*!< Interface captures all received data */ +#define DCMI_BSM_OTHER ((uint32_t)DCMI_CR_BSM_0) /*!< Interface captures every other byte from the received data */ +#define DCMI_BSM_ALTERNATE_4 ((uint32_t)DCMI_CR_BSM_1) /*!< Interface captures one byte out of four */ +#define DCMI_BSM_ALTERNATE_2 ((uint32_t)(DCMI_CR_BSM_0 | DCMI_CR_BSM_1)) /*!< Interface captures two bytes out of four */ + +/** + * @} + */ + +/** @defgroup DCMIEx_Byte_Select_Start DCMI Byte Select Start + * @{ + */ +#define DCMI_OEBS_ODD ((uint32_t)0x00000000) /*!< Interface captures first data from the frame/line start, second one being dropped */ +#define DCMI_OEBS_EVEN ((uint32_t)DCMI_CR_OEBS) /*!< Interface captures second data from the frame/line start, first one being dropped */ + +/** + * @} + */ + +/** @defgroup DCMIEx_Line_Select_Mode DCMI Line Select Mode + * @{ + */ +#define DCMI_LSM_ALL ((uint32_t)0x00000000) /*!< Interface captures all received lines */ +#define DCMI_LSM_ALTERNATE_2 ((uint32_t)DCMI_CR_LSM) /*!< Interface captures one line out of two */ + +/** + * @} + */ + +/** @defgroup DCMIEx_Line_Select_Start DCMI Line Select Start + * @{ + */ +#define DCMI_OELS_ODD ((uint32_t)0x00000000) /*!< Interface captures first line from the frame start, second one being dropped */ +#define DCMI_OELS_EVEN ((uint32_t)DCMI_CR_OELS) /*!< Interface captures second line from the frame start, first one being dropped */ + +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/** @defgroup DCMIEx_Private_Macros DCMI Extended Private Macros + * @{ + */ +#define IS_DCMI_BYTE_SELECT_MODE(MODE)(((MODE) == DCMI_BSM_ALL) || \ + ((MODE) == DCMI_BSM_OTHER) || \ + ((MODE) == DCMI_BSM_ALTERNATE_4) || \ + ((MODE) == DCMI_BSM_ALTERNATE_2)) + +#define IS_DCMI_BYTE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OEBS_ODD) || \ + ((POLARITY) == DCMI_OEBS_EVEN)) + +#define IS_DCMI_LINE_SELECT_MODE(MODE)(((MODE) == DCMI_LSM_ALL) || \ + ((MODE) == DCMI_LSM_ALTERNATE_2)) + +#define IS_DCMI_LINE_SELECT_START(POLARITY)(((POLARITY) == DCMI_OELS_ODD) || \ + ((POLARITY) == DCMI_OELS_EVEN)) +#endif /* STM32F446xx */ +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +#endif /* STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ + STM32F429xx || STM32F439xx || STM32F446xx */ +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_DCMI_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_def.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_def.h index dc3b23d5157..8ddc7ace134 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_def.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_def.h @@ -2,14 +2,14 @@ ****************************************************************************** * @file stm32f4xx_hal_def.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief This file contains HAL common defines, enumeration, macros and * structures definitions. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,6 +46,8 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx.h" +#include "stm32_hal_legacy.h" +#include /* Exported types ------------------------------------------------------------*/ @@ -70,10 +72,9 @@ typedef enum } HAL_LockTypeDef; /* Exported macro ------------------------------------------------------------*/ -#ifndef NULL +//#ifndef NULL #define HAL_NULL (void *) 0 -#endif - +//#endif #define HAL_MAX_DELAY 0xFFFFFFFF #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET) @@ -85,6 +86,8 @@ typedef enum (__DMA_HANDLE__).Parent = (__HANDLE__); \ } while(0) +#define UNUSED(x) ((void)(x)) + /** @brief Reset the Handle's State field. * @param __HANDLE__: specifies the Peripheral Handle. * @note This macro can be used for the following purpose: @@ -188,6 +191,22 @@ typedef enum #endif +/** + * @brief __NOINLINE definition + */ +#if defined ( __CC_ARM ) || defined ( __GNUC__ ) +/* ARM & GNUCompiler + ---------------- +*/ +#define __NOINLINE __attribute__ ( (noinline) ) + +#elif defined ( __ICCARM__ ) +/* ICCARM Compiler + --------------- +*/ +#define __NOINLINE _Pragma("optimize = no_inline") + +#endif #ifdef __cplusplus } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.c index 8043d734fd6..031f725b65a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_dma.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief DMA HAL module driver. * * This file provides firmware functions to manage the following @@ -86,7 +86,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -120,30 +120,40 @@ * @{ */ -/** @defgroup DMA +/** @defgroup DMA DMA * @brief DMA HAL module driver * @{ */ #ifdef HAL_DMA_MODULE_ENABLED -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -#define HAL_TIMEOUT_DMA_ABORT ((uint32_t)1000) /* 1s */ -/* Private macro -------------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ -static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); - +/* Private constants ---------------------------------------------------------*/ +/** @addtogroup DMA_Private_Constants + * @{ + */ + #define HAL_TIMEOUT_DMA_ABORT ((uint32_t)1000) /* 1s */ +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup DMA_Private_Functions +/** @addtogroup DMA_Private_Functions + * @{ + */ +static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); +/** + * @} + */ + +/* Exported functions ---------------------------------------------------------*/ +/** @addtogroup DMA_Exported_Functions * @{ */ -/** @defgroup DMA_Group1 Initialization and de-initialization functions - * @brief Initialization and de-initialization functions - * +/** @addtogroup DMA_Exported_Functions_Group1 + * @verbatim =============================================================================== ##### Initialization and de-initialization functions ##### @@ -203,11 +213,11 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) /* Get the CR register value */ tmp = hdma->Instance->CR; - /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC, DIR and CT bits */ + /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC, DIR, CT and DBM bits */ tmp &= ((uint32_t)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \ DMA_SxCR_PL | DMA_SxCR_MSIZE | DMA_SxCR_PSIZE | \ DMA_SxCR_MINC | DMA_SxCR_PINC | DMA_SxCR_CIRC | \ - DMA_SxCR_DIR | DMA_SxCR_CT )); + DMA_SxCR_DIR | DMA_SxCR_CT | DMA_SxCR_DBM)); /* Prepare the DMA Stream configuration */ tmp |= hdma->Init.Channel | hdma->Init.Direction | @@ -244,7 +254,7 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) /* Write to DMA Stream FCR */ hdma->Instance->FCR = tmp; - /* Initialise the error code */ + /* Initialize the error code */ hdma->ErrorCode = HAL_DMA_ERROR_NONE; /* Initialize the DMA state */ @@ -301,7 +311,7 @@ HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) __HAL_DMA_CLEAR_FLAG(hdma, __HAL_DMA_GET_FE_FLAG_INDEX(hdma)); __HAL_DMA_CLEAR_FLAG(hdma, __HAL_DMA_GET_HT_FLAG_INDEX(hdma)); - /* Initialise the error code */ + /* Initialize the error code */ hdma->ErrorCode = HAL_DMA_ERROR_NONE; /* Initialize the DMA state */ @@ -317,9 +327,8 @@ HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) * @} */ -/** @defgroup DMA_Group2 I/O operation functions - * @brief I/O operation functions - * +/** @addtogroup DMA_Exported_Functions_Group2 + * @verbatim =============================================================================== ##### IO operation functions ##### @@ -818,9 +827,8 @@ void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma) * @} */ -/** @defgroup DMA_Group3 Peripheral State functions - * @brief Peripheral State functions - * +/** @addtogroup DMA_Exported_Functions_Group3 + * @verbatim =============================================================================== ##### State and Errors functions ##### @@ -860,6 +868,14 @@ uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma) * @} */ +/** + * @} + */ + +/** @addtogroup DMA_Private_Functions + * @{ + */ + /** * @brief Sets the DMA Transfer parameter. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains @@ -871,6 +887,9 @@ uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma) */ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength) { + /* Clear DBM bit */ + hdma->Instance->CR &= (uint32_t)(~DMA_SxCR_DBM); + /* Configure DMA Stream data length */ hdma->Instance->NDTR = DataLength; @@ -893,11 +912,10 @@ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t hdma->Instance->M0AR = DstAddress; } } - /** * @} - */ - + */ + #endif /* HAL_DMA_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.h index b2582c75652..3f7c7da29fa 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_dma.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of DMA HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -56,6 +56,11 @@ /* Exported types ------------------------------------------------------------*/ +/** @defgroup DMA_Exported_Types DMA Exported Types + * @brief DMA Exported Types + * @{ + */ + /** * @brief DMA Configuration Structure definition */ @@ -97,7 +102,7 @@ typedef struct This parameter can be a value of @ref DMA_FIFO_threshold_level */ uint32_t MemBurst; /*!< Specifies the Burst transfer configuration for the memory transfers. - It specifies the amount of data to be transferred in a single non interruptable + It specifies the amount of data to be transferred in a single non interruptible transaction. This parameter can be a value of @ref DMA_Memory_burst @note The burst mode is possible only if the address Increment mode is enabled. */ @@ -109,6 +114,7 @@ typedef struct @note The burst mode is possible only if the address Increment mode is enabled. */ }DMA_InitTypeDef; + /** * @brief HAL DMA State structures definition */ @@ -159,16 +165,22 @@ typedef struct __DMA_HandleTypeDef void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */ - __IO uint32_t ErrorCode; /*!< DMA Error code */ + __IO uint32_t ErrorCode; /*!< DMA Error code */ }DMA_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup DMA_Exported_Constants +/** @defgroup DMA_Exported_Constants DMA Exported Constants + * @brief DMA Exported constants * @{ */ -/** @defgroup DMA_Error_Code +/** @defgroup DMA_Error_Code DMA Error Code + * @brief DMA Error Code * @{ */ #define HAL_DMA_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ @@ -180,7 +192,8 @@ typedef struct __DMA_HandleTypeDef * @} */ -/** @defgroup DMA_Channel_selection +/** @defgroup DMA_Channel_selection DMA Channel selection + * @brief DMA channel selection * @{ */ #define DMA_CHANNEL_0 ((uint32_t)0x00000000) /*!< DMA Channel 0 */ @@ -191,185 +204,134 @@ typedef struct __DMA_HandleTypeDef #define DMA_CHANNEL_5 ((uint32_t)0x0A000000) /*!< DMA Channel 5 */ #define DMA_CHANNEL_6 ((uint32_t)0x0C000000) /*!< DMA Channel 6 */ #define DMA_CHANNEL_7 ((uint32_t)0x0E000000) /*!< DMA Channel 7 */ - -#define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \ - ((CHANNEL) == DMA_CHANNEL_1) || \ - ((CHANNEL) == DMA_CHANNEL_2) || \ - ((CHANNEL) == DMA_CHANNEL_3) || \ - ((CHANNEL) == DMA_CHANNEL_4) || \ - ((CHANNEL) == DMA_CHANNEL_5) || \ - ((CHANNEL) == DMA_CHANNEL_6) || \ - ((CHANNEL) == DMA_CHANNEL_7)) /** * @} */ -/** @defgroup DMA_Data_transfer_direction +/** @defgroup DMA_Data_transfer_direction DMA Data transfer direction + * @brief DMA data transfer direction * @{ */ #define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000) /*!< Peripheral to memory direction */ #define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0) /*!< Memory to peripheral direction */ #define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_SxCR_DIR_1) /*!< Memory to memory direction */ - -#define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \ - ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \ - ((DIRECTION) == DMA_MEMORY_TO_MEMORY)) -/** - * @} - */ - -/** @defgroup DMA_Data_buffer_size - * @{ - */ -#define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000)) /** * @} - */ + */ -/** @defgroup DMA_Peripheral_incremented_mode +/** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode + * @brief DMA peripheral incremented mode * @{ */ #define DMA_PINC_ENABLE ((uint32_t)DMA_SxCR_PINC) /*!< Peripheral increment mode enable */ #define DMA_PINC_DISABLE ((uint32_t)0x00000000) /*!< Peripheral increment mode disable */ - -#define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \ - ((STATE) == DMA_PINC_DISABLE)) /** * @} */ -/** @defgroup DMA_Memory_incremented_mode +/** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode + * @brief DMA memory incremented mode * @{ */ #define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC) /*!< Memory increment mode enable */ #define DMA_MINC_DISABLE ((uint32_t)0x00000000) /*!< Memory increment mode disable */ - -#define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \ - ((STATE) == DMA_MINC_DISABLE)) /** * @} */ -/** @defgroup DMA_Peripheral_data_size +/** @defgroup DMA_Peripheral_data_size DMA Peripheral data size + * @brief DMA peripheral data size * @{ */ #define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Peripheral data alignment: Byte */ #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */ #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */ - -#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \ - ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \ - ((SIZE) == DMA_PDATAALIGN_WORD)) /** * @} */ - -/** @defgroup DMA_Memory_data_size +/** @defgroup DMA_Memory_data_size DMA Memory data size + * @brief DMA memory data size * @{ */ #define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Memory data alignment: Byte */ #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */ #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */ - -#define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \ - ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \ - ((SIZE) == DMA_MDATAALIGN_WORD )) /** * @} */ -/** @defgroup DMA_mode +/** @defgroup DMA_mode DMA mode + * @brief DMA mode * @{ */ #define DMA_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */ #define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */ #define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */ - -#define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \ - ((MODE) == DMA_CIRCULAR) || \ - ((MODE) == DMA_PFCTRL)) /** * @} */ -/** @defgroup DMA_Priority_level +/** @defgroup DMA_Priority_level DMA Priority level + * @brief DMA priority levels * @{ */ #define DMA_PRIORITY_LOW ((uint32_t)0x00000000) /*!< Priority level: Low */ #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */ #define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */ #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */ - -#define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \ - ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \ - ((PRIORITY) == DMA_PRIORITY_HIGH) || \ - ((PRIORITY) == DMA_PRIORITY_VERY_HIGH)) /** * @} */ -/** @defgroup DMA_FIFO_direct_mode +/** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode + * @brief DMA FIFO direct mode * @{ */ #define DMA_FIFOMODE_DISABLE ((uint32_t)0x00000000) /*!< FIFO mode disable */ #define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */ - -#define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \ - ((STATE) == DMA_FIFOMODE_ENABLE)) /** * @} */ -/** @defgroup DMA_FIFO_threshold_level +/** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level + * @brief DMA FIFO level * @{ */ #define DMA_FIFO_THRESHOLD_1QUARTERFULL ((uint32_t)0x00000000) /*!< FIFO threshold 1 quart full configuration */ #define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */ #define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */ #define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */ - -#define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \ - ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \ - ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \ - ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL)) /** * @} */ -/** @defgroup DMA_Memory_burst +/** @defgroup DMA_Memory_burst DMA Memory burst + * @brief DMA memory burst * @{ */ #define DMA_MBURST_SINGLE ((uint32_t)0x00000000) #define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0) #define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1) #define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST) - -#define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \ - ((BURST) == DMA_MBURST_INC4) || \ - ((BURST) == DMA_MBURST_INC8) || \ - ((BURST) == DMA_MBURST_INC16)) /** * @} */ -/** @defgroup DMA_Peripheral_burst +/** @defgroup DMA_Peripheral_burst DMA Peripheral burst + * @brief DMA peripheral burst * @{ */ #define DMA_PBURST_SINGLE ((uint32_t)0x00000000) #define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0) #define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1) #define DMA_PBURST_INC16 ((uint32_t)DMA_SxCR_PBURST) - -#define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \ - ((BURST) == DMA_PBURST_INC4) || \ - ((BURST) == DMA_PBURST_INC8) || \ - ((BURST) == DMA_PBURST_INC16)) /** * @} */ -/** @defgroup DMA_interrupt_enable_definitions +/** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions + * @brief DMA interrupts definition * @{ */ #define DMA_IT_TC ((uint32_t)DMA_SxCR_TCIE) @@ -381,7 +343,8 @@ typedef struct __DMA_HandleTypeDef * @} */ -/** @defgroup DMA_flag_definitions +/** @defgroup DMA_flag_definitions DMA flag definitions + * @brief DMA flag definitions * @{ */ #define DMA_FLAG_FEIF0_4 ((uint32_t)0x00800001) @@ -407,11 +370,11 @@ typedef struct __DMA_HandleTypeDef /** * @} */ - + /** * @} */ - + /* Exported macro ------------------------------------------------------------*/ /** @brief Reset DMA handle state @@ -664,21 +627,128 @@ typedef struct __DMA_HandleTypeDef #include "stm32f4xx_hal_dma_ex.h" /* Exported functions --------------------------------------------------------*/ - -/* Initialization and de-initialization functions *****************************/ + +/** @defgroup DMA_Exported_Functions DMA Exported Functions + * @brief DMA Exported functions + * @{ + */ + +/** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and de-initialization functions + * @{ + */ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma); HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma); +/** + * @} + */ -/* IO operation functions *****************************************************/ +/** @defgroup DMA_Exported_Functions_Group2 I/O operation functions + * @brief I/O operation functions + * @{ + */ HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma); HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout); void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma); +/** + * @} + */ -/* Peripheral State and Error functions ***************************************/ +/** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions + * @brief Peripheral State functions + * @{ + */ HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma); uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma); +/** + * @} + */ +/** + * @} + */ +/* Private Constants -------------------------------------------------------------*/ +/** @defgroup DMA_Private_Constants DMA Private Constants + * @brief DMA private defines and constants + * @{ + */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup DMA_Private_Macros DMA Private Macros + * @brief DMA private macros + * @{ + */ +#define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \ + ((CHANNEL) == DMA_CHANNEL_1) || \ + ((CHANNEL) == DMA_CHANNEL_2) || \ + ((CHANNEL) == DMA_CHANNEL_3) || \ + ((CHANNEL) == DMA_CHANNEL_4) || \ + ((CHANNEL) == DMA_CHANNEL_5) || \ + ((CHANNEL) == DMA_CHANNEL_6) || \ + ((CHANNEL) == DMA_CHANNEL_7)) + +#define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \ + ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \ + ((DIRECTION) == DMA_MEMORY_TO_MEMORY)) + +#define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000)) + +#define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \ + ((STATE) == DMA_PINC_DISABLE)) + +#define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \ + ((STATE) == DMA_MINC_DISABLE)) + +#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \ + ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \ + ((SIZE) == DMA_PDATAALIGN_WORD)) + +#define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \ + ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \ + ((SIZE) == DMA_MDATAALIGN_WORD )) + +#define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \ + ((MODE) == DMA_CIRCULAR) || \ + ((MODE) == DMA_PFCTRL)) + +#define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \ + ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \ + ((PRIORITY) == DMA_PRIORITY_HIGH) || \ + ((PRIORITY) == DMA_PRIORITY_VERY_HIGH)) + +#define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \ + ((STATE) == DMA_FIFOMODE_ENABLE)) + +#define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \ + ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \ + ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \ + ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL)) + +#define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \ + ((BURST) == DMA_MBURST_INC4) || \ + ((BURST) == DMA_MBURST_INC8) || \ + ((BURST) == DMA_MBURST_INC16)) + +#define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \ + ((BURST) == DMA_PBURST_INC4) || \ + ((BURST) == DMA_PBURST_INC8) || \ + ((BURST) == DMA_PBURST_INC16)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup DMA_Private_Functions DMA Private Functions + * @brief DMA private functions + * @{ + */ +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.c index 276a5e365cf..b1d3631f3d2 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_dma2d.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief DMA2D HAL module driver. * This file provides firmware functions to manage the following * functionalities of the DMA2D peripheral: @@ -11,11 +11,11 @@ * + IO operation functions * + Peripheral Control functions * + Peripheral State and Errors functions - * - @verbatim - ============================================================================== + * + @verbatim + ============================================================================== ##### How to use this driver ##### - ============================================================================== + ============================================================================== [..] (#) Program the required configuration through following parameters: the Transfer Mode, the output color mode and the output offset using @@ -87,7 +87,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -120,7 +120,7 @@ /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @defgroup DMA2D +/** @addtogroup DMA2D * @brief DMA2D HAL module driver * @{ */ @@ -129,18 +129,32 @@ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) -/* Private typedef -----------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup DMA2D_Private_Defines + * @{ + */ #define HAL_TIMEOUT_DMA2D_ABORT ((uint32_t)1000) /* 1s */ #define HAL_TIMEOUT_DMA2D_SUSPEND ((uint32_t)1000) /* 1s */ -/* Private macro -------------------------------------------------------------*/ +/** + * @} + */ + /* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -static void DMA2D_SetConfig(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh); +/** @addtogroup DMA2D_Private_Functions_Prototypes + * @{ + */ +static void DMA2D_SetConfig(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height); +/** + * @} + */ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup DMA2D_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup DMA2D_Exported_Functions * @{ */ @@ -184,6 +198,8 @@ HAL_StatusTypeDef HAL_DMA2D_Init(DMA2D_HandleTypeDef *hdma2d) if(hdma2d->State == HAL_DMA2D_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hdma2d->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_DMA2D_MspInit(hdma2d); } @@ -336,10 +352,10 @@ __weak void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d) * the color value if register to memory DMA2D mode is selected. * @param DstAddress: The destination memory Buffer address. * @param Width: The width of data to be transferred from source to destination. - * @param Heigh: The heigh of data to be transferred from source to destination. + * @param Height: The height of data to be transferred from source to destination. * @retval HAL status */ -HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh) +HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height) { /* Process locked */ __HAL_LOCK(hdma2d); @@ -348,14 +364,14 @@ HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, u hdma2d->State = HAL_DMA2D_STATE_BUSY; /* Check the parameters */ - assert_param(IS_DMA2D_LINE(Heigh)); + assert_param(IS_DMA2D_LINE(Height)); assert_param(IS_DMA2D_PIXEL(Width)); /* Disable the Peripheral */ __HAL_DMA2D_DISABLE(hdma2d); /* Configure the source, destination address and the data size */ - DMA2D_SetConfig(hdma2d, pdata, DstAddress, Width, Heigh); + DMA2D_SetConfig(hdma2d, pdata, DstAddress, Width, Height); /* Enable the Peripheral */ __HAL_DMA2D_ENABLE(hdma2d); @@ -373,10 +389,10 @@ HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, u * the color value if register to memory DMA2D mode is selected. * @param DstAddress: The destination memory Buffer address. * @param Width: The width of data to be transferred from source to destination. - * @param Heigh: The heigh of data to be transferred from source to destination. + * @param Height: The height of data to be transferred from source to destination. * @retval HAL status */ -HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh) +HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height) { /* Process locked */ __HAL_LOCK(hdma2d); @@ -385,14 +401,14 @@ HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata hdma2d->State = HAL_DMA2D_STATE_BUSY; /* Check the parameters */ - assert_param(IS_DMA2D_LINE(Heigh)); + assert_param(IS_DMA2D_LINE(Height)); assert_param(IS_DMA2D_PIXEL(Width)); /* Disable the Peripheral */ __HAL_DMA2D_DISABLE(hdma2d); /* Configure the source, destination address and the data size */ - DMA2D_SetConfig(hdma2d, pdata, DstAddress, Width, Heigh); + DMA2D_SetConfig(hdma2d, pdata, DstAddress, Width, Height); /* Enable the transfer complete interrupt */ __HAL_DMA2D_ENABLE_IT(hdma2d, DMA2D_IT_TC); @@ -417,10 +433,10 @@ HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata * @param SrcAddress2: The source memory Buffer address of the background layer. * @param DstAddress: The destination memory Buffer address * @param Width: The width of data to be transferred from source to destination. - * @param Heigh: The heigh of data to be transferred from source to destination. + * @param Height: The height of data to be transferred from source to destination. * @retval HAL status */ -HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Heigh) +HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Height) { /* Process locked */ __HAL_LOCK(hdma2d); @@ -429,7 +445,7 @@ HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t hdma2d->State = HAL_DMA2D_STATE_BUSY; /* Check the parameters */ - assert_param(IS_DMA2D_LINE(Heigh)); + assert_param(IS_DMA2D_LINE(Height)); assert_param(IS_DMA2D_PIXEL(Width)); /* Disable the Peripheral */ @@ -439,7 +455,7 @@ HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t hdma2d->Instance->BGMAR = SrcAddress2; /* Configure the source, destination address and the data size */ - DMA2D_SetConfig(hdma2d, SrcAddress1, DstAddress, Width, Heigh); + DMA2D_SetConfig(hdma2d, SrcAddress1, DstAddress, Width, Height); /* Enable the Peripheral */ __HAL_DMA2D_ENABLE(hdma2d); @@ -455,10 +471,10 @@ HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t * @param SrcAddress2: The source memory Buffer address of the background layer. * @param DstAddress: The destination memory Buffer address. * @param Width: The width of data to be transferred from source to destination. - * @param Heigh: The heigh of data to be transferred from source to destination. + * @param Height: The height of data to be transferred from source to destination. * @retval HAL status */ -HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Heigh) +HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Height) { /* Process locked */ __HAL_LOCK(hdma2d); @@ -467,7 +483,7 @@ HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32 hdma2d->State = HAL_DMA2D_STATE_BUSY; /* Check the parameters */ - assert_param(IS_DMA2D_LINE(Heigh)); + assert_param(IS_DMA2D_LINE(Height)); assert_param(IS_DMA2D_PIXEL(Width)); /* Disable the Peripheral */ @@ -477,7 +493,7 @@ HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32 hdma2d->Instance->BGMAR = SrcAddress2; /* Configure the source, destination address and the data size */ - DMA2D_SetConfig(hdma2d, SrcAddress1, DstAddress, Width, Heigh); + DMA2D_SetConfig(hdma2d, SrcAddress1, DstAddress, Width, Height); /* Enable the configuration error interrupt */ __HAL_DMA2D_ENABLE_IT(hdma2d, DMA2D_IT_CE); @@ -1165,10 +1181,10 @@ uint32_t HAL_DMA2D_GetError(DMA2D_HandleTypeDef *hdma2d) * @param pdata: The source memory Buffer address * @param DstAddress: The destination memory Buffer address * @param Width: The width of data to be transferred from source to destination. - * @param Heigh: The heigh of data to be transferred from source to destination. + * @param Height: The height of data to be transferred from source to destination. * @retval HAL status */ -static void DMA2D_SetConfig(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh) +static void DMA2D_SetConfig(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height) { uint32_t tmp = 0; uint32_t tmp1 = 0; @@ -1179,7 +1195,7 @@ static void DMA2D_SetConfig(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_ tmp = Width << 16; /* Configure DMA2D data size */ - hdma2d->Instance->NLR = (Heigh | tmp); + hdma2d->Instance->NLR = (Height | tmp); /* Configure DMA2D destination address */ hdma2d->Instance->OMAR = DstAddress; diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.h index af0ce06dc47..a57a7c6c9f1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma2d.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_dma2d.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of DMA2D HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -51,12 +51,15 @@ * @{ */ -/** @addtogroup DMA2D +/** @defgroup DMA2D DMA2D + * @brief DMA2D HAL module driver * @{ - */ - -/* Exported types ------------------------------------------------------------*/ + */ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup DMA2D_Exported_Types DMA2D Exported Types + * @{ + */ #define MAX_DMA2D_LAYER 2 /** @@ -158,23 +161,16 @@ typedef struct __DMA2D_HandleTypeDef __IO uint32_t ErrorCode; /*!< DMA2D Error code */ } DMA2D_HandleTypeDef; - - -/* Exported constants --------------------------------------------------------*/ - -/** @defgroup DMA2D_Exported_Constants - * @{ +/** + * @} */ -/** @defgroup DMA2D_Layer +/* Exported constants --------------------------------------------------------*/ +/** @defgroup DMA2D_Exported_Constants DMA2D Exported Constants * @{ */ -#define IS_DMA2D_LAYER(LAYER) ((LAYER) <= MAX_DMA2D_LAYER) -/** - * @} - */ -/** @defgroup DMA2D_Error_Code +/** @defgroup DMA2D_Error_Code DMA2D Error Code * @{ */ #define HAL_DMA2D_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ @@ -185,21 +181,18 @@ typedef struct __DMA2D_HandleTypeDef * @} */ -/** @defgroup DMA2D_Mode +/** @defgroup DMA2D_Mode DMA2D Mode * @{ */ #define DMA2D_M2M ((uint32_t)0x00000000) /*!< DMA2D memory to memory transfer mode */ #define DMA2D_M2M_PFC ((uint32_t)0x00010000) /*!< DMA2D memory to memory with pixel format conversion transfer mode */ #define DMA2D_M2M_BLEND ((uint32_t)0x00020000) /*!< DMA2D memory to memory with blending transfer mode */ #define DMA2D_R2M ((uint32_t)0x00030000) /*!< DMA2D register to memory transfer mode */ - -#define IS_DMA2D_MODE(MODE) (((MODE) == DMA2D_M2M) || ((MODE) == DMA2D_M2M_PFC) || \ - ((MODE) == DMA2D_M2M_BLEND) || ((MODE) == DMA2D_R2M)) /** * @} */ -/** @defgroup DMA2D_Color_Mode +/** @defgroup DMA2D_Color_Mode DMA2D Color Mode * @{ */ #define DMA2D_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 DMA2D color mode */ @@ -207,48 +200,36 @@ typedef struct __DMA2D_HandleTypeDef #define DMA2D_RGB565 ((uint32_t)0x00000002) /*!< RGB565 DMA2D color mode */ #define DMA2D_ARGB1555 ((uint32_t)0x00000003) /*!< ARGB1555 DMA2D color mode */ #define DMA2D_ARGB4444 ((uint32_t)0x00000004) /*!< ARGB4444 DMA2D color mode */ - -#define IS_DMA2D_CMODE(MODE_ARGB) (((MODE_ARGB) == DMA2D_ARGB8888) || ((MODE_ARGB) == DMA2D_RGB888) || \ - ((MODE_ARGB) == DMA2D_RGB565) || ((MODE_ARGB) == DMA2D_ARGB1555) || \ - ((MODE_ARGB) == DMA2D_ARGB4444)) /** * @} */ -/** @defgroup DMA2D_COLOR_VALUE +/** @defgroup DMA2D_COLOR_VALUE DMA2D COLOR VALUE * @{ */ - #define COLOR_VALUE ((uint32_t)0x000000FF) /*!< color value mask */ - -#define IS_DMA2D_COLOR(COLOR) ((COLOR) <= COLOR_VALUE) /** * @} */ -/** @defgroup DMA2D_SIZE +/** @defgroup DMA2D_SIZE DMA2D SIZE * @{ */ #define DMA2D_PIXEL (DMA2D_NLR_PL >> 16) /*!< DMA2D pixel per line */ #define DMA2D_LINE DMA2D_NLR_NL /*!< DMA2D number of line */ - -#define IS_DMA2D_LINE(LINE) ((LINE) <= DMA2D_LINE) -#define IS_DMA2D_PIXEL(PIXEL) ((PIXEL) <= DMA2D_PIXEL) /** * @} */ -/** @defgroup DMA2D_Offset +/** @defgroup DMA2D_Offset DMA2D Offset * @{ */ #define DMA2D_OFFSET DMA2D_FGOR_LO /*!< Line Offset */ - -#define IS_DMA2D_OFFSET(OOFFSET) ((OOFFSET) <= DMA2D_OFFSET) /** * @} */ -/** @defgroup DMA2D_Input_Color_Mode +/** @defgroup DMA2D_Input_Color_Mode DMA2D Input Color Mode * @{ */ #define CM_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 color mode */ @@ -262,64 +243,47 @@ typedef struct __DMA2D_HandleTypeDef #define CM_L4 ((uint32_t)0x00000008) /*!< L4 color mode */ #define CM_A8 ((uint32_t)0x00000009) /*!< A8 color mode */ #define CM_A4 ((uint32_t)0x0000000A) /*!< A4 color mode */ - -#define IS_DMA2D_INPUT_COLOR_MODE(INPUT_CM) (((INPUT_CM) == CM_ARGB8888) || ((INPUT_CM) == CM_RGB888) || \ - ((INPUT_CM) == CM_RGB565) || ((INPUT_CM) == CM_ARGB1555) || \ - ((INPUT_CM) == CM_ARGB4444) || ((INPUT_CM) == CM_L8) || \ - ((INPUT_CM) == CM_AL44) || ((INPUT_CM) == CM_AL88) || \ - ((INPUT_CM) == CM_L4) || ((INPUT_CM) == CM_A8) || \ - ((INPUT_CM) == CM_A4)) /** * @} */ -/** @defgroup DMA2D_ALPHA_MODE +/** @defgroup DMA2D_ALPHA_MODE DMA2D ALPHA MODE * @{ */ #define DMA2D_NO_MODIF_ALPHA ((uint32_t)0x00000000) /*!< No modification of the alpha channel value */ #define DMA2D_REPLACE_ALPHA ((uint32_t)0x00000001) /*!< Replace original alpha channel value by programmed alpha value */ #define DMA2D_COMBINE_ALPHA ((uint32_t)0x00000002) /*!< Replace original alpha channel value by programmed alpha value with original alpha channel value */ - -#define IS_DMA2D_ALPHA_MODE(AlphaMode) (((AlphaMode) == DMA2D_NO_MODIF_ALPHA) || \ - ((AlphaMode) == DMA2D_REPLACE_ALPHA) || \ - ((AlphaMode) == DMA2D_COMBINE_ALPHA)) /** * @} */ -/** @defgroup DMA2D_CLUT_CM +/** @defgroup DMA2D_CLUT_CM DMA2D CLUT CM * @{ */ #define DMA2D_CCM_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 DMA2D C-LUT color mode */ #define DMA2D_CCM_RGB888 ((uint32_t)0x00000001) /*!< RGB888 DMA2D C-LUT color mode */ - -#define IS_DMA2D_CLUT_CM(CLUT_CM) (((CLUT_CM) == DMA2D_CCM_ARGB8888) || ((CLUT_CM) == DMA2D_CCM_RGB888)) /** * @} */ -/** @defgroup DMA2D_Size_Clut +/** @defgroup DMA2D_Size_Clut DMA2D Size Clut * @{ */ #define DMA2D_CLUT_SIZE (DMA2D_FGPFCCR_CS >> 8) /*!< DMA2D C-LUT size */ - -#define IS_DMA2D_CLUT_SIZE(CLUT_SIZE) ((CLUT_SIZE) <= DMA2D_CLUT_SIZE) /** * @} */ -/** @defgroup DMA2D_DeadTime +/** @defgroup DMA2D_DeadTime DMA2D DeadTime * @{ */ #define LINE_WATERMARK DMA2D_LWR_LW - -#define IS_DMA2D_LineWatermark(LineWatermark) ((LineWatermark) <= LINE_WATERMARK) /** * @} */ -/** @defgroup DMA2D_Interrupts +/** @defgroup DMA2D_Interrupts DMA2D Interrupts * @{ */ #define DMA2D_IT_CE DMA2D_CR_CEIE /*!< Configuration Error Interrupt */ @@ -328,15 +292,11 @@ typedef struct __DMA2D_HandleTypeDef #define DMA2D_IT_TW DMA2D_CR_TWIE /*!< Transfer Watermark Interrupt */ #define DMA2D_IT_TC DMA2D_CR_TCIE /*!< Transfer Complete Interrupt */ #define DMA2D_IT_TE DMA2D_CR_TEIE /*!< Transfer Error Interrupt */ - -#define IS_DMA2D_IT(IT) (((IT) == DMA2D_IT_CTC) || ((IT) == DMA2D_IT_CAE) || \ - ((IT) == DMA2D_IT_TW) || ((IT) == DMA2D_IT_TC) || \ - ((IT) == DMA2D_IT_TE) || ((IT) == DMA2D_IT_CE)) /** * @} */ -/** @defgroup DMA2D_Flag +/** @defgroup DMA2D_Flag DMA2D Flag * @{ */ #define DMA2D_FLAG_CE DMA2D_ISR_CEIF /*!< Configuration Error Interrupt Flag */ @@ -345,10 +305,6 @@ typedef struct __DMA2D_HandleTypeDef #define DMA2D_FLAG_TW DMA2D_ISR_TWIF /*!< Transfer Watermark Interrupt Flag */ #define DMA2D_FLAG_TC DMA2D_ISR_TCIF /*!< Transfer Complete Interrupt Flag */ #define DMA2D_FLAG_TE DMA2D_ISR_TEIF /*!< Transfer Error Interrupt Flag */ - -#define IS_DMA2D_GET_FLAG(FLAG) (((FLAG) == DMA2D_FLAG_CTC) || ((FLAG) == DMA2D_FLAG_CAE) || \ - ((FLAG) == DMA2D_FLAG_TW) || ((FLAG) == DMA2D_FLAG_TC) || \ - ((FLAG) == DMA2D_FLAG_TE) || ((FLAG) == DMA2D_FLAG_CE)) /** * @} */ @@ -357,6 +313,9 @@ typedef struct __DMA2D_HandleTypeDef * @} */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup DMA2D_Exported_Macros DMA2D Exported Macros + * @{ + */ /** @brief Reset DMA2D handle state * @param __HANDLE__: specifies the DMA2D handle. @@ -453,9 +412,14 @@ typedef struct __DMA2D_HandleTypeDef * @retval The state of INTERRUPT. */ #define __HAL_DMA2D_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__)) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ - +/** @defgroup DMA2D_Exported_Functions DMA2D Exported Functions + * @{ + */ /* Initialization and de-initialization functions *******************************/ HAL_StatusTypeDef HAL_DMA2D_Init(DMA2D_HandleTypeDef *hdma2d); HAL_StatusTypeDef HAL_DMA2D_DeInit (DMA2D_HandleTypeDef *hdma2d); @@ -463,10 +427,10 @@ void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* hdma2d); void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d); /* IO operation functions *******************************************************/ -HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh); -HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Heigh); -HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh); -HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Heigh); +HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height); +HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Height); +HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height); +HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Height); HAL_StatusTypeDef HAL_DMA2D_Suspend(DMA2D_HandleTypeDef *hdma2d); HAL_StatusTypeDef HAL_DMA2D_Resume(DMA2D_HandleTypeDef *hdma2d); HAL_StatusTypeDef HAL_DMA2D_Abort(DMA2D_HandleTypeDef *hdma2d); @@ -483,22 +447,108 @@ HAL_StatusTypeDef HAL_DMA2D_ProgramLineEvent(DMA2D_HandleTypeDef *hdma2d, uint3 /* Peripheral State functions ***************************************************/ HAL_DMA2D_StateTypeDef HAL_DMA2D_GetState(DMA2D_HandleTypeDef *hdma2d); uint32_t HAL_DMA2D_GetError(DMA2D_HandleTypeDef *hdma2d); +/** + * @} + */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/* Private types -------------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Types DMA2D Private Types + * @{ + */ + +/** + * @} + */ + +/* Private defines -------------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Defines DMA2D Private Defines + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Variables DMA2D Private Variables + * @{ + */ /** * @} */ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Constants DMA2D Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Macros DMA2D Private Macros + * @{ + */ +#define IS_DMA2D_LAYER(LAYER) ((LAYER) <= MAX_DMA2D_LAYER) +#define IS_DMA2D_MODE(MODE) (((MODE) == DMA2D_M2M) || ((MODE) == DMA2D_M2M_PFC) || \ + ((MODE) == DMA2D_M2M_BLEND) || ((MODE) == DMA2D_R2M)) +#define IS_DMA2D_CMODE(MODE_ARGB) (((MODE_ARGB) == DMA2D_ARGB8888) || ((MODE_ARGB) == DMA2D_RGB888) || \ + ((MODE_ARGB) == DMA2D_RGB565) || ((MODE_ARGB) == DMA2D_ARGB1555) || \ + ((MODE_ARGB) == DMA2D_ARGB4444)) +#define IS_DMA2D_COLOR(COLOR) ((COLOR) <= COLOR_VALUE) +#define IS_DMA2D_LINE(LINE) ((LINE) <= DMA2D_LINE) +#define IS_DMA2D_PIXEL(PIXEL) ((PIXEL) <= DMA2D_PIXEL) +#define IS_DMA2D_OFFSET(OOFFSET) ((OOFFSET) <= DMA2D_OFFSET) +#define IS_DMA2D_INPUT_COLOR_MODE(INPUT_CM) (((INPUT_CM) == CM_ARGB8888) || ((INPUT_CM) == CM_RGB888) || \ + ((INPUT_CM) == CM_RGB565) || ((INPUT_CM) == CM_ARGB1555) || \ + ((INPUT_CM) == CM_ARGB4444) || ((INPUT_CM) == CM_L8) || \ + ((INPUT_CM) == CM_AL44) || ((INPUT_CM) == CM_AL88) || \ + ((INPUT_CM) == CM_L4) || ((INPUT_CM) == CM_A8) || \ + ((INPUT_CM) == CM_A4)) +#define IS_DMA2D_ALPHA_MODE(AlphaMode) (((AlphaMode) == DMA2D_NO_MODIF_ALPHA) || \ + ((AlphaMode) == DMA2D_REPLACE_ALPHA) || \ + ((AlphaMode) == DMA2D_COMBINE_ALPHA)) +#define IS_DMA2D_CLUT_CM(CLUT_CM) (((CLUT_CM) == DMA2D_CCM_ARGB8888) || ((CLUT_CM) == DMA2D_CCM_RGB888)) +#define IS_DMA2D_CLUT_SIZE(CLUT_SIZE) ((CLUT_SIZE) <= DMA2D_CLUT_SIZE) +#define IS_DMA2D_LineWatermark(LineWatermark) ((LineWatermark) <= LINE_WATERMARK) /** * @} */ - + +/* Private functions prototypes ---------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Functions_Prototypes DMA2D Private Functions Prototypes + * @{ + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup DMA2D_Private_Functions DMA2D Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + #ifdef __cplusplus } #endif #endif /* __STM32F4xx_HAL_DMA2D_H */ - /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.c index 6a85d87bc47..1b847ab8613 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_dma_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief DMA Extension HAL module driver * This file provides firmware functions to manage the following * functionalities of the DMA Extension peripheral: @@ -27,7 +27,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -61,30 +61,35 @@ * @{ */ -/** @defgroup DMAEx +/** @defgroup DMAEx DMAEx * @brief DMA Extended HAL module driver * @{ */ #ifdef HAL_DMA_MODULE_ENABLED -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ +/* Private Constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +/** @addtogroup DMAEx_Private_Functions + * @{ + */ static void DMA_MultiBufferSetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); +/** + * @} + */ -/* Private functions ---------------------------------------------------------*/ +/* Exported functions ---------------------------------------------------------*/ -/** @defgroup DMAEx_Private_Functions +/** @addtogroup DMAEx_Exported_Functions * @{ */ -/** @defgroup DMAEx_Group1 Extended features functions - * @brief Extended features functions - * +/** @addtogroup DMAEx_Exported_Functions_Group1 + * @verbatim =============================================================================== ##### Extended features functions ##### @@ -244,6 +249,14 @@ HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Addre * @} */ +/** + * @} + */ + +/** @addtogroup DMAEx_Private_Functions + * @{ + */ + /** * @brief Set the DMA Transfer parameter. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.h index 534ed763e9c..d86afd046b0 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_dma_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_dma_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of DMA HAL extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,7 +55,11 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup DMAEx_Exported_Types DMAEx Exported Types + * @brief DMAEx Exported types + * @{ + */ + /** * @brief HAL DMA Memory definition */ @@ -66,15 +70,42 @@ typedef enum }HAL_DMA_MemoryTypeDef; -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions + * @brief DMAEx Exported functions + * @{ + */ + +/** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions + * @brief Extended features functions + * @{ + */ + /* IO operation functions *******************************************************/ HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength); HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength); HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory); +/** + * @} + */ +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup DMAEx_Private_Functions DMAEx Private Functions + * @brief DMAEx Private functions + * @{ + */ +/** + * @} + */ + /** * @} */ @@ -87,6 +118,6 @@ HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Addre } #endif -#endif /* __STM32F4xx_HAL_DMA_H */ +#endif /*__STM32F4xx_HAL_DMA_EX_H*/ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.c index d9fc4098ade..c27249402e6 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_eth.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief ETH HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Ethernet (ETH) peripheral: @@ -26,9 +26,9 @@ (#)Initialize the ETH low level resources through the HAL_ETH_MspInit() API: (##) Enable the Ethernet interface clock using - (+++) __ETHMAC_CLK_ENABLE(); - (+++) __ETHMACTX_CLK_ENABLE(); - (+++) __ETHMACRX_CLK_ENABLE(); + (+++) __HAL_RCC_ETHMAC_CLK_ENABLE(); + (+++) __HAL_RCC_ETHMACTX_CLK_ENABLE(); + (+++) __HAL_RCC_ETHMACRX_CLK_ENABLE(); (##) Initialize the related GPIO clocks (##) Configure Ethernet pin-out @@ -63,12 +63,15 @@ (#) Configure the Ethernet DMA after ETH peripheral initialization HAL_ETH_ConfigDMA(); all DMA parameters should be filled. + + -@- The PTP protocol and the DMA descriptors ring mode are not supported + in this driver @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -102,7 +105,7 @@ * @{ */ -/** @defgroup ETH +/** @defgroup ETH ETH * @brief ETH HAL module driver * @{ */ @@ -113,12 +116,21 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @defgroup ETH_Private_Constants ETH Private Constants + * @{ + */ #define LINKED_STATE_TIMEOUT_VALUE ((uint32_t)2000) /* 2000 ms */ #define AUTONEGO_COMPLETED_TIMEOUT_VALUE ((uint32_t)1000) /* 1000 ms */ +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @defgroup ETH_Private_Functions ETH Private Functions + * @{ + */ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err); static void ETH_MACAddressConfig(ETH_HandleTypeDef *heth, uint32_t MacAddr, uint8_t *Addr); static void ETH_MACReceptionEnable(ETH_HandleTypeDef *heth); @@ -131,14 +143,17 @@ static void ETH_DMAReceptionEnable(ETH_HandleTypeDef *heth); static void ETH_DMAReceptionDisable(ETH_HandleTypeDef *heth); static void ETH_FlushTransmitFIFO(ETH_HandleTypeDef *heth); +/** + * @} + */ /* Private functions ---------------------------------------------------------*/ -/** @defgroup ETH_Private_Functions +/** @defgroup ETH_Exported_Functions ETH Exported Functions * @{ */ -/** @defgroup ETH_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions +/** @defgroup ETH_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions * @verbatim =============================================================================== @@ -161,7 +176,7 @@ static void ETH_FlushTransmitFIFO(ETH_HandleTypeDef *heth); */ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth) { - uint32_t tmpreg = 0, phyreg = 0; + uint32_t tmpreg1 = 0, phyreg = 0; uint32_t hclk = 60000000; uint32_t tickstart = 0; uint32_t err = ETH_SUCCESS; @@ -180,12 +195,14 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth) if(heth->State == HAL_ETH_STATE_RESET) { + /* Allocate lock resource and initialize it */ + heth->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC. */ HAL_ETH_MspInit(heth); } /* Enable SYSCFG Clock */ - __SYSCFG_CLK_ENABLE(); + __HAL_RCC_SYSCFG_CLK_ENABLE(); /* Select MII or RMII Mode*/ SYSCFG->PMC &= ~(SYSCFG_PMC_MII_RMII_SEL); @@ -203,9 +220,9 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth) /*-------------------------------- MAC Initialization ----------------------*/ /* Get the ETHERNET MACMIIAR value */ - tmpreg = (heth->Instance)->MACMIIAR; + tmpreg1 = (heth->Instance)->MACMIIAR; /* Clear CSR Clock Range CR[2:0] bits */ - tmpreg &= MACMIIAR_CR_MASK; + tmpreg1 &= ETH_MACMIIAR_CR_MASK; /* Get hclk frequency value */ hclk = HAL_RCC_GetHCLKFreq(); @@ -214,31 +231,31 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth) if((hclk >= 20000000)&&(hclk < 35000000)) { /* CSR Clock Range between 20-35 MHz */ - tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div16; + tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_Div16; } else if((hclk >= 35000000)&&(hclk < 60000000)) { /* CSR Clock Range between 35-60 MHz */ - tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div26; + tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_Div26; } else if((hclk >= 60000000)&&(hclk < 100000000)) { /* CSR Clock Range between 60-100 MHz */ - tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div42; + tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_Div42; } else if((hclk >= 100000000)&&(hclk < 150000000)) { /* CSR Clock Range between 100-150 MHz */ - tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div62; + tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_Div62; } else /* ((hclk >= 150000000)&&(hclk <= 168000000)) */ { /* CSR Clock Range between 150-168 MHz */ - tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div102; + tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_Div102; } /* Write to ETHERNET MAC MIIAR: Configure the ETHERNET CSR Clock Range */ - (heth->Instance)->MACMIIAR = (uint32_t)tmpreg; + (heth->Instance)->MACMIIAR = (uint32_t)tmpreg1; /*-------------------- PHY initialization and configuration ----------------*/ /* Put the PHY in reset mode */ @@ -599,7 +616,7 @@ __weak void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth) * @} */ -/** @defgroup ETH_Group2 IO operation functions +/** @defgroup ETH_Exported_Functions_Group2 IO operation functions * @brief Data transfers functions * @verbatim @@ -1014,7 +1031,7 @@ __weak void HAL_ETH_ErrorCallback(ETH_HandleTypeDef *heth) */ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue) { - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; uint32_t tickstart = 0; /* Check parameters */ @@ -1029,25 +1046,25 @@ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYR heth->State = HAL_ETH_STATE_BUSY_RD; /* Get the ETHERNET MACMIIAR value */ - tmpreg = heth->Instance->MACMIIAR; + tmpreg1 = heth->Instance->MACMIIAR; /* Keep only the CSR Clock Range CR[2:0] bits value */ - tmpreg &= ~MACMIIAR_CR_MASK; + tmpreg1 &= ~ETH_MACMIIAR_CR_MASK; /* Prepare the MII address register value */ - tmpreg |=(((uint32_t)heth->Init.PhyAddress << 11) & ETH_MACMIIAR_PA); /* Set the PHY device address */ - tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */ - tmpreg &= ~ETH_MACMIIAR_MW; /* Set the read mode */ - tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */ + tmpreg1 |=(((uint32_t)heth->Init.PhyAddress << 11) & ETH_MACMIIAR_PA); /* Set the PHY device address */ + tmpreg1 |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */ + tmpreg1 &= ~ETH_MACMIIAR_MW; /* Set the read mode */ + tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */ /* Write the result value into the MII Address register */ - heth->Instance->MACMIIAR = tmpreg; + heth->Instance->MACMIIAR = tmpreg1; /* Get tick */ tickstart = HAL_GetTick(); /* Check for the Busy flag */ - while((tmpreg & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) + while((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > PHY_READ_TO) @@ -1060,7 +1077,7 @@ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYR return HAL_TIMEOUT; } - tmpreg = heth->Instance->MACMIIAR; + tmpreg1 = heth->Instance->MACMIIAR; } /* Get MACMIIDR value */ @@ -1086,7 +1103,7 @@ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYR */ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t RegValue) { - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; uint32_t tickstart = 0; /* Check parameters */ @@ -1101,28 +1118,28 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY heth->State = HAL_ETH_STATE_BUSY_WR; /* Get the ETHERNET MACMIIAR value */ - tmpreg = heth->Instance->MACMIIAR; + tmpreg1 = heth->Instance->MACMIIAR; /* Keep only the CSR Clock Range CR[2:0] bits value */ - tmpreg &= ~MACMIIAR_CR_MASK; + tmpreg1 &= ~ETH_MACMIIAR_CR_MASK; /* Prepare the MII register address value */ - tmpreg |=(((uint32_t)heth->Init.PhyAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */ - tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */ - tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */ - tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */ + tmpreg1 |=(((uint32_t)heth->Init.PhyAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */ + tmpreg1 |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */ + tmpreg1 |= ETH_MACMIIAR_MW; /* Set the write mode */ + tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */ /* Give the value to the MII data register */ heth->Instance->MACMIIDR = (uint16_t)RegValue; /* Write the result value into the MII Address register */ - heth->Instance->MACMIIAR = tmpreg; + heth->Instance->MACMIIAR = tmpreg1; /* Get tick */ tickstart = HAL_GetTick(); /* Check for the Busy flag */ - while((tmpreg & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) + while((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB) { /* Check for the Timeout */ if((HAL_GetTick() - tickstart ) > PHY_WRITE_TO) @@ -1135,7 +1152,7 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY return HAL_TIMEOUT; } - tmpreg = heth->Instance->MACMIIAR; + tmpreg1 = heth->Instance->MACMIIAR; } /* Set ETH HAL State to READY */ @@ -1149,7 +1166,7 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY * @} */ -/** @defgroup ETH_Group3 Peripheral Control functions +/** @defgroup ETH_Exported_Functions_Group3 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -1257,7 +1274,7 @@ HAL_StatusTypeDef HAL_ETH_Stop(ETH_HandleTypeDef *heth) */ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef *macconf) { - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; /* Process Locked */ __HAL_LOCK(heth); @@ -1287,7 +1304,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef assert_param(IS_ETH_CONTROL_FRAMES(macconf->PassControlFrames)); assert_param(IS_ETH_BROADCAST_FRAMES_RECEPTION(macconf->BroadcastFramesReception)); assert_param(IS_ETH_DESTINATION_ADDR_FILTER(macconf->DestinationAddrFilter)); - assert_param(IS_ETH_PROMISCIOUS_MODE(macconf->PromiscuousMode)); + assert_param(IS_ETH_PROMISCUOUS_MODE(macconf->PromiscuousMode)); assert_param(IS_ETH_MULTICAST_FRAMES_FILTER(macconf->MulticastFramesFilter)); assert_param(IS_ETH_UNICAST_FRAMES_FILTER(macconf->UnicastFramesFilter)); assert_param(IS_ETH_PAUSE_TIME(macconf->PauseTime)); @@ -1301,11 +1318,11 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef /*------------------------ ETHERNET MACCR Configuration --------------------*/ /* Get the ETHERNET MACCR value */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; /* Clear WD, PCE, PS, TE and RE bits */ - tmpreg &= MACCR_CLEAR_MASK; + tmpreg1 &= ETH_MACCR_CLEAR_MASK; - tmpreg |= (uint32_t)(macconf->Watchdog | + tmpreg1 |= (uint32_t)(macconf->Watchdog | macconf->Jabber | macconf->InterFrameGap | macconf->CarrierSense | @@ -1320,13 +1337,13 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef macconf->DeferralCheck); /* Write to ETHERNET MACCR */ - (heth->Instance)->MACCR = (uint32_t)tmpreg; + (heth->Instance)->MACCR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account : at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; /*----------------------- ETHERNET MACFFR Configuration --------------------*/ /* Write to ETHERNET MACFFR */ @@ -1341,9 +1358,9 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef /* Wait until the write operation will be taken into account : at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACFFR; + tmpreg1 = (heth->Instance)->MACFFR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACFFR = tmpreg; + (heth->Instance)->MACFFR = tmpreg1; /*--------------- ETHERNET MACHTHR and MACHTLR Configuration ---------------*/ /* Write to ETHERNET MACHTHR */ @@ -1354,11 +1371,11 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef /*----------------------- ETHERNET MACFCR Configuration --------------------*/ /* Get the ETHERNET MACFCR value */ - tmpreg = (heth->Instance)->MACFCR; + tmpreg1 = (heth->Instance)->MACFCR; /* Clear xx bits */ - tmpreg &= MACFCR_CLEAR_MASK; + tmpreg1 &= ETH_MACFCR_CLEAR_MASK; - tmpreg |= (uint32_t)((macconf->PauseTime << 16) | + tmpreg1 |= (uint32_t)((macconf->PauseTime << 16) | macconf->ZeroQuantaPause | macconf->PauseLowThreshold | macconf->UnicastPauseFrameDetect | @@ -1366,13 +1383,13 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef macconf->TransmitFlowControl); /* Write to ETHERNET MACFCR */ - (heth->Instance)->MACFCR = (uint32_t)tmpreg; + (heth->Instance)->MACFCR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account : at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACFCR; + tmpreg1 = (heth->Instance)->MACFCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACFCR = tmpreg; + (heth->Instance)->MACFCR = tmpreg1; /*----------------------- ETHERNET MACVLANTR Configuration -----------------*/ (heth->Instance)->MACVLANTR = (uint32_t)(macconf->VLANTagComparison | @@ -1380,29 +1397,29 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef /* Wait until the write operation will be taken into account : at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACVLANTR; + tmpreg1 = (heth->Instance)->MACVLANTR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACVLANTR = tmpreg; + (heth->Instance)->MACVLANTR = tmpreg1; } else /* macconf == NULL : here we just configure Speed and Duplex mode */ { /*------------------------ ETHERNET MACCR Configuration --------------------*/ /* Get the ETHERNET MACCR value */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; /* Clear FES and DM bits */ - tmpreg &= ~((uint32_t)0x00004800); + tmpreg1 &= ~((uint32_t)0x00004800); - tmpreg |= (uint32_t)(heth->Init.Speed | heth->Init.DuplexMode); + tmpreg1 |= (uint32_t)(heth->Init.Speed | heth->Init.DuplexMode); /* Write to ETHERNET MACCR */ - (heth->Instance)->MACCR = (uint32_t)tmpreg; + (heth->Instance)->MACCR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; } /* Set the ETH state to Ready */ @@ -1424,7 +1441,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef */ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef *dmaconf) { - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; /* Process Locked */ __HAL_LOCK(heth); @@ -1452,11 +1469,11 @@ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef /*----------------------- ETHERNET DMAOMR Configuration --------------------*/ /* Get the ETHERNET DMAOMR value */ - tmpreg = (heth->Instance)->DMAOMR; + tmpreg1 = (heth->Instance)->DMAOMR; /* Clear xx bits */ - tmpreg &= DMAOMR_CLEAR_MASK; + tmpreg1 &= ETH_DMAOMR_CLEAR_MASK; - tmpreg |= (uint32_t)(dmaconf->DropTCPIPChecksumErrorFrame | + tmpreg1 |= (uint32_t)(dmaconf->DropTCPIPChecksumErrorFrame | dmaconf->ReceiveStoreForward | dmaconf->FlushReceivedFrame | dmaconf->TransmitStoreForward | @@ -1467,13 +1484,13 @@ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef dmaconf->SecondFrameOperate); /* Write to ETHERNET DMAOMR */ - (heth->Instance)->DMAOMR = (uint32_t)tmpreg; + (heth->Instance)->DMAOMR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->DMAOMR; + tmpreg1 = (heth->Instance)->DMAOMR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->DMAOMR = tmpreg; + (heth->Instance)->DMAOMR = tmpreg1; /*----------------------- ETHERNET DMABMR Configuration --------------------*/ (heth->Instance)->DMABMR = (uint32_t)(dmaconf->AddressAlignedBeats | @@ -1487,9 +1504,9 @@ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->DMABMR; + tmpreg1 = (heth->Instance)->DMABMR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->DMABMR = tmpreg; + (heth->Instance)->DMABMR = tmpreg1; /* Set the ETH state to Ready */ heth->State= HAL_ETH_STATE_READY; @@ -1505,7 +1522,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef * @} */ -/** @defgroup ETH_Group4 Peripheral State functions +/** @defgroup ETH_Exported_Functions_Group4 Peripheral State functions * @brief Peripheral State functions * @verbatim @@ -1538,6 +1555,14 @@ HAL_ETH_StateTypeDef HAL_ETH_GetState(ETH_HandleTypeDef *heth) /** * @} */ + +/** + * @} + */ + +/** @addtogroup ETH_Private_Functions + * @{ + */ /** * @brief Configures Ethernet MAC and DMA with default parameters. @@ -1550,7 +1575,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) { ETH_MACInitTypeDef macinit; ETH_DMAInitTypeDef dmainit; - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; if (err != ETH_SUCCESS) /* Auto-negotiation failed */ { @@ -1585,7 +1610,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) macinit.PassControlFrames = ETH_PASSCONTROLFRAMES_BLOCKALL; macinit.BroadcastFramesReception = ETH_BROADCASTFRAMESRECEPTION_ENABLE; macinit.DestinationAddrFilter = ETH_DESTINATIONADDRFILTER_NORMAL; - macinit.PromiscuousMode = ETH_PROMISCIOUSMODE_DISABLE; + macinit.PromiscuousMode = ETH_PROMISCUOUS_MODE_DISABLE; macinit.MulticastFramesFilter = ETH_MULTICASTFRAMESFILTER_PERFECT; macinit.UnicastFramesFilter = ETH_UNICASTFRAMESFILTER_PERFECT; macinit.HashTableHigh = 0x0; @@ -1601,9 +1626,9 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /*------------------------ ETHERNET MACCR Configuration --------------------*/ /* Get the ETHERNET MACCR value */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; /* Clear WD, PCE, PS, TE and RE bits */ - tmpreg &= MACCR_CLEAR_MASK; + tmpreg1 &= ETH_MACCR_CLEAR_MASK; /* Set the WD bit according to ETH Watchdog value */ /* Set the JD: bit according to ETH Jabber value */ /* Set the IFG bit according to ETH InterFrameGap value */ @@ -1617,7 +1642,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /* Set the ACS bit according to ETH AutomaticPadCRCStrip value */ /* Set the BL bit according to ETH BackOffLimit value */ /* Set the DC bit according to ETH DeferralCheck value */ - tmpreg |= (uint32_t)(macinit.Watchdog | + tmpreg1 |= (uint32_t)(macinit.Watchdog | macinit.Jabber | macinit.InterFrameGap | macinit.CarrierSense | @@ -1632,13 +1657,13 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) macinit.DeferralCheck); /* Write to ETHERNET MACCR */ - (heth->Instance)->MACCR = (uint32_t)tmpreg; + (heth->Instance)->MACCR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; /*----------------------- ETHERNET MACFFR Configuration --------------------*/ /* Set the RA bit according to ETH ReceiveAll value */ @@ -1661,9 +1686,9 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACFFR; + tmpreg1 = (heth->Instance)->MACFFR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACFFR = tmpreg; + (heth->Instance)->MACFFR = tmpreg1; /*--------------- ETHERNET MACHTHR and MACHTLR Configuration --------------*/ /* Write to ETHERNET MACHTHR */ @@ -1674,9 +1699,9 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /*----------------------- ETHERNET MACFCR Configuration -------------------*/ /* Get the ETHERNET MACFCR value */ - tmpreg = (heth->Instance)->MACFCR; + tmpreg1 = (heth->Instance)->MACFCR; /* Clear xx bits */ - tmpreg &= MACFCR_CLEAR_MASK; + tmpreg1 &= ETH_MACFCR_CLEAR_MASK; /* Set the PT bit according to ETH PauseTime value */ /* Set the DZPQ bit according to ETH ZeroQuantaPause value */ @@ -1684,7 +1709,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /* Set the UP bit according to ETH UnicastPauseFrameDetect value */ /* Set the RFE bit according to ETH ReceiveFlowControl value */ /* Set the TFE bit according to ETH TransmitFlowControl value */ - tmpreg |= (uint32_t)((macinit.PauseTime << 16) | + tmpreg1 |= (uint32_t)((macinit.PauseTime << 16) | macinit.ZeroQuantaPause | macinit.PauseLowThreshold | macinit.UnicastPauseFrameDetect | @@ -1692,13 +1717,13 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) macinit.TransmitFlowControl); /* Write to ETHERNET MACFCR */ - (heth->Instance)->MACFCR = (uint32_t)tmpreg; + (heth->Instance)->MACFCR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACFCR; + tmpreg1 = (heth->Instance)->MACFCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACFCR = tmpreg; + (heth->Instance)->MACFCR = tmpreg1; /*----------------------- ETHERNET MACVLANTR Configuration ----------------*/ /* Set the ETV bit according to ETH VLANTagComparison value */ @@ -1708,9 +1733,9 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACVLANTR; + tmpreg1 = (heth->Instance)->MACVLANTR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACVLANTR = tmpreg; + (heth->Instance)->MACVLANTR = tmpreg1; /* Ethernet DMA default initialization ************************************/ dmainit.DropTCPIPChecksumErrorFrame = ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE; @@ -1731,9 +1756,9 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) dmainit.DMAArbitration = ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1; /* Get the ETHERNET DMAOMR value */ - tmpreg = (heth->Instance)->DMAOMR; + tmpreg1 = (heth->Instance)->DMAOMR; /* Clear xx bits */ - tmpreg &= DMAOMR_CLEAR_MASK; + tmpreg1 &= ETH_DMAOMR_CLEAR_MASK; /* Set the DT bit according to ETH DropTCPIPChecksumErrorFrame value */ /* Set the RSF bit according to ETH ReceiveStoreForward value */ @@ -1744,7 +1769,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /* Set the FUF bit according to ETH ForwardUndersizedGoodFrames value */ /* Set the RTC bit according to ETH ReceiveThresholdControl value */ /* Set the OSF bit according to ETH SecondFrameOperate value */ - tmpreg |= (uint32_t)(dmainit.DropTCPIPChecksumErrorFrame | + tmpreg1 |= (uint32_t)(dmainit.DropTCPIPChecksumErrorFrame | dmainit.ReceiveStoreForward | dmainit.FlushReceivedFrame | dmainit.TransmitStoreForward | @@ -1755,13 +1780,13 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) dmainit.SecondFrameOperate); /* Write to ETHERNET DMAOMR */ - (heth->Instance)->DMAOMR = (uint32_t)tmpreg; + (heth->Instance)->DMAOMR = (uint32_t)tmpreg1; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->DMAOMR; + tmpreg1 = (heth->Instance)->DMAOMR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->DMAOMR = tmpreg; + (heth->Instance)->DMAOMR = tmpreg1; /*----------------------- ETHERNET DMABMR Configuration ------------------*/ /* Set the AAL bit according to ETH AddressAlignedBeats value */ @@ -1782,9 +1807,9 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->DMABMR; + tmpreg1 = (heth->Instance)->DMABMR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->DMABMR = tmpreg; + (heth->Instance)->DMABMR = tmpreg1; if((heth->Init).RxMode == ETH_RXINTERRUPT_MODE) { @@ -1811,20 +1836,20 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err) */ static void ETH_MACAddressConfig(ETH_HandleTypeDef *heth, uint32_t MacAddr, uint8_t *Addr) { - uint32_t tmpreg; + uint32_t tmpreg1; /* Check the parameters */ assert_param(IS_ETH_MAC_ADDRESS0123(MacAddr)); /* Calculate the selected MAC address high register */ - tmpreg = ((uint32_t)Addr[5] << 8) | (uint32_t)Addr[4]; + tmpreg1 = ((uint32_t)Addr[5] << 8) | (uint32_t)Addr[4]; /* Load the selected MAC address high register */ - (*(__IO uint32_t *)((uint32_t)(ETH_MAC_ADDR_HBASE + MacAddr))) = tmpreg; + (*(__IO uint32_t *)((uint32_t)(ETH_MAC_ADDR_HBASE + MacAddr))) = tmpreg1; /* Calculate the selected MAC address low register */ - tmpreg = ((uint32_t)Addr[3] << 24) | ((uint32_t)Addr[2] << 16) | ((uint32_t)Addr[1] << 8) | Addr[0]; + tmpreg1 = ((uint32_t)Addr[3] << 24) | ((uint32_t)Addr[2] << 16) | ((uint32_t)Addr[1] << 8) | Addr[0]; /* Load the selected MAC address low register */ - (*(__IO uint32_t *)((uint32_t)(ETH_MAC_ADDR_LBASE + MacAddr))) = tmpreg; + (*(__IO uint32_t *)((uint32_t)(ETH_MAC_ADDR_LBASE + MacAddr))) = tmpreg1; } /** @@ -1835,16 +1860,16 @@ static void ETH_MACAddressConfig(ETH_HandleTypeDef *heth, uint32_t MacAddr, uint */ static void ETH_MACTransmissionEnable(ETH_HandleTypeDef *heth) { - __IO uint32_t tmpreg = 0; + __IO uint32_t tmpreg1 = 0; /* Enable the MAC transmission */ (heth->Instance)->MACCR |= ETH_MACCR_TE; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; } /** @@ -1855,16 +1880,16 @@ static void ETH_MACTransmissionEnable(ETH_HandleTypeDef *heth) */ static void ETH_MACTransmissionDisable(ETH_HandleTypeDef *heth) { - __IO uint32_t tmpreg = 0; + __IO uint32_t tmpreg1 = 0; /* Disable the MAC transmission */ (heth->Instance)->MACCR &= ~ETH_MACCR_TE; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; } /** @@ -1875,16 +1900,16 @@ static void ETH_MACTransmissionDisable(ETH_HandleTypeDef *heth) */ static void ETH_MACReceptionEnable(ETH_HandleTypeDef *heth) { - __IO uint32_t tmpreg = 0; + __IO uint32_t tmpreg1 = 0; /* Enable the MAC reception */ (heth->Instance)->MACCR |= ETH_MACCR_RE; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; } /** @@ -1895,16 +1920,16 @@ static void ETH_MACReceptionEnable(ETH_HandleTypeDef *heth) */ static void ETH_MACReceptionDisable(ETH_HandleTypeDef *heth) { - __IO uint32_t tmpreg = 0; + __IO uint32_t tmpreg1 = 0; /* Disable the MAC reception */ (heth->Instance)->MACCR &= ~ETH_MACCR_RE; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->MACCR; + tmpreg1 = (heth->Instance)->MACCR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->MACCR = tmpreg; + (heth->Instance)->MACCR = tmpreg1; } /** @@ -1963,16 +1988,16 @@ static void ETH_DMAReceptionDisable(ETH_HandleTypeDef *heth) */ static void ETH_FlushTransmitFIFO(ETH_HandleTypeDef *heth) { - __IO uint32_t tmpreg = 0; + __IO uint32_t tmpreg1 = 0; /* Set the Flush Transmit FIFO bit */ (heth->Instance)->DMAOMR |= ETH_DMAOMR_FTF; /* Wait until the write operation will be taken into account: at least four TX_CLK/RX_CLK clock cycles */ - tmpreg = (heth->Instance)->DMAOMR; + tmpreg1 = (heth->Instance)->DMAOMR; HAL_Delay(ETH_REG_WRITE_DELAY); - (heth->Instance)->DMAOMR = tmpreg; + (heth->Instance)->DMAOMR = tmpreg1; } /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.h index 7c7aaa50fa3..26a1d8e55f5 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_eth.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_eth.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of ETH HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,8 +54,322 @@ /** @addtogroup ETH * @{ */ + +/** @addtogroup ETH_Private_Macros + * @{ + */ +#define IS_ETH_PHY_ADDRESS(ADDRESS) ((ADDRESS) <= 0x20) +#define IS_ETH_AUTONEGOTIATION(CMD) (((CMD) == ETH_AUTONEGOTIATION_ENABLE) || \ + ((CMD) == ETH_AUTONEGOTIATION_DISABLE)) +#define IS_ETH_SPEED(SPEED) (((SPEED) == ETH_SPEED_10M) || \ + ((SPEED) == ETH_SPEED_100M)) +#define IS_ETH_DUPLEX_MODE(MODE) (((MODE) == ETH_MODE_FULLDUPLEX) || \ + ((MODE) == ETH_MODE_HALFDUPLEX)) +#define IS_ETH_DUPLEX_MODE(MODE) (((MODE) == ETH_MODE_FULLDUPLEX) || \ + ((MODE) == ETH_MODE_HALFDUPLEX)) +#define IS_ETH_RX_MODE(MODE) (((MODE) == ETH_RXPOLLING_MODE) || \ + ((MODE) == ETH_RXINTERRUPT_MODE)) +#define IS_ETH_RX_MODE(MODE) (((MODE) == ETH_RXPOLLING_MODE) || \ + ((MODE) == ETH_RXINTERRUPT_MODE)) +#define IS_ETH_RX_MODE(MODE) (((MODE) == ETH_RXPOLLING_MODE) || \ + ((MODE) == ETH_RXINTERRUPT_MODE)) +#define IS_ETH_CHECKSUM_MODE(MODE) (((MODE) == ETH_CHECKSUM_BY_HARDWARE) || \ + ((MODE) == ETH_CHECKSUM_BY_SOFTWARE)) +#define IS_ETH_MEDIA_INTERFACE(MODE) (((MODE) == ETH_MEDIA_INTERFACE_MII) || \ + ((MODE) == ETH_MEDIA_INTERFACE_RMII)) +#define IS_ETH_WATCHDOG(CMD) (((CMD) == ETH_WATCHDOG_ENABLE) || \ + ((CMD) == ETH_WATCHDOG_DISABLE)) +#define IS_ETH_JABBER(CMD) (((CMD) == ETH_JABBER_ENABLE) || \ + ((CMD) == ETH_JABBER_DISABLE)) +#define IS_ETH_INTER_FRAME_GAP(GAP) (((GAP) == ETH_INTERFRAMEGAP_96BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_88BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_80BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_72BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_64BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_56BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_48BIT) || \ + ((GAP) == ETH_INTERFRAMEGAP_40BIT)) +#define IS_ETH_CARRIER_SENSE(CMD) (((CMD) == ETH_CARRIERSENCE_ENABLE) || \ + ((CMD) == ETH_CARRIERSENCE_DISABLE)) +#define IS_ETH_RECEIVE_OWN(CMD) (((CMD) == ETH_RECEIVEOWN_ENABLE) || \ + ((CMD) == ETH_RECEIVEOWN_DISABLE)) +#define IS_ETH_LOOPBACK_MODE(CMD) (((CMD) == ETH_LOOPBACKMODE_ENABLE) || \ + ((CMD) == ETH_LOOPBACKMODE_DISABLE)) +#define IS_ETH_CHECKSUM_OFFLOAD(CMD) (((CMD) == ETH_CHECKSUMOFFLAOD_ENABLE) || \ + ((CMD) == ETH_CHECKSUMOFFLAOD_DISABLE)) +#define IS_ETH_RETRY_TRANSMISSION(CMD) (((CMD) == ETH_RETRYTRANSMISSION_ENABLE) || \ + ((CMD) == ETH_RETRYTRANSMISSION_DISABLE)) +#define IS_ETH_AUTOMATIC_PADCRC_STRIP(CMD) (((CMD) == ETH_AUTOMATICPADCRCSTRIP_ENABLE) || \ + ((CMD) == ETH_AUTOMATICPADCRCSTRIP_DISABLE)) +#define IS_ETH_BACKOFF_LIMIT(LIMIT) (((LIMIT) == ETH_BACKOFFLIMIT_10) || \ + ((LIMIT) == ETH_BACKOFFLIMIT_8) || \ + ((LIMIT) == ETH_BACKOFFLIMIT_4) || \ + ((LIMIT) == ETH_BACKOFFLIMIT_1)) +#define IS_ETH_DEFERRAL_CHECK(CMD) (((CMD) == ETH_DEFFERRALCHECK_ENABLE) || \ + ((CMD) == ETH_DEFFERRALCHECK_DISABLE)) +#define IS_ETH_RECEIVE_ALL(CMD) (((CMD) == ETH_RECEIVEALL_ENABLE) || \ + ((CMD) == ETH_RECEIVEAll_DISABLE)) +#define IS_ETH_SOURCE_ADDR_FILTER(CMD) (((CMD) == ETH_SOURCEADDRFILTER_NORMAL_ENABLE) || \ + ((CMD) == ETH_SOURCEADDRFILTER_INVERSE_ENABLE) || \ + ((CMD) == ETH_SOURCEADDRFILTER_DISABLE)) +#define IS_ETH_CONTROL_FRAMES(PASS) (((PASS) == ETH_PASSCONTROLFRAMES_BLOCKALL) || \ + ((PASS) == ETH_PASSCONTROLFRAMES_FORWARDALL) || \ + ((PASS) == ETH_PASSCONTROLFRAMES_FORWARDPASSEDADDRFILTER)) +#define IS_ETH_BROADCAST_FRAMES_RECEPTION(CMD) (((CMD) == ETH_BROADCASTFRAMESRECEPTION_ENABLE) || \ + ((CMD) == ETH_BROADCASTFRAMESRECEPTION_DISABLE)) +#define IS_ETH_DESTINATION_ADDR_FILTER(FILTER) (((FILTER) == ETH_DESTINATIONADDRFILTER_NORMAL) || \ + ((FILTER) == ETH_DESTINATIONADDRFILTER_INVERSE)) +#define IS_ETH_PROMISCUOUS_MODE(CMD) (((CMD) == ETH_PROMISCUOUS_MODE_ENABLE) || \ + ((CMD) == ETH_PROMISCUOUS_MODE_DISABLE)) +#define IS_ETH_MULTICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_MULTICASTFRAMESFILTER_PERFECTHASHTABLE) || \ + ((FILTER) == ETH_MULTICASTFRAMESFILTER_HASHTABLE) || \ + ((FILTER) == ETH_MULTICASTFRAMESFILTER_PERFECT) || \ + ((FILTER) == ETH_MULTICASTFRAMESFILTER_NONE)) +#define IS_ETH_UNICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_UNICASTFRAMESFILTER_PERFECTHASHTABLE) || \ + ((FILTER) == ETH_UNICASTFRAMESFILTER_HASHTABLE) || \ + ((FILTER) == ETH_UNICASTFRAMESFILTER_PERFECT)) +#define IS_ETH_PAUSE_TIME(TIME) ((TIME) <= 0xFFFF) +#define IS_ETH_ZEROQUANTA_PAUSE(CMD) (((CMD) == ETH_ZEROQUANTAPAUSE_ENABLE) || \ + ((CMD) == ETH_ZEROQUANTAPAUSE_DISABLE)) +#define IS_ETH_PAUSE_LOW_THRESHOLD(THRESHOLD) (((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS4) || \ + ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS28) || \ + ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS144) || \ + ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS256)) +#define IS_ETH_UNICAST_PAUSE_FRAME_DETECT(CMD) (((CMD) == ETH_UNICASTPAUSEFRAMEDETECT_ENABLE) || \ + ((CMD) == ETH_UNICASTPAUSEFRAMEDETECT_DISABLE)) +#define IS_ETH_RECEIVE_FLOWCONTROL(CMD) (((CMD) == ETH_RECEIVEFLOWCONTROL_ENABLE) || \ + ((CMD) == ETH_RECEIVEFLOWCONTROL_DISABLE)) +#define IS_ETH_TRANSMIT_FLOWCONTROL(CMD) (((CMD) == ETH_TRANSMITFLOWCONTROL_ENABLE) || \ + ((CMD) == ETH_TRANSMITFLOWCONTROL_DISABLE)) +#define IS_ETH_VLAN_TAG_COMPARISON(COMPARISON) (((COMPARISON) == ETH_VLANTAGCOMPARISON_12BIT) || \ + ((COMPARISON) == ETH_VLANTAGCOMPARISON_16BIT)) +#define IS_ETH_VLAN_TAG_IDENTIFIER(IDENTIFIER) ((IDENTIFIER) <= 0xFFFF) +#define IS_ETH_MAC_ADDRESS0123(ADDRESS) (((ADDRESS) == ETH_MAC_ADDRESS0) || \ + ((ADDRESS) == ETH_MAC_ADDRESS1) || \ + ((ADDRESS) == ETH_MAC_ADDRESS2) || \ + ((ADDRESS) == ETH_MAC_ADDRESS3)) +#define IS_ETH_MAC_ADDRESS123(ADDRESS) (((ADDRESS) == ETH_MAC_ADDRESS1) || \ + ((ADDRESS) == ETH_MAC_ADDRESS2) || \ + ((ADDRESS) == ETH_MAC_ADDRESS3)) +#define IS_ETH_MAC_ADDRESS_FILTER(FILTER) (((FILTER) == ETH_MAC_ADDRESSFILTER_SA) || \ + ((FILTER) == ETH_MAC_ADDRESSFILTER_DA)) +#define IS_ETH_MAC_ADDRESS_MASK(MASK) (((MASK) == ETH_MAC_ADDRESSMASK_BYTE6) || \ + ((MASK) == ETH_MAC_ADDRESSMASK_BYTE5) || \ + ((MASK) == ETH_MAC_ADDRESSMASK_BYTE4) || \ + ((MASK) == ETH_MAC_ADDRESSMASK_BYTE3) || \ + ((MASK) == ETH_MAC_ADDRESSMASK_BYTE2) || \ + ((MASK) == ETH_MAC_ADDRESSMASK_BYTE1)) +#define IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(CMD) (((CMD) == ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE) || \ + ((CMD) == ETH_DROPTCPIPCHECKSUMERRORFRAME_DISABLE)) +#define IS_ETH_RECEIVE_STORE_FORWARD(CMD) (((CMD) == ETH_RECEIVESTOREFORWARD_ENABLE) || \ + ((CMD) == ETH_RECEIVESTOREFORWARD_DISABLE)) +#define IS_ETH_FLUSH_RECEIVE_FRAME(CMD) (((CMD) == ETH_FLUSHRECEIVEDFRAME_ENABLE) || \ + ((CMD) == ETH_FLUSHRECEIVEDFRAME_DISABLE)) +#define IS_ETH_TRANSMIT_STORE_FORWARD(CMD) (((CMD) == ETH_TRANSMITSTOREFORWARD_ENABLE) || \ + ((CMD) == ETH_TRANSMITSTOREFORWARD_DISABLE)) +#define IS_ETH_TRANSMIT_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_64BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_128BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_192BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_256BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_40BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_32BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_24BYTES) || \ + ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_16BYTES)) +#define IS_ETH_FORWARD_ERROR_FRAMES(CMD) (((CMD) == ETH_FORWARDERRORFRAMES_ENABLE) || \ + ((CMD) == ETH_FORWARDERRORFRAMES_DISABLE)) +#define IS_ETH_FORWARD_UNDERSIZED_GOOD_FRAMES(CMD) (((CMD) == ETH_FORWARDUNDERSIZEDGOODFRAMES_ENABLE) || \ + ((CMD) == ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE)) +#define IS_ETH_RECEIVE_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES) || \ + ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_32BYTES) || \ + ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_96BYTES) || \ + ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_128BYTES)) +#define IS_ETH_SECOND_FRAME_OPERATE(CMD) (((CMD) == ETH_SECONDFRAMEOPERARTE_ENABLE) || \ + ((CMD) == ETH_SECONDFRAMEOPERARTE_DISABLE)) +#define IS_ETH_ADDRESS_ALIGNED_BEATS(CMD) (((CMD) == ETH_ADDRESSALIGNEDBEATS_ENABLE) || \ + ((CMD) == ETH_ADDRESSALIGNEDBEATS_DISABLE)) +#define IS_ETH_FIXED_BURST(CMD) (((CMD) == ETH_FIXEDBURST_ENABLE) || \ + ((CMD) == ETH_FIXEDBURST_DISABLE)) +#define IS_ETH_RXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_RXDMABURSTLENGTH_1BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_2BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_8BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_16BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_32BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_4BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_8BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_16BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_32BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_64BEAT) || \ + ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_128BEAT)) +#define IS_ETH_TXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_TXDMABURSTLENGTH_1BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_2BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_8BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_16BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_32BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_4BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_8BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_16BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_32BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_64BEAT) || \ + ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_128BEAT)) +#define IS_ETH_DMA_DESC_SKIP_LENGTH(LENGTH) ((LENGTH) <= 0x1F) +#define IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(RATIO) (((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1) || \ + ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_2_1) || \ + ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_3_1) || \ + ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_4_1) || \ + ((RATIO) == ETH_DMAARBITRATION_RXPRIORTX)) +#define IS_ETH_DMATXDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMATXDESC_OWN) || \ + ((FLAG) == ETH_DMATXDESC_IC) || \ + ((FLAG) == ETH_DMATXDESC_LS) || \ + ((FLAG) == ETH_DMATXDESC_FS) || \ + ((FLAG) == ETH_DMATXDESC_DC) || \ + ((FLAG) == ETH_DMATXDESC_DP) || \ + ((FLAG) == ETH_DMATXDESC_TTSE) || \ + ((FLAG) == ETH_DMATXDESC_TER) || \ + ((FLAG) == ETH_DMATXDESC_TCH) || \ + ((FLAG) == ETH_DMATXDESC_TTSS) || \ + ((FLAG) == ETH_DMATXDESC_IHE) || \ + ((FLAG) == ETH_DMATXDESC_ES) || \ + ((FLAG) == ETH_DMATXDESC_JT) || \ + ((FLAG) == ETH_DMATXDESC_FF) || \ + ((FLAG) == ETH_DMATXDESC_PCE) || \ + ((FLAG) == ETH_DMATXDESC_LCA) || \ + ((FLAG) == ETH_DMATXDESC_NC) || \ + ((FLAG) == ETH_DMATXDESC_LCO) || \ + ((FLAG) == ETH_DMATXDESC_EC) || \ + ((FLAG) == ETH_DMATXDESC_VF) || \ + ((FLAG) == ETH_DMATXDESC_CC) || \ + ((FLAG) == ETH_DMATXDESC_ED) || \ + ((FLAG) == ETH_DMATXDESC_UF) || \ + ((FLAG) == ETH_DMATXDESC_DB)) +#define IS_ETH_DMA_TXDESC_SEGMENT(SEGMENT) (((SEGMENT) == ETH_DMATXDESC_LASTSEGMENTS) || \ + ((SEGMENT) == ETH_DMATXDESC_FIRSTSEGMENT)) +#define IS_ETH_DMA_TXDESC_CHECKSUM(CHECKSUM) (((CHECKSUM) == ETH_DMATXDESC_CHECKSUMBYPASS) || \ + ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMIPV4HEADER) || \ + ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMTCPUDPICMPSEGMENT) || \ + ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL)) +#define IS_ETH_DMATXDESC_BUFFER_SIZE(SIZE) ((SIZE) <= 0x1FFF) +#define IS_ETH_DMARXDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMARXDESC_OWN) || \ + ((FLAG) == ETH_DMARXDESC_AFM) || \ + ((FLAG) == ETH_DMARXDESC_ES) || \ + ((FLAG) == ETH_DMARXDESC_DE) || \ + ((FLAG) == ETH_DMARXDESC_SAF) || \ + ((FLAG) == ETH_DMARXDESC_LE) || \ + ((FLAG) == ETH_DMARXDESC_OE) || \ + ((FLAG) == ETH_DMARXDESC_VLAN) || \ + ((FLAG) == ETH_DMARXDESC_FS) || \ + ((FLAG) == ETH_DMARXDESC_LS) || \ + ((FLAG) == ETH_DMARXDESC_IPV4HCE) || \ + ((FLAG) == ETH_DMARXDESC_LC) || \ + ((FLAG) == ETH_DMARXDESC_FT) || \ + ((FLAG) == ETH_DMARXDESC_RWT) || \ + ((FLAG) == ETH_DMARXDESC_RE) || \ + ((FLAG) == ETH_DMARXDESC_DBE) || \ + ((FLAG) == ETH_DMARXDESC_CE) || \ + ((FLAG) == ETH_DMARXDESC_MAMPCE)) +#define IS_ETH_DMA_RXDESC_BUFFER(BUFFER) (((BUFFER) == ETH_DMARXDESC_BUFFER1) || \ + ((BUFFER) == ETH_DMARXDESC_BUFFER2)) +#define IS_ETH_PMT_GET_FLAG(FLAG) (((FLAG) == ETH_PMT_FLAG_WUFR) || \ + ((FLAG) == ETH_PMT_FLAG_MPR)) +#define IS_ETH_DMA_FLAG(FLAG) ((((FLAG) & (uint32_t)0xC7FE1800) == 0x00) && ((FLAG) != 0x00)) +#define IS_ETH_DMA_GET_FLAG(FLAG) (((FLAG) == ETH_DMA_FLAG_TST) || ((FLAG) == ETH_DMA_FLAG_PMT) || \ + ((FLAG) == ETH_DMA_FLAG_MMC) || ((FLAG) == ETH_DMA_FLAG_DATATRANSFERERROR) || \ + ((FLAG) == ETH_DMA_FLAG_READWRITEERROR) || ((FLAG) == ETH_DMA_FLAG_ACCESSERROR) || \ + ((FLAG) == ETH_DMA_FLAG_NIS) || ((FLAG) == ETH_DMA_FLAG_AIS) || \ + ((FLAG) == ETH_DMA_FLAG_ER) || ((FLAG) == ETH_DMA_FLAG_FBE) || \ + ((FLAG) == ETH_DMA_FLAG_ET) || ((FLAG) == ETH_DMA_FLAG_RWT) || \ + ((FLAG) == ETH_DMA_FLAG_RPS) || ((FLAG) == ETH_DMA_FLAG_RBU) || \ + ((FLAG) == ETH_DMA_FLAG_R) || ((FLAG) == ETH_DMA_FLAG_TU) || \ + ((FLAG) == ETH_DMA_FLAG_RO) || ((FLAG) == ETH_DMA_FLAG_TJT) || \ + ((FLAG) == ETH_DMA_FLAG_TBU) || ((FLAG) == ETH_DMA_FLAG_TPS) || \ + ((FLAG) == ETH_DMA_FLAG_T)) +#define IS_ETH_MAC_IT(IT) ((((IT) & (uint32_t)0xFFFFFDF1) == 0x00) && ((IT) != 0x00)) +#define IS_ETH_MAC_GET_IT(IT) (((IT) == ETH_MAC_IT_TST) || ((IT) == ETH_MAC_IT_MMCT) || \ + ((IT) == ETH_MAC_IT_MMCR) || ((IT) == ETH_MAC_IT_MMC) || \ + ((IT) == ETH_MAC_IT_PMT)) +#define IS_ETH_MAC_GET_FLAG(FLAG) (((FLAG) == ETH_MAC_FLAG_TST) || ((FLAG) == ETH_MAC_FLAG_MMCT) || \ + ((FLAG) == ETH_MAC_FLAG_MMCR) || ((FLAG) == ETH_MAC_FLAG_MMC) || \ + ((FLAG) == ETH_MAC_FLAG_PMT)) +#define IS_ETH_DMA_IT(IT) ((((IT) & (uint32_t)0xC7FE1800) == 0x00) && ((IT) != 0x00)) +#define IS_ETH_DMA_GET_IT(IT) (((IT) == ETH_DMA_IT_TST) || ((IT) == ETH_DMA_IT_PMT) || \ + ((IT) == ETH_DMA_IT_MMC) || ((IT) == ETH_DMA_IT_NIS) || \ + ((IT) == ETH_DMA_IT_AIS) || ((IT) == ETH_DMA_IT_ER) || \ + ((IT) == ETH_DMA_IT_FBE) || ((IT) == ETH_DMA_IT_ET) || \ + ((IT) == ETH_DMA_IT_RWT) || ((IT) == ETH_DMA_IT_RPS) || \ + ((IT) == ETH_DMA_IT_RBU) || ((IT) == ETH_DMA_IT_R) || \ + ((IT) == ETH_DMA_IT_TU) || ((IT) == ETH_DMA_IT_RO) || \ + ((IT) == ETH_DMA_IT_TJT) || ((IT) == ETH_DMA_IT_TBU) || \ + ((IT) == ETH_DMA_IT_TPS) || ((IT) == ETH_DMA_IT_T)) +#define IS_ETH_DMA_GET_OVERFLOW(OVERFLOW) (((OVERFLOW) == ETH_DMA_OVERFLOW_RXFIFOCOUNTER) || \ + ((OVERFLOW) == ETH_DMA_OVERFLOW_MISSEDFRAMECOUNTER)) +#define IS_ETH_MMC_IT(IT) (((((IT) & (uint32_t)0xFFDF3FFF) == 0x00) || (((IT) & (uint32_t)0xEFFDFF9F) == 0x00)) && \ + ((IT) != 0x00)) +#define IS_ETH_MMC_GET_IT(IT) (((IT) == ETH_MMC_IT_TGF) || ((IT) == ETH_MMC_IT_TGFMSC) || \ + ((IT) == ETH_MMC_IT_TGFSC) || ((IT) == ETH_MMC_IT_RGUF) || \ + ((IT) == ETH_MMC_IT_RFAE) || ((IT) == ETH_MMC_IT_RFCE)) +#define IS_ETH_ENHANCED_DESCRIPTOR_FORMAT(CMD) (((CMD) == ETH_DMAENHANCEDDESCRIPTOR_ENABLE) || \ + ((CMD) == ETH_DMAENHANCEDDESCRIPTOR_DISABLE)) + + +/** + * @} + */ + +/** @addtogroup ETH_Private_Defines + * @{ + */ +/* Delay to wait when writing to some Ethernet registers */ +#define ETH_REG_WRITE_DELAY ((uint32_t)0x00000001) + +/* ETHERNET Errors */ +#define ETH_SUCCESS ((uint32_t)0) +#define ETH_ERROR ((uint32_t)1) + +/* ETHERNET DMA Tx descriptors Collision Count Shift */ +#define ETH_DMATXDESC_COLLISION_COUNTSHIFT ((uint32_t)3) + +/* ETHERNET DMA Tx descriptors Buffer2 Size Shift */ +#define ETH_DMATXDESC_BUFFER2_SIZESHIFT ((uint32_t)16) + +/* ETHERNET DMA Rx descriptors Frame Length Shift */ +#define ETH_DMARXDESC_FRAME_LENGTHSHIFT ((uint32_t)16) + +/* ETHERNET DMA Rx descriptors Buffer2 Size Shift */ +#define ETH_DMARXDESC_BUFFER2_SIZESHIFT ((uint32_t)16) + +/* ETHERNET DMA Rx descriptors Frame length Shift */ +#define ETH_DMARXDESC_FRAMELENGTHSHIFT ((uint32_t)16) + +/* ETHERNET MAC address offsets */ +#define ETH_MAC_ADDR_HBASE (uint32_t)(ETH_MAC_BASE + (uint32_t)0x40) /* ETHERNET MAC address high offset */ +#define ETH_MAC_ADDR_LBASE (uint32_t)(ETH_MAC_BASE + (uint32_t)0x44) /* ETHERNET MAC address low offset */ + +/* ETHERNET MACMIIAR register Mask */ +#define ETH_MACMIIAR_CR_MASK ((uint32_t)0xFFFFFFE3) + +/* ETHERNET MACCR register Mask */ +#define ETH_MACCR_CLEAR_MASK ((uint32_t)0xFF20810F) + +/* ETHERNET MACFCR register Mask */ +#define ETH_MACFCR_CLEAR_MASK ((uint32_t)0x0000FF41) + +/* ETHERNET DMAOMR register Mask */ +#define ETH_DMAOMR_CLEAR_MASK ((uint32_t)0xF8DE3F23) + +/* ETHERNET Remote Wake-up frame register length */ +#define ETH_WAKEUP_REGISTER_LENGTH 8 + +/* ETHERNET Missed frames counter Shift */ +#define ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT 17 + /** + * @} + */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup ETH_Exported_Types ETH Exported Types + * @{ + */ /** * @brief HAL State structures definition @@ -117,7 +431,7 @@ typedef struct uint32_t Watchdog; /*!< Selects or not the Watchdog timer When enabled, the MAC allows no more then 2048 bytes to be received. When disabled, the MAC can receive up to 16384 bytes. - This parameter can be a value of @ref ETH_watchdog */ + This parameter can be a value of @ref ETH_Watchdog */ uint32_t Jabber; /*!< Selects or not Jabber timer When enabled, the MAC allows no more then 2048 bytes to be sent. @@ -341,29 +655,26 @@ typedef struct } ETH_HandleTypeDef; -/* Exported constants --------------------------------------------------------*/ - -#define IS_ETH_PHY_ADDRESS(ADDRESS) ((ADDRESS) <= 0x20) - -/* Delay to wait when writing to some Ethernet registers */ -#define ETH_REG_WRITE_DELAY ((uint32_t)0x00000001) - + /** + * @} + */ -/* ETHERNET Errors */ -#define ETH_SUCCESS ((uint32_t)0) -#define ETH_ERROR ((uint32_t)1) +/* Exported constants --------------------------------------------------------*/ +/** @defgroup ETH_Exported_Constants ETH Exported Constants + * @{ + */ -/** @defgroup ETH_Buffers_setting +/** @defgroup ETH_Buffers_setting ETH Buffers setting * @{ */ -#define ETH_MAX_PACKET_SIZE ((uint32_t)1524) /*!< ETH_HEADER + ETH_EXTRA + VLAN_TAG + MAX_ETH_PAYLOAD + ETH_CRC */ +#define ETH_MAX_PACKET_SIZE ((uint32_t)1524) /*!< ETH_HEADER + ETH_EXTRA + ETH_VLAN_TAG + ETH_MAX_ETH_PAYLOAD + ETH_CRC */ #define ETH_HEADER ((uint32_t)14) /*!< 6 byte Dest addr, 6 byte Src addr, 2 byte length/type */ #define ETH_CRC ((uint32_t)4) /*!< Ethernet CRC */ #define ETH_EXTRA ((uint32_t)2) /*!< Extra bytes in some cases */ -#define VLAN_TAG ((uint32_t)4) /*!< optional 802.1q VLAN Tag */ -#define MIN_ETH_PAYLOAD ((uint32_t)46) /*!< Minimum Ethernet payload size */ -#define MAX_ETH_PAYLOAD ((uint32_t)1500) /*!< Maximum Ethernet payload size */ -#define JUMBO_FRAME_PAYLOAD ((uint32_t)9000) /*!< Jumbo frame payload size */ +#define ETH_VLAN_TAG ((uint32_t)4) /*!< optional 802.1q VLAN Tag */ +#define ETH_MIN_ETH_PAYLOAD ((uint32_t)46) /*!< Minimum Ethernet payload size */ +#define ETH_MAX_ETH_PAYLOAD ((uint32_t)1500) /*!< Maximum Ethernet payload size */ +#define ETH_JUMBO_FRAME_PAYLOAD ((uint32_t)9000) /*!< Jumbo frame payload size */ /* Ethernet driver receive buffers are organized in a chained linked-list, when an ethernet packet is received, the Rx-DMA will transfer the packet from RxFIFO @@ -418,9 +729,16 @@ typedef struct #define ETH_TXBUFNB ((uint32_t)5 /* 5 Tx buffers of size ETH_TX_BUF_SIZE */ #endif + /** + * @} + */ + +/** @defgroup ETH_DMA_TX_Descriptor ETH DMA TX Descriptor + * @{ + */ /* - DMA Tx Desciptor + DMA Tx Descriptor ----------------------------------------------------------------------------------------------- TDES0 | OWN(31) | CTRL[30:26] | Reserved[25:24] | CTRL[23:20] | Reserved[19:17] | Status[16:0] | ----------------------------------------------------------------------------------------------- @@ -496,9 +814,7 @@ typedef struct /** * @} */ - - -/** @defgroup ETH_DMA_Rx_descriptor +/** @defgroup ETH_DMA_RX_Descriptor ETH DMA RX Descriptor * @{ */ @@ -593,97 +909,81 @@ typedef struct /* Bit definition of RDES7 register */ #define ETH_DMAPTPRXDESC_RTSH ((uint32_t)0xFFFFFFFF) /* Receive Time Stamp High */ - - - /** @defgroup ETH_AutoNegotiation +/** + * @} + */ + /** @defgroup ETH_AutoNegotiation ETH AutoNegotiation * @{ */ #define ETH_AUTONEGOTIATION_ENABLE ((uint32_t)0x00000001) #define ETH_AUTONEGOTIATION_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_AUTONEGOTIATION(CMD) (((CMD) == ETH_AUTONEGOTIATION_ENABLE) || \ - ((CMD) == ETH_AUTONEGOTIATION_DISABLE)) + /** * @} */ -/** @defgroup ETH_Speed +/** @defgroup ETH_Speed ETH Speed * @{ */ #define ETH_SPEED_10M ((uint32_t)0x00000000) #define ETH_SPEED_100M ((uint32_t)0x00004000) -#define IS_ETH_SPEED(SPEED) (((SPEED) == ETH_SPEED_10M) || \ - ((SPEED) == ETH_SPEED_100M)) + /** * @} */ -/** @defgroup ETH_Duplex_Mode +/** @defgroup ETH_Duplex_Mode ETH Duplex Mode * @{ */ #define ETH_MODE_FULLDUPLEX ((uint32_t)0x00000800) #define ETH_MODE_HALFDUPLEX ((uint32_t)0x00000000) -#define IS_ETH_DUPLEX_MODE(MODE) (((MODE) == ETH_MODE_FULLDUPLEX) || \ - ((MODE) == ETH_MODE_HALFDUPLEX)) /** * @} */ -/** @defgroup ETH_Rx_Mode +/** @defgroup ETH_Rx_Mode ETH Rx Mode * @{ */ #define ETH_RXPOLLING_MODE ((uint32_t)0x00000000) #define ETH_RXINTERRUPT_MODE ((uint32_t)0x00000001) -#define IS_ETH_RX_MODE(MODE) (((MODE) == ETH_RXPOLLING_MODE) || \ - ((MODE) == ETH_RXINTERRUPT_MODE)) /** * @} */ -/** @defgroup ETH_Checksum_Mode +/** @defgroup ETH_Checksum_Mode ETH Checksum Mode * @{ */ #define ETH_CHECKSUM_BY_HARDWARE ((uint32_t)0x00000000) #define ETH_CHECKSUM_BY_SOFTWARE ((uint32_t)0x00000001) -#define IS_ETH_CHECKSUM_MODE(MODE) (((MODE) == ETH_CHECKSUM_BY_HARDWARE) || \ - ((MODE) == ETH_CHECKSUM_BY_SOFTWARE)) /** * @} */ -/** @defgroup ETH_Media_Interface +/** @defgroup ETH_Media_Interface ETH Media Interface * @{ */ #define ETH_MEDIA_INTERFACE_MII ((uint32_t)0x00000000) #define ETH_MEDIA_INTERFACE_RMII ((uint32_t)SYSCFG_PMC_MII_RMII_SEL) -#define IS_ETH_MEDIA_INTERFACE(MODE) (((MODE) == ETH_MEDIA_INTERFACE_MII) || \ - ((MODE) == ETH_MEDIA_INTERFACE_RMII)) - /** * @} */ -/** @defgroup ETH_watchdog +/** @defgroup ETH_Watchdog ETH Watchdog * @{ */ #define ETH_WATCHDOG_ENABLE ((uint32_t)0x00000000) #define ETH_WATCHDOG_DISABLE ((uint32_t)0x00800000) -#define IS_ETH_WATCHDOG(CMD) (((CMD) == ETH_WATCHDOG_ENABLE) || \ - ((CMD) == ETH_WATCHDOG_DISABLE)) - /** * @} */ -/** @defgroup ETH_Jabber +/** @defgroup ETH_Jabber ETH Jabber * @{ */ #define ETH_JABBER_ENABLE ((uint32_t)0x00000000) #define ETH_JABBER_DISABLE ((uint32_t)0x00400000) -#define IS_ETH_JABBER(CMD) (((CMD) == ETH_JABBER_ENABLE) || \ - ((CMD) == ETH_JABBER_DISABLE)) - /** * @} */ -/** @defgroup ETH_Inter_Frame_Gap +/** @defgroup ETH_Inter_Frame_Gap ETH Inter Frame Gap * @{ */ #define ETH_INTERFRAMEGAP_96BIT ((uint32_t)0x00000000) /*!< minimum IFG between frames during transmission is 96Bit */ @@ -694,334 +994,238 @@ typedef struct #define ETH_INTERFRAMEGAP_56BIT ((uint32_t)0x000A0000) /*!< minimum IFG between frames during transmission is 56Bit */ #define ETH_INTERFRAMEGAP_48BIT ((uint32_t)0x000C0000) /*!< minimum IFG between frames during transmission is 48Bit */ #define ETH_INTERFRAMEGAP_40BIT ((uint32_t)0x000E0000) /*!< minimum IFG between frames during transmission is 40Bit */ -#define IS_ETH_INTER_FRAME_GAP(GAP) (((GAP) == ETH_INTERFRAMEGAP_96BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_88BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_80BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_72BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_64BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_56BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_48BIT) || \ - ((GAP) == ETH_INTERFRAMEGAP_40BIT)) - /** * @} */ -/** @defgroup ETH_Carrier_Sense +/** @defgroup ETH_Carrier_Sense ETH Carrier Sense * @{ */ #define ETH_CARRIERSENCE_ENABLE ((uint32_t)0x00000000) -#define ETH_CARRIERSENCE_DISABLE ((uint32_t)0x00010000) -#define IS_ETH_CARRIER_SENSE(CMD) (((CMD) == ETH_CARRIERSENCE_ENABLE) || \ - ((CMD) == ETH_CARRIERSENCE_DISABLE)) - +#define ETH_CARRIERSENCE_DISABLE ((uint32_t)0x00010000) /** * @} */ -/** @defgroup ETH_Receive_Own +/** @defgroup ETH_Receive_Own ETH Receive Own * @{ */ #define ETH_RECEIVEOWN_ENABLE ((uint32_t)0x00000000) -#define ETH_RECEIVEOWN_DISABLE ((uint32_t)0x00002000) -#define IS_ETH_RECEIVE_OWN(CMD) (((CMD) == ETH_RECEIVEOWN_ENABLE) || \ - ((CMD) == ETH_RECEIVEOWN_DISABLE)) - +#define ETH_RECEIVEOWN_DISABLE ((uint32_t)0x00002000) /** * @} */ -/** @defgroup ETH_Loop_Back_Mode +/** @defgroup ETH_Loop_Back_Mode ETH Loop Back Mode * @{ */ #define ETH_LOOPBACKMODE_ENABLE ((uint32_t)0x00001000) #define ETH_LOOPBACKMODE_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_LOOPBACK_MODE(CMD) (((CMD) == ETH_LOOPBACKMODE_ENABLE) || \ - ((CMD) == ETH_LOOPBACKMODE_DISABLE)) - /** * @} */ -/** @defgroup ETH_Checksum_Offload +/** @defgroup ETH_Checksum_Offload ETH Checksum Offload * @{ */ #define ETH_CHECKSUMOFFLAOD_ENABLE ((uint32_t)0x00000400) #define ETH_CHECKSUMOFFLAOD_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_CHECKSUM_OFFLOAD(CMD) (((CMD) == ETH_CHECKSUMOFFLAOD_ENABLE) || \ - ((CMD) == ETH_CHECKSUMOFFLAOD_DISABLE)) - /** * @} */ -/** @defgroup ETH_Retry_Transmission +/** @defgroup ETH_Retry_Transmission ETH Retry Transmission * @{ */ #define ETH_RETRYTRANSMISSION_ENABLE ((uint32_t)0x00000000) #define ETH_RETRYTRANSMISSION_DISABLE ((uint32_t)0x00000200) -#define IS_ETH_RETRY_TRANSMISSION(CMD) (((CMD) == ETH_RETRYTRANSMISSION_ENABLE) || \ - ((CMD) == ETH_RETRYTRANSMISSION_DISABLE)) - /** * @} */ -/** @defgroup ETH_Automatic_Pad_CRC_Strip +/** @defgroup ETH_Automatic_Pad_CRC_Strip ETH Automatic Pad CRC Strip * @{ */ #define ETH_AUTOMATICPADCRCSTRIP_ENABLE ((uint32_t)0x00000080) #define ETH_AUTOMATICPADCRCSTRIP_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_AUTOMATIC_PADCRC_STRIP(CMD) (((CMD) == ETH_AUTOMATICPADCRCSTRIP_ENABLE) || \ - ((CMD) == ETH_AUTOMATICPADCRCSTRIP_DISABLE)) - /** * @} */ -/** @defgroup ETH_Back_Off_Limit +/** @defgroup ETH_Back_Off_Limit ETH Back Off Limit * @{ */ #define ETH_BACKOFFLIMIT_10 ((uint32_t)0x00000000) #define ETH_BACKOFFLIMIT_8 ((uint32_t)0x00000020) #define ETH_BACKOFFLIMIT_4 ((uint32_t)0x00000040) #define ETH_BACKOFFLIMIT_1 ((uint32_t)0x00000060) -#define IS_ETH_BACKOFF_LIMIT(LIMIT) (((LIMIT) == ETH_BACKOFFLIMIT_10) || \ - ((LIMIT) == ETH_BACKOFFLIMIT_8) || \ - ((LIMIT) == ETH_BACKOFFLIMIT_4) || \ - ((LIMIT) == ETH_BACKOFFLIMIT_1)) - /** * @} */ -/** @defgroup ETH_Deferral_Check +/** @defgroup ETH_Deferral_Check ETH Deferral Check * @{ */ #define ETH_DEFFERRALCHECK_ENABLE ((uint32_t)0x00000010) #define ETH_DEFFERRALCHECK_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_DEFERRAL_CHECK(CMD) (((CMD) == ETH_DEFFERRALCHECK_ENABLE) || \ - ((CMD) == ETH_DEFFERRALCHECK_DISABLE)) - /** * @} */ -/** @defgroup ETH_Receive_All +/** @defgroup ETH_Receive_All ETH Receive All * @{ */ #define ETH_RECEIVEALL_ENABLE ((uint32_t)0x80000000) #define ETH_RECEIVEAll_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_RECEIVE_ALL(CMD) (((CMD) == ETH_RECEIVEALL_ENABLE) || \ - ((CMD) == ETH_RECEIVEAll_DISABLE)) - /** * @} */ -/** @defgroup ETH_Source_Addr_Filter +/** @defgroup ETH_Source_Addr_Filter ETH Source Addr Filter * @{ */ #define ETH_SOURCEADDRFILTER_NORMAL_ENABLE ((uint32_t)0x00000200) #define ETH_SOURCEADDRFILTER_INVERSE_ENABLE ((uint32_t)0x00000300) #define ETH_SOURCEADDRFILTER_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_SOURCE_ADDR_FILTER(CMD) (((CMD) == ETH_SOURCEADDRFILTER_NORMAL_ENABLE) || \ - ((CMD) == ETH_SOURCEADDRFILTER_INVERSE_ENABLE) || \ - ((CMD) == ETH_SOURCEADDRFILTER_DISABLE)) - /** * @} */ -/** @defgroup ETH_Pass_Control_Frames +/** @defgroup ETH_Pass_Control_Frames ETH Pass Control Frames * @{ */ #define ETH_PASSCONTROLFRAMES_BLOCKALL ((uint32_t)0x00000040) /*!< MAC filters all control frames from reaching the application */ #define ETH_PASSCONTROLFRAMES_FORWARDALL ((uint32_t)0x00000080) /*!< MAC forwards all control frames to application even if they fail the Address Filter */ #define ETH_PASSCONTROLFRAMES_FORWARDPASSEDADDRFILTER ((uint32_t)0x000000C0) /*!< MAC forwards control frames that pass the Address Filter. */ -#define IS_ETH_CONTROL_FRAMES(PASS) (((PASS) == ETH_PASSCONTROLFRAMES_BLOCKALL) || \ - ((PASS) == ETH_PASSCONTROLFRAMES_FORWARDALL) || \ - ((PASS) == ETH_PASSCONTROLFRAMES_FORWARDPASSEDADDRFILTER)) - /** * @} */ -/** @defgroup ETH_Broadcast_Frames_Reception +/** @defgroup ETH_Broadcast_Frames_Reception ETH Broadcast Frames Reception * @{ */ #define ETH_BROADCASTFRAMESRECEPTION_ENABLE ((uint32_t)0x00000000) #define ETH_BROADCASTFRAMESRECEPTION_DISABLE ((uint32_t)0x00000020) -#define IS_ETH_BROADCAST_FRAMES_RECEPTION(CMD) (((CMD) == ETH_BROADCASTFRAMESRECEPTION_ENABLE) || \ - ((CMD) == ETH_BROADCASTFRAMESRECEPTION_DISABLE)) - /** * @} */ -/** @defgroup ETH_Destination_Addr_Filter +/** @defgroup ETH_Destination_Addr_Filter ETH Destination Addr Filter * @{ */ #define ETH_DESTINATIONADDRFILTER_NORMAL ((uint32_t)0x00000000) #define ETH_DESTINATIONADDRFILTER_INVERSE ((uint32_t)0x00000008) -#define IS_ETH_DESTINATION_ADDR_FILTER(FILTER) (((FILTER) == ETH_DESTINATIONADDRFILTER_NORMAL) || \ - ((FILTER) == ETH_DESTINATIONADDRFILTER_INVERSE)) - /** * @} */ -/** @defgroup ETH_Promiscuous_Mode +/** @defgroup ETH_Promiscuous_Mode ETH Promiscuous Mode * @{ */ -#define ETH_PROMISCIOUSMODE_ENABLE ((uint32_t)0x00000001) -#define ETH_PROMISCIOUSMODE_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_PROMISCIOUS_MODE(CMD) (((CMD) == ETH_PROMISCIOUSMODE_ENABLE) || \ - ((CMD) == ETH_PROMISCIOUSMODE_DISABLE)) - +#define ETH_PROMISCUOUS_MODE_ENABLE ((uint32_t)0x00000001) +#define ETH_PROMISCUOUS_MODE_DISABLE ((uint32_t)0x00000000) /** * @} */ -/** @defgroup ETH_Multicast_Frames_Filter +/** @defgroup ETH_Multicast_Frames_Filter ETH Multicast Frames Filter * @{ */ #define ETH_MULTICASTFRAMESFILTER_PERFECTHASHTABLE ((uint32_t)0x00000404) #define ETH_MULTICASTFRAMESFILTER_HASHTABLE ((uint32_t)0x00000004) #define ETH_MULTICASTFRAMESFILTER_PERFECT ((uint32_t)0x00000000) #define ETH_MULTICASTFRAMESFILTER_NONE ((uint32_t)0x00000010) -#define IS_ETH_MULTICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_MULTICASTFRAMESFILTER_PERFECTHASHTABLE) || \ - ((FILTER) == ETH_MULTICASTFRAMESFILTER_HASHTABLE) || \ - ((FILTER) == ETH_MULTICASTFRAMESFILTER_PERFECT) || \ - ((FILTER) == ETH_MULTICASTFRAMESFILTER_NONE)) /** * @} */ -/** @defgroup ETH_Unicast_Frames_Filter +/** @defgroup ETH_Unicast_Frames_Filter ETH Unicast Frames Filter * @{ */ #define ETH_UNICASTFRAMESFILTER_PERFECTHASHTABLE ((uint32_t)0x00000402) #define ETH_UNICASTFRAMESFILTER_HASHTABLE ((uint32_t)0x00000002) #define ETH_UNICASTFRAMESFILTER_PERFECT ((uint32_t)0x00000000) -#define IS_ETH_UNICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_UNICASTFRAMESFILTER_PERFECTHASHTABLE) || \ - ((FILTER) == ETH_UNICASTFRAMESFILTER_HASHTABLE) || \ - ((FILTER) == ETH_UNICASTFRAMESFILTER_PERFECT)) -/** - * @} - */ - -/** @defgroup ETH_Pause_Time - * @{ - */ -#define IS_ETH_PAUSE_TIME(TIME) ((TIME) <= 0xFFFF) - /** * @} */ -/** @defgroup ETH_Zero_Quanta_Pause +/** @defgroup ETH_Zero_Quanta_Pause ETH Zero Quanta Pause * @{ */ #define ETH_ZEROQUANTAPAUSE_ENABLE ((uint32_t)0x00000000) #define ETH_ZEROQUANTAPAUSE_DISABLE ((uint32_t)0x00000080) -#define IS_ETH_ZEROQUANTA_PAUSE(CMD) (((CMD) == ETH_ZEROQUANTAPAUSE_ENABLE) || \ - ((CMD) == ETH_ZEROQUANTAPAUSE_DISABLE)) /** * @} */ -/** @defgroup ETH_Pause_Low_Threshold +/** @defgroup ETH_Pause_Low_Threshold ETH Pause Low Threshold * @{ */ #define ETH_PAUSELOWTHRESHOLD_MINUS4 ((uint32_t)0x00000000) /*!< Pause time minus 4 slot times */ #define ETH_PAUSELOWTHRESHOLD_MINUS28 ((uint32_t)0x00000010) /*!< Pause time minus 28 slot times */ #define ETH_PAUSELOWTHRESHOLD_MINUS144 ((uint32_t)0x00000020) /*!< Pause time minus 144 slot times */ #define ETH_PAUSELOWTHRESHOLD_MINUS256 ((uint32_t)0x00000030) /*!< Pause time minus 256 slot times */ -#define IS_ETH_PAUSE_LOW_THRESHOLD(THRESHOLD) (((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS4) || \ - ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS28) || \ - ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS144) || \ - ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS256)) /** * @} */ -/** @defgroup ETH_Unicast_Pause_Frame_Detect +/** @defgroup ETH_Unicast_Pause_Frame_Detect ETH Unicast Pause Frame Detect * @{ */ #define ETH_UNICASTPAUSEFRAMEDETECT_ENABLE ((uint32_t)0x00000008) #define ETH_UNICASTPAUSEFRAMEDETECT_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_UNICAST_PAUSE_FRAME_DETECT(CMD) (((CMD) == ETH_UNICASTPAUSEFRAMEDETECT_ENABLE) || \ - ((CMD) == ETH_UNICASTPAUSEFRAMEDETECT_DISABLE)) /** * @} */ -/** @defgroup ETH_Receive_Flow_Control +/** @defgroup ETH_Receive_Flow_Control ETH Receive Flow Control * @{ */ #define ETH_RECEIVEFLOWCONTROL_ENABLE ((uint32_t)0x00000004) #define ETH_RECEIVEFLOWCONTROL_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_RECEIVE_FLOWCONTROL(CMD) (((CMD) == ETH_RECEIVEFLOWCONTROL_ENABLE) || \ - ((CMD) == ETH_RECEIVEFLOWCONTROL_DISABLE)) /** * @} */ -/** @defgroup ETH_Transmit_Flow_Control +/** @defgroup ETH_Transmit_Flow_Control ETH Transmit Flow Control * @{ */ #define ETH_TRANSMITFLOWCONTROL_ENABLE ((uint32_t)0x00000002) #define ETH_TRANSMITFLOWCONTROL_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_TRANSMIT_FLOWCONTROL(CMD) (((CMD) == ETH_TRANSMITFLOWCONTROL_ENABLE) || \ - ((CMD) == ETH_TRANSMITFLOWCONTROL_DISABLE)) /** * @} */ -/** @defgroup ETH_VLAN_Tag_Comparison +/** @defgroup ETH_VLAN_Tag_Comparison ETH VLAN Tag Comparison * @{ */ #define ETH_VLANTAGCOMPARISON_12BIT ((uint32_t)0x00010000) #define ETH_VLANTAGCOMPARISON_16BIT ((uint32_t)0x00000000) -#define IS_ETH_VLAN_TAG_COMPARISON(COMPARISON) (((COMPARISON) == ETH_VLANTAGCOMPARISON_12BIT) || \ - ((COMPARISON) == ETH_VLANTAGCOMPARISON_16BIT)) -#define IS_ETH_VLAN_TAG_IDENTIFIER(IDENTIFIER) ((IDENTIFIER) <= 0xFFFF) - /** * @} */ -/** @defgroup ETH_MAC_addresses +/** @defgroup ETH_MAC_addresses ETH MAC addresses * @{ */ #define ETH_MAC_ADDRESS0 ((uint32_t)0x00000000) #define ETH_MAC_ADDRESS1 ((uint32_t)0x00000008) #define ETH_MAC_ADDRESS2 ((uint32_t)0x00000010) #define ETH_MAC_ADDRESS3 ((uint32_t)0x00000018) -#define IS_ETH_MAC_ADDRESS0123(ADDRESS) (((ADDRESS) == ETH_MAC_ADDRESS0) || \ - ((ADDRESS) == ETH_MAC_ADDRESS1) || \ - ((ADDRESS) == ETH_MAC_ADDRESS2) || \ - ((ADDRESS) == ETH_MAC_ADDRESS3)) -#define IS_ETH_MAC_ADDRESS123(ADDRESS) (((ADDRESS) == ETH_MAC_ADDRESS1) || \ - ((ADDRESS) == ETH_MAC_ADDRESS2) || \ - ((ADDRESS) == ETH_MAC_ADDRESS3)) /** * @} */ -/** @defgroup ETH_MAC_addresses_filter_SA_DA_filed_of_received_frames +/** @defgroup ETH_MAC_addresses_filter_SA_DA ETH MAC addresses filter SA DA * @{ */ #define ETH_MAC_ADDRESSFILTER_SA ((uint32_t)0x00000000) #define ETH_MAC_ADDRESSFILTER_DA ((uint32_t)0x00000008) -#define IS_ETH_MAC_ADDRESS_FILTER(FILTER) (((FILTER) == ETH_MAC_ADDRESSFILTER_SA) || \ - ((FILTER) == ETH_MAC_ADDRESSFILTER_DA)) /** * @} */ -/** @defgroup ETH_MAC_addresses_filter_Mask_bytes +/** @defgroup ETH_MAC_addresses_filter_Mask_bytes ETH MAC addresses filter Mask bytes * @{ */ #define ETH_MAC_ADDRESSMASK_BYTE6 ((uint32_t)0x20000000) /*!< Mask MAC Address high reg bits [15:8] */ @@ -1030,108 +1234,81 @@ typedef struct #define ETH_MAC_ADDRESSMASK_BYTE3 ((uint32_t)0x04000000) /*!< Mask MAC Address low reg bits [23:16] */ #define ETH_MAC_ADDRESSMASK_BYTE2 ((uint32_t)0x02000000) /*!< Mask MAC Address low reg bits [15:8] */ #define ETH_MAC_ADDRESSMASK_BYTE1 ((uint32_t)0x01000000) /*!< Mask MAC Address low reg bits [70] */ -#define IS_ETH_MAC_ADDRESS_MASK(MASK) (((MASK) == ETH_MAC_ADDRESSMASK_BYTE6) || \ - ((MASK) == ETH_MAC_ADDRESSMASK_BYTE5) || \ - ((MASK) == ETH_MAC_ADDRESSMASK_BYTE4) || \ - ((MASK) == ETH_MAC_ADDRESSMASK_BYTE3) || \ - ((MASK) == ETH_MAC_ADDRESSMASK_BYTE2) || \ - ((MASK) == ETH_MAC_ADDRESSMASK_BYTE1)) - /** * @} */ -/** @defgroup ETH_MAC_Debug_flags +/** @defgroup ETH_MAC_Debug_flags ETH MAC Debug flags * @{ */ #define ETH_MAC_TXFIFO_FULL ((uint32_t)0x02000000) /* Tx FIFO full */ - #define ETH_MAC_TXFIFONOT_EMPTY ((uint32_t)0x01000000) /* Tx FIFO not empty */ - #define ETH_MAC_TXFIFO_WRITE_ACTIVE ((uint32_t)0x00400000) /* Tx FIFO write active */ - #define ETH_MAC_TXFIFO_IDLE ((uint32_t)0x00000000) /* Tx FIFO read status: Idle */ #define ETH_MAC_TXFIFO_READ ((uint32_t)0x00100000) /* Tx FIFO read status: Read (transferring data to the MAC transmitter) */ #define ETH_MAC_TXFIFO_WAITING ((uint32_t)0x00200000) /* Tx FIFO read status: Waiting for TxStatus from MAC transmitter */ #define ETH_MAC_TXFIFO_WRITING ((uint32_t)0x00300000) /* Tx FIFO read status: Writing the received TxStatus or flushing the TxFIFO */ - #define ETH_MAC_TRANSMISSION_PAUSE ((uint32_t)0x00080000) /* MAC transmitter in pause */ - #define ETH_MAC_TRANSMITFRAMECONTROLLER_IDLE ((uint32_t)0x00000000) /* MAC transmit frame controller: Idle */ #define ETH_MAC_TRANSMITFRAMECONTROLLER_WAITING ((uint32_t)0x00020000) /* MAC transmit frame controller: Waiting for Status of previous frame or IFG/backoff period to be over */ #define ETH_MAC_TRANSMITFRAMECONTROLLER_GENRATING_PCF ((uint32_t)0x00040000) /* MAC transmit frame controller: Generating and transmitting a Pause control frame (in full duplex mode) */ #define ETH_MAC_TRANSMITFRAMECONTROLLER_TRANSFERRING ((uint32_t)0x00060000) /* MAC transmit frame controller: Transferring input frame for transmission */ - #define ETH_MAC_MII_TRANSMIT_ACTIVE ((uint32_t)0x00010000) /* MAC MII transmit engine active */ - #define ETH_MAC_RXFIFO_EMPTY ((uint32_t)0x00000000) /* Rx FIFO fill level: empty */ #define ETH_MAC_RXFIFO_BELOW_THRESHOLD ((uint32_t)0x00000100) /* Rx FIFO fill level: fill-level below flow-control de-activate threshold */ #define ETH_MAC_RXFIFO_ABOVE_THRESHOLD ((uint32_t)0x00000200) /* Rx FIFO fill level: fill-level above flow-control activate threshold */ #define ETH_MAC_RXFIFO_FULL ((uint32_t)0x00000300) /* Rx FIFO fill level: full */ - #define ETH_MAC_READCONTROLLER_IDLE ((uint32_t)0x00000060) /* Rx FIFO read controller IDLE state */ #define ETH_MAC_READCONTROLLER_READING_DATA ((uint32_t)0x00000060) /* Rx FIFO read controller Reading frame data */ #define ETH_MAC_READCONTROLLER_READING_STATUS ((uint32_t)0x00000060) /* Rx FIFO read controller Reading frame status (or time-stamp) */ #define ETH_MAC_READCONTROLLER_ FLUSHING ((uint32_t)0x00000060) /* Rx FIFO read controller Flushing the frame data and status */ - #define ETH_MAC_RXFIFO_WRITE_ACTIVE ((uint32_t)0x00000010) /* Rx FIFO write controller active */ - #define ETH_MAC_SMALL_FIFO_NOTACTIVE ((uint32_t)0x00000000) /* MAC small FIFO read / write controllers not active */ #define ETH_MAC_SMALL_FIFO_READ_ACTIVE ((uint32_t)0x00000002) /* MAC small FIFO read controller active */ #define ETH_MAC_SMALL_FIFO_WRITE_ACTIVE ((uint32_t)0x00000004) /* MAC small FIFO write controller active */ #define ETH_MAC_SMALL_FIFO_RW_ACTIVE ((uint32_t)0x00000006) /* MAC small FIFO read / write controllers active */ - -#define ETH_MAC_MII_RECEIVE_PROTOCOL_AVTIVE ((uint32_t)0x00000001) /* MAC MII receive protocol engine active */ - +#define ETH_MAC_MII_RECEIVE_PROTOCOL_ACTIVE ((uint32_t)0x00000001) /* MAC MII receive protocol engine active */ /** * @} */ -/** @defgroup ETH_Drop_TCP_IP_Checksum_Error_Frame +/** @defgroup ETH_Drop_TCP_IP_Checksum_Error_Frame ETH Drop TCP IP Checksum Error Frame * @{ */ #define ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE ((uint32_t)0x00000000) #define ETH_DROPTCPIPCHECKSUMERRORFRAME_DISABLE ((uint32_t)0x04000000) -#define IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(CMD) (((CMD) == ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE) || \ - ((CMD) == ETH_DROPTCPIPCHECKSUMERRORFRAME_DISABLE)) /** * @} */ -/** @defgroup ETH_Receive_Store_Forward +/** @defgroup ETH_Receive_Store_Forward ETH Receive Store Forward * @{ */ #define ETH_RECEIVESTOREFORWARD_ENABLE ((uint32_t)0x02000000) #define ETH_RECEIVESTOREFORWARD_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_RECEIVE_STORE_FORWARD(CMD) (((CMD) == ETH_RECEIVESTOREFORWARD_ENABLE) || \ - ((CMD) == ETH_RECEIVESTOREFORWARD_DISABLE)) /** * @} */ -/** @defgroup ETH_Flush_Received_Frame +/** @defgroup ETH_Flush_Received_Frame ETH Flush Received Frame * @{ */ #define ETH_FLUSHRECEIVEDFRAME_ENABLE ((uint32_t)0x00000000) #define ETH_FLUSHRECEIVEDFRAME_DISABLE ((uint32_t)0x01000000) -#define IS_ETH_FLUSH_RECEIVE_FRAME(CMD) (((CMD) == ETH_FLUSHRECEIVEDFRAME_ENABLE) || \ - ((CMD) == ETH_FLUSHRECEIVEDFRAME_DISABLE)) /** * @} */ -/** @defgroup ETH_Transmit_Store_Forward +/** @defgroup ETH_Transmit_Store_Forward ETH Transmit Store Forward * @{ */ #define ETH_TRANSMITSTOREFORWARD_ENABLE ((uint32_t)0x00200000) #define ETH_TRANSMITSTOREFORWARD_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_TRANSMIT_STORE_FORWARD(CMD) (((CMD) == ETH_TRANSMITSTOREFORWARD_ENABLE) || \ - ((CMD) == ETH_TRANSMITSTOREFORWARD_DISABLE)) /** * @} */ -/** @defgroup ETH_Transmit_Threshold_Control +/** @defgroup ETH_Transmit_Threshold_Control ETH Transmit Threshold Control * @{ */ #define ETH_TRANSMITTHRESHOLDCONTROL_64BYTES ((uint32_t)0x00000000) /*!< threshold level of the MTL Transmit FIFO is 64 Bytes */ @@ -1142,93 +1319,67 @@ typedef struct #define ETH_TRANSMITTHRESHOLDCONTROL_32BYTES ((uint32_t)0x00014000) /*!< threshold level of the MTL Transmit FIFO is 32 Bytes */ #define ETH_TRANSMITTHRESHOLDCONTROL_24BYTES ((uint32_t)0x00018000) /*!< threshold level of the MTL Transmit FIFO is 24 Bytes */ #define ETH_TRANSMITTHRESHOLDCONTROL_16BYTES ((uint32_t)0x0001C000) /*!< threshold level of the MTL Transmit FIFO is 16 Bytes */ -#define IS_ETH_TRANSMIT_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_64BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_128BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_192BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_256BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_40BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_32BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_24BYTES) || \ - ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_16BYTES)) /** * @} */ -/** @defgroup ETH_Forward_Error_Frames +/** @defgroup ETH_Forward_Error_Frames ETH Forward Error Frames * @{ */ #define ETH_FORWARDERRORFRAMES_ENABLE ((uint32_t)0x00000080) #define ETH_FORWARDERRORFRAMES_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_FORWARD_ERROR_FRAMES(CMD) (((CMD) == ETH_FORWARDERRORFRAMES_ENABLE) || \ - ((CMD) == ETH_FORWARDERRORFRAMES_DISABLE)) /** * @} */ -/** @defgroup ETH_Forward_Undersized_Good_Frames +/** @defgroup ETH_Forward_Undersized_Good_Frames ETH Forward Undersized Good Frames * @{ */ #define ETH_FORWARDUNDERSIZEDGOODFRAMES_ENABLE ((uint32_t)0x00000040) #define ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_FORWARD_UNDERSIZED_GOOD_FRAMES(CMD) (((CMD) == ETH_FORWARDUNDERSIZEDGOODFRAMES_ENABLE) || \ - ((CMD) == ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE)) - /** * @} */ -/** @defgroup ETH_Receive_Threshold_Control +/** @defgroup ETH_Receive_Threshold_Control ETH Receive Threshold Control * @{ */ #define ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES ((uint32_t)0x00000000) /*!< threshold level of the MTL Receive FIFO is 64 Bytes */ #define ETH_RECEIVEDTHRESHOLDCONTROL_32BYTES ((uint32_t)0x00000008) /*!< threshold level of the MTL Receive FIFO is 32 Bytes */ #define ETH_RECEIVEDTHRESHOLDCONTROL_96BYTES ((uint32_t)0x00000010) /*!< threshold level of the MTL Receive FIFO is 96 Bytes */ #define ETH_RECEIVEDTHRESHOLDCONTROL_128BYTES ((uint32_t)0x00000018) /*!< threshold level of the MTL Receive FIFO is 128 Bytes */ -#define IS_ETH_RECEIVE_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES) || \ - ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_32BYTES) || \ - ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_96BYTES) || \ - ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_128BYTES)) /** * @} */ -/** @defgroup ETH_Second_Frame_Operate +/** @defgroup ETH_Second_Frame_Operate ETH Second Frame Operate * @{ */ #define ETH_SECONDFRAMEOPERARTE_ENABLE ((uint32_t)0x00000004) #define ETH_SECONDFRAMEOPERARTE_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_SECOND_FRAME_OPERATE(CMD) (((CMD) == ETH_SECONDFRAMEOPERARTE_ENABLE) || \ - ((CMD) == ETH_SECONDFRAMEOPERARTE_DISABLE)) - /** * @} */ -/** @defgroup ETH_Address_Aligned_Beats +/** @defgroup ETH_Address_Aligned_Beats ETH Address Aligned Beats * @{ */ #define ETH_ADDRESSALIGNEDBEATS_ENABLE ((uint32_t)0x02000000) #define ETH_ADDRESSALIGNEDBEATS_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_ADDRESS_ALIGNED_BEATS(CMD) (((CMD) == ETH_ADDRESSALIGNEDBEATS_ENABLE) || \ - ((CMD) == ETH_ADDRESSALIGNEDBEATS_DISABLE)) - /** * @} */ -/** @defgroup ETH_Fixed_Burst +/** @defgroup ETH_Fixed_Burst ETH Fixed Burst * @{ */ #define ETH_FIXEDBURST_ENABLE ((uint32_t)0x00010000) #define ETH_FIXEDBURST_DISABLE ((uint32_t)0x00000000) -#define IS_ETH_FIXED_BURST(CMD) (((CMD) == ETH_FIXEDBURST_ENABLE) || \ - ((CMD) == ETH_FIXEDBURST_DISABLE)) - /** * @} */ -/** @defgroup ETH_Rx_DMA_Burst_Length +/** @defgroup ETH_Rx_DMA_Burst_Length ETH Rx DMA Burst Length * @{ */ #define ETH_RXDMABURSTLENGTH_1BEAT ((uint32_t)0x00020000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 1 */ @@ -1243,25 +1394,11 @@ typedef struct #define ETH_RXDMABURSTLENGTH_4XPBL_32BEAT ((uint32_t)0x01100000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 32 */ #define ETH_RXDMABURSTLENGTH_4XPBL_64BEAT ((uint32_t)0x01200000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 64 */ #define ETH_RXDMABURSTLENGTH_4XPBL_128BEAT ((uint32_t)0x01400000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 128 */ - -#define IS_ETH_RXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_RXDMABURSTLENGTH_1BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_2BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_8BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_16BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_32BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_4BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_8BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_16BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_32BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_64BEAT) || \ - ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_128BEAT)) - /** * @} */ -/** @defgroup ETH_Tx_DMA_Burst_Length +/** @defgroup ETH_Tx_DMA_Burst_Length ETH Tx DMA Burst Length * @{ */ #define ETH_TXDMABURSTLENGTH_1BEAT ((uint32_t)0x00000100) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */ @@ -1276,40 +1413,20 @@ typedef struct #define ETH_TXDMABURSTLENGTH_4XPBL_32BEAT ((uint32_t)0x01000800) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */ #define ETH_TXDMABURSTLENGTH_4XPBL_64BEAT ((uint32_t)0x01001000) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */ #define ETH_TXDMABURSTLENGTH_4XPBL_128BEAT ((uint32_t)0x01002000) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */ +/** + * @} + */ -#define IS_ETH_TXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_TXDMABURSTLENGTH_1BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_2BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_8BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_16BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_32BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_4BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_8BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_16BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_32BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_64BEAT) || \ - ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_128BEAT)) - -/** @defgroup ETH_DMA_Enhanced_descriptor_format +/** @defgroup ETH_DMA_Enhanced_descriptor_format ETH DMA Enhanced descriptor format * @{ */ -#define ETH_DMAENHANCEDDESCRIPTOR_ENABLE ((uint32_t)0x00000080) -#define ETH_DMAENHANCEDDESCRIPTOR_DISABLE ((uint32_t)0x00000000) - -#define IS_ETH_ENHANCED_DESCRIPTOR_FORMAT(CMD) (((CMD) == ETH_DMAENHANCEDDESCRIPTOR_ENABLE) || \ - ((CMD) == ETH_DMAENHANCEDDESCRIPTOR_DISABLE)) - +#define ETH_DMAENHANCEDDESCRIPTOR_ENABLE ((uint32_t)0x00000080) +#define ETH_DMAENHANCEDDESCRIPTOR_DISABLE ((uint32_t)0x00000000) /** * @} */ -/** - * @brief ETH DMA Descriptor SkipLength - */ -#define IS_ETH_DMA_DESC_SKIP_LENGTH(LENGTH) ((LENGTH) <= 0x1F) - - -/** @defgroup ETH_DMA_Arbitration +/** @defgroup ETH_DMA_Arbitration ETH DMA Arbitration * @{ */ #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1 ((uint32_t)0x00000000) @@ -1317,211 +1434,70 @@ typedef struct #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_3_1 ((uint32_t)0x00008000) #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_4_1 ((uint32_t)0x0000C000) #define ETH_DMAARBITRATION_RXPRIORTX ((uint32_t)0x00000002) -#define IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(RATIO) (((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1) || \ - ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_2_1) || \ - ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_3_1) || \ - ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_4_1) || \ - ((RATIO) == ETH_DMAARBITRATION_RXPRIORTX)) -/** - * @} - */ - -/** @defgroup ETH_DMA_Tx_descriptor_flags - * @{ - */ -#define IS_ETH_DMATXDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMATXDESC_OWN) || \ - ((FLAG) == ETH_DMATXDESC_IC) || \ - ((FLAG) == ETH_DMATXDESC_LS) || \ - ((FLAG) == ETH_DMATXDESC_FS) || \ - ((FLAG) == ETH_DMATXDESC_DC) || \ - ((FLAG) == ETH_DMATXDESC_DP) || \ - ((FLAG) == ETH_DMATXDESC_TTSE) || \ - ((FLAG) == ETH_DMATXDESC_TER) || \ - ((FLAG) == ETH_DMATXDESC_TCH) || \ - ((FLAG) == ETH_DMATXDESC_TTSS) || \ - ((FLAG) == ETH_DMATXDESC_IHE) || \ - ((FLAG) == ETH_DMATXDESC_ES) || \ - ((FLAG) == ETH_DMATXDESC_JT) || \ - ((FLAG) == ETH_DMATXDESC_FF) || \ - ((FLAG) == ETH_DMATXDESC_PCE) || \ - ((FLAG) == ETH_DMATXDESC_LCA) || \ - ((FLAG) == ETH_DMATXDESC_NC) || \ - ((FLAG) == ETH_DMATXDESC_LCO) || \ - ((FLAG) == ETH_DMATXDESC_EC) || \ - ((FLAG) == ETH_DMATXDESC_VF) || \ - ((FLAG) == ETH_DMATXDESC_CC) || \ - ((FLAG) == ETH_DMATXDESC_ED) || \ - ((FLAG) == ETH_DMATXDESC_UF) || \ - ((FLAG) == ETH_DMATXDESC_DB)) - /** * @} */ -/** @defgroup ETH_DMA_Tx_descriptor_segment +/** @defgroup ETH_DMA_Tx_descriptor_segment ETH DMA Tx descriptor segment * @{ */ #define ETH_DMATXDESC_LASTSEGMENTS ((uint32_t)0x40000000) /*!< Last Segment */ #define ETH_DMATXDESC_FIRSTSEGMENT ((uint32_t)0x20000000) /*!< First Segment */ -#define IS_ETH_DMA_TXDESC_SEGMENT(SEGMENT) (((SEGMENT) == ETH_DMATXDESC_LASTSEGMENTS) || \ - ((SEGMENT) == ETH_DMATXDESC_FIRSTSEGMENT)) - /** * @} */ -/** @defgroup ETH_DMA_Tx_descriptor_Checksum_Insertion_Control +/** @defgroup ETH_DMA_Tx_descriptor_Checksum_Insertion_Control ETH DMA Tx descriptor Checksum Insertion Control * @{ */ #define ETH_DMATXDESC_CHECKSUMBYPASS ((uint32_t)0x00000000) /*!< Checksum engine bypass */ #define ETH_DMATXDESC_CHECKSUMIPV4HEADER ((uint32_t)0x00400000) /*!< IPv4 header checksum insertion */ #define ETH_DMATXDESC_CHECKSUMTCPUDPICMPSEGMENT ((uint32_t)0x00800000) /*!< TCP/UDP/ICMP checksum insertion. Pseudo header checksum is assumed to be present */ #define ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL ((uint32_t)0x00C00000) /*!< TCP/UDP/ICMP checksum fully in hardware including pseudo header */ -#define IS_ETH_DMA_TXDESC_CHECKSUM(CHECKSUM) (((CHECKSUM) == ETH_DMATXDESC_CHECKSUMBYPASS) || \ - ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMIPV4HEADER) || \ - ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMTCPUDPICMPSEGMENT) || \ - ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL)) -/** - * @brief ETH DMA Tx Desciptor buffer size - */ -#define IS_ETH_DMATXDESC_BUFFER_SIZE(SIZE) ((SIZE) <= 0x1FFF) - -/** - * @} - */ - -/** @defgroup ETH_DMA_Rx_descriptor_flags - * @{ - */ -#define IS_ETH_DMARXDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMARXDESC_OWN) || \ - ((FLAG) == ETH_DMARXDESC_AFM) || \ - ((FLAG) == ETH_DMARXDESC_ES) || \ - ((FLAG) == ETH_DMARXDESC_DE) || \ - ((FLAG) == ETH_DMARXDESC_SAF) || \ - ((FLAG) == ETH_DMARXDESC_LE) || \ - ((FLAG) == ETH_DMARXDESC_OE) || \ - ((FLAG) == ETH_DMARXDESC_VLAN) || \ - ((FLAG) == ETH_DMARXDESC_FS) || \ - ((FLAG) == ETH_DMARXDESC_LS) || \ - ((FLAG) == ETH_DMARXDESC_IPV4HCE) || \ - ((FLAG) == ETH_DMARXDESC_LC) || \ - ((FLAG) == ETH_DMARXDESC_FT) || \ - ((FLAG) == ETH_DMARXDESC_RWT) || \ - ((FLAG) == ETH_DMARXDESC_RE) || \ - ((FLAG) == ETH_DMARXDESC_DBE) || \ - ((FLAG) == ETH_DMARXDESC_CE) || \ - ((FLAG) == ETH_DMARXDESC_MAMPCE)) - -/* ETHERNET DMA PTP Rx descriptor extended flags --------------------------------*/ -#define IS_ETH_DMAPTPRXDESC_GET_EXTENDED_FLAG(FLAG) (((FLAG) == ETH_DMAPTPRXDESC_PTPV) || \ - ((FLAG) == ETH_DMAPTPRXDESC_PTPFT) || \ - ((FLAG) == ETH_DMAPTPRXDESC_PTPMT) || \ - ((FLAG) == ETH_DMAPTPRXDESC_IPV6PR) || \ - ((FLAG) == ETH_DMAPTPRXDESC_IPV4PR) || \ - ((FLAG) == ETH_DMAPTPRXDESC_IPCB) || \ - ((FLAG) == ETH_DMAPTPRXDESC_IPPE) || \ - ((FLAG) == ETH_DMAPTPRXDESC_IPHE) || \ - ((FLAG) == ETH_DMAPTPRXDESC_IPPT)) - /** * @} */ -/** @defgroup ETH_DMA_Rx_descriptor_buffers_ +/** @defgroup ETH_DMA_Rx_descriptor_buffers ETH DMA Rx descriptor buffers * @{ */ #define ETH_DMARXDESC_BUFFER1 ((uint32_t)0x00000000) /*!< DMA Rx Desc Buffer1 */ #define ETH_DMARXDESC_BUFFER2 ((uint32_t)0x00000001) /*!< DMA Rx Desc Buffer2 */ -#define IS_ETH_DMA_RXDESC_BUFFER(BUFFER) (((BUFFER) == ETH_DMARXDESC_BUFFER1) || \ - ((BUFFER) == ETH_DMARXDESC_BUFFER2)) - - -/* ETHERNET DMA Tx descriptors Collision Count Shift */ -#define ETH_DMATXDESC_COLLISION_COUNTSHIFT ((uint32_t)3) - -/* ETHERNET DMA Tx descriptors Buffer2 Size Shift */ -#define ETH_DMATXDESC_BUFFER2_SIZESHIFT ((uint32_t)16) - -/* ETHERNET DMA Rx descriptors Frame Length Shift */ -#define ETH_DMARXDESC_FRAME_LENGTHSHIFT ((uint32_t)16) - -/* ETHERNET DMA Rx descriptors Buffer2 Size Shift */ -#define ETH_DMARXDESC_BUFFER2_SIZESHIFT ((uint32_t)16) - -/* ETHERNET DMA Rx descriptors Frame length Shift */ -#define ETH_DMARXDESC_FRAMELENGTHSHIFT ((uint32_t)16) - /** * @} */ -/** @defgroup ETH_PMT_Flags +/** @defgroup ETH_PMT_Flags ETH PMT Flags * @{ */ #define ETH_PMT_FLAG_WUFFRPR ((uint32_t)0x80000000) /*!< Wake-Up Frame Filter Register Pointer Reset */ #define ETH_PMT_FLAG_WUFR ((uint32_t)0x00000040) /*!< Wake-Up Frame Received */ #define ETH_PMT_FLAG_MPR ((uint32_t)0x00000020) /*!< Magic Packet Received */ -#define IS_ETH_PMT_GET_FLAG(FLAG) (((FLAG) == ETH_PMT_FLAG_WUFR) || \ - ((FLAG) == ETH_PMT_FLAG_MPR)) /** * @} */ -/** @defgroup ETH_MMC_Tx_Interrupts +/** @defgroup ETH_MMC_Tx_Interrupts ETH MMC Tx Interrupts * @{ */ #define ETH_MMC_IT_TGF ((uint32_t)0x00200000) /*!< When Tx good frame counter reaches half the maximum value */ #define ETH_MMC_IT_TGFMSC ((uint32_t)0x00008000) /*!< When Tx good multi col counter reaches half the maximum value */ #define ETH_MMC_IT_TGFSC ((uint32_t)0x00004000) /*!< When Tx good single col counter reaches half the maximum value */ - /** * @} */ -/** @defgroup ETH_MMC_Rx_Interrupts +/** @defgroup ETH_MMC_Rx_Interrupts ETH MMC Rx Interrupts * @{ */ #define ETH_MMC_IT_RGUF ((uint32_t)0x10020000) /*!< When Rx good unicast frames counter reaches half the maximum value */ #define ETH_MMC_IT_RFAE ((uint32_t)0x10000040) /*!< When Rx alignment error counter reaches half the maximum value */ #define ETH_MMC_IT_RFCE ((uint32_t)0x10000020) /*!< When Rx crc error counter reaches half the maximum value */ -#define IS_ETH_MMC_IT(IT) (((((IT) & (uint32_t)0xFFDF3FFF) == 0x00) || (((IT) & (uint32_t)0xEFFDFF9F) == 0x00)) && \ - ((IT) != 0x00)) -#define IS_ETH_MMC_GET_IT(IT) (((IT) == ETH_MMC_IT_TGF) || ((IT) == ETH_MMC_IT_TGFMSC) || \ - ((IT) == ETH_MMC_IT_TGFSC) || ((IT) == ETH_MMC_IT_RGUF) || \ - ((IT) == ETH_MMC_IT_RFAE) || ((IT) == ETH_MMC_IT_RFCE)) -/** - * @} - */ - -/** @defgroup ETH_MMC_Registers - * @{ - */ -#define ETH_MMCCR ((uint32_t)0x00000100) /*!< MMC CR register */ -#define ETH_MMCRIR ((uint32_t)0x00000104) /*!< MMC RIR register */ -#define ETH_MMCTIR ((uint32_t)0x00000108) /*!< MMC TIR register */ -#define ETH_MMCRIMR ((uint32_t)0x0000010C) /*!< MMC RIMR register */ -#define ETH_MMCTIMR ((uint32_t)0x00000110) /*!< MMC TIMR register */ -#define ETH_MMCTGFSCCR ((uint32_t)0x0000014C) /*!< MMC TGFSCCR register */ -#define ETH_MMCTGFMSCCR ((uint32_t)0x00000150) /*!< MMC TGFMSCCR register */ -#define ETH_MMCTGFCR ((uint32_t)0x00000168) /*!< MMC TGFCR register */ -#define ETH_MMCRFCECR ((uint32_t)0x00000194) /*!< MMC RFCECR register */ -#define ETH_MMCRFAECR ((uint32_t)0x00000198) /*!< MMC RFAECR register */ -#define ETH_MMCRGUFCR ((uint32_t)0x000001C4) /*!< MMC RGUFCR register */ - -/** - * @brief ETH MMC registers - */ -#define IS_ETH_MMC_REGISTER(REG) (((REG) == ETH_MMCCR) || ((REG) == ETH_MMCRIR) || \ - ((REG) == ETH_MMCTIR) || ((REG) == ETH_MMCRIMR) || \ - ((REG) == ETH_MMCTIMR) || ((REG) == ETH_MMCTGFSCCR) || \ - ((REG) == ETH_MMCTGFMSCCR) || ((REG) == ETH_MMCTGFCR) || \ - ((REG) == ETH_MMCRFCECR) || ((REG) == ETH_MMCRFAECR) || \ - ((REG) == ETH_MMCRGUFCR)) /** * @} */ -/** @defgroup ETH_MAC_Flags +/** @defgroup ETH_MAC_Flags ETH MAC Flags * @{ */ #define ETH_MAC_FLAG_TST ((uint32_t)0x00000200) /*!< Time stamp trigger flag (on MAC) */ @@ -1529,21 +1505,18 @@ typedef struct #define ETH_MAC_FLAG_MMCR ((uint32_t)0x00000020) /*!< MMC receive flag */ #define ETH_MAC_FLAG_MMC ((uint32_t)0x00000010) /*!< MMC flag (on MAC) */ #define ETH_MAC_FLAG_PMT ((uint32_t)0x00000008) /*!< PMT flag (on MAC) */ -#define IS_ETH_MAC_GET_FLAG(FLAG) (((FLAG) == ETH_MAC_FLAG_TST) || ((FLAG) == ETH_MAC_FLAG_MMCT) || \ - ((FLAG) == ETH_MAC_FLAG_MMCR) || ((FLAG) == ETH_MAC_FLAG_MMC) || \ - ((FLAG) == ETH_MAC_FLAG_PMT)) /** * @} */ -/** @defgroup ETH_DMA_Flags +/** @defgroup ETH_DMA_Flags ETH DMA Flags * @{ */ #define ETH_DMA_FLAG_TST ((uint32_t)0x20000000) /*!< Time-stamp trigger interrupt (on DMA) */ #define ETH_DMA_FLAG_PMT ((uint32_t)0x10000000) /*!< PMT interrupt (on DMA) */ #define ETH_DMA_FLAG_MMC ((uint32_t)0x08000000) /*!< MMC interrupt (on DMA) */ #define ETH_DMA_FLAG_DATATRANSFERERROR ((uint32_t)0x00800000) /*!< Error bits 0-Rx DMA, 1-Tx DMA */ -#define ETH_DMA_FLAG_READWRITEERROR ((uint32_t)0x01000000) /*!< Error bits 0-write trnsf, 1-read transfr */ +#define ETH_DMA_FLAG_READWRITEERROR ((uint32_t)0x01000000) /*!< Error bits 0-write transfer, 1-read transfer */ #define ETH_DMA_FLAG_ACCESSERROR ((uint32_t)0x02000000) /*!< Error bits 0-data buffer, 1-desc. access */ #define ETH_DMA_FLAG_NIS ((uint32_t)0x00010000) /*!< Normal interrupt summary flag */ #define ETH_DMA_FLAG_AIS ((uint32_t)0x00008000) /*!< Abnormal interrupt summary flag */ @@ -1560,24 +1533,11 @@ typedef struct #define ETH_DMA_FLAG_TBU ((uint32_t)0x00000004) /*!< Transmit buffer unavailable flag */ #define ETH_DMA_FLAG_TPS ((uint32_t)0x00000002) /*!< Transmit process stopped flag */ #define ETH_DMA_FLAG_T ((uint32_t)0x00000001) /*!< Transmit flag */ - -#define IS_ETH_DMA_FLAG(FLAG) ((((FLAG) & (uint32_t)0xC7FE1800) == 0x00) && ((FLAG) != 0x00)) -#define IS_ETH_DMA_GET_FLAG(FLAG) (((FLAG) == ETH_DMA_FLAG_TST) || ((FLAG) == ETH_DMA_FLAG_PMT) || \ - ((FLAG) == ETH_DMA_FLAG_MMC) || ((FLAG) == ETH_DMA_FLAG_DATATRANSFERERROR) || \ - ((FLAG) == ETH_DMA_FLAG_READWRITEERROR) || ((FLAG) == ETH_DMA_FLAG_ACCESSERROR) || \ - ((FLAG) == ETH_DMA_FLAG_NIS) || ((FLAG) == ETH_DMA_FLAG_AIS) || \ - ((FLAG) == ETH_DMA_FLAG_ER) || ((FLAG) == ETH_DMA_FLAG_FBE) || \ - ((FLAG) == ETH_DMA_FLAG_ET) || ((FLAG) == ETH_DMA_FLAG_RWT) || \ - ((FLAG) == ETH_DMA_FLAG_RPS) || ((FLAG) == ETH_DMA_FLAG_RBU) || \ - ((FLAG) == ETH_DMA_FLAG_R) || ((FLAG) == ETH_DMA_FLAG_TU) || \ - ((FLAG) == ETH_DMA_FLAG_RO) || ((FLAG) == ETH_DMA_FLAG_TJT) || \ - ((FLAG) == ETH_DMA_FLAG_TBU) || ((FLAG) == ETH_DMA_FLAG_TPS) || \ - ((FLAG) == ETH_DMA_FLAG_T)) /** * @} */ -/** @defgroup ETH_MAC_Interrupts +/** @defgroup ETH_MAC_Interrupts ETH MAC Interrupts * @{ */ #define ETH_MAC_IT_TST ((uint32_t)0x00000200) /*!< Time stamp trigger interrupt (on MAC) */ @@ -1585,15 +1545,11 @@ typedef struct #define ETH_MAC_IT_MMCR ((uint32_t)0x00000020) /*!< MMC receive interrupt */ #define ETH_MAC_IT_MMC ((uint32_t)0x00000010) /*!< MMC interrupt (on MAC) */ #define ETH_MAC_IT_PMT ((uint32_t)0x00000008) /*!< PMT interrupt (on MAC) */ -#define IS_ETH_MAC_IT(IT) ((((IT) & (uint32_t)0xFFFFFDF7) == 0x00) && ((IT) != 0x00)) -#define IS_ETH_MAC_GET_IT(IT) (((IT) == ETH_MAC_IT_TST) || ((IT) == ETH_MAC_IT_MMCT) || \ - ((IT) == ETH_MAC_IT_MMCR) || ((IT) == ETH_MAC_IT_MMC) || \ - ((IT) == ETH_MAC_IT_PMT)) /** * @} */ -/** @defgroup ETH_DMA_Interrupts +/** @defgroup ETH_DMA_Interrupts ETH DMA Interrupts * @{ */ #define ETH_DMA_IT_TST ((uint32_t)0x20000000) /*!< Time-stamp trigger interrupt (on DMA) */ @@ -1614,23 +1570,11 @@ typedef struct #define ETH_DMA_IT_TBU ((uint32_t)0x00000004) /*!< Transmit buffer unavailable interrupt */ #define ETH_DMA_IT_TPS ((uint32_t)0x00000002) /*!< Transmit process stopped interrupt */ #define ETH_DMA_IT_T ((uint32_t)0x00000001) /*!< Transmit interrupt */ - -#define IS_ETH_DMA_IT(IT) ((((IT) & (uint32_t)0xC7FE1800) == 0x00) && ((IT) != 0x00)) -#define IS_ETH_DMA_GET_IT(IT) (((IT) == ETH_DMA_IT_TST) || ((IT) == ETH_DMA_IT_PMT) || \ - ((IT) == ETH_DMA_IT_MMC) || ((IT) == ETH_DMA_IT_NIS) || \ - ((IT) == ETH_DMA_IT_AIS) || ((IT) == ETH_DMA_IT_ER) || \ - ((IT) == ETH_DMA_IT_FBE) || ((IT) == ETH_DMA_IT_ET) || \ - ((IT) == ETH_DMA_IT_RWT) || ((IT) == ETH_DMA_IT_RPS) || \ - ((IT) == ETH_DMA_IT_RBU) || ((IT) == ETH_DMA_IT_R) || \ - ((IT) == ETH_DMA_IT_TU) || ((IT) == ETH_DMA_IT_RO) || \ - ((IT) == ETH_DMA_IT_TJT) || ((IT) == ETH_DMA_IT_TBU) || \ - ((IT) == ETH_DMA_IT_TPS) || ((IT) == ETH_DMA_IT_T)) - /** * @} */ -/** @defgroup ETH_DMA_transmit_process_state_ +/** @defgroup ETH_DMA_transmit_process_state ETH DMA transmit process state * @{ */ #define ETH_DMA_TRANSMITPROCESS_STOPPED ((uint32_t)0x00000000) /*!< Stopped - Reset or Stop Tx Command issued */ @@ -1645,7 +1589,7 @@ typedef struct */ -/** @defgroup ETH_DMA_receive_process_state_ +/** @defgroup ETH_DMA_receive_process_state ETH DMA receive process state * @{ */ #define ETH_DMA_RECEIVEPROCESS_STOPPED ((uint32_t)0x00000000) /*!< Stopped - Reset or Stop Rx Command issued */ @@ -1659,47 +1603,34 @@ typedef struct * @} */ -/** @defgroup ETH_DMA_overflow_ +/** @defgroup ETH_DMA_overflow ETH DMA overflow * @{ */ #define ETH_DMA_OVERFLOW_RXFIFOCOUNTER ((uint32_t)0x10000000) /*!< Overflow bit for FIFO overflow counter */ #define ETH_DMA_OVERFLOW_MISSEDFRAMECOUNTER ((uint32_t)0x00010000) /*!< Overflow bit for missed frame counter */ -#define IS_ETH_DMA_GET_OVERFLOW(OVERFLOW) (((OVERFLOW) == ETH_DMA_OVERFLOW_RXFIFOCOUNTER) || \ - ((OVERFLOW) == ETH_DMA_OVERFLOW_MISSEDFRAMECOUNTER)) /** * @} */ -/* ETHERNET MAC address offsets */ -#define ETH_MAC_ADDR_HBASE (uint32_t)(ETH_MAC_BASE + (uint32_t)0x40) /* ETHERNET MAC address high offset */ -#define ETH_MAC_ADDR_LBASE (uint32_t)(ETH_MAC_BASE + (uint32_t)0x44) /* ETHERNET MAC address low offset */ - -/* ETHERNET MACMIIAR register Mask */ -#define MACMIIAR_CR_MASK ((uint32_t)0xFFFFFFE3) - -/* ETHERNET MACCR register Mask */ -#define MACCR_CLEAR_MASK ((uint32_t)0xFF20810F) - -/* ETHERNET MACFCR register Mask */ -#define MACFCR_CLEAR_MASK ((uint32_t)0x0000FF41) - - -/* ETHERNET DMAOMR register Mask */ -#define DMAOMR_CLEAR_MASK ((uint32_t)0xF8DE3F23) - - -/* ETHERNET Remote Wake-up frame register length */ -#define ETH_WAKEUP_REGISTER_LENGTH 8 +/** @defgroup ETH_EXTI_LINE_WAKEUP ETH EXTI LINE WAKEUP + * @{ + */ +#define ETH_EXTI_LINE_WAKEUP ((uint32_t)0x00080000) /*!< External interrupt line 19 Connected to the ETH EXTI Line */ -/* ETHERNET Missed frames counter Shift */ -#define ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT 17 +/** + * @} + */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup ETH_Exported_Macros ETH Exported Macros + * @brief macros to handle interrupts and specific clock configurations + * @{ + */ + /** @brief Reset ETH handle state * @param __HANDLE__: specifies the ETH handle. * @retval None @@ -1709,7 +1640,7 @@ typedef struct /** * @brief Checks whether the specified ETHERNET DMA Tx Desc flag is set or not. * @param __HANDLE__: ETH Handle - * @param __FLAG__: specifies the flag to check. + * @param __FLAG__: specifies the flag of TDES0 to check. * @retval the ETH_DMATxDescFlag (SET or RESET). */ #define __HAL_ETH_DMATXDESC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->TxDesc->Status & (__FLAG__) == (__FLAG__)) @@ -1717,7 +1648,7 @@ typedef struct /** * @brief Checks whether the specified ETHERNET DMA Rx Desc flag is set or not. * @param __HANDLE__: ETH Handle - * @param __FLAG__: specifies the flag to check. + * @param __FLAG__: specifies the flag of RDES0 to check. * @retval the ETH_DMATxDescFlag (SET or RESET). */ #define __HAL_ETH_DMARXDESC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->RxDesc->Status & (__FLAG__) == (__FLAG__)) @@ -1882,7 +1813,7 @@ typedef struct * @brief Enables the specified ETHERNET DMA interrupts. * @param __HANDLE__ : ETH Handle * @param __INTERRUPT__: specifies the ETHERNET DMA interrupt sources to be - * enabled @defgroup ETH_DMA_Interrupts + * enabled @ref ETH_DMA_Interrupts * @retval None */ #define __HAL_ETH_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DMAIER |= (__INTERRUPT__)) @@ -1891,7 +1822,7 @@ typedef struct * @brief Disables the specified ETHERNET DMA interrupts. * @param __HANDLE__ : ETH Handle * @param __INTERRUPT__: specifies the ETHERNET DMA interrupt sources to be - * disabled. @defgroup ETH_DMA_Interrupts + * disabled. @ref ETH_DMA_Interrupts * @retval None */ #define __HAL_ETH_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DMAIER &= ~(__INTERRUPT__)) @@ -1899,7 +1830,7 @@ typedef struct /** * @brief Clears the ETHERNET DMA IT pending bit. * @param __HANDLE__ : ETH Handle - * @param __INTERRUPT__: specifies the interrupt pending bit to clear. @defgroup ETH_DMA_Interrupts + * @param __INTERRUPT__: specifies the interrupt pending bit to clear. @ref ETH_DMA_Interrupts * @retval None */ #define __HAL_ETH_DMA_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DMASR =(__INTERRUPT__)) @@ -1907,7 +1838,7 @@ typedef struct /** * @brief Checks whether the specified ETHERNET DMA flag is set or not. * @param __HANDLE__: ETH Handle - * @param __FLAG__: specifies the flag to check. @defgroup ETH_DMA_Flags + * @param __FLAG__: specifies the flag to check. @ref ETH_DMA_Flags * @retval The new state of ETH_DMA_FLAG (SET or RESET). */ #define __HAL_ETH_DMA_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->DMASR &( __FLAG__)) == ( __FLAG__)) @@ -1915,7 +1846,7 @@ typedef struct /** * @brief Checks whether the specified ETHERNET DMA flag is set or not. * @param __HANDLE__: ETH Handle - * @param __FLAG__: specifies the flag to clear. @defgroup ETH_DMA_Flags + * @param __FLAG__: specifies the flag to clear. @ref ETH_DMA_Flags * @retval The new state of ETH_DMA_FLAG (SET or RESET). */ #define __HAL_ETH_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->DMASR = (__FLAG__)) @@ -2117,74 +2048,102 @@ typedef struct * @arg ETH_MMC_IT_TGFSC : When Tx good single col counter reaches half the maximum value * @retval None */ -#define __HAL_ETH_MMC_TX_IT_DISABLE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MMCRIMR |= (__INTERRUPT__)) - -/** @defgroup ETH_EXTI_LINE_WAKEUP - * @{ - */ -#define ETH_EXTI_LINE_WAKEUP ((uint32_t)0x00080000) /*!< External interrupt line 19 Connected to the ETH EXTI Line */ - -/** - * @} - */ +#define __HAL_ETH_MMC_TX_IT_DISABLE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MMCRIMR |= (__INTERRUPT__)) /** * @brief Enables the ETH External interrupt line. - * @param None * @retval None */ -#define __HAL_ETH_EXTI_ENABLE_IT() EXTI->IMR |= (ETH_EXTI_LINE_WAKEUP) +#define __HAL_ETH_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (ETH_EXTI_LINE_WAKEUP) /** * @brief Disables the ETH External interrupt line. - * @param None * @retval None */ -#define __HAL_ETH_EXTI_DISABLE_IT() EXTI->IMR &= ~(ETH_EXTI_LINE_WAKEUP) +#define __HAL_ETH_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(ETH_EXTI_LINE_WAKEUP) + +/** + * @brief Enable event on ETH External event line. + * @retval None. + */ +#define __HAL_ETH_WAKEUP_EXTI_ENABLE_EVENT() EXTI->EMR |= (ETH_EXTI_LINE_WAKEUP) + +/** + * @brief Disable event on ETH External event line + * @retval None. + */ +#define __HAL_ETH_WAKEUP_EXTI_DISABLE_EVENT() EXTI->EMR &= ~(ETH_EXTI_LINE_WAKEUP) /** * @brief Get flag of the ETH External interrupt line. - * @param None * @retval None */ -#define __HAL_ETH_EXTI_GET_FLAG() EXTI->PR & (ETH_EXTI_LINE_WAKEUP) +#define __HAL_ETH_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (ETH_EXTI_LINE_WAKEUP) /** * @brief Clear flag of the ETH External interrupt line. - * @param None * @retval None */ -#define __HAL_ETH_EXTI_CLEAR_FLAG() EXTI->PR = (ETH_EXTI_LINE_WAKEUP) +#define __HAL_ETH_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (ETH_EXTI_LINE_WAKEUP) /** - * @brief Sets rising edge trigger to the ETH External interrupt line. - * @param None + * @brief Enables rising edge trigger to the ETH External interrupt line. + * @retval None + */ +#define __HAL_ETH_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER() EXTI->RTSR |= ETH_EXTI_LINE_WAKEUP + +/** + * @brief Disables the rising edge trigger to the ETH External interrupt line. * @retval None */ -#define __HAL_ETH_EXTI_SET_RISING_EGDE_TRIGGER() EXTI->FTSR &= ~(ETH_EXTI_LINE_WAKEUP);\ - EXTI->RTSR |= ETH_EXTI_LINE_WAKEUP +#define __HAL_ETH_WAKEUP_EXTI_DISABLE_RISING_EDGE_TRIGGER() EXTI->RTSR &= ~(ETH_EXTI_LINE_WAKEUP) /** - * @brief Sets falling edge trigger to the ETH External interrupt line. - * @param None + * @brief Enables falling edge trigger to the ETH External interrupt line. * @retval None */ -#define __HAL_ETH_EXTI_SET_FALLING_EGDE_TRIGGER() EXTI->FTSR |= (ETH_EXTI_LINE_WAKEUP);\ - EXTI->RTSR &= ~(ETH_EXTI_LINE_WAKEUP) +#define __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR |= (ETH_EXTI_LINE_WAKEUP) + +/** + * @brief Disables falling edge trigger to the ETH External interrupt line. + * @retval None + */ +#define __HAL_ETH_WAKEUP_EXTI_DISABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR &= ~(ETH_EXTI_LINE_WAKEUP) + +/** + * @brief Enables rising/falling edge trigger to the ETH External interrupt line. + * @retval None + */ +#define __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER() EXTI->RTSR |= ETH_EXTI_LINE_WAKEUP;\ + EXTI->FTSR |= ETH_EXTI_LINE_WAKEUP /** - * @brief Sets rising/falling edge trigger to the ETH External interrupt line. - * @param None + * @brief Disables rising/falling edge trigger to the ETH External interrupt line. * @retval None */ -#define __HAL_ETH_EXTI_SET_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(ETH_EXTI_LINE_WAKEUP);\ - EXTI->FTSR &= ~(ETH_EXTI_LINE_WAKEUP);\ - EXTI->RTSR |= ETH_EXTI_LINE_WAKEUP;\ - EXTI->FTSR |= ETH_EXTI_LINE_WAKEUP +#define __HAL_ETH_WAKEUP_EXTI_DISABLE_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(ETH_EXTI_LINE_WAKEUP);\ + EXTI->FTSR &= ~(ETH_EXTI_LINE_WAKEUP) + +/** + * @brief Generate a Software interrupt on selected EXTI line. + * @retval None. + */ +#define __HAL_ETH_WAKEUP_EXTI_GENERATE_SWIT() EXTI->SWIER|= ETH_EXTI_LINE_WAKEUP +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup ETH_Exported_Functions + * @{ + */ + /* Initialization and de-initialization functions ****************************/ + +/** @addtogroup ETH_Exported_Functions_Group1 + * @{ + */ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth); HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth); void HAL_ETH_MspInit(ETH_HandleTypeDef *heth); @@ -2192,41 +2151,67 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth); HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount); HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount); +/** + * @} + */ /* IO operation functions ****************************************************/ + +/** @addtogroup ETH_Exported_Functions_Group2 + * @{ + */ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameLength); HAL_StatusTypeDef HAL_ETH_GetReceivedFrame(ETH_HandleTypeDef *heth); - - /* Non-Blocking mode: Interrupt */ +/* Communication with PHY functions*/ +HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue); +HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t RegValue); +/* Non-Blocking mode: Interrupt */ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame_IT(ETH_HandleTypeDef *heth); void HAL_ETH_IRQHandler(ETH_HandleTypeDef *heth); - - /* Callback in non blocking modes (Interrupt) */ +/* Callback in non blocking modes (Interrupt) */ void HAL_ETH_TxCpltCallback(ETH_HandleTypeDef *heth); void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth); void HAL_ETH_ErrorCallback(ETH_HandleTypeDef *heth); - -/* Cmmunication with PHY functions*/ -HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue); -HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t RegValue); +/** + * @} + */ /* Peripheral Control functions **********************************************/ + +/** @addtogroup ETH_Exported_Functions_Group3 + * @{ + */ + HAL_StatusTypeDef HAL_ETH_Start(ETH_HandleTypeDef *heth); HAL_StatusTypeDef HAL_ETH_Stop(ETH_HandleTypeDef *heth); - HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef *macconf); HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef *dmaconf); +/** + * @} + */ /* Peripheral State functions ************************************************/ + +/** @addtogroup ETH_Exported_Functions_Group4 + * @{ + */ HAL_ETH_StateTypeDef HAL_ETH_GetState(ETH_HandleTypeDef *heth); +/** + * @} + */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ /** * @} - */ + */ /** * @} - */ + */ + +/** + * @} + */ + +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #ifdef __cplusplus } @@ -2235,5 +2220,4 @@ HAL_ETH_StateTypeDef HAL_ETH_GetState(ETH_HandleTypeDef *heth); #endif /* __STM32F4xx_HAL_ETH_H */ - /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.c index 36983348a8d..db0947e361f 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_flash.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief FLASH HAL module driver. * This file provides firmware functions to manage the following * functionalities of the internal FLASH memory: @@ -65,7 +65,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -99,7 +99,7 @@ * @{ */ -/** @defgroup FLASH +/** @defgroup FLASH FLASH * @brief FLASH HAL module driver * @{ */ @@ -108,16 +108,29 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup FLASH_Private_Constants + * @{ + */ #define SECTOR_MASK ((uint32_t)0xFFFFFF07) - -#define HAL_FLASH_TIMEOUT_VALUE ((uint32_t)50000)/* 50 s */ +#define FLASH_TIMEOUT_VALUE ((uint32_t)50000)/* 50 s */ +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup FLASH_Private_Variables + * @{ + */ /* Variable used for Erase sectors under interruption */ FLASH_ProcessTypeDef pFlash; - +/** + * @} + */ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup FLASH_Private_Functions + * @{ + */ /* Program operations */ static void FLASH_Program_DoubleWord(uint32_t Address, uint64_t Data); static void FLASH_Program_Word(uint32_t Address, uint32_t Data); @@ -126,13 +139,16 @@ static void FLASH_Program_Byte(uint32_t Address, uint8_t Data); static void FLASH_SetErrorCode(void); HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); +/** + * @} + */ -/* Private functions ---------------------------------------------------------*/ -/** @defgroup FLASH_Private_Functions FLASH Private functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup FLASH_Exported_Functions FLASH Exported Functions * @{ */ -/** @defgroup FLASH_Group1 Programming operation functions +/** @defgroup FLASH_Exported_Functions_Group1 Programming operation functions * @brief Programming operation functions * @verbatim @@ -164,24 +180,24 @@ HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint __HAL_LOCK(&pFlash); /* Check the parameters */ - assert_param(IS_TYPEPROGRAM(TypeProgram)); + assert_param(IS_FLASH_TYPEPROGRAM(TypeProgram)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { - if(TypeProgram == TYPEPROGRAM_BYTE) + if(TypeProgram == FLASH_TYPEPROGRAM_BYTE) { /*Program byte (8-bit) at a specified address.*/ FLASH_Program_Byte(Address, (uint8_t) Data); } - else if(TypeProgram == TYPEPROGRAM_HALFWORD) + else if(TypeProgram == FLASH_TYPEPROGRAM_HALFWORD) { /*Program halfword (16-bit) at a specified address.*/ FLASH_Program_HalfWord(Address, (uint16_t) Data); } - else if(TypeProgram == TYPEPROGRAM_WORD) + else if(TypeProgram == FLASH_TYPEPROGRAM_WORD) { /*Program word (32-bit) at a specified address.*/ FLASH_Program_Word(Address, (uint32_t) Data); @@ -193,7 +209,7 @@ HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint } /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); /* If the program operation is completed, disable the PG Bit */ FLASH->CR &= (~FLASH_CR_PG); @@ -222,7 +238,7 @@ HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, u __HAL_LOCK(&pFlash); /* Check the parameters */ - assert_param(IS_TYPEPROGRAM(TypeProgram)); + assert_param(IS_FLASH_TYPEPROGRAM(TypeProgram)); /* Enable End of FLASH Operation interrupt */ __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP); @@ -237,17 +253,17 @@ HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, u pFlash.ProcedureOnGoing = FLASH_PROC_PROGRAM; pFlash.Address = Address; - if(TypeProgram == TYPEPROGRAM_BYTE) + if(TypeProgram == FLASH_TYPEPROGRAM_BYTE) { /*Program byte (8-bit) at a specified address.*/ FLASH_Program_Byte(Address, (uint8_t) Data); } - else if(TypeProgram == TYPEPROGRAM_HALFWORD) + else if(TypeProgram == FLASH_TYPEPROGRAM_HALFWORD) { /*Program halfword (16-bit) at a specified address.*/ FLASH_Program_HalfWord(Address, (uint16_t) Data); } - else if(TypeProgram == TYPEPROGRAM_WORD) + else if(TypeProgram == FLASH_TYPEPROGRAM_WORD) { /*Program word (32-bit) at a specified address.*/ FLASH_Program_Word(Address, (uint32_t) Data); @@ -263,7 +279,6 @@ HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, u /** * @brief This function handles FLASH interrupt request. - * @param None * @retval None */ void HAL_FLASH_IRQHandler(void) @@ -300,7 +315,8 @@ void HAL_FLASH_IRQHandler(void) FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR| FLASH_FLAG_PGSERR); /*Increment sector number*/ - temp = ++pFlash.Sector; + pFlash.Sector++; + temp = pFlash.Sector; FLASH_Erase_Sector(temp, pFlash.VoltageForErase); } else @@ -317,7 +333,7 @@ void HAL_FLASH_IRQHandler(void) } else { - if (pFlash.ProcedureOnGoing == FLASH_PROC_MASSERASE) + if(pFlash.ProcedureOnGoing == FLASH_PROC_MASSERASE) { /*MassErase ended. Return the selected bank*/ /* FLASH EOP interrupt user callback */ @@ -346,14 +362,14 @@ void HAL_FLASH_IRQHandler(void) temp = pFlash.Sector; pFlash.Sector = 0xFFFFFFFF; } - else if (pFlash.ProcedureOnGoing == FLASH_PROC_MASSERASE) + else if(pFlash.ProcedureOnGoing == FLASH_PROC_MASSERASE) { /*return the faulty bank*/ temp = pFlash.Bank; } else { - /*retrun the faulty address*/ + /*return the faulty address*/ temp = pFlash.Address; } @@ -419,7 +435,7 @@ __weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue) * @} */ -/** @defgroup FLASH_Group2 Peripheral Control functions +/** @defgroup FLASH_Exported_Functions_Group2 Peripheral Control functions * @brief management functions * @verbatim @@ -436,7 +452,6 @@ __weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue) /** * @brief Unlock the FLASH control register access - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASH_Unlock(void) @@ -457,7 +472,6 @@ HAL_StatusTypeDef HAL_FLASH_Unlock(void) /** * @brief Locks the FLASH control register access - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASH_Lock(void) @@ -468,10 +482,8 @@ HAL_StatusTypeDef HAL_FLASH_Lock(void) return HAL_OK; } - /** * @brief Unlock the FLASH Option Control Registers access. - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void) @@ -492,7 +504,6 @@ HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void) /** * @brief Lock the FLASH Option Control Registers access. - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASH_OB_Lock(void) @@ -505,7 +516,6 @@ HAL_StatusTypeDef HAL_FLASH_OB_Lock(void) /** * @brief Launch the option byte loading. - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASH_OB_Launch(void) @@ -514,14 +524,14 @@ HAL_StatusTypeDef HAL_FLASH_OB_Launch(void) *(__IO uint8_t *)OPTCR_BYTE0_ADDRESS |= FLASH_OPTCR_OPTSTRT; /* Wait for last operation to be completed */ - return(FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE)); + return(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE)); } /** * @} */ -/** @defgroup FLASH_Group3 Peripheral State and Errors functions +/** @defgroup FLASH_Exported_Functions_Group3 Peripheral State and Errors functions * @brief Peripheral Errors functions * @verbatim @@ -537,16 +547,15 @@ HAL_StatusTypeDef HAL_FLASH_OB_Launch(void) /** * @brief Get the specific FLASH error flag. - * @param None - * @retval FLASH_ErrorCode: The returned value can be: - * @arg FLASH_ERROR_RD: FLASH Read Protection error flag (PCROP) - * @arg FLASH_ERROR_PGS: FLASH Programming Sequence error flag - * @arg FLASH_ERROR_PGP: FLASH Programming Parallelism error flag - * @arg FLASH_ERROR_PGA: FLASH Programming Alignment error flag - * @arg FLASH_ERROR_WRP: FLASH Write protected error flag - * @arg FLASH_ERROR_OPERATION: FLASH operation Error flag - */ -FLASH_ErrorTypeDef HAL_FLASH_GetError(void) + * @retval FLASH_ErrorCode: The returned value can be a combination of: + * @arg HAL_FLASH_ERROR_RD: FLASH Read Protection error flag (PCROP) + * @arg HAL_FLASH_ERROR_PGS: FLASH Programming Sequence error flag + * @arg HAL_FLASH_ERROR_PGP: FLASH Programming Parallelism error flag + * @arg HAL_FLASH_ERROR_PGA: FLASH Programming Alignment error flag + * @arg HAL_FLASH_ERROR_WRP: FLASH Write protected error flag + * @arg HAL_FLASH_ERROR_OPERATION: FLASH operation Error flag + */ +uint32_t HAL_FLASH_GetError(void) { return pFlash.ErrorCode; } @@ -563,6 +572,10 @@ FLASH_ErrorTypeDef HAL_FLASH_GetError(void) HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout) { uint32_t tickstart = 0; + + /* Clear Error Code */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset. Even if the FLASH operation fails, the BUSY flag will be reset and an error flag will be set */ @@ -696,39 +709,38 @@ static void FLASH_Program_Byte(uint32_t Address, uint8_t Data) /** * @brief Set the specific FLASH error flag. - * @param None * @retval None */ static void FLASH_SetErrorCode(void) { if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_WRPERR) != RESET) { - pFlash.ErrorCode = FLASH_ERROR_WRP; + pFlash.ErrorCode |= HAL_FLASH_ERROR_WRP; } if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGAERR) != RESET) { - pFlash.ErrorCode |= (FLASH_ErrorTypeDef)FLASH_ERROR_PGA; + pFlash.ErrorCode |= HAL_FLASH_ERROR_PGA; } if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGPERR) != RESET) { - pFlash.ErrorCode |= FLASH_ERROR_PGP; + pFlash.ErrorCode |= HAL_FLASH_ERROR_PGP; } if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGSERR) != RESET) { - pFlash.ErrorCode |= FLASH_ERROR_PGS; + pFlash.ErrorCode |= HAL_FLASH_ERROR_PGS; } if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_RDERR) != RESET) { - pFlash.ErrorCode |= FLASH_ERROR_RD; + pFlash.ErrorCode |= HAL_FLASH_ERROR_RD; } if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_OPERR) != RESET) { - pFlash.ErrorCode |= FLASH_ERROR_OPERATION; + pFlash.ErrorCode |= HAL_FLASH_ERROR_OPERATION; } } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.h index f763b7d1990..14bfd3e08b4 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_flash.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of FLASH HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,20 +54,11 @@ * @{ */ -/* Exported types ------------------------------------------------------------*/ -/** - * @brief FLASH Error structure definition +/* Exported types ------------------------------------------------------------*/ +/** @defgroup FLASH_Exported_Types FLASH Exported Types + * @{ */ -typedef enum -{ - FLASH_ERROR_RD = 0x01, - FLASH_ERROR_PGS = 0x02, - FLASH_ERROR_PGP = 0x04, - FLASH_ERROR_PGA = 0x08, - FLASH_ERROR_WRP = 0x10, - FLASH_ERROR_OPERATION = 0x20 -}FLASH_ErrorTypeDef; - + /** * @brief FLASH Procedure structure definition */ @@ -79,7 +70,6 @@ typedef enum FLASH_PROC_PROGRAM } FLASH_ProcedureTypeDef; - /** * @brief FLASH handle Structure definition */ @@ -89,7 +79,7 @@ typedef struct __IO uint32_t NbSectorsToErase; /*Internal variable to save the remaining sectors to erase in IT context*/ - __IO uint8_t VoltageForErase; /*Internal variable to provide voltange range selected by user in IT context*/ + __IO uint8_t VoltageForErase; /*Internal variable to provide voltage range selected by user in IT context*/ __IO uint32_t Sector; /*Internal variable to define the current sector which is erasing*/ @@ -99,34 +89,40 @@ typedef struct HAL_LockTypeDef Lock; /* FLASH locking object */ - __IO FLASH_ErrorTypeDef ErrorCode; /* FLASH error code */ + __IO uint32_t ErrorCode; /* FLASH error code */ }FLASH_ProcessTypeDef; -/** - * @brief FLASH Error source - */ -/* Exported constants --------------------------------------------------------*/ +/** + * @} + */ +/* Exported constants --------------------------------------------------------*/ /** @defgroup FLASH_Exported_Constants FLASH Exported Constants * @{ */ - - - +/** @defgroup FLASH_Error_Code FLASH Error Code + * @brief FLASH Error Code + * @{ + */ +#define HAL_FLASH_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_FLASH_ERROR_RD ((uint32_t)0x00000001) /*!< Read Protection error */ +#define HAL_FLASH_ERROR_PGS ((uint32_t)0x00000002) /*!< Programming Sequence error */ +#define HAL_FLASH_ERROR_PGP ((uint32_t)0x00000004) /*!< Programming Parallelism error */ +#define HAL_FLASH_ERROR_PGA ((uint32_t)0x00000008) /*!< Programming Alignment error */ +#define HAL_FLASH_ERROR_WRP ((uint32_t)0x00000010) /*!< Write protection error */ +#define HAL_FLASH_ERROR_OPERATION ((uint32_t)0x00000020) /*!< Operation Error */ +/** + * @} + */ + /** @defgroup FLASH_Type_Program FLASH Type Program * @{ */ -#define TYPEPROGRAM_BYTE ((uint32_t)0x00) /*!< Program byte (8-bit) at a specified address */ -#define TYPEPROGRAM_HALFWORD ((uint32_t)0x01) /*!< Program a half-word (16-bit) at a specified address */ -#define TYPEPROGRAM_WORD ((uint32_t)0x02) /*!< Program a word (32-bit) at a specified address */ -#define TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03) /*!< Program a double word (64-bit) at a specified address */ - -#define IS_TYPEPROGRAM(VALUE)(((VALUE) == TYPEPROGRAM_BYTE) || \ - ((VALUE) == TYPEPROGRAM_HALFWORD) || \ - ((VALUE) == TYPEPROGRAM_WORD) || \ - ((VALUE) == TYPEPROGRAM_DOUBLEWORD)) - +#define FLASH_TYPEPROGRAM_BYTE ((uint32_t)0x00) /*!< Program byte (8-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_HALFWORD ((uint32_t)0x01) /*!< Program a half-word (16-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_WORD ((uint32_t)0x02) /*!< Program a word (32-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03) /*!< Program a double word (64-bit) at a specified address */ /** * @} */ @@ -143,7 +139,6 @@ typedef struct #define FLASH_FLAG_PGSERR FLASH_SR_PGSERR /*!< FLASH Programming Sequence error flag */ #define FLASH_FLAG_RDERR ((uint32_t)0x00000100) /*!< Read Protection error flag (PCROP) */ #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */ - /** * @} */ @@ -154,7 +149,6 @@ typedef struct */ #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of FLASH Operation Interrupt source */ #define FLASH_IT_ERR ((uint32_t)0x02000000) /*!< Error Interrupt source */ - /** * @} */ @@ -183,33 +177,14 @@ typedef struct * @} */ -/** - * @brief ACR register byte 0 (Bits[7:0]) base address - */ -#define ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00) -/** - * @brief OPTCR register byte 0 (Bits[7:0]) base address - */ -#define OPTCR_BYTE0_ADDRESS ((uint32_t)0x40023C14) -/** - * @brief OPTCR register byte 1 (Bits[15:8]) base address - */ -#define OPTCR_BYTE1_ADDRESS ((uint32_t)0x40023C15) -/** - * @brief OPTCR register byte 2 (Bits[23:16]) base address - */ -#define OPTCR_BYTE2_ADDRESS ((uint32_t)0x40023C16) -/** - * @brief OPTCR register byte 3 (Bits[31:24]) base address - */ -#define OPTCR_BYTE3_ADDRESS ((uint32_t)0x40023C17) - /** * @} */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup FLASH_Exported_Macros FLASH Exported Macros + * @{ + */ /** * @brief Set the FLASH Latency. * @param __LATENCY__: FLASH Latency @@ -259,15 +234,18 @@ typedef struct * @note This function must be used only when the Instruction Cache is disabled. * @retval None */ -#define __HAL_FLASH_INSTRUCTION_CACHE_RESET() (FLASH->ACR |= FLASH_ACR_ICRST) +#define __HAL_FLASH_INSTRUCTION_CACHE_RESET() do {FLASH->ACR |= FLASH_ACR_ICRST; \ + FLASH->ACR &= ~FLASH_ACR_ICRST; \ + }while(0) /** * @brief Resets the FLASH data Cache. * @note This function must be used only when the data Cache is disabled. * @retval None */ -#define __HAL_FLASH_DATA_CACHE_RESET() (FLASH->ACR |= FLASH_ACR_DCRST) - +#define __HAL_FLASH_DATA_CACHE_RESET() do {FLASH->ACR |= FLASH_ACR_DCRST; \ + FLASH->ACR &= ~FLASH_ACR_DCRST; \ + }while(0) /** * @brief Enable the specified FLASH interrupt. * @param __INTERRUPT__ : FLASH interrupt @@ -318,33 +296,127 @@ typedef struct * @retval none */ #define __HAL_FLASH_CLEAR_FLAG(__FLAG__) (FLASH->SR = (__FLAG__)) +/** + * @} + */ /* Include FLASH HAL Extension module */ #include "stm32f4xx_hal_flash_ex.h" #include "stm32f4xx_hal_flash_ramfunc.h" /* Exported functions --------------------------------------------------------*/ +/** @addtogroup FLASH_Exported_Functions + * @{ + */ +/** @addtogroup FLASH_Exported_Functions_Group1 + * @{ + */ /* Program operation functions ***********************************************/ -HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data); -HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data); +HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data); +HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data); /* FLASH IRQ handler method */ -void HAL_FLASH_IRQHandler(void); +void HAL_FLASH_IRQHandler(void); /* Callbacks in non blocking modes */ -void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue); -void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue); +void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue); +void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue); +/** + * @} + */ +/** @addtogroup FLASH_Exported_Functions_Group2 + * @{ + */ /* Peripheral Control functions **********************************************/ -HAL_StatusTypeDef HAL_FLASH_Unlock(void); -HAL_StatusTypeDef HAL_FLASH_Lock(void); -HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void); -HAL_StatusTypeDef HAL_FLASH_OB_Lock(void); +HAL_StatusTypeDef HAL_FLASH_Unlock(void); +HAL_StatusTypeDef HAL_FLASH_Lock(void); +HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void); +HAL_StatusTypeDef HAL_FLASH_OB_Lock(void); /* Option bytes control */ -HAL_StatusTypeDef HAL_FLASH_OB_Launch(void); +HAL_StatusTypeDef HAL_FLASH_OB_Launch(void); +/** + * @} + */ +/** @addtogroup FLASH_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions ************************************************/ -FLASH_ErrorTypeDef HAL_FLASH_GetError(void); - +uint32_t HAL_FLASH_GetError(void); HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/** @defgroup FLASH_Private_Variables FLASH Private Variables + * @{ + */ + +/** + * @} + */ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup FLASH_Private_Constants FLASH Private Constants + * @{ + */ + +/** + * @brief ACR register byte 0 (Bits[7:0]) base address + */ +#define ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00) +/** + * @brief OPTCR register byte 0 (Bits[7:0]) base address + */ +#define OPTCR_BYTE0_ADDRESS ((uint32_t)0x40023C14) +/** + * @brief OPTCR register byte 1 (Bits[15:8]) base address + */ +#define OPTCR_BYTE1_ADDRESS ((uint32_t)0x40023C15) +/** + * @brief OPTCR register byte 2 (Bits[23:16]) base address + */ +#define OPTCR_BYTE2_ADDRESS ((uint32_t)0x40023C16) +/** + * @brief OPTCR register byte 3 (Bits[31:24]) base address + */ +#define OPTCR_BYTE3_ADDRESS ((uint32_t)0x40023C17) + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup FLASH_Private_Macros FLASH Private Macros + * @{ + */ + +/** @defgroup FLASH_IS_FLASH_Definitions FLASH Private macros to check input parameters + * @{ + */ +#define IS_FLASH_TYPEPROGRAM(VALUE)(((VALUE) == FLASH_TYPEPROGRAM_BYTE) || \ + ((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \ + ((VALUE) == FLASH_TYPEPROGRAM_WORD) || \ + ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD)) +/** + * @} + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup FLASH_Private_Functions FLASH Private Functions + * @{ + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.c index db9dfd94c6d..2d1fb44f4ed 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_flash_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Extended FLASH HAL module driver. * This file provides firmware functions to manage the following * functionalities of the FLASH extension peripheral: @@ -42,7 +42,7 @@ (#) Advanced Option Bytes Programming functions: Use HAL_FLASHEx_AdvOBProgram() to : (++) Extended space (bank 2) erase function (++) Full FLASH space (2 Mo) erase (bank 1 and bank 2) - (++) Dual Boot actrivation + (++) Dual Boot activation (++) Write protection configuration for bank 2 (++) PCROP protection configuration and control for both banks @@ -50,7 +50,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -84,7 +84,7 @@ * @{ */ -/** @defgroup FLASHEx +/** @defgroup FLASHEx FLASHEx * @brief FLASH HAL Extension module driver * @{ */ @@ -93,14 +93,29 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup FLASHEx_Private_Constants + * @{ + */ #define SECTOR_MASK ((uint32_t)0xFFFFFF07) - -#define HAL_FLASH_TIMEOUT_VALUE ((uint32_t)50000)/* 50 s */ +#define FLASH_TIMEOUT_VALUE ((uint32_t)50000)/* 50 s */ +/** + * @} + */ + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup FLASHEx_Private_Variables + * @{ + */ extern FLASH_ProcessTypeDef pFlash; +/** + * @} + */ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup FLASHEx_Private_Functions + * @{ + */ /* Option bytes control */ static void FLASH_MassErase(uint8_t VoltageRange, uint32_t Banks); static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks); @@ -113,10 +128,10 @@ static uint16_t FLASH_OB_GetWRP(void); static FlagStatus FLASH_OB_GetRDP(void); static uint8_t FLASH_OB_GetBOR(void); -#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) static HAL_StatusTypeDef FLASH_OB_EnablePCROP(uint32_t Sector); static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t Sector); -#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) static HAL_StatusTypeDef FLASH_OB_EnablePCROP(uint32_t SectorBank1, uint32_t SectorBank2, uint32_t Banks); @@ -124,14 +139,17 @@ static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t SectorBank1, uint32_t Se static HAL_StatusTypeDef FLASH_OB_BootConfig(uint8_t BootConfig); #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ -/* Private functions ---------------------------------------------------------*/ extern HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); +/** + * @} + */ -/** @defgroup FLASHEx_Private_Functions Extended FLASH Private functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup FLASHEx_Exported_Functions FLASHEx Exported Functions * @{ */ -/** @defgroup FLASHEx_Group1 Extended IO operation functions +/** @defgroup FLASHEx_Exported_Functions_Group1 Extended IO operation functions * @brief Extended IO operation functions * @verbatim @@ -165,23 +183,23 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t __HAL_LOCK(&pFlash); /* Check the parameters */ - assert_param(IS_TYPEERASE(pEraseInit->TypeErase)); + assert_param(IS_FLASH_TYPEERASE(pEraseInit->TypeErase)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); - if (status == HAL_OK) + if(status == HAL_OK) { /*Initialization of SectorError variable*/ *SectorError = 0xFFFFFFFF; - if (pEraseInit->TypeErase == TYPEERASE_MASSERASE) + if(pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE) { /*Mass erase to be done*/ FLASH_MassErase((uint8_t) pEraseInit->VoltageRange, pEraseInit->Banks); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); /* if the erase operation is completed, disable the MER Bit */ FLASH->CR &= (~FLASH_MER_BIT); @@ -189,7 +207,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t else { /* Check the parameters */ - assert_param(IS_NBSECTORS(pEraseInit->NbSectors + pEraseInit->Sector)); + assert_param(IS_FLASH_NBSECTORS(pEraseInit->NbSectors + pEraseInit->Sector)); /* Erase by sector by sector to be done*/ for(index = pEraseInit->Sector; index < (pEraseInit->NbSectors + pEraseInit->Sector); index++) @@ -197,13 +215,13 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t FLASH_Erase_Sector(index, (uint8_t) pEraseInit->VoltageRange); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); /* If the erase operation is completed, disable the SER Bit */ FLASH->CR &= (~FLASH_CR_SER); FLASH->CR &= SECTOR_MASK; - if (status != HAL_OK) + if(status != HAL_OK) { /* In case of error, stop erase procedure and return the faulty sector*/ *SectorError = index; @@ -234,7 +252,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit) __HAL_LOCK(&pFlash); /* Check the parameters */ - assert_param(IS_TYPEERASE(pEraseInit->TypeErase)); + assert_param(IS_FLASH_TYPEERASE(pEraseInit->TypeErase)); /* Enable End of FLASH Operation interrupt */ __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP); @@ -246,7 +264,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit) __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |\ FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR| FLASH_FLAG_PGSERR); - if (pEraseInit->TypeErase == TYPEERASE_MASSERASE) + if(pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE) { /*Mass erase to be done*/ pFlash.ProcedureOnGoing = FLASH_PROC_MASSERASE; @@ -258,7 +276,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit) /* Erase by sector to be done*/ /* Check the parameters */ - assert_param(IS_NBSECTORS(pEraseInit->NbSectors + pEraseInit->Sector)); + assert_param(IS_FLASH_NBSECTORS(pEraseInit->NbSectors + pEraseInit->Sector)); pFlash.ProcedureOnGoing = FLASH_PROC_SECTERASE; pFlash.NbSectorsToErase = pEraseInit->NbSectors; @@ -293,7 +311,7 @@ HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit) if((pOBInit->OptionType & OPTIONBYTE_WRP) == OPTIONBYTE_WRP) { assert_param(IS_WRPSTATE(pOBInit->WRPState)); - if (pOBInit->WRPState == WRPSTATE_ENABLE) + if(pOBInit->WRPState == OB_WRPSTATE_ENABLE) { /*Enable of Write protection on the selected Sector*/ status = FLASH_OB_EnableWRP(pOBInit->WRPSector, pOBInit->Banks); @@ -356,7 +374,7 @@ void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit) } #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /** * @brief Program option bytes * @param pAdvOBInit: pointer to an FLASH_AdvOBProgramInitTypeDef structure that @@ -372,33 +390,33 @@ HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvO assert_param(IS_OBEX(pAdvOBInit->OptionType)); /*Program PCROP option byte*/ - if (((pAdvOBInit->OptionType) & OBEX_PCROP) == OBEX_PCROP) + if(((pAdvOBInit->OptionType) & OPTIONBYTE_PCROP) == OPTIONBYTE_PCROP) { /* Check the parameters */ assert_param(IS_PCROPSTATE(pAdvOBInit->PCROPState)); - if ((pAdvOBInit->PCROPState) == PCROPSTATE_ENABLE) + if((pAdvOBInit->PCROPState) == OB_PCROP_STATE_ENABLE) { /*Enable of Write protection on the selected Sector*/ -#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) status = FLASH_OB_EnablePCROP(pAdvOBInit->Sectors); #else /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ status = FLASH_OB_EnablePCROP(pAdvOBInit->SectorsBank1, pAdvOBInit->SectorsBank2, pAdvOBInit->Banks); -#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ } else { /*Disable of Write protection on the selected Sector*/ -#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) status = FLASH_OB_DisablePCROP(pAdvOBInit->Sectors); #else /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ status = FLASH_OB_DisablePCROP(pAdvOBInit->SectorsBank1, pAdvOBInit->SectorsBank2, pAdvOBInit->Banks); -#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ } } #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) /*Program BOOT config option byte*/ - if (((pAdvOBInit->OptionType) & OBEX_BOOTCONFIG) == OBEX_BOOTCONFIG) + if(((pAdvOBInit->OptionType) & OPTIONBYTE_BOOTCONFIG) == OPTIONBYTE_BOOTCONFIG) { status = FLASH_OB_BootConfig(pAdvOBInit->BootConfig); } @@ -416,7 +434,7 @@ HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvO */ void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit) { -#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /*Get Sector*/ pAdvOBInit->Sectors = (*(__IO uint16_t *)(OPTCR_BYTE2_ADDRESS)); #else /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ @@ -428,7 +446,7 @@ void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit) /*Get Boot config OB*/ pAdvOBInit->BootConfig = *(__IO uint8_t *)OPTCR_BYTE0_ADDRESS; -#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ } /** @@ -437,10 +455,9 @@ void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit) * @note After PCROP activated Option Byte modification NOT POSSIBLE! excepted * Global Read Out Protection modification (from level1 to level0) * @note Once SPRMOD bit is active unprotection of a protected sector is not possible - * @note Read a prtotected sector will set RDERR Flag and write a protected sector will set WRPERR Flag - * @note This function can be used only for STM32F427xx/STM32F429xx/STM32F437xx/STM32F439xx/STM32F401xx devices. + * @note Read a protected sector will set RDERR Flag and write a protected sector will set WRPERR Flag + * @note This function can be used only for STM32F42xxx/STM32F43xxx/STM32F401xx/STM32F411xx/STM32F446xx devices. * - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void) @@ -454,7 +471,6 @@ HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void) *(__IO uint8_t *)OPTCR_BYTE3_ADDRESS = (uint8_t)(OB_PCROP_SELECTED | optiontmp); return HAL_OK; - } /** @@ -463,10 +479,9 @@ HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void) * @note After PCROP activated Option Byte modification NOT POSSIBLE! excepted * Global Read Out Protection modification (from level1 to level0) * @note Once SPRMOD bit is active unprotection of a protected sector is not possible - * @note Read a prtotected sector will set RDERR Flag and write a protected sector will set WRPERR Flag - * @note This function can be used only for STM32F427xx/STM32F429xx/STM32F437xx/STM32F439xx/STM32F401xx devices. + * @note Read a protected sector will set RDERR Flag and write a protected sector will set WRPERR Flag + * @note This function can be used only for STM32F42xxx/STM32F43xxx/STM32F401xx/STM32F411xx/STM32F446xx devices. * - * @param None * @retval HAL Status */ HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void) @@ -481,15 +496,12 @@ HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void) return HAL_OK; } - #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) - /** * @brief Returns the FLASH Write Protection Option Bytes value for Bank 2 * @note This function can be used only for STM32F427X and STM32F429X devices. - * @param None * @retval The FLASH Write Protection Option Bytes value */ uint16_t HAL_FLASHEx_OB_GetBank2WRP(void) @@ -508,13 +520,13 @@ uint16_t HAL_FLASHEx_OB_GetBank2WRP(void) * @brief Full erase of FLASH memory sectors * @param VoltageRange: The device voltage range which defines the erase parallelism. * This parameter can be one of the following values: - * @arg VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, + * @arg FLASH_VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, * the operation will be done by byte (8-bit) - * @arg VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, + * @arg FLASH_VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, * the operation will be done by half word (16-bit) - * @arg VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, + * @arg FLASH_VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, * the operation will be done by word (32-bit) - * @arg VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, + * @arg FLASH_VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, * the operation will be done by double word (64-bit) * * @param Banks: Banks to be erased @@ -560,13 +572,13 @@ static void FLASH_MassErase(uint8_t VoltageRange, uint32_t Banks) * The value of this parameter depend on device used within the same series * @param VoltageRange: The device voltage range which defines the erase parallelism. * This parameter can be one of the following values: - * @arg VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, + * @arg FLASH_VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, * the operation will be done by byte (8-bit) - * @arg VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, + * @arg FLASH_VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, * the operation will be done by half word (16-bit) - * @arg VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, + * @arg FLASH_VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, * the operation will be done by word (32-bit) - * @arg VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, + * @arg FLASH_VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, * the operation will be done by double word (64-bit) * * @retval None @@ -579,15 +591,15 @@ void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange) assert_param(IS_FLASH_SECTOR(Sector)); assert_param(IS_VOLTAGERANGE(VoltageRange)); - if(VoltageRange == VOLTAGE_RANGE_1) + if(VoltageRange == FLASH_VOLTAGE_RANGE_1) { tmp_psize = FLASH_PSIZE_BYTE; } - else if(VoltageRange == VOLTAGE_RANGE_2) + else if(VoltageRange == FLASH_VOLTAGE_RANGE_2) { tmp_psize = FLASH_PSIZE_HALF_WORD; } - else if(VoltageRange == VOLTAGE_RANGE_3) + else if(VoltageRange == FLASH_VOLTAGE_RANGE_3) { tmp_psize = FLASH_PSIZE_WORD; } @@ -597,7 +609,7 @@ void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange) } /* Need to add offset of 4 when sector higher than FLASH_SECTOR_11 */ - if (Sector > FLASH_SECTOR_11) + if(Sector > FLASH_SECTOR_11) { Sector += 4; } @@ -640,14 +652,14 @@ static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks) assert_param(IS_FLASH_BANK(Banks)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { - if (((WRPSector == OB_WRP_SECTOR_All) && ((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH))) || + if(((WRPSector == OB_WRP_SECTOR_All) && ((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH))) || (WRPSector < OB_WRP_SECTOR_12)) { - if (WRPSector == OB_WRP_SECTOR_All) + if(WRPSector == OB_WRP_SECTOR_All) { /*Write protection on all sector of BANK1*/ *(__IO uint16_t*)OPTCR_BYTE2_ADDRESS &= (~(WRPSector>>12)); @@ -665,10 +677,10 @@ static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks) } /*Write protection on all sector of BANK2*/ - if ((WRPSector == OB_WRP_SECTOR_All) && (Banks == FLASH_BANK_BOTH)) + if((WRPSector == OB_WRP_SECTOR_All) && (Banks == FLASH_BANK_BOTH)) { /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -677,7 +689,6 @@ static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks) } } - return status; } @@ -701,7 +712,7 @@ static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks) * @arg FLASH_BANK_2: Bank2 to be erased * @arg FLASH_BANK_BOTH: Bank1 and Bank2 to be erased * - * @retval HAL Staus + * @retval HAL Status */ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks) { @@ -712,14 +723,14 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks) assert_param(IS_FLASH_BANK(Banks)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { - if (((WRPSector == OB_WRP_SECTOR_All) && ((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH))) || + if(((WRPSector == OB_WRP_SECTOR_All) && ((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH))) || (WRPSector < OB_WRP_SECTOR_12)) { - if (WRPSector == OB_WRP_SECTOR_All) + if(WRPSector == OB_WRP_SECTOR_All) { /*Write protection on all sector of BANK1*/ *(__IO uint16_t*)OPTCR_BYTE2_ADDRESS |= (uint16_t)(WRPSector>>12); @@ -737,10 +748,10 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks) } /*Write protection on all sector of BANK2*/ - if ((WRPSector == OB_WRP_SECTOR_All) && (Banks == FLASH_BANK_BOTH)) + if((WRPSector == OB_WRP_SECTOR_All) && (Banks == FLASH_BANK_BOTH)) { /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -772,7 +783,7 @@ static HAL_StatusTypeDef FLASH_OB_BootConfig(uint8_t BootConfig) assert_param(IS_OB_BOOT(BootConfig)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -811,11 +822,11 @@ static HAL_StatusTypeDef FLASH_OB_EnablePCROP(uint32_t SectorBank1, uint32_t Sec assert_param(IS_FLASH_BANK(Banks)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { - if ((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH)) + if((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH)) { assert_param(IS_OB_PCROP(SectorBank1)); /*Write protection done on sectors of BANK1*/ @@ -829,11 +840,11 @@ static HAL_StatusTypeDef FLASH_OB_EnablePCROP(uint32_t SectorBank1, uint32_t Sec } /*Write protection on all sector of BANK2*/ - if (Banks == FLASH_BANK_BOTH) + if(Banks == FLASH_BANK_BOTH) { assert_param(IS_OB_PCROP(SectorBank2)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -876,11 +887,11 @@ static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t SectorBank1, uint32_t Se assert_param(IS_FLASH_BANK(Banks)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { - if ((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH)) + if((Banks == FLASH_BANK_1) || (Banks == FLASH_BANK_BOTH)) { assert_param(IS_OB_PCROP(SectorBank1)); /*Write protection done on sectors of BANK1*/ @@ -894,11 +905,11 @@ static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t SectorBank1, uint32_t Se } /*Write protection on all sector of BANK2*/ - if (Banks == FLASH_BANK_BOTH) + if(Banks == FLASH_BANK_BOTH) { assert_param(IS_OB_PCROP(SectorBank2)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -916,18 +927,18 @@ static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t SectorBank1, uint32_t Se #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /** * @brief Mass erase of FLASH memory * @param VoltageRange: The device voltage range which defines the erase parallelism. * This parameter can be one of the following values: - * @arg VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, + * @arg FLASH_VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, * the operation will be done by byte (8-bit) - * @arg VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, + * @arg FLASH_VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, * the operation will be done by half word (16-bit) - * @arg VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, + * @arg FLASH_VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, * the operation will be done by word (32-bit) - * @arg VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, + * @arg FLASH_VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, * the operation will be done by double word (64-bit) * * @param Banks: Banks to be erased @@ -957,13 +968,13 @@ static void FLASH_MassErase(uint8_t VoltageRange, uint32_t Banks) * The value of this parameter depend on device used within the same series * @param VoltageRange: The device voltage range which defines the erase parallelism. * This parameter can be one of the following values: - * @arg VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, + * @arg FLASH_VOLTAGE_RANGE_1: when the device voltage range is 1.8V to 2.1V, * the operation will be done by byte (8-bit) - * @arg VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, + * @arg FLASH_VOLTAGE_RANGE_2: when the device voltage range is 2.1V to 2.7V, * the operation will be done by half word (16-bit) - * @arg VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, + * @arg FLASH_VOLTAGE_RANGE_3: when the device voltage range is 2.7V to 3.6V, * the operation will be done by word (32-bit) - * @arg VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, + * @arg FLASH_VOLTAGE_RANGE_4: when the device voltage range is 2.7V to 3.6V + External Vpp, * the operation will be done by double word (64-bit) * * @retval None @@ -976,15 +987,15 @@ void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange) assert_param(IS_FLASH_SECTOR(Sector)); assert_param(IS_VOLTAGERANGE(VoltageRange)); - if(VoltageRange == VOLTAGE_RANGE_1) + if(VoltageRange == FLASH_VOLTAGE_RANGE_1) { tmp_psize = FLASH_PSIZE_BYTE; } - else if(VoltageRange == VOLTAGE_RANGE_2) + else if(VoltageRange == FLASH_VOLTAGE_RANGE_2) { tmp_psize = FLASH_PSIZE_HALF_WORD; } - else if(VoltageRange == VOLTAGE_RANGE_3) + else if(VoltageRange == FLASH_VOLTAGE_RANGE_3) { tmp_psize = FLASH_PSIZE_WORD; } @@ -1027,7 +1038,7 @@ static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks) assert_param(IS_FLASH_BANK(Banks)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -1063,7 +1074,7 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks) assert_param(IS_FLASH_BANK(Banks)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -1072,9 +1083,9 @@ static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks) return status; } -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F40xxx || STM32F41xxx || STM32F401xx || STM32F411xE || STM32F446xx */ -#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /** * @brief Enable the read/write protection (PCROP) of the desired sectors. * @note This function can be used only for STM32F401xx devices. @@ -1092,7 +1103,7 @@ static HAL_StatusTypeDef FLASH_OB_EnablePCROP(uint32_t Sector) assert_param(IS_OB_PCROP(Sector)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -1120,7 +1131,7 @@ static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t Sector) assert_param(IS_OB_PCROP(Sector)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -1130,7 +1141,7 @@ static HAL_StatusTypeDef FLASH_OB_DisablePCROP(uint32_t Sector) return status; } -#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ /** * @brief Set the read protection level. @@ -1152,7 +1163,7 @@ static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig(uint8_t Level) assert_param(IS_OB_RDP_LEVEL(Level)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -1189,7 +1200,7 @@ static HAL_StatusTypeDef FLASH_OB_UserConfig(uint8_t Iwdg, uint8_t Stop, uint8_t assert_param(IS_OB_STDBY_SOURCE(Stdby)); /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation((uint32_t)HAL_FLASH_TIMEOUT_VALUE); + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); if(status == HAL_OK) { @@ -1229,7 +1240,6 @@ static HAL_StatusTypeDef FLASH_OB_BOR_LevelConfig(uint8_t Level) /** * @brief Return the FLASH User Option Byte value. - * @param None * @retval uint8_t FLASH User Option Bytes values: IWDG_SW(Bit0), RST_STOP(Bit1) * and RST_STDBY(Bit2). */ @@ -1241,7 +1251,6 @@ static uint8_t FLASH_OB_GetUser(void) /** * @brief Return the FLASH Write Protection Option Bytes value. - * @param None * @retval uint16_t FLASH Write Protection Option Bytes value */ static uint16_t FLASH_OB_GetWRP(void) @@ -1252,8 +1261,7 @@ static uint16_t FLASH_OB_GetWRP(void) /** * @brief Returns the FLASH Read Protection level. - * @param None - * @retval FlagStatus FLASH ReadOut Protection Status: + * @retval FlagStatus FLASH Readout Protection Status: * - SET, when OB_RDP_Level_1 or OB_RDP_Level_2 is set * - RESET, when OB_RDP_Level_0 is set */ @@ -1261,7 +1269,7 @@ static FlagStatus FLASH_OB_GetRDP(void) { FlagStatus readstatus = RESET; - if ((*(__IO uint8_t*)(OPTCR_BYTE1_ADDRESS) != (uint8_t)OB_RDP_LEVEL_0)) + if((*(__IO uint8_t*)(OPTCR_BYTE1_ADDRESS) != (uint8_t)OB_RDP_LEVEL_0)) { readstatus = SET; } @@ -1271,7 +1279,6 @@ static FlagStatus FLASH_OB_GetRDP(void) /** * @brief Returns the FLASH BOR level. - * @param None * @retval uint8_t The FLASH BOR level: * - OB_BOR_LEVEL3: Supply voltage ranges from 2.7 to 3.6 V * - OB_BOR_LEVEL2: Supply voltage ranges from 2.4 to 2.7 V diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.h index e060f16a3bc..2ae52d4a82d 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_flash_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of FLASH HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,6 +55,9 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup FLASHEx_Exported_Types FLASH Exported Types + * @{ + */ /** * @brief FLASH Erase structure definition @@ -109,7 +112,7 @@ typedef struct * @brief FLASH Advanced Option Bytes Program structure definition */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) typedef struct { uint32_t OptionType; /*!< Option byte to be configured for extension. @@ -118,10 +121,10 @@ typedef struct uint32_t PCROPState; /*!< PCROP activation or deactivation. This parameter can be a value of @ref FLASHEx_PCROP_State */ -#if defined (STM32F401xC) || defined (STM32F401xE) || defined (STM32F411xE) +#if defined (STM32F401xC) || defined (STM32F401xE) || defined (STM32F411xE) || defined (STM32F446xx) uint16_t Sectors; /*!< specifies the sector(s) set for PCROP. This parameter can be a value of @ref FLASHEx_Option_Bytes_PC_ReadWrite_Protection */ -#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) uint32_t Banks; /*!< Select banks for PCROP activation/deactivation of all sectors. @@ -138,7 +141,10 @@ typedef struct #endif /*STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ } FLASH_AdvOBProgramInitTypeDef; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ @@ -149,12 +155,8 @@ typedef struct /** @defgroup FLASHEx_Type_Erase FLASH Type Erase * @{ */ -#define TYPEERASE_SECTORS ((uint32_t)0x00) /*!< Sectors erase only */ -#define TYPEERASE_MASSERASE ((uint32_t)0x01) /*!< Flash Mass erase activation */ - -#define IS_TYPEERASE(VALUE)(((VALUE) == TYPEERASE_SECTORS) || \ - ((VALUE) == TYPEERASE_MASSERASE)) - +#define FLASH_TYPEERASE_SECTORS ((uint32_t)0x00) /*!< Sectors erase only */ +#define FLASH_TYPEERASE_MASSERASE ((uint32_t)0x01) /*!< Flash Mass erase activation */ /** * @} */ @@ -162,16 +164,10 @@ typedef struct /** @defgroup FLASHEx_Voltage_Range FLASH Voltage Range * @{ */ -#define VOLTAGE_RANGE_1 ((uint32_t)0x00) /*!< Device operating range: 1.8V to 2.1V */ -#define VOLTAGE_RANGE_2 ((uint32_t)0x01) /*!< Device operating range: 2.1V to 2.7V */ -#define VOLTAGE_RANGE_3 ((uint32_t)0x02) /*!< Device operating range: 2.7V to 3.6V */ -#define VOLTAGE_RANGE_4 ((uint32_t)0x03) /*!< Device operating range: 2.7V to 3.6V + External Vpp */ - -#define IS_VOLTAGERANGE(RANGE)(((RANGE) == VOLTAGE_RANGE_1) || \ - ((RANGE) == VOLTAGE_RANGE_2) || \ - ((RANGE) == VOLTAGE_RANGE_3) || \ - ((RANGE) == VOLTAGE_RANGE_4)) - +#define FLASH_VOLTAGE_RANGE_1 ((uint32_t)0x00) /*!< Device operating range: 1.8V to 2.1V */ +#define FLASH_VOLTAGE_RANGE_2 ((uint32_t)0x01) /*!< Device operating range: 2.1V to 2.7V */ +#define FLASH_VOLTAGE_RANGE_3 ((uint32_t)0x02) /*!< Device operating range: 2.7V to 3.6V */ +#define FLASH_VOLTAGE_RANGE_4 ((uint32_t)0x03) /*!< Device operating range: 2.7V to 3.6V + External Vpp */ /** * @} */ @@ -179,12 +175,8 @@ typedef struct /** @defgroup FLASHEx_WRP_State FLASH WRP State * @{ */ -#define WRPSTATE_DISABLE ((uint32_t)0x00) /*!< Disable the write protection of the desired bank 1 sectors */ -#define WRPSTATE_ENABLE ((uint32_t)0x01) /*!< Enable the write protection of the desired bank 1 sectors */ - -#define IS_WRPSTATE(VALUE)(((VALUE) == WRPSTATE_DISABLE) || \ - ((VALUE) == WRPSTATE_ENABLE)) - +#define OB_WRPSTATE_DISABLE ((uint32_t)0x00) /*!< Disable the write protection of the desired bank 1 sectors */ +#define OB_WRPSTATE_ENABLE ((uint32_t)0x01) /*!< Enable the write protection of the desired bank 1 sectors */ /** * @} */ @@ -196,9 +188,6 @@ typedef struct #define OPTIONBYTE_RDP ((uint32_t)0x02) /*!< RDP option byte configuration */ #define OPTIONBYTE_USER ((uint32_t)0x04) /*!< USER option byte configuration */ #define OPTIONBYTE_BOR ((uint32_t)0x08) /*!< BOR option byte configuration */ - -#define IS_OPTIONBYTE(VALUE)(((VALUE) < (OPTIONBYTE_WRP|OPTIONBYTE_RDP|OPTIONBYTE_USER|OPTIONBYTE_BOR))) - /** * @} */ @@ -210,9 +199,6 @@ typedef struct #define OB_RDP_LEVEL_1 ((uint8_t)0x55) /*#define OB_RDP_LEVEL_2 ((uint8_t)0xCC)*/ /*!< Warning: When enabling read protection level 2 it s no more possible to go back to level 1 or 0 */ -#define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\ - ((LEVEL) == OB_RDP_LEVEL_1))/*||\ - ((LEVEL) == OB_RDP_LEVEL_2))*/ /** * @} */ @@ -222,7 +208,6 @@ typedef struct */ #define OB_IWDG_SW ((uint8_t)0x20) /*!< Software IWDG selected */ #define OB_IWDG_HW ((uint8_t)0x00) /*!< Hardware IWDG selected */ -#define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW)) /** * @} */ @@ -232,7 +217,6 @@ typedef struct */ #define OB_STOP_NO_RST ((uint8_t)0x40) /*!< No reset generated when entering in STOP */ #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */ -#define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST)) /** * @} */ @@ -243,7 +227,6 @@ typedef struct */ #define OB_STDBY_NO_RST ((uint8_t)0x80) /*!< No reset generated when entering in STANDBY */ #define OB_STDBY_RST ((uint8_t)0x00) /*!< Reset generated when entering in STANDBY */ -#define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST)) /** * @} */ @@ -255,23 +238,17 @@ typedef struct #define OB_BOR_LEVEL2 ((uint8_t)0x04) /*!< Supply voltage ranges from 2.40 to 2.70 V */ #define OB_BOR_LEVEL1 ((uint8_t)0x08) /*!< Supply voltage ranges from 2.10 to 2.40 V */ #define OB_BOR_OFF ((uint8_t)0x0C) /*!< Supply voltage ranges from 1.62 to 2.10 V */ -#define IS_OB_BOR_LEVEL(LEVEL) (((LEVEL) == OB_BOR_LEVEL1) || ((LEVEL) == OB_BOR_LEVEL2) ||\ - ((LEVEL) == OB_BOR_LEVEL3) || ((LEVEL) == OB_BOR_OFF)) /** * @} */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /** @defgroup FLASHEx_PCROP_State FLASH PCROP State * @{ */ -#define PCROPSTATE_DISABLE ((uint32_t)0x00) /*!< Disable PCROP */ -#define PCROPSTATE_ENABLE ((uint32_t)0x01) /*!< Enable PCROP */ - -#define IS_PCROPSTATE(VALUE)(((VALUE) == PCROPSTATE_DISABLE) || \ - ((VALUE) == PCROPSTATE_ENABLE)) - +#define OB_PCROP_STATE_DISABLE ((uint32_t)0x00) /*!< Disable PCROP */ +#define OB_PCROP_STATE_ENABLE ((uint32_t)0x01) /*!< Enable PCROP */ /** * @} */ @@ -281,20 +258,13 @@ typedef struct * @{ */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) -#define OBEX_PCROP ((uint32_t)0x01) /*!< PCROP option byte configuration */ -#define OBEX_BOOTCONFIG ((uint32_t)0x02) /*!< BOOTConfig option byte configuration */ - -#define IS_OBEX(VALUE)(((VALUE) == OBEX_PCROP) || \ - ((VALUE) == OBEX_BOOTCONFIG)) - +#define OPTIONBYTE_PCROP ((uint32_t)0x01) /*!< PCROP option byte configuration */ +#define OPTIONBYTE_BOOTCONFIG ((uint32_t)0x02) /*!< BOOTConfig option byte configuration */ #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) -#define OBEX_PCROP ((uint32_t)0x01) /*!= FLASH_BASE) && ((ADDRESS) < FLASH_END)) -#define IS_NBSECTORS(NBSECTORS) (((NBSECTORS) != 0) && ((NBSECTORS) <= FLASH_SECTOR_TOTAL)) /** * @} @@ -555,8 +452,6 @@ typedef struct #define OB_WRP_SECTOR_22 ((uint32_t)0x00000400 << 12) /*!< Write protection of Sector22 */ #define OB_WRP_SECTOR_23 ((uint32_t)0x00000800 << 12) /*!< Write protection of Sector23 */ #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF << 12) /*!< Write protection of all Sectors */ - -#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFF000000) == 0x00000000) && ((SECTOR) != 0x00000000)) #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ /*-----------------------------------------------------------------------------------------------------*/ @@ -575,8 +470,6 @@ typedef struct #define OB_WRP_SECTOR_10 ((uint32_t)0x00000400) /*!< Write protection of Sector10 */ #define OB_WRP_SECTOR_11 ((uint32_t)0x00000800) /*!< Write protection of Sector11 */ #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */ - -#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ /*-----------------------------------------------------------------------------------------------------*/ @@ -589,13 +482,11 @@ typedef struct #define OB_WRP_SECTOR_4 ((uint32_t)0x00000010) /*!< Write protection of Sector4 */ #define OB_WRP_SECTOR_5 ((uint32_t)0x00000020) /*!< Write protection of Sector5 */ #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */ - -#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) #endif /* STM32F401xC */ /*-----------------------------------------------------------------------------------------------------*/ -/*--------------------------------------- STM32F401xE/STM32F411xE -------------------------------------*/ -#if defined(STM32F401xE) || defined(STM32F411xE) +/*---------------------------------- STM32F401xE/STM32F411xE/STM32F446xx ------------------------------*/ +#if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) #define OB_WRP_SECTOR_0 ((uint32_t)0x00000001) /*!< Write protection of Sector0 */ #define OB_WRP_SECTOR_1 ((uint32_t)0x00000002) /*!< Write protection of Sector1 */ #define OB_WRP_SECTOR_2 ((uint32_t)0x00000004) /*!< Write protection of Sector2 */ @@ -605,9 +496,7 @@ typedef struct #define OB_WRP_SECTOR_6 ((uint32_t)0x00000040) /*!< Write protection of Sector6 */ #define OB_WRP_SECTOR_7 ((uint32_t)0x00000080) /*!< Write protection of Sector7 */ #define OB_WRP_SECTOR_All ((uint32_t)0x00000FFF) /*!< Write protection of all Sectors */ - -#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) -#endif /* STM32F401xE || STM32F411xE */ +#endif /* STM32F401xE || STM32F411xE || STM32F446xx */ /*-----------------------------------------------------------------------------------------------------*/ /** * @} @@ -643,8 +532,6 @@ typedef struct #define OB_PCROP_SECTOR_22 ((uint32_t)0x00000400) /*!< PC Read/Write protection of Sector22 */ #define OB_PCROP_SECTOR_23 ((uint32_t)0x00000800) /*!< PC Read/Write protection of Sector23 */ #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */ - -#define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ /*-----------------------------------------------------------------------------------------------------*/ @@ -657,13 +544,11 @@ typedef struct #define OB_PCROP_SECTOR_4 ((uint32_t)0x00000010) /*!< PC Read/Write protection of Sector4 */ #define OB_PCROP_SECTOR_5 ((uint32_t)0x00000020) /*!< PC Read/Write protection of Sector5 */ #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */ - -#define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) #endif /* STM32F401xC */ /*-----------------------------------------------------------------------------------------------------*/ -/*--------------------------------------- STM32F401xE/STM32F411xE -------------------------------------*/ -#if defined(STM32F401xE) || defined(STM32F411xE) +/*------------------------------ STM32F401xE/STM32F411xE/STM32F446xx ----------------------------------*/ +#if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) #define OB_PCROP_SECTOR_0 ((uint32_t)0x00000001) /*!< PC Read/Write protection of Sector0 */ #define OB_PCROP_SECTOR_1 ((uint32_t)0x00000002) /*!< PC Read/Write protection of Sector1 */ #define OB_PCROP_SECTOR_2 ((uint32_t)0x00000004) /*!< PC Read/Write protection of Sector2 */ @@ -673,9 +558,7 @@ typedef struct #define OB_PCROP_SECTOR_6 ((uint32_t)0x00000040) /*!< PC Read/Write protection of Sector6 */ #define OB_PCROP_SECTOR_7 ((uint32_t)0x00000080) /*!< PC Read/Write protection of Sector7 */ #define OB_PCROP_SECTOR_All ((uint32_t)0x00000FFF) /*!< PC Read/Write protection of all Sectors */ - -#define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) -#endif /* STM32F401xE || STM32F411xE */ +#endif /* STM32F401xE || STM32F411xE || STM32F446xx */ /*-----------------------------------------------------------------------------------------------------*/ /** @@ -688,7 +571,6 @@ typedef struct #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) #define OB_DUAL_BOOT_ENABLE ((uint8_t)0x10) /*!< Dual Bank Boot Enable */ #define OB_DUAL_BOOT_DISABLE ((uint8_t)0x00) /*!< Dual Bank Boot Disable, always boot on User Flash */ -#define IS_OB_BOOT(BOOT) (((BOOT) == OB_DUAL_BOOT_ENABLE) || ((BOOT) == OB_DUAL_BOOT_DISABLE)) #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ /** * @} @@ -698,21 +580,13 @@ typedef struct * @{ */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) #define OB_PCROP_DESELECTED ((uint8_t)0x00) /*!< Disabled PcROP, nWPRi bits used for Write Protection on sector i */ #define OB_PCROP_SELECTED ((uint8_t)0x80) /*!< Enable PcROP, nWPRi bits used for PCRoP Protection on sector i */ -#define IS_OB_PCROP_SELECT(PCROP) (((PCROP) == OB_PCROP_SELECTED) || ((PCROP) == OB_PCROP_DESELECTED)) -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ /** * @} */ - -/** - * @brief OPTCR1 register byte 2 (Bits[23:16]) base address - */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) -#define OPTCR1_BYTE2_ADDRESS ((uint32_t)0x40023C1A) -#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ /** * @} @@ -721,7 +595,13 @@ typedef struct /* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup FLASHEx_Exported_Functions + * @{ + */ +/** @addtogroup FLASHEx_Exported_Functions_Group1 + * @{ + */ /* Extension Program operation functions *************************************/ HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError); HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); @@ -729,18 +609,245 @@ HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit); void HAL_FLASHEx_AdvOBGetConfig(FLASH_AdvOBProgramInitTypeDef *pAdvOBInit); HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP(void); HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP(void); -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) uint16_t HAL_FLASHEx_OB_GetBank2WRP(void); #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup FLASHEx_Private_Constants FLASH Private Constants + * @{ + */ +/*--------------------------------------- STM32F42xxx/STM32F43xxx--------------------------------------*/ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define FLASH_SECTOR_TOTAL 24 +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +/*--------------------------------------- STM32F40xxx/STM32F41xxx -------------------------------------*/ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) +#define FLASH_SECTOR_TOTAL 12 +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ +/*--------------------------------------------- STM32F401xC -------------------------------------------*/ +#if defined(STM32F401xC) +#define FLASH_SECTOR_TOTAL 6 +#endif /* STM32F401xC */ + +/*--------------------------------- STM32F401xE/STM32F411xE/STM32F446xx -------------------------------*/ +#if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define FLASH_SECTOR_TOTAL 8 +#endif /* STM32F401xE || STM32F411xE || STM32F446xx */ + +/** + * @brief OPTCR1 register byte 2 (Bits[23:16]) base address + */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define OPTCR1_BYTE2_ADDRESS ((uint32_t)0x40023C1A) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup FLASHEx_Private_Macros FLASH Private Macros + * @{ + */ + +/** @defgroup FLASHEx_IS_FLASH_Definitions FLASH Private macros to check input parameters + * @{ + */ + +#define IS_FLASH_TYPEERASE(VALUE)(((VALUE) == FLASH_TYPEERASE_SECTORS) || \ + ((VALUE) == FLASH_TYPEERASE_MASSERASE)) + +#define IS_VOLTAGERANGE(RANGE)(((RANGE) == FLASH_VOLTAGE_RANGE_1) || \ + ((RANGE) == FLASH_VOLTAGE_RANGE_2) || \ + ((RANGE) == FLASH_VOLTAGE_RANGE_3) || \ + ((RANGE) == FLASH_VOLTAGE_RANGE_4)) + +#define IS_WRPSTATE(VALUE)(((VALUE) == OB_WRPSTATE_DISABLE) || \ + ((VALUE) == OB_WRPSTATE_ENABLE)) + +#define IS_OPTIONBYTE(VALUE)(((VALUE) <= (OPTIONBYTE_WRP|OPTIONBYTE_RDP|OPTIONBYTE_USER|OPTIONBYTE_BOR))) + +#define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\ + ((LEVEL) == OB_RDP_LEVEL_1))/*||\ + ((LEVEL) == OB_RDP_LEVEL_2))*/ + +#define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW)) + +#define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST)) + +#define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST)) + +#define IS_OB_BOR_LEVEL(LEVEL) (((LEVEL) == OB_BOR_LEVEL1) || ((LEVEL) == OB_BOR_LEVEL2) ||\ + ((LEVEL) == OB_BOR_LEVEL3) || ((LEVEL) == OB_BOR_OFF)) + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_PCROPSTATE(VALUE)(((VALUE) == OB_PCROP_STATE_DISABLE) || \ + ((VALUE) == OB_PCROP_STATE_ENABLE)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#define IS_OBEX(VALUE)(((VALUE) == OPTIONBYTE_PCROP) || \ + ((VALUE) == OPTIONBYTE_BOOTCONFIG)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_OBEX(VALUE)(((VALUE) == OPTIONBYTE_PCROP)) +#endif /* STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \ + ((LATENCY) == FLASH_LATENCY_1) || \ + ((LATENCY) == FLASH_LATENCY_2) || \ + ((LATENCY) == FLASH_LATENCY_3) || \ + ((LATENCY) == FLASH_LATENCY_4) || \ + ((LATENCY) == FLASH_LATENCY_5) || \ + ((LATENCY) == FLASH_LATENCY_6) || \ + ((LATENCY) == FLASH_LATENCY_7) || \ + ((LATENCY) == FLASH_LATENCY_8) || \ + ((LATENCY) == FLASH_LATENCY_9) || \ + ((LATENCY) == FLASH_LATENCY_10) || \ + ((LATENCY) == FLASH_LATENCY_11) || \ + ((LATENCY) == FLASH_LATENCY_12) || \ + ((LATENCY) == FLASH_LATENCY_13) || \ + ((LATENCY) == FLASH_LATENCY_14) || \ + ((LATENCY) == FLASH_LATENCY_15)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) || \ + ((LATENCY) == FLASH_LATENCY_1) || \ + ((LATENCY) == FLASH_LATENCY_2) || \ + ((LATENCY) == FLASH_LATENCY_3) || \ + ((LATENCY) == FLASH_LATENCY_4) || \ + ((LATENCY) == FLASH_LATENCY_5) || \ + ((LATENCY) == FLASH_LATENCY_6) || \ + ((LATENCY) == FLASH_LATENCY_7)) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1) || \ + ((BANK) == FLASH_BANK_2) || \ + ((BANK) == FLASH_BANK_BOTH)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1)) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ + + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_FLASH_SECTOR(SECTOR) ( ((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\ + ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\ + ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\ + ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7) ||\ + ((SECTOR) == FLASH_SECTOR_8) || ((SECTOR) == FLASH_SECTOR_9) ||\ + ((SECTOR) == FLASH_SECTOR_10) || ((SECTOR) == FLASH_SECTOR_11) ||\ + ((SECTOR) == FLASH_SECTOR_12) || ((SECTOR) == FLASH_SECTOR_13) ||\ + ((SECTOR) == FLASH_SECTOR_14) || ((SECTOR) == FLASH_SECTOR_15) ||\ + ((SECTOR) == FLASH_SECTOR_16) || ((SECTOR) == FLASH_SECTOR_17) ||\ + ((SECTOR) == FLASH_SECTOR_18) || ((SECTOR) == FLASH_SECTOR_19) ||\ + ((SECTOR) == FLASH_SECTOR_20) || ((SECTOR) == FLASH_SECTOR_21) ||\ + ((SECTOR) == FLASH_SECTOR_22) || ((SECTOR) == FLASH_SECTOR_23)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) +#define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\ + ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\ + ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\ + ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7) ||\ + ((SECTOR) == FLASH_SECTOR_8) || ((SECTOR) == FLASH_SECTOR_9) ||\ + ((SECTOR) == FLASH_SECTOR_10) || ((SECTOR) == FLASH_SECTOR_11)) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ + +#if defined(STM32F401xC) +#define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\ + ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\ + ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5)) +#endif /* STM32F401xC */ + +#if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||\ + ((SECTOR) == FLASH_SECTOR_2) || ((SECTOR) == FLASH_SECTOR_3) ||\ + ((SECTOR) == FLASH_SECTOR_4) || ((SECTOR) == FLASH_SECTOR_5) ||\ + ((SECTOR) == FLASH_SECTOR_6) || ((SECTOR) == FLASH_SECTOR_7)) +#endif /* STM32F401xE || STM32F411xE || STM32F446xx */ + +#define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= FLASH_END)) +#define IS_FLASH_NBSECTORS(NBSECTORS) (((NBSECTORS) != 0) && ((NBSECTORS) <= FLASH_SECTOR_TOTAL)) + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFF000000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) +#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ + +#if defined(STM32F401xC) +#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F401xC */ + +#if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F401xE || STM32F411xE || STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +#if defined(STM32F401xC) +#define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F401xC */ + +#if defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_OB_PCROP(SECTOR)((((SECTOR) & (uint32_t)0xFFFFF000) == 0x00000000) && ((SECTOR) != 0x00000000)) +#endif /* STM32F401xE || STM32F411xE || STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_OB_BOOT(BOOT) (((BOOT) == OB_DUAL_BOOT_ENABLE) || ((BOOT) == OB_DUAL_BOOT_DISABLE)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +#define IS_OB_PCROP_SELECT(PCROP) (((PCROP) == OB_PCROP_SELECTED) || ((PCROP) == OB_PCROP_DESELECTED)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ +/** + * @} + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup FLASHEx_Private_Functions FLASH Private Functions + * @{ + */ void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange); +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.c index 93bf8249157..368fa4c8b08 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_flash_ramfunc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief FLASH RAMFUNC module driver. * This file provides a FLASH firmware functions which should be * executed from internal SRAM @@ -36,7 +36,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -70,27 +70,26 @@ * @{ */ -/** @defgroup FLASH_RAMFUNC +/** @defgroup FLASHRAMFUNC FLASH RAMFUNC * @brief FLASH functions executed from RAM * @{ */ #ifdef HAL_FLASH_MODULE_ENABLED -#if defined(STM32F411xE) +#if defined(STM32F411xE) || defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup FLASH_RAMFUNC_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup FLASHRAMFUNC_Exported_Functions FLASH RAMFUNC Exported Functions * @{ */ -/** @defgroup FLASH_RAMFUNC_Group1 Peripheral features functions executed from internal RAM +/** @defgroup FLASHRAMFUNC_Exported_Functions_Group1 Peripheral features functions executed from internal RAM * @brief Peripheral Extended features functions * @verbatim @@ -109,15 +108,14 @@ /** * @brief Stop the flash interface while System Run * @note This mode is only available for STM32F411xx devices. - * @note This mode could n't be set while executing with the flash itself. + * @note This mode couldn't be set while executing with the flash itself. * It should be done with specific routine executed from RAM. - * @param None * @retval None */ __RAM_FUNC HAL_FLASHEx_StopFlashInterfaceClk(void) { /* Enable Power ctrl clock */ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Stop the flash interface while System Run */ SET_BIT(PWR->CR, PWR_CR_FISSR); @@ -127,15 +125,14 @@ __RAM_FUNC HAL_FLASHEx_StopFlashInterfaceClk(void) /** * @brief Start the flash interface while System Run * @note This mode is only available for STM32F411xx devices. - * @note This mode could n't be set while executing with the flash itself. + * @note This mode couldn't be set while executing with the flash itself. * It should be done with specific routine executed from RAM. - * @param None * @retval None */ __RAM_FUNC HAL_FLASHEx_StartFlashInterfaceClk(void) { /* Enable Power ctrl clock */ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Start the flash interface while System Run */ CLEAR_BIT(PWR->CR, PWR_CR_FISSR); @@ -147,13 +144,12 @@ __RAM_FUNC HAL_FLASHEx_StartFlashInterfaceClk(void) * @note This mode is only available for STM32F411xx devices. * @note This mode could n't be set while executing with the flash itself. * It should be done with specific routine executed from RAM. - * @param None * @retval None */ __RAM_FUNC HAL_FLASHEx_EnableFlashSleepMode(void) { /* Enable Power ctrl clock */ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Enable the flash sleep while System Run */ SET_BIT(PWR->CR, PWR_CR_FMSSR); @@ -163,15 +159,14 @@ __RAM_FUNC HAL_FLASHEx_EnableFlashSleepMode(void) /** * @brief Disable the flash sleep while System Run * @note This mode is only available for STM32F411xx devices. - * @note This mode could n't be set while executing with the flash itself. + * @note This mode couldn't be set while executing with the flash itself. * It should be done with specific routine executed from RAM. - * @param None * @retval None */ __RAM_FUNC HAL_FLASHEx_DisableFlashSleepMode(void) { /* Enable Power ctrl clock */ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Disable the flash sleep while System Run */ CLEAR_BIT(PWR->CR, PWR_CR_FMSSR); @@ -186,7 +181,7 @@ __RAM_FUNC HAL_FLASHEx_DisableFlashSleepMode(void) * @} */ -#endif /* STM32F411xE */ +#endif /* STM32F411xE || STM32F446xx */ #endif /* HAL_FLASH_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.h index cd7de67cd19..08770bf6032 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_flash_ramfunc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_flash_ramfunc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of FLASH RAMFUNC driver. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,7 @@ extern "C" { #endif -#if defined(STM32F411xE) +#if defined(STM32F411xE) || defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" @@ -52,18 +52,31 @@ * @{ */ -/** @addtogroup FLASH_RAMFUNC +/** @addtogroup FLASHRAMFUNC * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup FLASHRAMFUNC_Exported_Functions + * @{ + */ + +/** @addtogroup FLASHRAMFUNC_Exported_Functions_Group1 + * @{ + */ __RAM_FUNC HAL_FLASHEx_StopFlashInterfaceClk(void); __RAM_FUNC HAL_FLASHEx_StartFlashInterfaceClk(void); __RAM_FUNC HAL_FLASHEx_EnableFlashSleepMode(void); __RAM_FUNC HAL_FLASHEx_DisableFlashSleepMode(void); +/** + * @} + */ +/** + * @} + */ #endif /* STM32F411xE */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.c new file mode 100644 index 00000000000..1c15cc2e3d0 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.c @@ -0,0 +1,4098 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_fmpi2c.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief FMPI2C HAL module driver. + * + * This file provides firmware functions to manage the following + * functionalities of the Inter Integrated Circuit (FMPI2C) peripheral: + * + Initialization and de-initialization functions + * + IO operation functions + * + Peripheral State functions + * + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + The FMPI2C HAL driver can be used as follows: + + (#) Declare a FMPI2C_HandleTypeDef handle structure, for example: + FMPI2C_HandleTypeDef hfmpi2c; + + (#)Initialize the FMPI2C low level resources by implement the HAL_FMPI2C_MspInit ()API: + (##) Enable the FMPI2Cx interface clock + (##) FMPI2C pins configuration + (+++) Enable the clock for the FMPI2C GPIOs + (+++) Configure FMPI2C pins as alternate function open-drain + (##) NVIC configuration if you need to use interrupt process + (+++) Configure the FMPI2Cx interrupt priority + (+++) Enable the NVIC FMPI2C IRQ Channel + (##) DMA Configuration if you need to use DMA process + (+++) Declare a DMA_HandleTypeDef handle structure for the transmit or receive stream + (+++) Enable the DMAx interface clock using + (+++) Configure the DMA handle parameters + (+++) Configure the DMA Tx or Rx Stream + (+++) Associate the initilalized DMA handle to the hfmpi2c DMA Tx or Rx handle + (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx or Rx Stream + + (#) Configure the Communication Clock Timing, Own Address1, Master Adressing Mode, Dual Addressing mode, + Own Address2, Own Address2 Mask, General call and Nostretch mode in the hfmpi2c Init structure. + + (#) Initialize the FMPI2C registers by calling the HAL_FMPI2C_Init() API: + (+++) These API's configures also the low level Hardware GPIO, CLOCK, CORTEX...etc) + by calling the customed HAL_FMPI2C_MspInit(&hfmpi2c) API. + + (#) To check if target device is ready for communication, use the function HAL_FMPI2C_IsDeviceReady() + + (#) For FMPI2C IO and IO MEM operations, three mode of operations are available within this driver : + + *** Polling mode IO operation *** + ================================= + [..] + (+) Transmit in master mode an amount of data in blocking mode using HAL_FMPI2C_Master_Transmit() + (+) Receive in master mode an amount of data in blocking mode using HAL_FMPI2C_Master_Receive() + (+) Transmit in slave mode an amount of data in blocking mode using HAL_FMPI2C_Slave_Transmit() + (+) Receive in slave mode an amount of data in blocking mode using HAL_FMPI2C_Slave_Receive() + + *** Polling mode IO MEM operation *** + ===================================== + [..] + (+) Write an amount of data in blocking mode to a specific memory address using HAL_FMPI2C_Mem_Write() + (+) Read an amount of data in blocking mode from a specific memory address using HAL_FMPI2C_Mem_Read() + + + *** Interrupt mode IO operation *** + =================================== + [..] + (+) Transmit in master mode an amount of data in non blocking mode using HAL_FMPI2C_Master_Transmit_IT() + (+) At transmission end of transfer HAL_FMPI2C_MasterTxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MasterTxCpltCallback + (+) Receive in master mode an amount of data in non blocking mode using HAL_FMPI2C_Master_Receive_IT() + (+) At reception end of transfer HAL_FMPI2C_MasterRxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MasterRxCpltCallback + (+) Transmit in slave mode an amount of data in non blocking mode using HAL_FMPI2C_Slave_Transmit_IT() + (+) At transmission end of transfer HAL_FMPI2C_SlaveTxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_SlaveTxCpltCallback + (+) Receive in slave mode an amount of data in non blocking mode using HAL_FMPI2C_Slave_Receive_IT() + (+) At reception end of transfer HAL_FMPI2C_SlaveRxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_SlaveRxCpltCallback + (+) In case of transfer Error, HAL_FMPI2C_ErrorCallback() function is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_ErrorCallback + + *** Interrupt mode IO MEM operation *** + ======================================= + [..] + (+) Write an amount of data in no-blocking mode with Interrupt to a specific memory address using + HAL_FMPI2C_Mem_Write_IT() + (+) At MEM end of write transfer HAL_FMPI2C_MemTxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MemTxCpltCallback + (+) Read an amount of data in no-blocking mode with Interrupt from a specific memory address using + HAL_FMPI2C_Mem_Read_IT() + (+) At MEM end of read transfer HAL_FMPI2C_MemRxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MemRxCpltCallback + (+) In case of transfer Error, HAL_FMPI2C_ErrorCallback() function is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_ErrorCallback + + *** DMA mode IO operation *** + ============================== + [..] + (+) Transmit in master mode an amount of data in non blocking mode (DMA) using + HAL_FMPI2C_Master_Transmit_DMA() + (+) At transmission end of transfer HAL_FMPI2C_MasterTxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MasterTxCpltCallback + (+) Receive in master mode an amount of data in non blocking mode (DMA) using + HAL_FMPI2C_Master_Receive_DMA() + (+) At reception end of transfer HAL_FMPI2C_MasterRxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MasterRxCpltCallback + (+) Transmit in slave mode an amount of data in non blocking mode (DMA) using + HAL_FMPI2C_Slave_Transmit_DMA() + (+) At transmission end of transfer HAL_FMPI2C_SlaveTxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_SlaveTxCpltCallback + (+) Receive in slave mode an amount of data in non blocking mode (DMA) using + HAL_FMPI2C_Slave_Receive_DMA() + (+) At reception end of transfer HAL_FMPI2C_SlaveRxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_SlaveRxCpltCallback + (+) In case of transfer Error, HAL_FMPI2C_ErrorCallback() function is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_ErrorCallback + + *** DMA mode IO MEM operation *** + ================================= + [..] + (+) Write an amount of data in no-blocking mode with DMA to a specific memory address using + HAL_FMPI2C_Mem_Write_DMA() + (+) At MEM end of write transfer HAL_FMPI2C_MemTxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MemTxCpltCallback + (+) Read an amount of data in no-blocking mode with DMA from a specific memory address using + HAL_FMPI2C_Mem_Read_DMA() + (+) At MEM end of read transfer HAL_FMPI2C_MemRxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_MemRxCpltCallback + (+) In case of transfer Error, HAL_FMPI2C_ErrorCallback() function is executed and user can + add his own code by customization of function pointer HAL_FMPI2C_ErrorCallback + + + *** FMPI2C HAL driver macros list *** + ================================== + [..] + Below the list of most used macros in FMPI2C HAL driver. + + (+) __HAL_FMPI2C_ENABLE: Enable the FMPI2C peripheral + (+) __HAL_FMPI2C_DISABLE: Disable the FMPI2C peripheral + (+) __HAL_FMPI2C_GET_FLAG : Checks whether the specified FMPI2C flag is set or not + (+) __HAL_FMPI2C_CLEAR_FLAG : Clears the specified FMPI2C pending flag + (+) __HAL_FMPI2C_ENABLE_IT: Enables the specified FMPI2C interrupt + (+) __HAL_FMPI2C_DISABLE_IT: Disables the specified FMPI2C interrupt + + [..] + (@) You can refer to the FMPI2C HAL driver header file for more useful macros + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @defgroup FMPI2C FMPI2C + * @brief FMPI2C HAL module driver + * @{ + */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + +#if defined(STM32F446xx) + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @addtogroup FMPI2C_Private_Constants + * @{ + */ +#define TIMING_CLEAR_MASK ((uint32_t)0xF0FFFFFF) /*Instance)); + assert_param(IS_FMPI2C_OWN_ADDRESS1(hfmpi2c->Init.OwnAddress1)); + assert_param(IS_FMPI2C_ADDRESSING_MODE(hfmpi2c->Init.AddressingMode)); + assert_param(IS_FMPI2C_DUAL_ADDRESS(hfmpi2c->Init.DualAddressMode)); + assert_param(IS_FMPI2C_OWN_ADDRESS2(hfmpi2c->Init.OwnAddress2)); + assert_param(IS_FMPI2C_OWN_ADDRESS2_MASK(hfmpi2c->Init.OwnAddress2Masks)); + assert_param(IS_FMPI2C_GENERAL_CALL(hfmpi2c->Init.GeneralCallMode)); + assert_param(IS_FMPI2C_NO_STRETCH(hfmpi2c->Init.NoStretchMode)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hfmpi2c->Lock = HAL_UNLOCKED; + /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ + HAL_FMPI2C_MspInit(hfmpi2c); + } + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + + /* Disable the selected FMPI2C peripheral */ + __HAL_FMPI2C_DISABLE(hfmpi2c); + + /*---------------------------- FMPI2Cx TIMINGR Configuration ------------------*/ + /* Configure FMPI2Cx: Frequency range */ + hfmpi2c->Instance->TIMINGR = hfmpi2c->Init.Timing & TIMING_CLEAR_MASK; + + /*---------------------------- FMPI2Cx OAR1 Configuration ---------------------*/ + /* Configure FMPI2Cx: Own Address1 and ack own address1 mode */ + hfmpi2c->Instance->OAR1 &= ~FMPI2C_OAR1_OA1EN; + if(hfmpi2c->Init.OwnAddress1 != 0) + { + if(hfmpi2c->Init.AddressingMode == FMPI2C_ADDRESSINGMODE_7BIT) + { + hfmpi2c->Instance->OAR1 = (FMPI2C_OAR1_OA1EN | hfmpi2c->Init.OwnAddress1); + } + else /* FMPI2C_ADDRESSINGMODE_10BIT */ + { + hfmpi2c->Instance->OAR1 = (FMPI2C_OAR1_OA1EN | FMPI2C_OAR1_OA1MODE | hfmpi2c->Init.OwnAddress1); + } + } + + /*---------------------------- FMPI2Cx CR2 Configuration ----------------------*/ + /* Configure FMPI2Cx: Addressing Master mode */ + if(hfmpi2c->Init.AddressingMode == FMPI2C_ADDRESSINGMODE_10BIT) + { + hfmpi2c->Instance->CR2 = (FMPI2C_CR2_ADD10); + } + /* Enable the AUTOEND by default, and enable NACK (should be disable only during Slave process */ + hfmpi2c->Instance->CR2 |= (FMPI2C_CR2_AUTOEND | FMPI2C_CR2_NACK); + + /*---------------------------- FMPI2Cx OAR2 Configuration ---------------------*/ + /* Configure FMPI2Cx: Dual mode and Own Address2 */ + hfmpi2c->Instance->OAR2 = (hfmpi2c->Init.DualAddressMode | hfmpi2c->Init.OwnAddress2 | (hfmpi2c->Init.OwnAddress2Masks << 8)); + + /*---------------------------- FMPI2Cx CR1 Configuration ----------------------*/ + /* Configure FMPI2Cx: Generalcall and NoStretch mode */ + hfmpi2c->Instance->CR1 = (hfmpi2c->Init.GeneralCallMode | hfmpi2c->Init.NoStretchMode); + + /* Enable the selected FMPI2C peripheral */ + __HAL_FMPI2C_ENABLE(hfmpi2c); + + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the FMPI2C peripheral. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_DeInit(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* Check the FMPI2C handle allocation */ + if(hfmpi2c == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_FMPI2C_ALL_INSTANCE(hfmpi2c->Instance)); + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + + /* Disable the FMPI2C Peripheral Clock */ + __HAL_FMPI2C_DISABLE(hfmpi2c); + + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + HAL_FMPI2C_MspDeInit(hfmpi2c); + + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + hfmpi2c->State = HAL_FMPI2C_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief FMPI2C MSP Init. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ + __weak void HAL_FMPI2C_MspInit(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_MspInit could be implemented in the user file + */ +} + +/** + * @brief FMPI2C MSP DeInit + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ + __weak void HAL_FMPI2C_MspDeInit(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_MspDeInit could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup FMPI2C_Exported_Functions_Group2 I/O operation functions + * @brief Data transfers functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to manage the FMPI2C data + transfers. + + (#) There is two mode of transfer: + (++) Blocking mode : The communication is performed in the polling mode. + The status of all data processing is returned by the same function + after finishing transfer. + (++) No-Blocking mode : The communication is performed using Interrupts + or DMA. These functions return the status of the transfer startup. + The end of the data processing will be indicated through the + dedicated FMPI2C IRQ when using Interrupt mode or the DMA IRQ when + using DMA mode. + + (#) Blocking mode functions are : + (++) HAL_FMPI2C_Master_Transmit() + (++) HAL_FMPI2C_Master_Receive() + (++) HAL_FMPI2C_Slave_Transmit() + (++) HAL_FMPI2C_Slave_Receive() + (++) HAL_FMPI2C_Mem_Write() + (++) HAL_FMPI2C_Mem_Read() + (++) HAL_FMPI2C_IsDeviceReady() + + (#) No-Blocking mode functions with Interrupt are : + (++) HAL_FMPI2C_Master_Transmit_IT() + (++) HAL_FMPI2C_Master_Receive_IT() + (++) HAL_FMPI2C_Slave_Transmit_IT() + (++) HAL_FMPI2C_Slave_Receive_IT() + (++) HAL_FMPI2C_Mem_Write_IT() + (++) HAL_FMPI2C_Mem_Read_IT() + + (#) No-Blocking mode functions with DMA are : + (++) HAL_FMPI2C_Master_Transmit_DMA() + (++) HAL_FMPI2C_Master_Receive_DMA() + (++) HAL_FMPI2C_Slave_Transmit_DMA() + (++) HAL_FMPI2C_Slave_Receive_DMA() + (++) HAL_FMPI2C_Mem_Write_DMA() + (++) HAL_FMPI2C_Mem_Read_DMA() + + (#) A set of Transfer Complete Callbacks are provided in No_Blocking mode: + (++) HAL_FMPI2C_MemTxCpltCallback() + (++) HAL_FMPI2C_MemRxCpltCallback() + (++) HAL_FMPI2C_MasterTxCpltCallback() + (++) HAL_FMPI2C_MasterRxCpltCallback() + (++) HAL_FMPI2C_SlaveTxCpltCallback() + (++) HAL_FMPI2C_SlaveRxCpltCallback() + (++) HAL_FMPI2C_ErrorCallback() + +@endverbatim + * @{ + */ + +/** + * @brief Transmits in master mode an amount of data in blocking mode. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint32_t sizetmp = 0; + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MASTER_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + /* Size > 255, need to set RELOAD bit */ + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_WRITE); + sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_WRITE); + sizetmp = Size; + } + + do + { + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + /* Write data to TXDR */ + hfmpi2c->Instance->TXDR = (*pData++); + sizetmp--; + Size--; + + if((sizetmp == 0)&&(Size!=0)) + { + /* Wait until TXE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + sizetmp = Size; + } + } + + }while(Size > 0); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is set */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receives in master mode an amount of data in blocking mode. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Receive(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint32_t sizetmp = 0; + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MASTER_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + /* Size > 255, need to set RELOAD bit */ + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_READ); + sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_READ); + sizetmp = Size; + } + + do + { + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_RXNE, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Write data to RXDR */ + (*pData++) =hfmpi2c->Instance->RXDR; + sizetmp--; + Size--; + + if((sizetmp == 0)&&(Size!=0)) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + sizetmp = Size; + } + } + + }while(Size > 0); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is set */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmits in slave mode an amount of data in blocking mode. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit(FMPI2C_HandleTypeDef *hfmpi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_SLAVE_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hfmpi2c->Instance->CR2 &= ~FMPI2C_CR2_NACK; + + /* Wait until ADDR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_ADDR, RESET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_ADDR); + + /* If 10bit addressing mode is selected */ + if(hfmpi2c->Init.AddressingMode == FMPI2C_ADDRESSINGMODE_10BIT) + { + /* Wait until ADDR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_ADDR, RESET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_ADDR); + } + + /* Wait until DIR flag is set Transmitter mode */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_DIR, RESET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + do + { + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Read data from TXDR */ + hfmpi2c->Instance->TXDR = (*pData++); + Size--; + }while(Size > 0); + + /* Wait until STOP flag is set */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Normal use case for Transmitter mode */ + /* A NACK is generated to confirm the end of transfer */ + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Clear STOP flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_STOPF); + + /* Wait until BUSY flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_BUSY, SET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in slave mode an amount of data in blocking mode + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive(FMPI2C_HandleTypeDef *hfmpi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_SLAVE_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hfmpi2c->Instance->CR2 &= ~FMPI2C_CR2_NACK; + + /* Wait until ADDR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_ADDR, RESET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_ADDR); + + /* Wait until DIR flag is reset Receiver mode */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_DIR, SET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + while(Size > 0) + { + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnRXNEFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_TIMEOUT) + { + return HAL_TIMEOUT; + } + else + { + return HAL_ERROR; + } + } + + /* Read data from RXDR */ + (*pData++) = hfmpi2c->Instance->RXDR; + Size--; + } + + /* Wait until STOP flag is set */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Clear STOP flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_STOPF); + + /* Wait until BUSY flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_BUSY, SET, Timeout) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in master mode an amount of data in no-blocking mode with Interrupt + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MASTER_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_WRITE); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_WRITE); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Note : The FMPI2C interrupts must be enabled after unlocking current process + to avoid the risk of FMPI2C interrupt handle execution before current + process unlock */ + + + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */ + __HAL_FMPI2C_ENABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_TXI ); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in master mode an amount of data in no-blocking mode with Interrupt + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Receive_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MASTER_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_READ); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_READ); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Note : The FMPI2C interrupts must be enabled after unlocking current process + to avoid the risk of FMPI2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, RXI interrupt */ + /* possible to enable all of these */ + /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */ + __HAL_FMPI2C_ENABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI | FMPI2C_IT_STOPI | FMPI2C_IT_NACKI | FMPI2C_IT_RXI ); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in slave mode an amount of data in no-blocking mode with Interrupt + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_SLAVE_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hfmpi2c->Instance->CR2 &= ~FMPI2C_CR2_NACK; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferSize = Size; + hfmpi2c->XferCount = Size; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Note : The FMPI2C interrupts must be enabled after unlocking current process + to avoid the risk of FMPI2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */ + __HAL_FMPI2C_ENABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI | FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_TXI ); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in slave mode an amount of data in no-blocking mode with Interrupt + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_SLAVE_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hfmpi2c->Instance->CR2 &= ~FMPI2C_CR2_NACK; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferSize = Size; + hfmpi2c->XferCount = Size; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Note : The FMPI2C interrupts must be enabled after unlocking current process + to avoid the risk of FMPI2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, RXI interrupt */ + /* possible to enable all of these */ + /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */ + __HAL_FMPI2C_ENABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI | FMPI2C_IT_STOPI | FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in master mode an amount of data in no-blocking mode with DMA + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_DMA(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MASTER_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Set the FMPI2C DMA transfer complete callback */ + hfmpi2c->hdmatx->XferCpltCallback = FMPI2C_DMAMasterTransmitCplt; + + /* Set the DMA error callback */ + hfmpi2c->hdmatx->XferErrorCallback = FMPI2C_DMAError; + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmatx, (uint32_t)pData, (uint32_t)&hfmpi2c->Instance->TXDR, hfmpi2c->XferSize); + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_WRITE); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_WRITE); + } + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_TXIS) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_TXDMAEN; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in master mode an amount of data in no-blocking mode with DMA + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Receive_DMA(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MASTER_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Set the FMPI2C DMA transfer complete callback */ + hfmpi2c->hdmarx->XferCpltCallback = FMPI2C_DMAMasterReceiveCplt; + + /* Set the DMA error callback */ + hfmpi2c->hdmarx->XferErrorCallback = FMPI2C_DMAError; + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmarx, (uint32_t)&hfmpi2c->Instance->RXDR, (uint32_t)pData, hfmpi2c->XferSize); + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_READ); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_READ); + } + + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_RXNE, RESET, FMPI2C_TIMEOUT_RXNE) != HAL_OK) + { + return HAL_TIMEOUT; + } + + + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_RXDMAEN; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in slave mode an amount of data in no-blocking mode with DMA + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit_DMA(FMPI2C_HandleTypeDef *hfmpi2c, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_SLAVE_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + hfmpi2c->XferSize = Size; + + /* Set the FMPI2C DMA transfer complete callback */ + hfmpi2c->hdmatx->XferCpltCallback = FMPI2C_DMASlaveTransmitCplt; + + /* Set the DMA error callback */ + hfmpi2c->hdmatx->XferErrorCallback = FMPI2C_DMAError; + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmatx, (uint32_t)pData, (uint32_t)&hfmpi2c->Instance->TXDR, hfmpi2c->XferSize); + + /* Enable Address Acknowledge */ + hfmpi2c->Instance->CR2 &= ~FMPI2C_CR2_NACK; + + /* Wait until ADDR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_ADDR, RESET, FMPI2C_TIMEOUT_ADDR) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_ADDR); + + /* If 10bits addressing mode is selected */ + if(hfmpi2c->Init.AddressingMode == FMPI2C_ADDRESSINGMODE_10BIT) + { + /* Wait until ADDR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_ADDR, RESET, FMPI2C_TIMEOUT_ADDR) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_ADDR); + } + + /* Wait until DIR flag is set Transmitter mode */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_DIR, RESET, FMPI2C_TIMEOUT_BUSY) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_TXDMAEN; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in slave mode an amount of data in no-blocking mode with DMA + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive_DMA(FMPI2C_HandleTypeDef *hfmpi2c, uint8_t *pData, uint16_t Size) +{ + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_SLAVE_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferSize = Size; + hfmpi2c->XferCount = Size; + + /* Set the FMPI2C DMA transfer complete callback */ + hfmpi2c->hdmarx->XferCpltCallback = FMPI2C_DMASlaveReceiveCplt; + + /* Set the DMA error callback */ + hfmpi2c->hdmarx->XferErrorCallback = FMPI2C_DMAError; + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmarx, (uint32_t)&hfmpi2c->Instance->RXDR, (uint32_t)pData, Size); + + /* Enable Address Acknowledge */ + hfmpi2c->Instance->CR2 &= ~FMPI2C_CR2_NACK; + + /* Wait until ADDR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_ADDR, RESET, FMPI2C_TIMEOUT_ADDR) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_ADDR); + + /* Wait until DIR flag is set Receiver mode */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_DIR, SET, FMPI2C_TIMEOUT_DIR) != HAL_OK) + { + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + return HAL_TIMEOUT; + } + + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_RXDMAEN; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @brief Write an amount of data in blocking mode to a specific memory address + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Mem_Write(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint32_t Sizetmp = 0; + + /* Check the parameters */ + assert_param(IS_FMPI2C_MEMADD_SIZE(MemAddSize)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MEM_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Send Slave Address and Memory Address */ + if(FMPI2C_RequestMemoryWrite(hfmpi2c, DevAddress, MemAddress, MemAddSize, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_ERROR; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + + /* Set NBYTES to write and reload if size > 255 */ + /* Size > 255, need to set RELOAD bit */ + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + Sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + Sizetmp = Size; + } + + do + { + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Write data to DR */ + hfmpi2c->Instance->TXDR = (*pData++); + Sizetmp--; + Size--; + + if((Sizetmp == 0)&&(Size!=0)) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + Sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + Sizetmp = Size; + } + } + + }while(Size > 0); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Read an amount of data in blocking mode from a specific memory address + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Mem_Read(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint32_t Sizetmp = 0; + + /* Check the parameters */ + assert_param(IS_FMPI2C_MEMADD_SIZE(MemAddSize)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MEM_BUSY_RX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + /* Send Slave Address and Memory Address */ + if(FMPI2C_RequestMemoryRead(hfmpi2c, DevAddress, MemAddress, MemAddSize, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_ERROR; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + /* Size > 255, need to set RELOAD bit */ + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_READ); + Sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_READ); + Sizetmp = Size; + } + + do + { + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_RXNE, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Read data from RXDR */ + (*pData++) = hfmpi2c->Instance->RXDR; + + /* Decrement the Size counter */ + Sizetmp--; + Size--; + + if((Sizetmp == 0)&&(Size!=0)) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + if(Size > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + Sizetmp = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,Size, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + Sizetmp = Size; + } + } + + }while(Size > 0); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @brief Write an amount of data in no-blocking mode with Interrupt to a specific memory address + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Mem_Write_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_MEMADD_SIZE(MemAddSize)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MEM_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Send Slave Address and Memory Address */ + if(FMPI2C_RequestMemoryWrite(hfmpi2c, DevAddress, MemAddress, MemAddSize, FMPI2C_TIMEOUT_FLAG) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_ERROR; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + + /* Set NBYTES to write and reload if size > 255 */ + /* Size > 255, need to set RELOAD bit */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Note : The FMPI2C interrupts must be enabled after unlocking current process + to avoid the risk of FMPI2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */ + __HAL_FMPI2C_ENABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_TXI ); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Read an amount of data in no-blocking mode with Interrupt from a specific memory address + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Mem_Read_IT(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_MEMADD_SIZE(MemAddSize)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MEM_BUSY_RX; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Send Slave Address and Memory Address */ + if(FMPI2C_RequestMemoryRead(hfmpi2c, DevAddress, MemAddress, MemAddSize, FMPI2C_TIMEOUT_FLAG) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_ERROR; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + /* Size > 255, need to set RELOAD bit */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_READ); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_READ); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Note : The FMPI2C interrupts must be enabled after unlocking current process + to avoid the risk of FMPI2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, RXI interrupt */ + /* possible to enable all of these */ + /* FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI */ + __HAL_FMPI2C_ENABLE_IT(hfmpi2c, FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_RXI ); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @brief Write an amount of data in no-blocking mode with DMA to a specific memory address + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Mem_Write_DMA(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_MEMADD_SIZE(MemAddSize)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MEM_BUSY_TX; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Set the FMPI2C DMA transfer complete callback */ + hfmpi2c->hdmatx->XferCpltCallback = FMPI2C_DMAMemTransmitCplt; + + /* Set the DMA error callback */ + hfmpi2c->hdmatx->XferErrorCallback = FMPI2C_DMAError; + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmatx, (uint32_t)pData, (uint32_t)&hfmpi2c->Instance->TXDR, hfmpi2c->XferSize); + + /* Send Slave Address and Memory Address */ + if(FMPI2C_RequestMemoryWrite(hfmpi2c, DevAddress, MemAddress, MemAddSize, FMPI2C_TIMEOUT_FLAG) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_ERROR; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + } + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_TXIS) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_TXDMAEN; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Reads an amount of data in no-blocking mode with DMA from a specific memory address. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be read + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_Mem_Read_DMA(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_MEMADD_SIZE(MemAddSize)); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_MEM_BUSY_RX; + + hfmpi2c->pBuffPtr = pData; + hfmpi2c->XferCount = Size; + if(Size > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = Size; + } + + /* Set the FMPI2C DMA transfer complete callback */ + hfmpi2c->hdmarx->XferCpltCallback = FMPI2C_DMAMemReceiveCplt; + + /* Set the DMA error callback */ + hfmpi2c->hdmarx->XferErrorCallback = FMPI2C_DMAError; + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmarx, (uint32_t)&hfmpi2c->Instance->RXDR, (uint32_t)pData, hfmpi2c->XferSize); + + /* Send Slave Address and Memory Address */ + if(FMPI2C_RequestMemoryRead(hfmpi2c, DevAddress, MemAddress, MemAddSize, FMPI2C_TIMEOUT_FLAG) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_ERROR; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + + /* Set NBYTES to write and reload if size > 255 and generate RESTART */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_READ); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_GENERATE_START_READ); + } + + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_RXNE, RESET, FMPI2C_TIMEOUT_RXNE) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_RXDMAEN; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Checks if target device is ready for communication. + * @note This function is used with Memory devices + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param Trials: Number of trials + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2C_IsDeviceReady(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout) +{ + uint32_t tickstart = 0; + + __IO uint32_t FMPI2C_Trials = 0; + + if(hfmpi2c->State == HAL_FMPI2C_STATE_READY) + { + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + + do + { + /* Generate Start */ + hfmpi2c->Instance->CR2 = __HAL_FMPI2C_GENERATE_START(hfmpi2c->Init.AddressingMode,DevAddress); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is set or a NACK flag is set*/ + tickstart = HAL_GetTick(); + while((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == RESET) && (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == RESET) && (hfmpi2c->State != HAL_FMPI2C_STATE_TIMEOUT)) + { + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Device is ready */ + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + } + + /* Check if the NACKF flag has not been set */ + if (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == RESET) + { + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_STOPF, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Device is ready */ + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + } + else + { + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_STOPF, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Clear NACK Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Clear STOP Flag, auto generated with autoend*/ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + } + + /* Check if the maximum allowed number of trials has been reached */ + if (FMPI2C_Trials++ == Trials) + { + /* Generate Stop */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_STOP; + + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_STOPF, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + } + }while(FMPI2C_Trials < Trials); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_TIMEOUT; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief This function handles FMPI2C event interrupt request. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ +void HAL_FMPI2C_EV_IRQHandler(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* FMPI2C in mode Transmitter ---------------------------------------------------*/ + if (((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TXIS) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TCR) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TC) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_ADDR) == SET)) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, (FMPI2C_IT_TCI | FMPI2C_IT_STOPI | FMPI2C_IT_NACKI | FMPI2C_IT_TXI | FMPI2C_IT_ADDRI)) == SET)) + { + /* Slave mode selected */ + if (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_TX) + { + FMPI2C_SlaveTransmit_ISR(hfmpi2c); + } + } + + if (((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TXIS) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TCR) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TC) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET)) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, (FMPI2C_IT_TCI | FMPI2C_IT_STOPI | FMPI2C_IT_NACKI | FMPI2C_IT_TXI)) == SET)) + { + /* Master mode selected */ + if ((hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MEM_BUSY_TX)) + { + FMPI2C_MasterTransmit_ISR(hfmpi2c); + } + } + + /* FMPI2C in mode Receiver ----------------------------------------------------*/ + if (((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_RXNE) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TCR) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TC) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_ADDR) == SET)) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, (FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_RXI | FMPI2C_IT_ADDRI)) == SET)) + { + /* Slave mode selected */ + if (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_RX) + { + FMPI2C_SlaveReceive_ISR(hfmpi2c); + } + } + if (((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_RXNE) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TCR) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TC) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) || (__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET)) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, (FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_RXI)) == SET)) + { + /* Master mode selected */ + if ((hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_RX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MEM_BUSY_RX)) + { + FMPI2C_MasterReceive_ISR(hfmpi2c); + } + } +} + +/** + * @brief This function handles FMPI2C error interrupt request. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ +void HAL_FMPI2C_ER_IRQHandler(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* FMPI2C Bus error interrupt occurred ------------------------------------*/ + if((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_BERR) == SET) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, FMPI2C_IT_ERRI) == SET)) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_BERR; + + /* Clear BERR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_BERR); + } + + /* FMPI2C Over-Run/Under-Run interrupt occurred ----------------------------------------*/ + if((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_OVR) == SET) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, FMPI2C_IT_ERRI) == SET)) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_OVR; + + /* Clear OVR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_OVR); + } + + /* FMPI2C Arbitration Loss error interrupt occurred -------------------------------------*/ + if((__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_ARLO) == SET) && (__HAL_FMPI2C_GET_IT_SOURCE(hfmpi2c, FMPI2C_IT_ERRI) == SET)) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_ARLO; + + /* Clear ARLO flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_ARLO); + } + + /* Call the Error Callback in case of Error detected */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } +} + +/** + * @brief Master Tx Transfer completed callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ + __weak void HAL_FMPI2C_MasterTxCpltCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_TxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Master Rx Transfer completed callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ +__weak void HAL_FMPI2C_MasterRxCpltCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_TxCpltCallback could be implemented in the user file + */ +} + +/** @brief Slave Tx Transfer completed callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ + __weak void HAL_FMPI2C_SlaveTxCpltCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_TxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Slave Rx Transfer completed callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ +__weak void HAL_FMPI2C_SlaveRxCpltCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_TxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Memory Tx Transfer completed callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ + __weak void HAL_FMPI2C_MemTxCpltCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_TxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Memory Rx Transfer completed callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ +__weak void HAL_FMPI2C_MemRxCpltCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_TxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief FMPI2C error callbacks. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval None + */ + __weak void HAL_FMPI2C_ErrorCallback(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FMPI2C_ErrorCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup FMPI2C_Exported_Functions_Group3 Peripheral State and Errors functions + * @brief Peripheral State and Errors functions + * +@verbatim + =============================================================================== + ##### Peripheral State and Errors functions ##### + =============================================================================== + [..] + This subsection permit to get in run-time the status of the peripheral + and the data flow. + +@endverbatim + * @{ + */ + +/** + * @brief Returns the FMPI2C state. + * @param hfmpi2c : FMPI2C handle + * @retval HAL state + */ +HAL_FMPI2C_StateTypeDef HAL_FMPI2C_GetState(FMPI2C_HandleTypeDef *hfmpi2c) +{ + return hfmpi2c->State; +} + +/** +* @brief Return the FMPI2C error code +* @param hfmpi2c : pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. +* @retval FMPI2C Error Code +*/ +uint32_t HAL_FMPI2C_GetError(FMPI2C_HandleTypeDef *hfmpi2c) +{ + return hfmpi2c->ErrorCode; +} + +/** + * @} + */ + +/** + * @brief Handle Interrupt Flags Master Transmit Mode + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_MasterTransmit_ISR(FMPI2C_HandleTypeDef *hfmpi2c) +{ + uint16_t DevAddress; + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TXIS) == SET) + { + /* Write data to TXDR */ + hfmpi2c->Instance->TXDR = (*hfmpi2c->pBuffPtr++); + hfmpi2c->XferSize--; + hfmpi2c->XferCount--; + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TCR) == SET) + { + if((hfmpi2c->XferSize == 0)&&(hfmpi2c->XferCount!=0)) + { + DevAddress = (hfmpi2c->Instance->CR2 & FMPI2C_CR2_SADD); + + if(hfmpi2c->XferCount > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + hfmpi2c->XferSize = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferCount, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + hfmpi2c->XferSize = hfmpi2c->XferCount; + } + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Wrong size Status regarding TCR flag event */ + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_SIZE; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TC) == SET) + { + if(hfmpi2c->XferCount == 0) + { + /* Generate Stop */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_STOP; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Wrong size Status regarding TCR flag event */ + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_SIZE; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) + { + /* Disable ERR, TC, STOP, NACK, TXI interrupt */ + __HAL_FMPI2C_DISABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_TXI ); + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_MEM_BUSY_TX) + { + HAL_FMPI2C_MemTxCpltCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_MasterTxCpltCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET) + { + /* Clear NACK Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief Handle Interrupt Flags Master Receive Mode + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_MasterReceive_ISR(FMPI2C_HandleTypeDef *hfmpi2c) +{ + uint16_t DevAddress; + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_RXNE) == SET) + { + /* Read data from RXDR */ + (*hfmpi2c->pBuffPtr++) = hfmpi2c->Instance->RXDR; + hfmpi2c->XferSize--; + hfmpi2c->XferCount--; + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TCR) == SET) + { + if((hfmpi2c->XferSize == 0)&&(hfmpi2c->XferCount!=0)) + { + DevAddress = (hfmpi2c->Instance->CR2 & FMPI2C_CR2_SADD); + + if(hfmpi2c->XferCount > 255) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,255, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + hfmpi2c->XferSize = 255; + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferCount, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + hfmpi2c->XferSize = hfmpi2c->XferCount; + } + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Wrong size Status regarding TCR flag event */ + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_SIZE; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TC) == SET) + { + if(hfmpi2c->XferCount == 0) + { + /* Generate Stop */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_STOP; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Wrong size Status regarding TCR flag event */ + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_SIZE; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) + { + /* Disable ERR, TC, STOP, NACK, TXI interrupt */ + __HAL_FMPI2C_DISABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_RXI ); + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + if(hfmpi2c->State == HAL_FMPI2C_STATE_MEM_BUSY_RX) + { + HAL_FMPI2C_MemRxCpltCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_MasterRxCpltCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET) + { + /* Clear NACK Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; + +} + +/** + * @brief Handle Interrupt Flags Slave Transmit Mode + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_SlaveTransmit_ISR(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* Process locked */ + __HAL_LOCK(hfmpi2c); + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) != RESET) + { + /* Check that FMPI2C transfer finished */ + /* if yes, normal usecase, a NACK is sent by the MASTER when Transfer is finished */ + /* Mean XferCount == 0*/ + /* So clear Flag NACKF only */ + if(hfmpi2c->XferCount == 0) + { + /* Clear NACK Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + } + else + { + /* if no, error usecase, a Non-Acknowledge of last Data is generated by the MASTER*/ + /* Clear NACK Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Set ErrorCode corresponding to a Non-Acknowledge */ + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + /* Call the Error callback to prevent upper layer */ + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_ADDR) == SET) + { + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_ADDR); + } + /* Check first if STOPF is set */ + /* to prevent a Write Data in TX buffer */ + /* which is stuck in TXDR until next */ + /* communication with Master */ + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) + { + /* Disable ERRI, TCI, STOPI, NACKI, ADDRI, RXI, TXI interrupt */ + __HAL_FMPI2C_DISABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_TXI ); + + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + HAL_FMPI2C_SlaveTxCpltCallback(hfmpi2c); + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TXIS) == SET) + { + /* Write data to TXDR only if XferCount not reach "0" */ + /* A TXIS flag can be set, during STOP treatment */ + if(hfmpi2c->XferCount > 0) + { + /* Write data to TXDR */ + hfmpi2c->Instance->TXDR = (*hfmpi2c->pBuffPtr++); + hfmpi2c->XferCount--; + } + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief Handle Interrupt Flags Slave Receive Mode + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_SlaveReceive_ISR(FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) != RESET) + { + /* Clear NACK Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_ADDR) == SET) + { + /* Clear ADDR flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_ADDR); + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_RXNE) == SET) + { + /* Read data from RXDR */ + (*hfmpi2c->pBuffPtr++) = hfmpi2c->Instance->RXDR; + hfmpi2c->XferSize--; + hfmpi2c->XferCount--; + } + else if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) + { + /* Disable ERRI, TCI, STOPI, NACKI, ADDRI, RXI, TXI interrupt */ + __HAL_FMPI2C_DISABLE_IT(hfmpi2c,FMPI2C_IT_ERRI | FMPI2C_IT_TCI| FMPI2C_IT_STOPI| FMPI2C_IT_NACKI | FMPI2C_IT_ADDRI | FMPI2C_IT_RXI | FMPI2C_IT_RXI ); + + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + HAL_FMPI2C_SlaveRxCpltCallback(hfmpi2c); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief Master sends target device address followed by internal memory address for write request. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_RequestMemoryWrite(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout) +{ + FMPI2C_TransferConfig(hfmpi2c,DevAddress,MemAddSize, FMPI2C_RELOAD_MODE, FMPI2C_GENERATE_START_WRITE); + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* If Memory address size is 8Bit */ + if(MemAddSize == FMPI2C_MEMADD_SIZE_8BIT) + { + /* Send Memory Address */ + hfmpi2c->Instance->TXDR = __HAL_FMPI2C_MEM_ADD_LSB(MemAddress); + } + /* If Memory address size is 16Bit */ + else + { + /* Send MSB of Memory Address */ + hfmpi2c->Instance->TXDR = __HAL_FMPI2C_MEM_ADD_MSB(MemAddress); + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Send LSB of Memory Address */ + hfmpi2c->Instance->TXDR = __HAL_FMPI2C_MEM_ADD_LSB(MemAddress); + } + + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + +return HAL_OK; +} + +/** + * @brief Master sends target device address followed by internal memory address for read request. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param DevAddress: Target device address + * @param MemAddress: Internal memory address + * @param MemAddSize: Size of internal memory address + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_RequestMemoryRead(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout) +{ + FMPI2C_TransferConfig(hfmpi2c,DevAddress,MemAddSize, FMPI2C_SOFTEND_MODE, FMPI2C_GENERATE_START_WRITE); + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* If Memory address size is 8Bit */ + if(MemAddSize == FMPI2C_MEMADD_SIZE_8BIT) + { + /* Send Memory Address */ + hfmpi2c->Instance->TXDR = __HAL_FMPI2C_MEM_ADD_LSB(MemAddress); + } + /* If Mememory address size is 16Bit */ + else + { + /* Send MSB of Memory Address */ + hfmpi2c->Instance->TXDR = __HAL_FMPI2C_MEM_ADD_MSB(MemAddress); + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, Timeout) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + return HAL_ERROR; + } + else + { + return HAL_TIMEOUT; + } + } + + /* Send LSB of Memory Address */ + hfmpi2c->Instance->TXDR = __HAL_FMPI2C_MEM_ADD_LSB(MemAddress); + } + + /* Wait until TC flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TC, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + return HAL_OK; +} + + +/** + * @brief DMA FMPI2C master transmit process complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void FMPI2C_DMAMasterTransmitCplt(DMA_HandleTypeDef *hdma) +{ + uint16_t DevAddress; + FMPI2C_HandleTypeDef* hfmpi2c = (FMPI2C_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + /* Check if last DMA request was done with RELOAD */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, FMPI2C_TIMEOUT_TCR) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_TXDMAEN; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + hfmpi2c->pBuffPtr += hfmpi2c->XferSize; + hfmpi2c->XferCount -= hfmpi2c->XferSize; + if(hfmpi2c->XferCount > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = hfmpi2c->XferCount; + } + + DevAddress = (hfmpi2c->Instance->CR2 & FMPI2C_CR2_SADD); + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmatx, (uint32_t)hfmpi2c->pBuffPtr, (uint32_t)&hfmpi2c->Instance->TXDR, hfmpi2c->XferSize); + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + } + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_TXIS) != HAL_OK) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_TXDMAEN; + } + } + } + else + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_TXDMAEN; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_MasterTxCpltCallback(hfmpi2c); + } + } +} + +/** + * @brief DMA FMPI2C slave transmit process complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void FMPI2C_DMASlaveTransmitCplt(DMA_HandleTypeDef *hdma) +{ + FMPI2C_HandleTypeDef* hfmpi2c = (FMPI2C_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + /* Wait until STOP flag is set */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + /* Normal Use case, a AF is generated by master */ + /* to inform slave the end of transfer */ + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c,FMPI2C_FLAG_STOPF); + + /* Wait until BUSY flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_BUSY, SET, FMPI2C_TIMEOUT_BUSY) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_TXDMAEN; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_SlaveTxCpltCallback(hfmpi2c); + } +} + +/** + * @brief DMA FMPI2C master receive process complete callback + * @param hdma: DMA handle + * @retval None + */ +static void FMPI2C_DMAMasterReceiveCplt(DMA_HandleTypeDef *hdma) +{ + FMPI2C_HandleTypeDef* hfmpi2c = (FMPI2C_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + uint16_t DevAddress; + + /* Check if last DMA request was done with RELOAD */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, FMPI2C_TIMEOUT_TCR) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_RXDMAEN; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + hfmpi2c->pBuffPtr += hfmpi2c->XferSize; + hfmpi2c->XferCount -= hfmpi2c->XferSize; + if(hfmpi2c->XferCount > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = hfmpi2c->XferCount; + } + + DevAddress = (hfmpi2c->Instance->CR2 & FMPI2C_CR2_SADD); + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmarx, (uint32_t)&hfmpi2c->Instance->RXDR, (uint32_t)hfmpi2c->pBuffPtr, hfmpi2c->XferSize); + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + } + + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_RXNE, RESET, FMPI2C_TIMEOUT_RXNE) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_RXDMAEN; + } + } + } + else + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_RXDMAEN; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_MasterRxCpltCallback(hfmpi2c); + } + } +} + +/** + * @brief DMA FMPI2C slave receive process complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void FMPI2C_DMASlaveReceiveCplt(DMA_HandleTypeDef *hdma) +{ + FMPI2C_HandleTypeDef* hfmpi2c = (FMPI2C_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOPF flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Wait until BUSY flag is reset */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_BUSY, SET, FMPI2C_TIMEOUT_BUSY) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_RXDMAEN; + + /* Disable Address Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_SlaveRxCpltCallback(hfmpi2c); + } +} + +/** + * @brief DMA FMPI2C Memory Write process complete callback + * @param hdma : DMA handle + * @retval None + */ +static void FMPI2C_DMAMemTransmitCplt(DMA_HandleTypeDef *hdma) +{ + uint16_t DevAddress; + FMPI2C_HandleTypeDef* hfmpi2c = ( FMPI2C_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Check if last DMA request was done with RELOAD */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, FMPI2C_TIMEOUT_TCR) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_TXDMAEN; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + hfmpi2c->pBuffPtr += hfmpi2c->XferSize; + hfmpi2c->XferCount -= hfmpi2c->XferSize; + if(hfmpi2c->XferCount > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = hfmpi2c->XferCount; + } + + DevAddress = (hfmpi2c->Instance->CR2 & FMPI2C_CR2_SADD); + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmatx, (uint32_t)hfmpi2c->pBuffPtr, (uint32_t)&hfmpi2c->Instance->TXDR, hfmpi2c->XferSize); + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + } + + /* Wait until TXIS flag is set */ + if(FMPI2C_WaitOnTXISFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_TXIS) != HAL_OK) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_TXDMAEN; + } + } + } + else + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_TXDMAEN; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_MemTxCpltCallback(hfmpi2c); + } + } +} + +/** + * @brief DMA FMPI2C Memory Read process complete callback + * @param hdma: DMA handle + * @retval None + */ +static void FMPI2C_DMAMemReceiveCplt(DMA_HandleTypeDef *hdma) +{ + FMPI2C_HandleTypeDef* hfmpi2c = ( FMPI2C_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + uint16_t DevAddress; + + /* Check if last DMA request was done with RELOAD */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + /* Wait until TCR flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_TCR, RESET, FMPI2C_TIMEOUT_TCR) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_RXDMAEN; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + hfmpi2c->pBuffPtr += hfmpi2c->XferSize; + hfmpi2c->XferCount -= hfmpi2c->XferSize; + if(hfmpi2c->XferCount > 255) + { + hfmpi2c->XferSize = 255; + } + else + { + hfmpi2c->XferSize = hfmpi2c->XferCount; + } + + DevAddress = (hfmpi2c->Instance->CR2 & FMPI2C_CR2_SADD); + + /* Enable the DMA channel */ + HAL_DMA_Start_IT(hfmpi2c->hdmarx, (uint32_t)&hfmpi2c->Instance->RXDR, (uint32_t)hfmpi2c->pBuffPtr, hfmpi2c->XferSize); + + /* Send Slave Address */ + /* Set NBYTES to write and reload if size > 255 */ + if( (hfmpi2c->XferSize == 255) && (hfmpi2c->XferSize < hfmpi2c->XferCount) ) + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_RELOAD_MODE, FMPI2C_NO_STARTSTOP); + } + else + { + FMPI2C_TransferConfig(hfmpi2c,DevAddress,hfmpi2c->XferSize, FMPI2C_AUTOEND_MODE, FMPI2C_NO_STARTSTOP); + } + + /* Wait until RXNE flag is set */ + if(FMPI2C_WaitOnFlagUntilTimeout(hfmpi2c, FMPI2C_FLAG_RXNE, RESET, FMPI2C_TIMEOUT_RXNE) != HAL_OK) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + /* Enable DMA Request */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_RXDMAEN; + } + } + } + else + { + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if(FMPI2C_WaitOnSTOPFlagUntilTimeout(hfmpi2c, FMPI2C_TIMEOUT_STOPF) != HAL_OK) + { + if(hfmpi2c->ErrorCode == HAL_FMPI2C_ERROR_AF) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_AF; + } + else + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + } + } + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + /* Disable DMA Request */ + hfmpi2c->Instance->CR1 &= ~FMPI2C_CR1_RXDMAEN; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Check if Errors has been detected during transfer */ + if(hfmpi2c->ErrorCode != HAL_FMPI2C_ERROR_NONE) + { + HAL_FMPI2C_ErrorCallback(hfmpi2c); + } + else + { + HAL_FMPI2C_MemRxCpltCallback(hfmpi2c); + } + } +} + +/** + * @brief DMA FMPI2C communication error callback. + * @param hdma : DMA handle + * @retval None + */ +static void FMPI2C_DMAError(DMA_HandleTypeDef *hdma) +{ + FMPI2C_HandleTypeDef* hfmpi2c = ( FMPI2C_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Disable Acknowledge */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_NACK; + + hfmpi2c->XferCount = 0; + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_DMA; + + HAL_FMPI2C_ErrorCallback(hfmpi2c); +} + +/** + * @brief This function handles FMPI2C Communication Timeout. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param Flag: specifies the FMPI2C flag to check. + * @param Status: The new Flag status (SET or RESET). + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_WaitOnFlagUntilTimeout(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t Flag, FlagStatus Status, uint32_t Timeout) +{ + uint32_t tickstart = HAL_GetTick(); + + /* Wait until flag is set */ + if(Status == RESET) + { + while(__HAL_FMPI2C_GET_FLAG(hfmpi2c, Flag) == RESET) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + } + } + else + { + while(__HAL_FMPI2C_GET_FLAG(hfmpi2c, Flag) != RESET) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + } + } + return HAL_OK; +} + +/** + * @brief This function handles FMPI2C Communication Timeout for specific usage of TXIS flag. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_WaitOnTXISFlagUntilTimeout(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t Timeout) +{ + uint32_t tickstart = HAL_GetTick(); + + while(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_TXIS) == RESET) + { + /* Check if a NACK is detected */ + if(FMPI2C_IsAcknowledgeFailed(hfmpi2c, Timeout) != HAL_OK) + { + return HAL_ERROR; + } + + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_TIMEOUT; + } + } + } + return HAL_OK; +} + +/** + * @brief This function handles FMPI2C Communication Timeout for specific usage of STOP flag. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_WaitOnSTOPFlagUntilTimeout(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t Timeout) +{ + uint32_t tickstart = 0x00; + tickstart = HAL_GetTick(); + + while(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == RESET) + { + /* Check if a NACK is detected */ + if(FMPI2C_IsAcknowledgeFailed(hfmpi2c, Timeout) != HAL_OK) + { + return HAL_ERROR; + } + + /* Check for the Timeout */ + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_TIMEOUT; + } + } + return HAL_OK; +} + +/** + * @brief This function handles FMPI2C Communication Timeout for specific usage of RXNE flag. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_WaitOnRXNEFlagUntilTimeout(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t Timeout) +{ + uint32_t tickstart = 0x00; + tickstart = HAL_GetTick(); + + while(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_RXNE) == RESET) + { + /* Check if a STOPF is detected */ + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == SET) + { + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_NONE; + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_ERROR; + } + + /* Check for the Timeout */ + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + hfmpi2c->ErrorCode |= HAL_FMPI2C_ERROR_TIMEOUT; + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_TIMEOUT; + } + } + return HAL_OK; +} + +/** + * @brief This function handles Acknowledge failed detection during an FMPI2C Communication. + * @param hfmpi2c : Pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2C. + * @param Timeout: Timeout duration + * @retval HAL status + */ +static HAL_StatusTypeDef FMPI2C_IsAcknowledgeFailed(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t Timeout) +{ + uint32_t tickstart = 0x00; + tickstart = HAL_GetTick(); + + if(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_AF) == SET) + { + /* Generate stop if necessary only in case of FMPI2C peripheral in MASTER mode */ + if((hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MEM_BUSY_TX) + || (hfmpi2c->State == HAL_FMPI2C_STATE_MEM_BUSY_RX)) + { + /* No need to generate the STOP condition if AUTOEND mode is enabled */ + /* Generate the STOP condition only in case of SOFTEND mode is enabled */ + if((hfmpi2c->Instance->CR2 & FMPI2C_AUTOEND_MODE) != FMPI2C_AUTOEND_MODE) + { + /* Generate Stop */ + hfmpi2c->Instance->CR2 |= FMPI2C_CR2_STOP; + } + } + + /* Wait until STOP Flag is reset */ + /* AutoEnd should be initiate after AF */ + while(__HAL_FMPI2C_GET_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF) == RESET) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + return HAL_TIMEOUT; + } + } + } + + /* Clear NACKF Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_AF); + + /* Clear STOP Flag */ + __HAL_FMPI2C_CLEAR_FLAG(hfmpi2c, FMPI2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + __HAL_FMPI2C_RESET_CR2(hfmpi2c); + + hfmpi2c->ErrorCode = HAL_FMPI2C_ERROR_AF; + hfmpi2c->State= HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_ERROR; + } + return HAL_OK; +} + +/** + * @brief Handles FMPI2Cx communication when starting transfer or during transfer (TC or TCR flag are set). + * @param hfmpi2c: FMPI2C handle. + * @param DevAddress: specifies the slave address to be programmed. + * @param Size: specifies the number of bytes to be programmed. + * This parameter must be a value between 0 and 255. + * @param Mode: new state of the FMPI2C START condition generation. + * This parameter can be one of the following values: + * @arg FMPI2C_RELOAD_MODE: Enable Reload mode . + * @arg FMPI2C_AUTOEND_MODE: Enable Automatic end mode. + * @arg FMPI2C_SOFTEND_MODE: Enable Software end mode. + * @param Request: new state of the FMPI2C START condition generation. + * This parameter can be one of the following values: + * @arg FMPI2C_NO_STARTSTOP: Don't Generate stop and start condition. + * @arg FMPI2C_GENERATE_STOP: Generate stop condition (Size should be set to 0). + * @arg FMPI2C_GENERATE_START_READ: Generate Restart for read request. + * @arg FMPI2C_GENERATE_START_WRITE: Generate Restart for write request. + * @retval None + */ +static void FMPI2C_TransferConfig(FMPI2C_HandleTypeDef *hfmpi2c, uint16_t DevAddress, uint8_t Size, uint32_t Mode, uint32_t Request) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_FMPI2C_ALL_INSTANCE(hfmpi2c->Instance)); + assert_param(IS_TRANSFER_MODE(Mode)); + assert_param(IS_TRANSFER_REQUEST(Request)); + + /* Get the CR2 register value */ + tmpreg = hfmpi2c->Instance->CR2; + + /* clear tmpreg specific bits */ + tmpreg &= (uint32_t)~((uint32_t)(FMPI2C_CR2_SADD | FMPI2C_CR2_NBYTES | FMPI2C_CR2_RELOAD | FMPI2C_CR2_AUTOEND | FMPI2C_CR2_RD_WRN | FMPI2C_CR2_START | FMPI2C_CR2_STOP)); + + /* update tmpreg */ + tmpreg |= (uint32_t)(((uint32_t)DevAddress & FMPI2C_CR2_SADD) | (((uint32_t)Size << 16 ) & FMPI2C_CR2_NBYTES) | \ + (uint32_t)Mode | (uint32_t)Request); + + /* update CR2 register */ + hfmpi2c->Instance->CR2 = tmpreg; +} + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ +#endif /* HAL_FMPI2C_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.h new file mode 100644 index 00000000000..7e5ef307f73 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c.h @@ -0,0 +1,577 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_fmpi2c.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of FMPI2C HAL module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_FMPI2C_H +#define __STM32F4xx_HAL_FMPI2C_H + +#ifdef __cplusplus + extern "C" { +#endif + +#if defined(STM32F446xx) + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup FMPI2C + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup FMPI2C_Exported_Types FMPI2C Exported Types + * @{ + */ + +/** + * @brief FMPI2C Configuration Structure definition + */ +typedef struct +{ + uint32_t Timing; /*!< Specifies the FMPI2C_TIMINGR_register value. + This parameter calculated by referring to FMPI2C initialization + section in Reference manual */ + + uint32_t OwnAddress1; /*!< Specifies the first device own address. + This parameter can be a 7-bit or 10-bit address. */ + + uint32_t AddressingMode; /*!< Specifies if 7-bit or 10-bit addressing mode is selected. + This parameter can be a value of @ref FMPI2C_addressing_mode */ + + uint32_t DualAddressMode; /*!< Specifies if dual addressing mode is selected. + This parameter can be a value of @ref FMPI2C_dual_addressing_mode */ + + uint32_t OwnAddress2; /*!< Specifies the second device own address if dual addressing mode is selected + This parameter can be a 7-bit address. */ + + uint32_t OwnAddress2Masks; /*!< Specifies the acknoledge mask address second device own address if dual addressing mode is selected + This parameter can be a value of @ref FMPI2C_own_address2_masks */ + + uint32_t GeneralCallMode; /*!< Specifies if general call mode is selected. + This parameter can be a value of @ref FMPI2C_general_call_addressing_mode */ + + uint32_t NoStretchMode; /*!< Specifies if nostretch mode is selected. + This parameter can be a value of @ref FMPI2C_nostretch_mode */ + +}FMPI2C_InitTypeDef; + +/** + * @brief HAL State structures definition + */ +typedef enum +{ + HAL_FMPI2C_STATE_RESET = 0x00, /*!< FMPI2C not yet initialized or disabled */ + HAL_FMPI2C_STATE_READY = 0x01, /*!< FMPI2C initialized and ready for use */ + HAL_FMPI2C_STATE_BUSY = 0x02, /*!< FMPI2C internal process is ongoing */ + HAL_FMPI2C_STATE_MASTER_BUSY_TX = 0x12, /*!< Master Data Transmission process is ongoing */ + HAL_FMPI2C_STATE_MASTER_BUSY_RX = 0x22, /*!< Master Data Reception process is ongoing */ + HAL_FMPI2C_STATE_SLAVE_BUSY_TX = 0x32, /*!< Slave Data Transmission process is ongoing */ + HAL_FMPI2C_STATE_SLAVE_BUSY_RX = 0x42, /*!< Slave Data Reception process is ongoing */ + HAL_FMPI2C_STATE_MEM_BUSY_TX = 0x52, /*!< Memory Data Transmission process is ongoing */ + HAL_FMPI2C_STATE_MEM_BUSY_RX = 0x62, /*!< Memory Data Reception process is ongoing */ + HAL_FMPI2C_STATE_TIMEOUT = 0x03, /*!< Timeout state */ + HAL_FMPI2C_STATE_ERROR = 0x04 /*!< Reception process is ongoing */ +}HAL_FMPI2C_StateTypeDef; + +/** + * @brief HAL FMPI2C Error Code structure definition + */ +typedef enum +{ + HAL_FMPI2C_ERROR_NONE = 0x00, /*!< No error */ + HAL_FMPI2C_ERROR_BERR = 0x01, /*!< BERR error */ + HAL_FMPI2C_ERROR_ARLO = 0x02, /*!< ARLO error */ + HAL_FMPI2C_ERROR_AF = 0x04, /*!< ACKF error */ + HAL_FMPI2C_ERROR_OVR = 0x08, /*!< OVR error */ + HAL_FMPI2C_ERROR_DMA = 0x10, /*!< DMA transfer error */ + HAL_FMPI2C_ERROR_TIMEOUT = 0x20, /*!< Timeout error */ + HAL_FMPI2C_ERROR_SIZE = 0x40 /*!< Size Management error */ +}HAL_FMPI2C_ErrorTypeDef; + +/** + * @brief FMPI2C handle Structure definition + */ +typedef struct +{ + FMPI2C_TypeDef *Instance; /*!< FMPI2C registers base address */ + + FMPI2C_InitTypeDef Init; /*!< FMPI2C communication parameters */ + + uint8_t *pBuffPtr; /*!< Pointer to FMPI2C transfer buffer */ + + uint16_t XferSize; /*!< FMPI2C transfer size */ + + __IO uint16_t XferCount; /*!< FMPI2C transfer counter */ + + DMA_HandleTypeDef *hdmatx; /*!< FMPI2C Tx DMA handle parameters */ + + DMA_HandleTypeDef *hdmarx; /*!< FMPI2C Rx DMA handle parameters */ + + HAL_LockTypeDef Lock; /*!< FMPI2C locking object */ + + __IO HAL_FMPI2C_StateTypeDef State; /*!< FMPI2C communication state */ + + __IO HAL_FMPI2C_ErrorTypeDef ErrorCode; /* FMPI2C Error code */ + +}FMPI2C_HandleTypeDef; +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup FMPI2C_Exported_Constants FMPI2C Exported Constants + * @{ + */ + +/** @defgroup FMPI2C_addressing_mode FMPI2C addressing mode + * @{ + */ +#define FMPI2C_ADDRESSINGMODE_7BIT ((uint32_t)0x00000001) +#define FMPI2C_ADDRESSINGMODE_10BIT ((uint32_t)0x00000002) + +/** + * @} + */ + +/** @defgroup FMPI2C_dual_addressing_mode FMPI2C dual addressing mode + * @{ + */ + +#define FMPI2C_DUALADDRESS_DISABLE ((uint32_t)0x00000000) +#define FMPI2C_DUALADDRESS_ENABLE FMPI2C_OAR2_OA2EN + +/** + * @} + */ + +/** @defgroup FMPI2C_own_address2_masks FMPI2C own address2 masks + * @{ + */ + +#define FMPI2C_OA2_NOMASK ((uint8_t)0x00) +#define FMPI2C_OA2_MASK01 ((uint8_t)0x01) +#define FMPI2C_OA2_MASK02 ((uint8_t)0x02) +#define FMPI2C_OA2_MASK03 ((uint8_t)0x03) +#define FMPI2C_OA2_MASK04 ((uint8_t)0x04) +#define FMPI2C_OA2_MASK05 ((uint8_t)0x05) +#define FMPI2C_OA2_MASK06 ((uint8_t)0x06) +#define FMPI2C_OA2_MASK07 ((uint8_t)0x07) + +/** + * @} + */ + +/** @defgroup FMPI2C_general_call_addressing_mode FMPI2C general call addressing mode + * @{ + */ +#define FMPI2C_GENERALCALL_DISABLE ((uint32_t)0x00000000) +#define FMPI2C_GENERALCALL_ENABLE FMPI2C_CR1_GCEN + +/** + * @} + */ + +/** @defgroup FMPI2C_nostretch_mode FMPI2C nostretch mode + * @{ + */ +#define FMPI2C_NOSTRETCH_DISABLE ((uint32_t)0x00000000) +#define FMPI2C_NOSTRETCH_ENABLE FMPI2C_CR1_NOSTRETCH + +/** + * @} + */ + +/** @defgroup FMPI2C_Memory_Address_Size FMPI2C Memory Address Size + * @{ + */ +#define FMPI2C_MEMADD_SIZE_8BIT ((uint32_t)0x00000001) +#define FMPI2C_MEMADD_SIZE_16BIT ((uint32_t)0x00000002) + +/** + * @} + */ + +/** @defgroup FMPI2C_ReloadEndMode_definition FMPI2C ReloadEndMode definition + * @{ + */ + +#define FMPI2C_RELOAD_MODE FMPI2C_CR2_RELOAD +#define FMPI2C_AUTOEND_MODE FMPI2C_CR2_AUTOEND +#define FMPI2C_SOFTEND_MODE ((uint32_t)0x00000000) + +/** + * @} + */ + +/** @defgroup FMPI2C_StartStopMode_definition FMPI2C StartStopMode definition + * @{ + */ + +#define FMPI2C_NO_STARTSTOP ((uint32_t)0x00000000) +#define FMPI2C_GENERATE_STOP FMPI2C_CR2_STOP +#define FMPI2C_GENERATE_START_READ (uint32_t)(FMPI2C_CR2_START | FMPI2C_CR2_RD_WRN) +#define FMPI2C_GENERATE_START_WRITE FMPI2C_CR2_START + +/** + * @} + */ + +/** @defgroup FMPI2C_Interrupt_configuration_definition FMPI2C Interrupt configuration definition + * @brief FMPI2C Interrupt definition + * Elements values convention: 0xXXXXXXXX + * - XXXXXXXX : Interrupt control mask + * @{ + */ +#define FMPI2C_IT_ERRI FMPI2C_CR1_ERRIE +#define FMPI2C_IT_TCI FMPI2C_CR1_TCIE +#define FMPI2C_IT_STOPI FMPI2C_CR1_STOPIE +#define FMPI2C_IT_NACKI FMPI2C_CR1_NACKIE +#define FMPI2C_IT_ADDRI FMPI2C_CR1_ADDRIE +#define FMPI2C_IT_RXI FMPI2C_CR1_RXIE +#define FMPI2C_IT_TXI FMPI2C_CR1_TXIE + +/** + * @} + */ + + +/** @defgroup FMPI2C_Flag_definition FMPI2C Flag definition + * @{ + */ + +#define FMPI2C_FLAG_TXE FMPI2C_ISR_TXE +#define FMPI2C_FLAG_TXIS FMPI2C_ISR_TXIS +#define FMPI2C_FLAG_RXNE FMPI2C_ISR_RXNE +#define FMPI2C_FLAG_ADDR FMPI2C_ISR_ADDR +#define FMPI2C_FLAG_AF FMPI2C_ISR_NACKF +#define FMPI2C_FLAG_STOPF FMPI2C_ISR_STOPF +#define FMPI2C_FLAG_TC FMPI2C_ISR_TC +#define FMPI2C_FLAG_TCR FMPI2C_ISR_TCR +#define FMPI2C_FLAG_BERR FMPI2C_ISR_BERR +#define FMPI2C_FLAG_ARLO FMPI2C_ISR_ARLO +#define FMPI2C_FLAG_OVR FMPI2C_ISR_OVR +#define FMPI2C_FLAG_PECERR FMPI2C_ISR_PECERR +#define FMPI2C_FLAG_TIMEOUT FMPI2C_ISR_TIMEOUT +#define FMPI2C_FLAG_ALERT FMPI2C_ISR_ALERT +#define FMPI2C_FLAG_BUSY FMPI2C_ISR_BUSY +#define FMPI2C_FLAG_DIR FMPI2C_ISR_DIR + +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup FMPI2C_Exported_Macros FMPI2C Exported Macros + * @{ + */ + +/** @brief Reset FMPI2C handle state + * @param __HANDLE__: specifies the FMPI2C Handle. + * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral. + * @retval None + */ +#define __HAL_FMPI2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_FMPI2C_STATE_RESET) + +/** @brief Enables or disables the specified FMPI2C interrupts. + * @param __HANDLE__: specifies the FMPI2C Handle. + * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral. + * @param __INTERRUPT__: specifies the interrupt source to enable or disable. + * This parameter can be one of the following values: + * @arg FMPI2C_IT_ERRI: Errors interrupt enable + * @arg FMPI2C_IT_TCI: Transfer complete interrupt enable + * @arg FMPI2C_IT_STOPI: STOP detection interrupt enable + * @arg FMPI2C_IT_NACKI: NACK received interrupt enable + * @arg FMPI2C_IT_ADDRI: Address match interrupt enable + * @arg FMPI2C_IT_RXI: RX interrupt enable + * @arg FMPI2C_IT_TXI: TX interrupt enable + * + * @retval None + */ + +#define __HAL_FMPI2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__)) +#define __HAL_FMPI2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__))) + +/** @brief Checks if the specified FMPI2C interrupt source is enabled or disabled. + * @param __HANDLE__: specifies the FMPI2C Handle. + * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral. + * @param __INTERRUPT__: specifies the FMPI2C interrupt source to check. + * This parameter can be one of the following values: + * @arg FMPI2C_IT_ERRI: Errors interrupt enable + * @arg FMPI2C_IT_TCI: Transfer complete interrupt enable + * @arg FMPI2C_IT_STOPI: STOP detection interrupt enable + * @arg FMPI2C_IT_NACKI: NACK received interrupt enable + * @arg FMPI2C_IT_ADDRI: Address match interrupt enable + * @arg FMPI2C_IT_RXI: RX interrupt enable + * @arg FMPI2C_IT_TXI: TX interrupt enable + * + * @retval The new state of __IT__ (TRUE or FALSE). + */ +#define __HAL_FMPI2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) + +/** @brief Checks whether the specified FMPI2C flag is set or not. + * @param __HANDLE__: specifies the FMPI2C Handle. + * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral. + * @param __FLAG__: specifies the flag to check. + * This parameter can be one of the following values: + * @arg FMPI2C_FLAG_TXE: Transmit data register empty + * @arg FMPI2C_FLAG_TXIS: Transmit interrupt status + * @arg FMPI2C_FLAG_RXNE: Receive data register not empty + * @arg FMPI2C_FLAG_ADDR: Address matched (slave mode) + * @arg FMPI2C_FLAG_AF: Acknowledge failure received flag + * @arg FMPI2C_FLAG_STOPF: STOP detection flag + * @arg FMPI2C_FLAG_TC: Transfer complete (master mode) + * @arg FMPI2C_FLAG_TCR: Transfer complete reload + * @arg FMPI2C_FLAG_BERR: Bus error + * @arg FMPI2C_FLAG_ARLO: Arbitration lost + * @arg FMPI2C_FLAG_OVR: Overrun/Underrun + * @arg FMPI2C_FLAG_PECERR: PEC error in reception + * @arg FMPI2C_FLAG_TIMEOUT: Timeout or Tlow detection flag + * @arg FMPI2C_FLAG_ALERT: SMBus alert + * @arg FMPI2C_FLAG_BUSY: Bus busy + * @arg FMPI2C_FLAG_DIR: Transfer direction (slave mode) + * + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_FMPI2C_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__) & FMPI2C_FLAG_MASK)) == ((__FLAG__) & FMPI2C_FLAG_MASK))) + +/** @brief Clears the FMPI2C pending flags which are cleared by writing 1 in a specific bit. + * @param __HANDLE__: specifies the FMPI2C Handle. + * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral. + * @param __FLAG__: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg FMPI2C_FLAG_ADDR: Address matched (slave mode) + * @arg FMPI2C_FLAG_AF: Acknowledge failure received flag + * @arg FMPI2C_FLAG_STOPF: STOP detection flag + * @arg FMPI2C_FLAG_BERR: Bus error + * @arg FMPI2C_FLAG_ARLO: Arbitration lost + * @arg FMPI2C_FLAG_OVR: Overrun/Underrun + * @arg FMPI2C_FLAG_PECERR: PEC error in reception + * @arg FMPI2C_FLAG_TIMEOUT: Timeout or Tlow detection flag + * @arg FMPI2C_FLAG_ALERT: SMBus alert + * + * @retval None + */ +#define __HAL_FMPI2C_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = ((__FLAG__) & FMPI2C_FLAG_MASK)) + + +#define __HAL_FMPI2C_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= FMPI2C_CR1_PE) +#define __HAL_FMPI2C_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~FMPI2C_CR1_PE) + +#define __HAL_FMPI2C_RESET_CR2(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= (uint32_t)~((uint32_t)(FMPI2C_CR2_SADD | FMPI2C_CR2_HEAD10R | FMPI2C_CR2_NBYTES | FMPI2C_CR2_RELOAD | FMPI2C_CR2_RD_WRN))) + +#define __HAL_FMPI2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00))) >> 8))) +#define __HAL_FMPI2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) + +#define __HAL_FMPI2C_GENERATE_START(__ADDMODE__,__ADDRESS__) (((__ADDMODE__) == FMPI2C_ADDRESSINGMODE_7BIT) ? (uint32_t)((((uint32_t)(__ADDRESS__) & (FMPI2C_CR2_SADD)) | (FMPI2C_CR2_START) | (FMPI2C_CR2_AUTOEND)) & (~FMPI2C_CR2_RD_WRN)) : \ + (uint32_t)((((uint32_t)(__ADDRESS__) & (FMPI2C_CR2_SADD)) | (FMPI2C_CR2_ADD10) | (FMPI2C_CR2_START)) & (~FMPI2C_CR2_RD_WRN))) + +#define IS_FMPI2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= (uint32_t)0x000003FF) +#define IS_FMPI2C_OWN_ADDRESS2(ADDRESS2) ((ADDRESS2) <= (uint16_t)0x00FF) + +/** + * @} + */ + +/* Include FMPI2C HAL Extension module */ +#include "stm32f4xx_hal_fmpi2c_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup FMPI2C_Exported_Functions + * @{ + */ + +/** @addtogroup FMPI2C_Exported_Functions_Group1 + * @{ + */ + +/* Initialization/de-initialization functions**********************************/ +HAL_StatusTypeDef HAL_FMPI2C_Init(FMPI2C_HandleTypeDef *hFMPI2C); +HAL_StatusTypeDef HAL_FMPI2C_DeInit (FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_MspInit(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_MspDeInit(FMPI2C_HandleTypeDef *hFMPI2C); + +/** + * @} + */ + +/** @addtogroup FMPI2C_Exported_Functions_Group2 + * @{ + */ + +/* I/O operation functions ***************************************************/ + /******* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_FMPI2C_Master_Receive(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_FMPI2C_Mem_Write(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_FMPI2C_Mem_Read(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_FMPI2C_IsDeviceReady(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout); + + /******* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Master_Receive_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Mem_Write_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Mem_Read_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size); + + /******* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Master_Receive_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Mem_Write_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_FMPI2C_Mem_Read_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size); + + /******* FMPI2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */ +void HAL_FMPI2C_EV_IRQHandler(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_ER_IRQHandler(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_MasterTxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_MasterRxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_SlaveTxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_SlaveRxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_MemTxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_MemRxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2C_ErrorCallback(FMPI2C_HandleTypeDef *hFMPI2C); +/** + * @} + */ + +/** @addtogroup FMPI2C_Exported_Functions_Group3 + * @{ + */ + +/* Peripheral State functions ************************************************/ +HAL_FMPI2C_StateTypeDef HAL_FMPI2C_GetState(FMPI2C_HandleTypeDef *hFMPI2C); +uint32_t HAL_FMPI2C_GetError(FMPI2C_HandleTypeDef *hFMPI2C); + +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup FMPI2C_Private_Constants FMPI2C Private Constants + * @{ + */ +#define FMPI2C_FLAG_MASK ((uint32_t)0x0001FFFF) +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup FMPI2C_Private_Macros FMPI2C Private Macros + * @{ + */ + +#define IS_FMPI2C_ADDRESSING_MODE(MODE) (((MODE) == FMPI2C_ADDRESSINGMODE_7BIT) || \ + ((MODE) == FMPI2C_ADDRESSINGMODE_10BIT)) + +#define IS_FMPI2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == FMPI2C_DUALADDRESS_DISABLE) || \ + ((ADDRESS) == FMPI2C_DUALADDRESS_ENABLE)) + +#define IS_FMPI2C_OWN_ADDRESS2_MASK(MASK) (((MASK) == FMPI2C_OA2_NOMASK) || \ + ((MASK) == FMPI2C_OA2_MASK01) || \ + ((MASK) == FMPI2C_OA2_MASK02) || \ + ((MASK) == FMPI2C_OA2_MASK03) || \ + ((MASK) == FMPI2C_OA2_MASK04) || \ + ((MASK) == FMPI2C_OA2_MASK05) || \ + ((MASK) == FMPI2C_OA2_MASK06) || \ + ((MASK) == FMPI2C_OA2_MASK07)) + +#define IS_FMPI2C_GENERAL_CALL(CALL) (((CALL) == FMPI2C_GENERALCALL_DISABLE) || \ + ((CALL) == FMPI2C_GENERALCALL_ENABLE)) + +#define IS_FMPI2C_NO_STRETCH(STRETCH) (((STRETCH) == FMPI2C_NOSTRETCH_DISABLE) || \ + ((STRETCH) == FMPI2C_NOSTRETCH_ENABLE)) + +#define IS_FMPI2C_MEMADD_SIZE(SIZE) (((SIZE) == FMPI2C_MEMADD_SIZE_8BIT) || \ + ((SIZE) == FMPI2C_MEMADD_SIZE_16BIT)) + +#define IS_TRANSFER_MODE(MODE) (((MODE) == FMPI2C_RELOAD_MODE) || \ + ((MODE) == FMPI2C_AUTOEND_MODE) || \ + ((MODE) == FMPI2C_SOFTEND_MODE)) + +#define IS_TRANSFER_REQUEST(REQUEST) (((REQUEST) == FMPI2C_GENERATE_STOP) || \ + ((REQUEST) == FMPI2C_GENERATE_START_READ) || \ + ((REQUEST) == FMPI2C_GENERATE_START_WRITE) || \ + ((REQUEST) == FMPI2C_NO_STARTSTOP)) + +/** + * @} + */ +/* Private functions ---------------------------------------------------------*/ +/** @defgroup FMPI2C_Private_Functions FMPI2C Private Functions + * @brief FMPI2C private functions + * @{ + */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ +#ifdef __cplusplus +} +#endif + + +#endif /* __STM32F4xx_HAL_FMPI2C_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.c new file mode 100644 index 00000000000..38e03b8a8a8 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.c @@ -0,0 +1,326 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_fmpi2c_ex.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Extended FMPI2C HAL module driver. + * + * This file provides firmware functions to manage the following + * functionalities of the Inter Integrated Circuit (FMPI2C) peripheral: + * + Extended Control methods + * + @verbatim + ============================================================================== + ##### FMPI2C peripheral extended features ##### + ============================================================================== + + [..] Comparing to other previous devices, the FMPI2C interface for STM32L4XX + devices contains the following additional features + + (+) Possibility to disable or enable Analog Noise Filter + (+) Use of a configured Digital Noise Filter + (+) Disable or enable wakeup from Stop mode + + ##### How to use this driver ##### + ============================================================================== + [..] This driver provides functions to configure Noise Filter + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @defgroup FMPI2CEx FMPI2CEx + * @brief FMPI2C HAL module driver + * @{ + */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + +#if defined(STM32F446xx) + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup FMPI2CEx_Exported_Functions FMPI2C Extended Exported Functions + * @{ + */ + + +/** @defgroup FMPI2CEx_Exported_Functions_Group1 Peripheral Control methods + * @brief management functions + * +@verbatim + =============================================================================== + ##### Extension features functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure Noise Filters + +@endverbatim + * @{ + */ + +/** + * @brief Configures FMPI2C Analog noise filter. + * @param hfmpi2c : pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2Cx peripheral. + * @param AnalogFilter : new state of the Analog filter. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2CEx_AnalogFilter_Config(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t AnalogFilter) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_ALL_INSTANCE(hfmpi2c->Instance)); + assert_param(IS_FMPI2C_ANALOG_FILTER(AnalogFilter)); + + if((hfmpi2c->State == HAL_FMPI2C_STATE_BUSY) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_RX) + || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_RX)) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + + /* Disable the selected FMPI2C peripheral */ + __HAL_FMPI2C_DISABLE(hfmpi2c); + + /* Reset FMPI2Cx ANOFF bit */ + hfmpi2c->Instance->CR1 &= ~(FMPI2C_CR1_ANFOFF); + + /* Set analog filter bit*/ + hfmpi2c->Instance->CR1 |= AnalogFilter; + + __HAL_FMPI2C_ENABLE(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief Configures FMPI2C Digital noise filter. + * @param hfmpi2c : pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2Cx peripheral. + * @param DigitalFilter : Coefficient of digital noise filter between 0x00 and 0x0F. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2CEx_DigitalFilter_Config(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t DigitalFilter) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_FMPI2C_ALL_INSTANCE(hfmpi2c->Instance)); + assert_param(IS_FMPI2C_DIGITAL_FILTER(DigitalFilter)); + + if((hfmpi2c->State == HAL_FMPI2C_STATE_BUSY) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_RX) + || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_RX)) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + + /* Disable the selected FMPI2C peripheral */ + __HAL_FMPI2C_DISABLE(hfmpi2c); + + /* Get the old register value */ + tmpreg = hfmpi2c->Instance->CR1; + + /* Reset FMPI2Cx DNF bits [11:8] */ + tmpreg &= ~(FMPI2C_CR1_DFN); + + /* Set FMPI2Cx DNF coefficient */ + tmpreg |= DigitalFilter << 8; + + /* Store the new register value */ + hfmpi2c->Instance->CR1 = tmpreg; + + __HAL_FMPI2C_ENABLE(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief Enables FMPI2C wakeup from stop mode. + * @param hfmpi2c : pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2Cx peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2CEx_EnableWakeUp (FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_ALL_INSTANCE(hfmpi2c->Instance)); + + if((hfmpi2c->State == HAL_FMPI2C_STATE_BUSY) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_RX) + || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_RX)) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + + /* Disable the selected FMPI2C peripheral */ + __HAL_FMPI2C_DISABLE(hfmpi2c); + + /* Enable wakeup from stop mode */ + hfmpi2c->Instance->CR1 |= FMPI2C_CR1_WUPEN; + + __HAL_FMPI2C_ENABLE(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + + +/** + * @brief Disables FMPI2C wakeup from stop mode. + * @param hfmpi2c : pointer to a FMPI2C_HandleTypeDef structure that contains + * the configuration information for the specified FMPI2Cx peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_FMPI2CEx_DisableWakeUp (FMPI2C_HandleTypeDef *hfmpi2c) +{ + /* Check the parameters */ + assert_param(IS_FMPI2C_ALL_INSTANCE(hfmpi2c->Instance)); + + if((hfmpi2c->State == HAL_FMPI2C_STATE_BUSY) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_MASTER_BUSY_RX) + || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_TX) || (hfmpi2c->State == HAL_FMPI2C_STATE_SLAVE_BUSY_RX)) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_BUSY; + + /* Disable the selected FMPI2C peripheral */ + __HAL_FMPI2C_DISABLE(hfmpi2c); + + /* Enable wakeup from stop mode */ + hfmpi2c->Instance->CR1 &= ~(FMPI2C_CR1_WUPEN); + + __HAL_FMPI2C_ENABLE(hfmpi2c); + + hfmpi2c->State = HAL_FMPI2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hfmpi2c); + + return HAL_OK; +} + +/** + * @brief Enable the FMPI2C1 fast mode plus driving capability. + * @param ConfigFastModePlus: selects the pin. + * This parameter can be one of the @ref FMPI2CEx_FastModePlus values + * @retval None + */ +void HAL_FMPI2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus) +{ + /* Check the parameter */ + assert_param(IS_FMPI2C_FASTMODEPLUS(ConfigFastModePlus)); + + /* Enable SYSCFG clock */ + __HAL_RCC_SYSCFG_CLK_ENABLE(); + + /* Enable fast mode plus driving capability for selected pin */ + SET_BIT(SYSCFG->CFGR, (uint32_t)ConfigFastModePlus); +} + +/** + * @brief Disable the FMPI2C1 fast mode plus driving capability. + * @param ConfigFastModePlus: selects the pin. + * This parameter can be one of the @ref FMPI2CEx_FastModePlus values + * @retval None + */ +void HAL_FMPI2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus) +{ + /* Check the parameter */ + assert_param(IS_FMPI2C_FASTMODEPLUS(ConfigFastModePlus)); + + /* Enable SYSCFG clock */ + __HAL_RCC_SYSCFG_CLK_ENABLE(); + + /* Disable fast mode plus driving capability for selected pin */ + CLEAR_BIT(SYSCFG->CFGR, (uint32_t)ConfigFastModePlus); +} + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ +#endif /* HAL_FMPI2C_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.h new file mode 100644 index 00000000000..57f05740122 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_fmpi2c_ex.h @@ -0,0 +1,151 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_fmpi2c_ex.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of FMPI2C HAL Extension module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_FMPI2C_EX_H +#define __STM32F4xx_HAL_FMPI2C_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +#if defined(STM32F446xx) + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup FMPI2CEx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup FMPI2CEx_Exported_Constants FMPI2C Exported Constants + * @{ + */ + +/** @defgroup FMPI2CEx_Analog_Filter FMPI2C Analog Filter + * @{ + */ +#define FMPI2C_ANALOGFILTER_ENABLE ((uint32_t)0x00000000) +#define FMPI2C_ANALOGFILTER_DISABLE FMPI2C_CR1_ANFOFF +/** + * @} + */ + +/** @defgroup FMPI2CEx_FastModePlus FMPI2C Fast Mode Plus + * @{ + */ +#define FMPI2C_FASTMODEPLUS_SCL SYSCFG_CFGR_FMPI2C1_SCL /*!< Enable Fast Mode Plus on FMPI2C1 SCL pins */ +#define FMPI2C_FASTMODEPLUS_SDA SYSCFG_CFGR_FMPI2C1_SDA /*!< Enable Fast Mode Plus on FMPI2C1 SDA pins */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup FMPI2CEx_Exported_Functions + * @{ + */ + +/** @addtogroup FMPI2CEx_Exported_Functions_Group1 + * @{ + */ +/* Peripheral Control functions ************************************************/ +HAL_StatusTypeDef HAL_FMPI2CEx_AnalogFilter_Config(FMPI2C_HandleTypeDef *hFMPI2C, uint32_t AnalogFilter); +HAL_StatusTypeDef HAL_FMPI2CEx_DigitalFilter_Config(FMPI2C_HandleTypeDef *hFMPI2C, uint32_t DigitalFilter); +HAL_StatusTypeDef HAL_FMPI2CEx_EnableWakeUp (FMPI2C_HandleTypeDef *hFMPI2C); +HAL_StatusTypeDef HAL_FMPI2CEx_DisableWakeUp (FMPI2C_HandleTypeDef *hFMPI2C); +void HAL_FMPI2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); +void HAL_FMPI2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Constants I2C Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Macros I2C Private Macros + * @{ + */ +#define IS_FMPI2C_ANALOG_FILTER(FILTER) (((FILTER) == FMPI2C_ANALOGFILTER_ENABLE) || \ + ((FILTER) == FMPI2C_ANALOGFILTER_DISABLE)) + +#define IS_FMPI2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000F) + +#define IS_FMPI2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (FMPI2C_FASTMODEPLUS_SCL)) == FMPI2C_FASTMODEPLUS_SCL) || \ + (((__CONFIG__) & (FMPI2C_FASTMODEPLUS_SDA)) == FMPI2C_FASTMODEPLUS_SDA)) +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_FMPI2C_EX_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.c index 1f5ffe57830..3ad1ac9c5ec 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_gpio.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief GPIO HAL module driver. * This file provides firmware functions to manage the following * functionalities of the General Purpose Input/Output (GPIO) peripheral: @@ -15,42 +15,43 @@ ##### GPIO Peripheral features ##### ============================================================================== [..] - (+) Each port bit of the general-purpose I/O (GPIO) ports can be individually - configured by software in several modes: - (++) Input mode - (++) Analog mode - (++) Output mode - (++) Alternate function mode - (++) External interrupt/event lines - - (+) During and just after reset, the alternate functions and external interrupt - lines are not active and the I/O ports are configured in input floating mode. - - (+) All GPIO pins have weak internal pull-up and pull-down resistors, which can be - activated or not. - - (+) In Output or Alternate mode, each IO can be configured on open-drain or push-pull - type and the IO speed can be selected depending on the VDD value. - - (+) The microcontroller IO pins are connected to onboard peripherals/modules through a - multiplexer that allows only one peripheral alternate function (AF) connected - to an IO pin at a time. In this way, there can be no conflict between peripherals - sharing the same IO pin. - - (+) All ports have external interrupt/event capability. To use external interrupt - lines, the port must be configured in input mode. All available GPIO pins are - connected to the 16 external interrupt/event lines from EXTI0 to EXTI15. - - (+) The external interrupt/event controller consists of up to 23 edge detectors - (16 lines are connected to GPIO) for generating event/interrupt requests (each - input line can be independently configured to select the type (interrupt or event) - and the corresponding trigger event (rising or falling or both). Each line can - also be masked independently. + Subject to the specific hardware characteristics of each I/O port listed in the datasheet, each + port bit of the General Purpose IO (GPIO) Ports, can be individually configured by software + in several modes: + (+) Input mode + (+) Analog mode + (+) Output mode + (+) Alternate function mode + (+) External interrupt/event lines + + [..] + During and just after reset, the alternate functions and external interrupt + lines are not active and the I/O ports are configured in input floating mode. + + [..] + All GPIO pins have weak internal pull-up and pull-down resistors, which can be + activated or not. + + [..] + In Output or Alternate mode, each IO can be configured on open-drain or push-pull + type and the IO speed can be selected depending on the VDD value. + + [..] + All ports have external interrupt/event capability. To use external interrupt + lines, the port must be configured in input mode. All available GPIO pins are + connected to the 16 external interrupt/event lines from EXTI0 to EXTI15. + + [..] + The external interrupt/event controller consists of up to 23 edge detectors + (16 lines are connected to GPIO) for generating event/interrupt requests (each + input line can be independently configured to select the type (interrupt or event) + and the corresponding trigger event (rising or falling or both). Each line can + also be masked independently. ##### How to use this driver ##### ============================================================================== [..] - (#) Enable the GPIO AHB clock using the following function: __GPIOx_CLK_ENABLE(). + (#) Enable the GPIO AHB clock using the following function: __HAL_RCC_GPIOx_CLK_ENABLE(). (#) Configure the GPIO pin(s) using HAL_GPIO_Init(). (++) Configure the IO mode using "Mode" member from GPIO_InitTypeDef structure @@ -74,6 +75,9 @@ (#) To set/reset the level of a pin configured in output mode use HAL_GPIO_WritePin()/HAL_GPIO_TogglePin(). + + (#) To lock pin configuration until next reset use HAL_GPIO_LockPin(). + (#) During and just after reset, the alternate functions are not active and the GPIO pins are configured in input floating mode (except JTAG @@ -91,7 +95,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -125,7 +129,7 @@ * @{ */ -/** @defgroup GPIO +/** @defgroup GPIO GPIO * @brief GPIO HAL module driver * @{ */ @@ -134,19 +138,9 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -#define GET_GPIO_SOURCE(__GPIOx__) \ -(((uint32_t)(__GPIOx__) == ((uint32_t)GPIOA_BASE))? (uint32_t)0 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x0400)))? (uint32_t)1 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x0800)))? (uint32_t)2 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x0C00)))? (uint32_t)3 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x1000)))? (uint32_t)4 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x1400)))? (uint32_t)5 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x1800)))? (uint32_t)6 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x1C00)))? (uint32_t)7 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x2000)))? (uint32_t)8 :\ - ((uint32_t)(__GPIOx__) == ((uint32_t)(GPIOA_BASE + 0x2400)))? (uint32_t)9 : (uint32_t)10) - +/** @addtogroup GPIO_Private_Constants GPIO Private Constants + * @{ + */ #define GPIO_MODE ((uint32_t)0x00000003) #define EXTI_MODE ((uint32_t)0x10000000) #define GPIO_MODE_IT ((uint32_t)0x00010000) @@ -156,26 +150,34 @@ #define GPIO_OUTPUT_TYPE ((uint32_t)0x00000010) #define GPIO_NUMBER ((uint32_t)16) +/** + * @} + */ +/* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup GPIO_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup GPIO_Exported_Functions GPIO Exported Functions * @{ */ -/** @defgroup GPIO_Group1 Initialization and de-initialization functions +/** @defgroup GPIO_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * -@verbatim +@verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== - + [..] + This section provides functions allowing to initialize and de-initialize the GPIOs + to be ready for use. + @endverbatim * @{ */ + /** * @brief Initializes the GPIOx peripheral according to the specified parameters in the GPIO_Init. * @param GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32F429X device or @@ -192,6 +194,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) uint32_t temp = 0x00; /* Check the parameters */ + assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); assert_param(IS_GPIO_PIN(GPIO_Init->Pin)); assert_param(IS_GPIO_MODE(GPIO_Init->Mode)); assert_param(IS_GPIO_PULL(GPIO_Init->Pull)); @@ -255,11 +258,11 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE) { /* Enable SYSCFG Clock */ - __SYSCFG_CLK_ENABLE(); + __HAL_RCC_SYSCFG_CLK_ENABLE(); temp = SYSCFG->EXTICR[position >> 2]; temp &= ~(((uint32_t)0x0F) << (4 * (position & 0x03))); - temp |= ((uint32_t)(GET_GPIO_SOURCE(GPIOx)) << (4 * (position & 0x03))); + temp |= ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4 * (position & 0x03))); SYSCFG->EXTICR[position >> 2] = temp; /* Clear EXTI line configuration */ @@ -315,6 +318,9 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) uint32_t iocurrent = 0x00; uint32_t tmp = 0x00; + /* Check the parameters */ + assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); + /* Configure the port pins */ for(position = 0; position < GPIO_NUMBER; position++) { @@ -326,7 +332,7 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) if(iocurrent == ioposition) { /*------------------------- GPIO Mode Configuration --------------------*/ - /* Configure IO Direction in Input Floting Mode */ + /* Configure IO Direction in Input Floating Mode */ GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (position * 2)); /* Configure the default Alternate Function in current IO */ @@ -338,21 +344,26 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) /* Configure the default value IO Output Type */ GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ; - /* Deactivate the Pull-up oand Pull-down resistor for the current IO */ + /* Deactivate the Pull-up and Pull-down resistor for the current IO */ GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2)); /*------------------------- EXTI Mode Configuration --------------------*/ - /* Configure the External Interrupt or event for the current IO */ - tmp = ((uint32_t)0x0F) << (4 * (position & 0x03)); - SYSCFG->EXTICR[position >> 2] &= ~tmp; - - /* Clear EXTI line configuration */ - EXTI->IMR &= ~((uint32_t)iocurrent); - EXTI->EMR &= ~((uint32_t)iocurrent); + tmp = SYSCFG->EXTICR[position >> 2]; + tmp &= (((uint32_t)0x0F) << (4 * (position & 0x03))); + if(tmp == ((uint32_t)(GET_GPIO_SOURCE(GPIOx)) << (4 * (position & 0x03)))) + { + /* Configure the External Interrupt or event for the current IO */ + tmp = ((uint32_t)0x0F) << (4 * (position & 0x03)); + SYSCFG->EXTICR[position >> 2] &= ~tmp; - /* Clear Rising Falling edge configuration */ - EXTI->RTSR &= ~((uint32_t)iocurrent); - EXTI->FTSR &= ~((uint32_t)iocurrent); + /* Clear EXTI line configuration */ + EXTI->IMR &= ~((uint32_t)iocurrent); + EXTI->EMR &= ~((uint32_t)iocurrent); + + /* Clear Rising Falling edge configuration */ + EXTI->RTSR &= ~((uint32_t)iocurrent); + EXTI->FTSR &= ~((uint32_t)iocurrent); + } } } } @@ -361,7 +372,7 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) * @} */ -/** @defgroup GPIO_Group2 IO operation functions +/** @defgroup GPIO_Exported_Functions_Group2 IO operation functions * @brief GPIO Read and Write * @verbatim @@ -424,11 +435,11 @@ void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState Pin if(PinState != GPIO_PIN_RESET) { - GPIOx->BSRRL = GPIO_Pin; + GPIOx->BSRR = GPIO_Pin; } else { - GPIOx->BSRRH = GPIO_Pin ; + GPIOx->BSRR = (uint32_t)GPIO_Pin << 16; } } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.h index 5fe59c10a94..0e9c6248f43 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_gpio.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of GPIO HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,9 +55,12 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup GPIO_Exported_Types GPIO Exported Types + * @{ + */ /** - * @brief GPIO Init structure definition + * @brief GPIO Init structure definition */ typedef struct { @@ -74,7 +77,7 @@ typedef struct This parameter can be a value of @ref GPIO_speed_define */ uint32_t Alternate; /*!< Peripheral to be connected to the selected pins. - This parameter can be a value of @ref GPIO_Alternat_function_selection */ + This parameter can be a value of @ref GPIO_Alternate_function_selection */ }GPIO_InitTypeDef; /** @@ -85,15 +88,17 @@ typedef enum GPIO_PIN_RESET = 0, GPIO_PIN_SET }GPIO_PinState; -#define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET)) +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup GPIO_Exported_Constants +/** @defgroup GPIO_Exported_Constants GPIO Exported Constants * @{ - */ + */ -/** @defgroup GPIO_pins_define +/** @defgroup GPIO_pins_define GPIO pins define * @{ */ #define GPIO_PIN_0 ((uint16_t)0x0001) /* Pin 0 selected */ @@ -115,13 +120,11 @@ typedef enum #define GPIO_PIN_All ((uint16_t)0xFFFF) /* All pins selected */ #define GPIO_PIN_MASK ((uint32_t)0x0000FFFF) /* PIN mask for assert test */ -#define IS_GPIO_PIN(PIN) (((PIN) & GPIO_PIN_MASK ) != (uint32_t)0x00) - /** * @} */ -/** @defgroup GPIO_mode_define +/** @defgroup GPIO_mode_define GPIO mode define * @brief GPIO Configuration Mode * Elements values convention: 0xX0yz00YZ * - X : GPIO mode or EXTI Mode @@ -146,24 +149,11 @@ typedef enum #define GPIO_MODE_EVT_RISING ((uint32_t)0x10120000) /*!< External Event Mode with Rising edge trigger detection */ #define GPIO_MODE_EVT_FALLING ((uint32_t)0x10220000) /*!< External Event Mode with Falling edge trigger detection */ #define GPIO_MODE_EVT_RISING_FALLING ((uint32_t)0x10320000) /*!< External Event Mode with Rising/Falling edge trigger detection */ - -#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_MODE_INPUT) ||\ - ((MODE) == GPIO_MODE_OUTPUT_PP) ||\ - ((MODE) == GPIO_MODE_OUTPUT_OD) ||\ - ((MODE) == GPIO_MODE_AF_PP) ||\ - ((MODE) == GPIO_MODE_AF_OD) ||\ - ((MODE) == GPIO_MODE_IT_RISING) ||\ - ((MODE) == GPIO_MODE_IT_FALLING) ||\ - ((MODE) == GPIO_MODE_IT_RISING_FALLING) ||\ - ((MODE) == GPIO_MODE_EVT_RISING) ||\ - ((MODE) == GPIO_MODE_EVT_FALLING) ||\ - ((MODE) == GPIO_MODE_EVT_RISING_FALLING) ||\ - ((MODE) == GPIO_MODE_ANALOG)) - /** * @} */ -/** @defgroup GPIO_speed_define + +/** @defgroup GPIO_speed_define GPIO speed define * @brief GPIO Output Maximum frequency * @{ */ @@ -171,23 +161,17 @@ typedef enum #define GPIO_SPEED_MEDIUM ((uint32_t)0x00000001) /*!< Medium speed */ #define GPIO_SPEED_FAST ((uint32_t)0x00000002) /*!< Fast speed */ #define GPIO_SPEED_HIGH ((uint32_t)0x00000003) /*!< High speed */ - -#define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_SPEED_LOW) || ((SPEED) == GPIO_SPEED_MEDIUM) || \ - ((SPEED) == GPIO_SPEED_FAST) || ((SPEED) == GPIO_SPEED_HIGH)) /** * @} */ - /** @defgroup GPIO_pull_define + /** @defgroup GPIO_pull_define GPIO pull define * @brief GPIO Pull-Up or Pull-Down Activation * @{ */ #define GPIO_NOPULL ((uint32_t)0x00000000) /*!< No Pull-up or Pull-down activation */ #define GPIO_PULLUP ((uint32_t)0x00000001) /*!< Pull-up activation */ #define GPIO_PULLDOWN ((uint32_t)0x00000002) /*!< Pull-down activation */ - -#define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \ - ((PULL) == GPIO_PULLDOWN)) /** * @} */ @@ -197,6 +181,9 @@ typedef enum */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup GPIO_Exported_Macros GPIO Exported Macros + * @{ + */ /** * @brief Checks whether the specified EXTI line flag is set or not. @@ -237,16 +224,32 @@ typedef enum * @retval None */ #define __HAL_GPIO_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__)) +/** + * @} + */ /* Include GPIO HAL Extension module */ #include "stm32f4xx_hal_gpio_ex.h" -/* Exported functions --------------------------------------------------------*/ -/* Initialization and de-initialization functions *******************************/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup GPIO_Exported_Functions + * @{ + */ + +/** @addtogroup GPIO_Exported_Functions_Group1 + * @{ + */ +/* Initialization and de-initialization functions *****************************/ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init); void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin); +/** + * @} + */ -/* IO operation functions *******************************************************/ +/** @addtogroup GPIO_Exported_Functions_Group2 + * @{ + */ +/* IO operation functions *****************************************************/ GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState); void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); @@ -261,6 +264,59 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin); /** * @} */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup GPIO_Private_Constants GPIO Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup GPIO_Private_Macros GPIO Private Macros + * @{ + */ +#define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET)) +#define IS_GPIO_PIN(PIN) (((PIN) & GPIO_PIN_MASK ) != (uint32_t)0x00) +#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_MODE_INPUT) ||\ + ((MODE) == GPIO_MODE_OUTPUT_PP) ||\ + ((MODE) == GPIO_MODE_OUTPUT_OD) ||\ + ((MODE) == GPIO_MODE_AF_PP) ||\ + ((MODE) == GPIO_MODE_AF_OD) ||\ + ((MODE) == GPIO_MODE_IT_RISING) ||\ + ((MODE) == GPIO_MODE_IT_FALLING) ||\ + ((MODE) == GPIO_MODE_IT_RISING_FALLING) ||\ + ((MODE) == GPIO_MODE_EVT_RISING) ||\ + ((MODE) == GPIO_MODE_EVT_FALLING) ||\ + ((MODE) == GPIO_MODE_EVT_RISING_FALLING) ||\ + ((MODE) == GPIO_MODE_ANALOG)) +#define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_SPEED_LOW) || ((SPEED) == GPIO_SPEED_MEDIUM) || \ + ((SPEED) == GPIO_SPEED_FAST) || ((SPEED) == GPIO_SPEED_HIGH)) +#define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \ + ((PULL) == GPIO_PULLDOWN)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup GPIO_Private_Functions GPIO Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ #ifdef __cplusplus } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio_ex.h index b89e4dc0338..41e7b75563a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_gpio_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_gpio_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of GPIO HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -50,23 +50,21 @@ * @{ */ -/** @addtogroup GPIO +/** @defgroup GPIOEx GPIOEx * @{ */ /* Exported types ------------------------------------------------------------*/ - /* Exported constants --------------------------------------------------------*/ - -/** @defgroup GPIO_Exported_Constants +/** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants * @{ - */ + */ -/** @defgroup GPIO_Alternat_function_selection +/** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection * @{ - */ + */ -/*------------------------- STM32F429xx/STM32F439xx---------------------------*/ +/*------------------------------------------ STM32F429xx/STM32F439xx --------------------------------------*/ #if defined (STM32F429xx) || defined (STM32F439xx) /** * @brief AF 0 selection @@ -110,6 +108,7 @@ */ #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */ #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */ @@ -181,30 +180,6 @@ * @brief AF 15 selection */ #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ - -#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ - ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ - ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ - ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ - ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ - ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ - ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ - ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ - ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ - ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ - ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ - ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ - ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ - ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ - ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ - ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ - ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ - ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ - ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ - ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ - ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \ - ((AF) == GPIO_AF14_LTDC)) - #endif /* STM32F429xx || STM32F439xx */ /*------------------------------------------------------------------------------------------*/ @@ -252,10 +227,13 @@ */ #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */ #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */ -#define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ +/** @brief GPIO_Legacy + */ +#define GPIO_AF5_I2S3ext GPIO_AF5_SPI3 /* I2S3ext_SD Alternate Function mapping */ /** * @brief AF 6 selection @@ -317,29 +295,6 @@ * @brief AF 15 selection */ #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ - -#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ - ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ - ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ - ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ - ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ - ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ - ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ - ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ - ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ - ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ - ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ - ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ - ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ - ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ - ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ - ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ - ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ - ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ - ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ - ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ - ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1)) - #endif /* STM32F427xx || STM32F437xx */ /*------------------------------------------------------------------------------------------*/ @@ -446,26 +401,6 @@ * @brief AF 15 selection */ #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ - -#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ - ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ - ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ - ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ - ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ - ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ - ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ - ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ - ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ - ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ - ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ - ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ - ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ - ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ - ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ - ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ - ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ - ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) - #endif /* STM32F407xx || STM32F417xx */ /*------------------------------------------------------------------------------------------*/ @@ -519,7 +454,7 @@ * @brief AF 6 selection */ #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ -#define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ +#define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ /** * @brief AF 7 selection @@ -562,25 +497,6 @@ * @brief AF 15 selection */ #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ - -#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ - ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ - ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ - ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ - ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ - ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ - ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ - ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ - ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ - ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ - ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ - ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ - ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ - ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ - ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ - ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \ - ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) - #endif /* STM32F405xx || STM32F415xx */ /*------------------------------------------------------------------------------------------*/ @@ -671,21 +587,6 @@ * @brief AF 15 selection */ #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ - -#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ - ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ - ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ - ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ - ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ - ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \ - ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \ - ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \ - ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \ - ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ - ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \ - ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \ - ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT)) - #endif /* STM32F401xC || STM32F401xE */ /*------------------------------------------------------------------------------------------*/ @@ -779,7 +680,342 @@ * @brief AF 15 selection */ #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ +#endif /* STM32F411xE */ +/*---------------------------------------- STM32F446xx -------------------------------------------*/ +#if defined (STM32F446xx) +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ + +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ +#define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ +#define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ +#define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ +#define GPIO_AF3_CEC ((uint8_t)0x03) /* CEC Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ +#define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ +#define GPIO_AF4_FMPI2C1 ((uint8_t)0x04) /* FMPI2C1 Alternate Function mapping */ +#define GPIO_AF4_CEC ((uint8_t)0x04) /* CEC Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ + +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_SPI4 ((uint8_t)0x06) /* SPI4 Alternate Function mapping */ +#define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_UART5 ((uint8_t)0x07) /* UART5 Alternate Function mapping */ +#define GPIO_AF7_SPI2 ((uint8_t)0x07) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF7_SPDIFRX ((uint8_t)0x07) /* SPDIFRX Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ +#define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ +#define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ +#define GPIO_AF8_SPDIFRX ((uint8_t)0x08) /* SPDIFRX Alternate Function mapping */ +#define GPIO_AF8_SAI2 ((uint8_t)0x08) /* SAI2 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ +#define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */ +#define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ +#define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ +#define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ +#define GPIO_AF9_QSPI ((uint8_t)0x09) /* QSPI Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ +#define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */ +#define GPIO_AF10_SAI2 ((uint8_t)0xA) /* SAI2 Alternate Function mapping */ +#define GPIO_AF10_QSPI ((uint8_t)0xA) /* QSPI Alternate Function mapping */ + +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ +#define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */ +#define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ + +/** + * @brief AF 13 selection + */ +#define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ + +#endif /* STM32F446xx */ + +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros + * @{ + */ +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions + * @{ + */ +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup GPIOEx_Private_Constants GPIO Private Constants + * @{ + */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup GPIOEx_Private_Macros GPIO Private Macros + * @{ + */ +/** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index + * @{ + */ +#if defined (STM32F405xx) || defined (STM32F415xx) || defined (STM32F407xx) || defined (STM32F417xx) +#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U :\ + ((__GPIOx__) == (GPIOE))? 4U :\ + ((__GPIOx__) == (GPIOF))? 5U :\ + ((__GPIOx__) == (GPIOG))? 6U :\ + ((__GPIOx__) == (GPIOH))? 7U :\ + ((__GPIOx__) == (GPIOI))? 8U : 9U) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ + +#if defined (STM32F427xx) || defined (STM32F437xx) || defined (STM32F429xx) || defined (STM32F439xx) +#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U :\ + ((__GPIOx__) == (GPIOE))? 4U :\ + ((__GPIOx__) == (GPIOF))? 5U :\ + ((__GPIOx__) == (GPIOG))? 6U :\ + ((__GPIOx__) == (GPIOH))? 7U :\ + ((__GPIOx__) == (GPIOI))? 8U :\ + ((__GPIOx__) == (GPIOJ))? 9U : 10U) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#if defined (STM32F401xC) || defined (STM32F401xE) || defined (STM32F411xE) +#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U :\ + ((__GPIOx__) == (GPIOE))? 4U : 5U) +#endif /* STM32F401xC || STM32F401xE || STM32F411xE */ + +#if defined (STM32F446xx) +#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U :\ + ((__GPIOx__) == (GPIOE))? 4U :\ + ((__GPIOx__) == (GPIOF))? 5U :\ + ((__GPIOx__) == (GPIOG))? 6U : 8U) +#endif /* STM32F446xx */ + +/** + * @} + */ + +/** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function + * @{ + */ +/*------------------------- STM32F429xx/STM32F439xx---------------------------*/ +#if defined (STM32F429xx) || defined (STM32F439xx) +#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ + ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ + ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ + ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ + ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ + ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ + ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ + ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ + ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ + ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ + ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ + ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ + ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ + ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ + ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ + ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ + ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ + ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ + ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ + ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ + ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \ + ((AF) == GPIO_AF14_LTDC)) + +#endif /* STM32F429xx || STM32F439xx */ +/*------------------------------------------------------------------------------------------*/ + +/*---------------------------------- STM32F427xx/STM32F437xx--------------------------------*/ +#if defined (STM32F427xx) || defined (STM32F437xx) +#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ + ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ + ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ + ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ + ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ + ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ + ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ + ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ + ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ + ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ + ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ + ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ + ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ + ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ + ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ + ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ + ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ + ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ + ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ + ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ + ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1)) + +#endif /* STM32F427xx || STM32F437xx */ +/*------------------------------------------------------------------------------------------*/ + +/*---------------------------------- STM32F407xx/STM32F417xx--------------------------------*/ +#if defined (STM32F407xx) || defined (STM32F417xx) +#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ + ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ + ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ + ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ + ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ + ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ + ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ + ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ + ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ + ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ + ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ + ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ + ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ + ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ + ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ + ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ + ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ + ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) + +#endif /* STM32F407xx || STM32F417xx */ +/*------------------------------------------------------------------------------------------*/ + +/*---------------------------------- STM32F405xx/STM32F415xx--------------------------------*/ +#if defined (STM32F405xx) || defined (STM32F415xx) +#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ + ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ + ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ + ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ + ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ + ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ + ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ + ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ + ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ + ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ + ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ + ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ + ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ + ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ + ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ + ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \ + ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) + +#endif /* STM32F405xx || STM32F415xx */ + +/*------------------------------------------------------------------------------------------*/ + +/*---------------------------------------- STM32F401xx--------------------------------------*/ +#if defined(STM32F401xC) || defined(STM32F401xE) +#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ + ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ + ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ + ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ + ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ + ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \ + ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \ + ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \ + ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \ + ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ + ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \ + ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \ + ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT)) + +#endif /* STM32F401xC || STM32F401xE */ +/*------------------------------------------------------------------------------------------*/ +/*---------------------------------------- STM32F411xx--------------------------------------*/ +#if defined(STM32F411xE) #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ @@ -797,6 +1033,39 @@ ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT)) #endif /* STM32F411xE */ +/*----------------------------------------------------------------------------------------------------*/ + +/*----------------------------------------------- STM32F446xx ----------------------------------------*/ +#if defined(STM32F446xx) +#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ + ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ + ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ + ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ + ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ + ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ + ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ + ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ + ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ + ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ + ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ + ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ + ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ + ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ + ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ + ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ + ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ + ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ + ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \ + ((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \ + ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF6_SPI2) || \ + ((AF) == GPIO_AF6_SPI4) || ((AF) == GPIO_AF7_UART5) || \ + ((AF) == GPIO_AF7_SPI2) || ((AF) == GPIO_AF7_SPI3) || \ + ((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \ + ((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF9_QSPI) || \ + ((AF) == GPIO_AF10_SAI2) || ((AF) == GPIO_AF10_QSPI)) + +#endif /* STM32F446xx */ + /** * @} */ @@ -805,9 +1074,14 @@ * @} */ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions --------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +/** @defgroup GPIOEx_Private_Functions GPIO Private Functions + * @{ + */ +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.c index 7c2dfcca8f5..95165aa6f6c 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_hash.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief HASH HAL module driver. * This file provides firmware functions to manage the following * functionalities of the HASH peripheral: @@ -20,7 +20,7 @@ [..] The HASH HAL driver can be used as follows: (#)Initialize the HASH low level resources by implementing the HAL_HASH_MspInit(): - (##) Enable the HASH interface clock using __HASH_CLK_ENABLE() + (##) Enable the HASH interface clock using __HAL_RCC_HASH_CLK_ENABLE() (##) In case of using processing APIs based on interrupts (e.g. HAL_HMAC_SHA1_Start_IT()) (+++) Configure the HASH interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the HASH IRQ handler using HAL_NVIC_EnableIRQ() @@ -68,7 +68,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -102,7 +102,7 @@ * @{ */ -/** @defgroup HASH +/** @defgroup HASH HASH * @brief HASH HAL module driver. * @{ */ @@ -116,18 +116,208 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @defgroup HASH_Private_Functions HASH Private Functions + * @{ + */ static void HASH_DMAXferCplt(DMA_HandleTypeDef *hdma); static void HASH_DMAError(DMA_HandleTypeDef *hdma); static void HASH_GetDigest(uint8_t *pMsgDigest, uint8_t Size); static void HASH_WriteData(uint8_t *pInBuffer, uint32_t Size); - +/** + * @} + */ + /* Private functions ---------------------------------------------------------*/ +/** @addtogroup HASH_Private_Functions + * @{ + */ + +/** + * @brief DMA HASH Input Data complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void HASH_DMAXferCplt(DMA_HandleTypeDef *hdma) +{ + HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + uint32_t inputaddr = 0; + uint32_t buffersize = 0; + + if((HASH->CR & HASH_CR_MODE) != HASH_CR_MODE) + { + /* Disable the DMA transfer */ + HASH->CR &= (uint32_t)(~HASH_CR_DMAE); + + /* Change HASH peripheral state */ + hhash->State = HAL_HASH_STATE_READY; + + /* Call Input data transfer complete callback */ + HAL_HASH_InCpltCallback(hhash); + } + else + { + /* Increment Interrupt counter */ + hhash->HashInCount++; + /* Disable the DMA transfer before starting the next transfer */ + HASH->CR &= (uint32_t)(~HASH_CR_DMAE); + + if(hhash->HashInCount <= 2) + { + /* In case HashInCount = 1, set the DMA to transfer data to HASH DIN register */ + if(hhash->HashInCount == 1) + { + inputaddr = (uint32_t)hhash->pHashInBuffPtr; + buffersize = hhash->HashBuffSize; + } + /* In case HashInCount = 2, set the DMA to transfer key to HASH DIN register */ + else if(hhash->HashInCount == 2) + { + inputaddr = (uint32_t)hhash->Init.pKey; + buffersize = hhash->Init.KeySize; + } + /* Configure the number of valid bits in last word of the message */ + HASH->STR |= 8 * (buffersize % 4); + + /* Set the HASH DMA transfer complete */ + hhash->hdmain->XferCpltCallback = HASH_DMAXferCplt; + + /* Enable the DMA In DMA Stream */ + HAL_DMA_Start_IT(hhash->hdmain, inputaddr, (uint32_t)&HASH->DIN, (buffersize%4 ? (buffersize+3)/4:buffersize/4)); + + /* Enable DMA requests */ + HASH->CR |= (HASH_CR_DMAE); + } + else + { + /* Disable the DMA transfer */ + HASH->CR &= (uint32_t)(~HASH_CR_DMAE); + + /* Reset the InCount */ + hhash->HashInCount = 0; + + /* Change HASH peripheral state */ + hhash->State = HAL_HASH_STATE_READY; + + /* Call Input data transfer complete callback */ + HAL_HASH_InCpltCallback(hhash); + } + } +} + +/** + * @brief DMA HASH communication error callback. + * @param hdma: DMA handle + * @retval None + */ +static void HASH_DMAError(DMA_HandleTypeDef *hdma) +{ + HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + hhash->State= HAL_HASH_STATE_READY; + HAL_HASH_ErrorCallback(hhash); +} + +/** + * @brief Writes the input buffer in data register. + * @param pInBuffer: Pointer to input buffer + * @param Size: The size of input buffer + * @retval None + */ +static void HASH_WriteData(uint8_t *pInBuffer, uint32_t Size) +{ + uint32_t buffercounter; + uint32_t inputaddr = (uint32_t) pInBuffer; + + for(buffercounter = 0; buffercounter < Size; buffercounter+=4) + { + HASH->DIN = *(uint32_t*)inputaddr; + inputaddr+=4; + } +} + +/** + * @brief Provides the message digest result. + * @param pMsgDigest: Pointer to the message digest + * @param Size: The size of the message digest in bytes + * @retval None + */ +static void HASH_GetDigest(uint8_t *pMsgDigest, uint8_t Size) +{ + uint32_t msgdigest = (uint32_t)pMsgDigest; + + switch(Size) + { + case 16: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + break; + case 20: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); + break; + case 28: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); + break; + case 32: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[7]); + break; + default: + break; + } +} -/** @defgroup HASH_Private_Functions +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup HASH_Exported_Functions * @{ */ + -/** @defgroup HASH_Group1 Initialization and de-initialization functions +/** @addtogroup HASH_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions. * @verbatim @@ -165,6 +355,8 @@ HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash) if(hhash->State == HAL_HASH_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hhash->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_HASH_MspInit(hhash); } @@ -299,7 +491,7 @@ __weak void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash) * @} */ -/** @defgroup HASH_Group2 HASH processing functions using polling mode +/** @defgroup HASH_Exported_Functions_Group2 HASH processing functions using polling mode * @brief processing functions using polling mode * @verbatim @@ -344,7 +536,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuff { /* Select the MD5 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_MD5 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_MD5 | HASH_CR_INIT; } /* Set the phase */ @@ -417,7 +609,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pI { /* Select the MD5 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_MD5 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_MD5 | HASH_CR_INIT; } /* Set the phase */ @@ -466,7 +658,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuf { /* Select the SHA1 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA1 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA1 | HASH_CR_INIT; } /* Set the phase */ @@ -517,13 +709,11 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuf /** * @brief Initializes the HASH peripheral in SHA1 mode then processes pInBuffer. - The digest is available in pOutBuffer. * @param hhash: pointer to a HASH_HandleTypeDef structure that contains * the configuration information for HASH module * @param pInBuffer: Pointer to the input buffer (buffer to be hashed). * @param Size: Length of the input buffer in bytes. * If the Size is not multiple of 64 bytes, the padding is managed by hardware. - * @param pOutBuffer: Pointer to the computed digest. Its size must be 20 bytes. * @retval HAL status */ HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size) @@ -539,7 +729,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *p { /* Select the SHA1 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA1 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA1 | HASH_CR_INIT; } /* Set the phase */ @@ -565,7 +755,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *p * @} */ -/** @defgroup HASH_Group3 HASH processing functions using interrupt mode +/** @defgroup HASH_Exported_Functions_Group3 HASH processing functions using interrupt mode * @brief processing functions using interrupt mode. * @verbatim @@ -586,7 +776,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *p * The digest is available in pOutBuffer. * @param hhash: pointer to a HASH_HandleTypeDef structure that contains * the configuration information for HASH module - * @param pOutBuffer: Pointer to the Output buffer (hashed buffer). + * @param pInBuffer: Pointer to the input buffer (buffer to be hashed). * @param Size: Length of the input buffer in bytes. * If the Size is not multiple of 64 bytes, the padding is managed by hardware. * @param pOutBuffer: Pointer to the computed digest. Its size must be 16 bytes. @@ -623,7 +813,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInB if(hhash->Phase == HAL_HASH_PHASE_READY) { /* Select the SHA1 mode */ - HASH->CR |= HASH_AlgoSelection_MD5; + HASH->CR |= HASH_ALGOSELECTION_MD5; /* Reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ HASH->CR |= HASH_CR_INIT; @@ -672,6 +862,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInB for(buffercounter = 0; buffercounter < 64; buffercounter+=4) { HASH->DIN = *(uint32_t*)inputaddr; + inputaddr+=4; } if(hhash->HashITCounter == 0) { @@ -775,7 +966,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pIn if(hhash->Phase == HAL_HASH_PHASE_READY) { /* Select the SHA1 mode */ - HASH->CR |= HASH_AlgoSelection_SHA1; + HASH->CR |= HASH_ALGOSELECTION_SHA1; /* Reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ HASH->CR |= HASH_CR_INIT; @@ -897,11 +1088,11 @@ void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash) { switch(HASH->CR & HASH_CR_ALGO) { - case HASH_AlgoSelection_MD5: + case HASH_ALGOSELECTION_MD5: HAL_HASH_MD5_Start_IT(hhash, HAL_NULL, 0, HAL_NULL); break; - case HASH_AlgoSelection_SHA1: + case HASH_ALGOSELECTION_SHA1: HAL_HASH_SHA1_Start_IT(hhash, HAL_NULL, 0, HAL_NULL); break; @@ -914,7 +1105,7 @@ void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash) * @} */ -/** @defgroup HASH_Group4 HASH processing functions using DMA mode +/** @defgroup HASH_Exported_Functions_Group4 HASH processing functions using DMA mode * @brief processing functions using DMA mode. * @verbatim @@ -955,7 +1146,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pIn { /* Select the MD5 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_MD5 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_MD5 | HASH_CR_INIT; } /* Configure the number of valid bits in last word of the message */ @@ -1059,7 +1250,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pI { /* Select the SHA1 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA1; + HASH->CR |= HASH_ALGOSELECTION_SHA1; HASH->CR |= HASH_CR_INIT; } @@ -1143,7 +1334,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutB * @} */ -/** @defgroup HASH_Group5 HASH-MAC (HMAC) processing functions using polling mode +/** @defgroup HASH_Exported_Functions_Group5 HASH-MAC (HMAC) processing functions using polling mode * @brief HMAC processing functions using polling mode . * @verbatim @@ -1188,12 +1379,12 @@ HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuff if(hhash->Init.KeySize > 64) { /* Select the HMAC MD5 mode */ - HASH->CR |= (HASH_AlgoSelection_MD5 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_MD5 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY | HASH_CR_INIT); } else { /* Select the HMAC MD5 mode */ - HASH->CR |= (HASH_AlgoSelection_MD5 | HASH_AlgoMode_HMAC | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_MD5 | HASH_ALGOMODE_HMAC | HASH_CR_INIT); } } @@ -1333,12 +1524,12 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuf if(hhash->Init.KeySize > 64) { /* Select the HMAC SHA1 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA1 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA1 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY | HASH_CR_INIT); } else { /* Select the HMAC SHA1 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA1 | HASH_AlgoMode_HMAC | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA1 | HASH_ALGOMODE_HMAC | HASH_CR_INIT); } } @@ -1452,7 +1643,7 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuf * @} */ -/** @defgroup HASH_Group6 HASH-MAC (HMAC) processing functions using DMA mode +/** @defgroup HASH_Exported_Functions_Group6 HASH-MAC (HMAC) processing functions using DMA mode * @brief HMAC processing functions using DMA mode . * @verbatim @@ -1500,12 +1691,12 @@ HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pIn if(hhash->Init.KeySize > 64) { /* Select the HMAC MD5 mode */ - HASH->CR |= (HASH_AlgoSelection_MD5 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_MD5 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY | HASH_CR_INIT); } else { /* Select the HMAC MD5 mode */ - HASH->CR |= (HASH_AlgoSelection_MD5 | HASH_AlgoMode_HMAC | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_MD5 | HASH_ALGOMODE_HMAC | HASH_CR_INIT); } } @@ -1567,12 +1758,12 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pI if(hhash->Init.KeySize > 64) { /* Select the HMAC SHA1 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA1 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA1 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY | HASH_CR_INIT); } else { /* Select the HMAC SHA1 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA1 | HASH_AlgoMode_HMAC | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA1 | HASH_ALGOMODE_HMAC | HASH_CR_INIT); } } @@ -1606,7 +1797,7 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pI * @} */ -/** @defgroup HASH_Group7 Peripheral State functions +/** @defgroup HASH_Exported_Functions_Group7 Peripheral State functions * @brief Peripheral State functions. * @verbatim @@ -1635,184 +1826,10 @@ HAL_HASH_STATETypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash) * @} */ -/** - * @brief DMA HASH Input Data complete callback. - * @param hdma: DMA handle - * @retval None - */ -static void HASH_DMAXferCplt(DMA_HandleTypeDef *hdma) -{ - HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - uint32_t inputaddr = 0; - uint32_t buffersize = 0; - - if((HASH->CR & HASH_CR_MODE) != HASH_CR_MODE) - { - /* Disable the DMA transfer */ - HASH->CR &= (uint32_t)(~HASH_CR_DMAE); - - /* Change HASH peripheral state */ - hhash->State = HAL_HASH_STATE_READY; - - /* Call Input data transfer complete callback */ - HAL_HASH_InCpltCallback(hhash); - } - else - { - /* Increment Interrupt counter */ - hhash->HashInCount++; - /* Disable the DMA transfer before starting the next transfer */ - HASH->CR &= (uint32_t)(~HASH_CR_DMAE); - - if(hhash->HashInCount <= 2) - { - /* In case HashInCount = 1, set the DMA to transfer data to HASH DIN register */ - if(hhash->HashInCount == 1) - { - inputaddr = (uint32_t)hhash->pHashInBuffPtr; - buffersize = hhash->HashBuffSize; - } - /* In case HashInCount = 2, set the DMA to transfer key to HASH DIN register */ - else if(hhash->HashInCount == 2) - { - inputaddr = (uint32_t)hhash->Init.pKey; - buffersize = hhash->Init.KeySize; - } - /* Configure the number of valid bits in last word of the message */ - HASH->STR |= 8 * (buffersize % 4); - - /* Set the HASH DMA transfer complete */ - hhash->hdmain->XferCpltCallback = HASH_DMAXferCplt; - - /* Enable the DMA In DMA Stream */ - HAL_DMA_Start_IT(hhash->hdmain, inputaddr, (uint32_t)&HASH->DIN, (buffersize%4 ? (buffersize+3)/4:buffersize/4)); - - /* Enable DMA requests */ - HASH->CR |= (HASH_CR_DMAE); - } - else - { - /* Disable the DMA transfer */ - HASH->CR &= (uint32_t)(~HASH_CR_DMAE); - - /* Reset the InCount */ - hhash->HashInCount = 0; - - /* Change HASH peripheral state */ - hhash->State = HAL_HASH_STATE_READY; - - /* Call Input data transfer complete callback */ - HAL_HASH_InCpltCallback(hhash); - } - } -} - -/** - * @brief DMA HASH communication error callback. - * @param hdma: DMA handle - * @retval None - */ -static void HASH_DMAError(DMA_HandleTypeDef *hdma) -{ - HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - hhash->State= HAL_HASH_STATE_READY; - HAL_HASH_ErrorCallback(hhash); -} - -/** - * @brief Writes the input buffer in data register. - * @param pInBuffer: Pointer to input buffer - * @param Size: The size of input buffer - * @retval None - */ -static void HASH_WriteData(uint8_t *pInBuffer, uint32_t Size) -{ - uint32_t buffercounter; - uint32_t inputaddr = (uint32_t) pInBuffer; - - for(buffercounter = 0; buffercounter < Size; buffercounter+=4) - { - HASH->DIN = *(uint32_t*)inputaddr; - inputaddr+=4; - } -} - -/** - * @brief Provides the message digest result. - * @param pMsgDigest: Pointer to the message digest - * @param Size: The size of the message digest in bytes - * @retval None - */ -static void HASH_GetDigest(uint8_t *pMsgDigest, uint8_t Size) -{ - uint32_t msgdigest = (uint32_t)pMsgDigest; - - switch(Size) - { - case 16: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - break; - case 20: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); - break; - case 28: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); - break; - case 32: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[7]); - break; - default: - break; - } -} - /** * @} */ + #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */ #endif /* HAL_HASH_MODULE_ENABLED */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.h index 4ac57430ec1..8fcc0e708b0 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_hash.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of HASH HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -52,19 +52,24 @@ * @{ */ -/** @addtogroup HASH - * @{ +/** @addtogroup HASH + * @brief HASH HAL module driver + * @{ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup HASH_Exported_Types HASH Exported Types + * @{ + */ -/** - * @brief HASH Configuration Structure definition +/** @defgroup HASH_Exported_Types_Group1 HASH Configuration Structure definition + * @{ */ + typedef struct { uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string. - This parameter can be a value of @ref HASH_Data_Type */ + This parameter can be a value of @ref HASH DataType */ uint32_t KeySize; /*!< The key size is used only in HMAC operation */ @@ -72,8 +77,13 @@ typedef struct }HASH_InitTypeDef; /** - * @brief HAL State structures definition - */ + * @} + */ + +/** @defgroup HASH_Exported_Types_Group2 HASH State structures definition + * @{ + */ + typedef enum { HAL_HASH_STATE_RESET = 0x00, /*!< HASH not yet initialized or disabled */ @@ -84,8 +94,13 @@ typedef enum }HAL_HASH_STATETypeDef; /** - * @brief HAL phase structures definition + * @} */ + +/** @defgroup HASH_Exported_Types_Group3 HASH phase structures definition + * @{ + */ + typedef enum { HAL_HASH_PHASE_READY = 0x01, /*!< HASH peripheral is ready for initialization */ @@ -93,8 +108,13 @@ typedef enum }HAL_HASHPhaseTypeDef; /** - * @brief HASH Handle Structure definition + * @} */ + +/** @defgroup HASH_Exported_Types_Group4 HASH Handle structures definition + * @{ + */ + typedef struct { HASH_InitTypeDef Init; /*!< HASH required parameters */ @@ -120,69 +140,62 @@ typedef struct __IO HAL_HASH_STATETypeDef State; /*!< HASH peripheral state */ } HASH_HandleTypeDef; -/* Exported constants --------------------------------------------------------*/ +/** + * @} + */ + -/** @defgroup HASH_Exported_Constants +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup HASH_Exported_Constants HASH Exported Constants * @{ */ -/** @defgroup HASH_Algo_Selection +/** @defgroup HASH_Exported_Constants_Group1 HASH Algorithm Selection * @{ */ -#define HASH_AlgoSelection_SHA1 ((uint32_t)0x0000) /*!< HASH function is SHA1 */ -#define HASH_AlgoSelection_SHA224 HASH_CR_ALGO_1 /*!< HASH function is SHA224 */ -#define HASH_AlgoSelection_SHA256 HASH_CR_ALGO /*!< HASH function is SHA256 */ -#define HASH_AlgoSelection_MD5 HASH_CR_ALGO_0 /*!< HASH function is MD5 */ - -#define IS_HASH_ALGOSELECTION(ALGOSELECTION) (((ALGOSELECTION) == HASH_AlgoSelection_SHA1) || \ - ((ALGOSELECTION) == HASH_AlgoSelection_SHA224) || \ - ((ALGOSELECTION) == HASH_AlgoSelection_SHA256) || \ - ((ALGOSELECTION) == HASH_AlgoSelection_MD5)) +#define HASH_ALGOSELECTION_SHA1 ((uint32_t)0x0000) /*!< HASH function is SHA1 */ +#define HASH_ALGOSELECTION_SHA224 HASH_CR_ALGO_1 /*!< HASH function is SHA224 */ +#define HASH_ALGOSELECTION_SHA256 HASH_CR_ALGO /*!< HASH function is SHA256 */ +#define HASH_ALGOSELECTION_MD5 HASH_CR_ALGO_0 /*!< HASH function is MD5 */ /** * @} */ -/** @defgroup HASH_Algorithm_Mode +/** @defgroup HASH_Exported_Constants_Group2 HASH Algorithm Mode * @{ - */ -#define HASH_AlgoMode_HASH ((uint32_t)0x00000000) /*!< Algorithm is HASH */ -#define HASH_AlgoMode_HMAC HASH_CR_MODE /*!< Algorithm is HMAC */ - -#define IS_HASH_ALGOMODE(ALGOMODE) (((ALGOMODE) == HASH_AlgoMode_HASH) || \ - ((ALGOMODE) == HASH_AlgoMode_HMAC)) + */ +#define HASH_ALGOMODE_HASH ((uint32_t)0x00000000) /*!< Algorithm is HASH */ +#define HASH_ALGOMODE_HMAC HASH_CR_MODE /*!< Algorithm is HMAC */ /** * @} */ -/** @defgroup HASH_Data_Type +/** @defgroup HASH_Exported_Constants_Group3 HASH DataType * @{ */ #define HASH_DATATYPE_32B ((uint32_t)0x0000) /*!< 32-bit data. No swapping */ #define HASH_DATATYPE_16B HASH_CR_DATATYPE_0 /*!< 16-bit data. Each half word is swapped */ #define HASH_DATATYPE_8B HASH_CR_DATATYPE_1 /*!< 8-bit data. All bytes are swapped */ #define HASH_DATATYPE_1B HASH_CR_DATATYPE /*!< 1-bit data. In the word all bits are swapped */ - -#define IS_HASH_DATATYPE(DATATYPE) (((DATATYPE) == HASH_DATATYPE_32B)|| \ - ((DATATYPE) == HASH_DATATYPE_16B)|| \ - ((DATATYPE) == HASH_DATATYPE_8B) || \ - ((DATATYPE) == HASH_DATATYPE_1B)) /** * @} */ -/** @defgroup HASH_HMAC_Long_key_only_for_HMAC_mode +/** @defgroup HASH_Exported_Constants_Group4 HASH HMAC Long key + * @brief HASH HMAC Long key used only for HMAC mode * @{ - */ -#define HASH_HMACKeyType_ShortKey ((uint32_t)0x00000000) /*!< HMAC Key is <= 64 bytes */ -#define HASH_HMACKeyType_LongKey HASH_CR_LKEY /*!< HMAC Key is > 64 bytes */ - -#define IS_HASH_HMAC_KEYTYPE(KEYTYPE) (((KEYTYPE) == HASH_HMACKeyType_ShortKey) || \ - ((KEYTYPE) == HASH_HMACKeyType_LongKey)) + */ +#define HASH_HMAC_KEYTYPE_SHORTKEY ((uint32_t)0x00000000) /*!< HMAC Key is <= 64 bytes */ +#define HASH_HMAC_KEYTYPE_LONGKEY HASH_CR_LKEY /*!< HMAC Key is > 64 bytes */ /** * @} */ -/** @defgroup HASH_flags_definition +/** @defgroup HASH_Exported_Constants_Group5 HASH Flags definition * @{ */ #define HASH_FLAG_DINIS HASH_SR_DINIS /*!< 16 locations are free in the DIN : A new block can be entered into the input buffer */ @@ -194,9 +207,9 @@ typedef struct * @} */ -/** @defgroup HASH_interrupts_definition +/** @defgroup HASH_Exported_Constants_Group6 HASH Interrupts definition * @{ - */ + */ #define HASH_IT_DINI HASH_IMR_DINIM /*!< A new block can be entered into the input buffer (DIN) */ #define HASH_IT_DCI HASH_IMR_DCIM /*!< Digest calculation complete */ /** @@ -208,7 +221,10 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup HASH_Exported_Macros HASH Exported Macros + * @{ + */ + /** @brief Reset HASH handle state * @param __HANDLE__: specifies the HASH handle. * @retval None @@ -227,34 +243,21 @@ typedef struct */ #define __HAL_HASH_GET_FLAG(__FLAG__) ((HASH->SR & (__FLAG__)) == (__FLAG__)) -/** - * @brief Macros for HMAC finish. - * @param None - * @retval None - */ -#define HAL_HMAC_MD5_Finish HAL_HASH_MD5_Finish -#define HAL_HMAC_SHA1_Finish HAL_HASH_SHA1_Finish -#define HAL_HMAC_SHA224_Finish HAL_HASH_SHA224_Finish -#define HAL_HMAC_SHA256_Finish HAL_HASH_SHA256_Finish - /** * @brief Enable the multiple DMA mode. * This feature is available only in STM32F429x and STM32F439x devices. - * @param None * @retval None */ #define __HAL_HASH_SET_MDMAT() HASH->CR |= HASH_CR_MDMAT /** * @brief Disable the multiple DMA mode. - * @param None * @retval None */ #define __HAL_HASH_RESET_MDMAT() HASH->CR &= (uint32_t)(~HASH_CR_MDMAT) /** * @brief Start the digest computation - * @param None * @retval None */ #define __HAL_HASH_START_DIGEST() HASH->STR |= HASH_STR_DCAL @@ -268,50 +271,164 @@ typedef struct HASH->STR |= 8 * ((SIZE) % 4);\ }while(0) +/** + * @} + */ + /* Include HASH HAL Extension module */ #include "stm32f4xx_hal_hash_ex.h" - /* Exported functions --------------------------------------------------------*/ -/* Initialization and de-initialization functions **********************************/ +/** @defgroup HASH_Exported_Functions HASH Exported Functions + * @{ + */ + +/** @addtogroup HASH_Exported_Functions_Group1 + * @{ + */ HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash); HAL_StatusTypeDef HAL_HASH_DeInit(HASH_HandleTypeDef *hhash); +/** + * @} + */ -/* HASH processing using polling *********************************************/ +/** @addtogroup HASH_Exported_Functions_Group2 + * @{ + */ HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HASH_MD5_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); - -/* HASH-MAC processing using polling *****************************************/ +/** + * @} + */ + +/** @addtogroup HASH_Exported_Functions_Group3 + * @{ + */ HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); +/** + * @} + */ -/* HASH processing using interrupt *******************************************/ +/** @addtogroup HASH_Exported_Functions_Group4 + * @{ + */ HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer); HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer); +/** + * @} + */ -/* HASH processing using DMA *************************************************/ +/** @addtogroup HASH_Exported_Functions_Group5 + * @{ + */ HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout); +/** + * @} + */ -/* HASH-HMAC processing using DMA ********************************************/ +/** @addtogroup HASH_Exported_Functions_Group6 + * @{ + */ HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); +/** + * @} + */ -/* Processing functions ******************************************************/ +/** @addtogroup HASH_Exported_Functions_Group7 + * @{ + */ void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash); +/** + * @} + */ -/* Peripheral State functions ************************************************/ +/** @addtogroup HASH_Exported_Functions_Group8 + * @{ + */ HAL_HASH_STATETypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash); void HAL_HASH_MspInit(HASH_HandleTypeDef *hhash); void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash); void HAL_HASH_InCpltCallback(HASH_HandleTypeDef *hhash); void HAL_HASH_DgstCpltCallback(HASH_HandleTypeDef *hhash); void HAL_HASH_ErrorCallback(HASH_HandleTypeDef *hhash); +/** + * @} + */ + + /** + * @} + */ + + /* Private types -------------------------------------------------------------*/ +/** @defgroup HASH_Private_Types HASH Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup HASH_Private_Variables HASH Private Variables + * @{ + */ + +/** + * @} + */ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup HASH_Private_Constants HASH Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup HASH_Private_Macros HASH Private Macros + * @{ + */ +#define IS_HASH_ALGOSELECTION(__ALGOSELECTION__) (((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA1) || \ + ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA224) || \ + ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA256) || \ + ((__ALGOSELECTION__) == HASH_ALGOSELECTION_MD5)) + + +#define IS_HASH_ALGOMODE(__ALGOMODE__) (((__ALGOMODE__) == HASH_ALGOMODE_HASH) || \ + ((__ALGOMODE__) == HASH_ALGOMODE_HMAC)) + + +#define IS_HASH_DATATYPE(__DATATYPE__) (((__DATATYPE__) == HASH_DATATYPE_32B)|| \ + ((__DATATYPE__) == HASH_DATATYPE_16B)|| \ + ((__DATATYPE__) == HASH_DATATYPE_8B) || \ + ((__DATATYPE__) == HASH_DATATYPE_1B)) + + +#define IS_HASH_HMAC_KEYTYPE(__KEYTYPE__) (((__KEYTYPE__) == HASH_HMAC_KEYTYPE_SHORTKEY) || \ + ((__KEYTYPE__) == HASH_HMAC_KEYTYPE_LONGKEY)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup HASH_Private_Functions HASH Private Functions + * @{ + */ + +/** + * @} + */ + #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.c index 6716e5cdd88..d56e4c5a8ed 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_hash_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief HASH HAL Extension module driver. * This file provides firmware functions to manage the following * functionalities of HASH peripheral: @@ -17,7 +17,7 @@ [..] The HASH HAL driver can be used as follows: (#)Initialize the HASH low level resources by implementing the HAL_HASH_MspInit(): - (##) Enable the HASH interface clock using __HASH_CLK_ENABLE() + (##) Enable the HASH interface clock using __HAL_RCC_HASH_CLK_ENABLE() (##) In case of using processing APIs based on interrupts (e.g. HAL_HMACEx_SHA224_Start()) (+++) Configure the HASH interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the HASH IRQ handler using HAL_NVIC_EnableIRQ() @@ -65,7 +65,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -99,7 +99,7 @@ * @{ */ -/** @defgroup HASHEx +/** @defgroup HASHEx HASHEx * @brief HASH Extension HAL module driver. * @{ */ @@ -113,17 +113,207 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup HASHEx_Private_Functions + * @{ + */ static void HASHEx_DMAXferCplt(DMA_HandleTypeDef *hdma); static void HASHEx_WriteData(uint8_t *pInBuffer, uint32_t Size); static void HASHEx_GetDigest(uint8_t *pMsgDigest, uint8_t Size); static void HASHEx_DMAError(DMA_HandleTypeDef *hdma); - +/** + * @} + */ + /* Private functions ---------------------------------------------------------*/ -/** @defgroup HASHEx_Private_Functions +/** @addtogroup HASHEx_Private_Functions * @{ */ +/** + * @brief Writes the input buffer in data register. + * @param pInBuffer: Pointer to input buffer + * @param Size: The size of input buffer + * @retval None + */ +static void HASHEx_WriteData(uint8_t *pInBuffer, uint32_t Size) +{ + uint32_t buffercounter; + uint32_t inputaddr = (uint32_t) pInBuffer; + + for(buffercounter = 0; buffercounter < Size; buffercounter+=4) + { + HASH->DIN = *(uint32_t*)inputaddr; + inputaddr+=4; + } +} + +/** + * @brief Provides the message digest result. + * @param pMsgDigest: Pointer to the message digest + * @param Size: The size of the message digest in bytes + * @retval None + */ +static void HASHEx_GetDigest(uint8_t *pMsgDigest, uint8_t Size) +{ + uint32_t msgdigest = (uint32_t)pMsgDigest; + + switch(Size) + { + case 16: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + break; + case 20: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); + break; + case 28: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); + break; + case 32: + /* Read the message digest */ + *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); + msgdigest+=4; + *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[7]); + break; + default: + break; + } +} + +/** + * @brief DMA HASH Input Data complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void HASHEx_DMAXferCplt(DMA_HandleTypeDef *hdma) +{ + HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + uint32_t inputaddr = 0; + uint32_t buffersize = 0; + + if((HASH->CR & HASH_CR_MODE) != HASH_CR_MODE) + { + /* Disable the DMA transfer */ + HASH->CR &= (uint32_t)(~HASH_CR_DMAE); + + /* Change HASH peripheral state */ + hhash->State = HAL_HASH_STATE_READY; + + /* Call Input data transfer complete callback */ + HAL_HASH_InCpltCallback(hhash); + } + else + { + /* Increment Interrupt counter */ + hhash->HashInCount++; + /* Disable the DMA transfer before starting the next transfer */ + HASH->CR &= (uint32_t)(~HASH_CR_DMAE); + + if(hhash->HashInCount <= 2) + { + /* In case HashInCount = 1, set the DMA to transfer data to HASH DIN register */ + if(hhash->HashInCount == 1) + { + inputaddr = (uint32_t)hhash->pHashInBuffPtr; + buffersize = hhash->HashBuffSize; + } + /* In case HashInCount = 2, set the DMA to transfer key to HASH DIN register */ + else if(hhash->HashInCount == 2) + { + inputaddr = (uint32_t)hhash->Init.pKey; + buffersize = hhash->Init.KeySize; + } + /* Configure the number of valid bits in last word of the message */ + HASH->STR |= 8 * (buffersize % 4); + + /* Set the HASH DMA transfer complete */ + hhash->hdmain->XferCpltCallback = HASHEx_DMAXferCplt; + + /* Enable the DMA In DMA Stream */ + HAL_DMA_Start_IT(hhash->hdmain, inputaddr, (uint32_t)&HASH->DIN, (buffersize%4 ? (buffersize+3)/4:buffersize/4)); + + /* Enable DMA requests */ + HASH->CR |= (HASH_CR_DMAE); + } + else + { + /* Disable the DMA transfer */ + HASH->CR &= (uint32_t)(~HASH_CR_DMAE); + + /* Reset the InCount */ + hhash->HashInCount = 0; + + /* Change HASH peripheral state */ + hhash->State = HAL_HASH_STATE_READY; + + /* Call Input data transfer complete callback */ + HAL_HASH_InCpltCallback(hhash); + } + } +} + +/** + * @brief DMA HASH communication error callback. + * @param hdma: DMA handle + * @retval None + */ +static void HASHEx_DMAError(DMA_HandleTypeDef *hdma) +{ + HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + hhash->State= HAL_HASH_STATE_READY; + HAL_HASH_ErrorCallback(hhash); +} + + /** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup HASHEx_Exported_Functions + * @{ + */ + /** @defgroup HASHEx_Group1 HASH processing functions * @brief processing functions using polling mode * @@ -167,7 +357,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pI { /* Select the SHA224 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA224 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA224 | HASH_CR_INIT; } /* Set the phase */ @@ -243,7 +433,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pI { /* Select the SHA256 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA256 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA256 | HASH_CR_INIT; } /* Set the phase */ @@ -316,7 +506,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA224_Accumulate(HASH_HandleTypeDef *hhash, uint8_ { /* Select the SHA224 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA224 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA224 | HASH_CR_INIT; } /* Set the phase */ @@ -362,7 +552,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA256_Accumulate(HASH_HandleTypeDef *hhash, uint8_ { /* Select the SHA256 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA256 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA256 | HASH_CR_INIT; } /* Set the phase */ @@ -414,12 +604,13 @@ HAL_StatusTypeDef HAL_HASHEx_SHA256_Accumulate(HASH_HandleTypeDef *hhash, uint8_ * @param Size: Length of the input buffer in bytes. * If the Size is not multiple of 64 bytes, the padding is managed by hardware. * @param pOutBuffer: Pointer to the computed digest. Its size must be 20 bytes. + * @param Timeout: Timeout value * @retval HAL status */ HAL_StatusTypeDef HAL_HMACEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout) { uint32_t tickstart = 0; - + /* Process Locked */ __HAL_LOCK(hhash); @@ -433,12 +624,12 @@ HAL_StatusTypeDef HAL_HMACEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pI if(hhash->Init.KeySize > 64) { /* Select the HMAC SHA224 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA224 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA224 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY | HASH_CR_INIT); } else { /* Select the HMAC SHA224 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA224 | HASH_AlgoMode_HMAC | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA224 | HASH_ALGOMODE_HMAC | HASH_CR_INIT); } } @@ -557,6 +748,7 @@ HAL_StatusTypeDef HAL_HMACEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pI * @param Size: Length of the input buffer in bytes. * If the Size is not multiple of 64 bytes, the padding is managed by hardware. * @param pOutBuffer: Pointer to the computed digest. Its size must be 20 bytes. + * @param Timeout: Timeout value * @retval HAL status */ HAL_StatusTypeDef HAL_HMACEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout) @@ -576,12 +768,12 @@ HAL_StatusTypeDef HAL_HMACEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pI if(hhash->Init.KeySize > 64) { /* Select the HMAC SHA256 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA256 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey); + HASH->CR |= (HASH_ALGOSELECTION_SHA256 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY); } else { /* Select the HMAC SHA256 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA256 | HASH_AlgoMode_HMAC); + HASH->CR |= (HASH_ALGOSELECTION_SHA256 | HASH_ALGOMODE_HMAC); } /* Reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ @@ -755,7 +947,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_IT(HASH_HandleTypeDef *hhash, uint8_t if(hhash->Phase == HAL_HASH_PHASE_READY) { /* Select the SHA224 mode */ - HASH->CR |= HASH_AlgoSelection_SHA224; + HASH->CR |= HASH_ALGOSELECTION_SHA224; /* Reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ HASH->CR |= HASH_CR_INIT; @@ -899,7 +1091,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_IT(HASH_HandleTypeDef *hhash, uint8_t if(hhash->Phase == HAL_HASH_PHASE_READY) { /* Select the SHA256 mode */ - HASH->CR |= HASH_AlgoSelection_SHA256; + HASH->CR |= HASH_ALGOSELECTION_SHA256; /* Reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ HASH->CR |= HASH_CR_INIT; @@ -1013,11 +1205,11 @@ void HAL_HASHEx_IRQHandler(HASH_HandleTypeDef *hhash) switch(HASH->CR & HASH_CR_ALGO) { - case HASH_AlgoSelection_SHA224: + case HASH_ALGOSELECTION_SHA224: HAL_HASHEx_SHA224_Start_IT(hhash, HAL_NULL, 0, HAL_NULL); break; - case HASH_AlgoSelection_SHA256: + case HASH_ALGOSELECTION_SHA256: HAL_HASHEx_SHA256_Start_IT(hhash, HAL_NULL, 0, HAL_NULL); break; @@ -1072,7 +1264,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t { /* Select the SHA224 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA224 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA224 | HASH_CR_INIT; } /* Configure the number of valid bits in last word of the message */ @@ -1176,7 +1368,7 @@ HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t { /* Select the SHA256 mode and reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ - HASH->CR |= HASH_AlgoSelection_SHA256 | HASH_CR_INIT; + HASH->CR |= HASH_ALGOSELECTION_SHA256 | HASH_CR_INIT; } /* Configure the number of valid bits in last word of the message */ @@ -1307,12 +1499,12 @@ HAL_StatusTypeDef HAL_HMACEx_SHA224_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t if(hhash->Init.KeySize > 64) { /* Select the HMAC SHA224 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA224 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA224 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY | HASH_CR_INIT); } else { /* Select the HMAC SHA224 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA224 | HASH_AlgoMode_HMAC | HASH_CR_INIT); + HASH->CR |= (HASH_ALGOSELECTION_SHA224 | HASH_ALGOMODE_HMAC | HASH_CR_INIT); } } @@ -1374,12 +1566,12 @@ HAL_StatusTypeDef HAL_HMACEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t if(hhash->Init.KeySize > 64) { /* Select the HMAC SHA256 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA256 | HASH_AlgoMode_HMAC | HASH_HMACKeyType_LongKey); + HASH->CR |= (HASH_ALGOSELECTION_SHA256 | HASH_ALGOMODE_HMAC | HASH_HMAC_KEYTYPE_LONGKEY); } else { /* Select the HMAC SHA256 mode */ - HASH->CR |= (HASH_AlgoSelection_SHA256 | HASH_AlgoMode_HMAC); + HASH->CR |= (HASH_ALGOSELECTION_SHA256 | HASH_ALGOMODE_HMAC); } /* Reset the HASH processor core, so that the HASH will be ready to compute the message digest of a new message */ @@ -1416,182 +1608,6 @@ HAL_StatusTypeDef HAL_HMACEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t * @} */ -/** - * @brief Writes the input buffer in data register. - * @param pInBuffer: Pointer to input buffer - * @param Size: The size of input buffer - * @retval None - */ -static void HASHEx_WriteData(uint8_t *pInBuffer, uint32_t Size) -{ - uint32_t buffercounter; - uint32_t inputaddr = (uint32_t) pInBuffer; - - for(buffercounter = 0; buffercounter < Size; buffercounter+=4) - { - HASH->DIN = *(uint32_t*)inputaddr; - inputaddr+=4; - } -} - -/** - * @brief Provides the message digest result. - * @param pMsgDigest: Pointer to the message digest - * @param Size: The size of the message digest in bytes - * @retval None - */ -static void HASHEx_GetDigest(uint8_t *pMsgDigest, uint8_t Size) -{ - uint32_t msgdigest = (uint32_t)pMsgDigest; - - switch(Size) - { - case 16: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - break; - case 20: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); - break; - case 28: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); - break; - case 32: - /* Read the message digest */ - *(uint32_t*)(msgdigest) = __REV(HASH->HR[0]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[1]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[2]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[3]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH->HR[4]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[5]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[6]); - msgdigest+=4; - *(uint32_t*)(msgdigest) = __REV(HASH_DIGEST->HR[7]); - break; - default: - break; - } -} - -/** - * @brief DMA HASH Input Data complete callback. - * @param hdma: DMA handle - * @retval None - */ -static void HASHEx_DMAXferCplt(DMA_HandleTypeDef *hdma) -{ - HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - uint32_t inputaddr = 0; - uint32_t buffersize = 0; - - if((HASH->CR & HASH_CR_MODE) != HASH_CR_MODE) - { - /* Disable the DMA transfer */ - HASH->CR &= (uint32_t)(~HASH_CR_DMAE); - - /* Change HASH peripheral state */ - hhash->State = HAL_HASH_STATE_READY; - - /* Call Input data transfer complete callback */ - HAL_HASH_InCpltCallback(hhash); - } - else - { - /* Increment Interrupt counter */ - hhash->HashInCount++; - /* Disable the DMA transfer before starting the next transfer */ - HASH->CR &= (uint32_t)(~HASH_CR_DMAE); - - if(hhash->HashInCount <= 2) - { - /* In case HashInCount = 1, set the DMA to transfer data to HASH DIN register */ - if(hhash->HashInCount == 1) - { - inputaddr = (uint32_t)hhash->pHashInBuffPtr; - buffersize = hhash->HashBuffSize; - } - /* In case HashInCount = 2, set the DMA to transfer key to HASH DIN register */ - else if(hhash->HashInCount == 2) - { - inputaddr = (uint32_t)hhash->Init.pKey; - buffersize = hhash->Init.KeySize; - } - /* Configure the number of valid bits in last word of the message */ - HASH->STR |= 8 * (buffersize % 4); - - /* Set the HASH DMA transfer complete */ - hhash->hdmain->XferCpltCallback = HASHEx_DMAXferCplt; - - /* Enable the DMA In DMA Stream */ - HAL_DMA_Start_IT(hhash->hdmain, inputaddr, (uint32_t)&HASH->DIN, (buffersize%4 ? (buffersize+3)/4:buffersize/4)); - - /* Enable DMA requests */ - HASH->CR |= (HASH_CR_DMAE); - } - else - { - /* Disable the DMA transfer */ - HASH->CR &= (uint32_t)(~HASH_CR_DMAE); - - /* Reset the InCount */ - hhash->HashInCount = 0; - - /* Change HASH peripheral state */ - hhash->State = HAL_HASH_STATE_READY; - - /* Call Input data transfer complete callback */ - HAL_HASH_InCpltCallback(hhash); - } - } -} - -/** - * @brief DMA HASH communication error callback. - * @param hdma: DMA handle - * @retval None - */ -static void HASHEx_DMAError(DMA_HandleTypeDef *hdma) -{ - HASH_HandleTypeDef* hhash = ( HASH_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - hhash->State= HAL_HASH_STATE_READY; - HAL_HASH_ErrorCallback(hhash); -} - - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.h index a9899053fa8..0bab531a63b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hash_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_hash_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of HASH HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -51,8 +51,9 @@ * @{ */ -/** @addtogroup HASHEx - * @{ +/** @addtogroup HASHEx + * @brief HASHEx HAL Extension module driver + * @{ */ /* Exported types ------------------------------------------------------------*/ @@ -60,33 +61,127 @@ /* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ -/* HASH processing using polling *********************************************/ +/** @defgroup HASHEx_Exported_Functions HASHEx Exported Functions + * @{ + */ + +/** @defgroup HASHEx_Exported_Functions_Group1 HASHEx processing using polling functions + * @{ + */ + HAL_StatusTypeDef HAL_HASHEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HASHEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HASHEx_SHA224_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HASHEx_SHA256_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); -/* HASH-MAC processing using polling *****************************************/ +/** + * @} + */ + +/** @defgroup HASHEx_Exported_Functions_Group2 HMAC processing using polling functions + * @{ + */ + HAL_StatusTypeDef HAL_HMACEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HMACEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout); -/* HASH processing using interrupt *******************************************/ +/** + * @} + */ + +/** @defgroup HASHEx_Exported_Functions_Group3 HASHEx processing using functions + * @{ + */ + HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer); HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer); -/* HASH processing using DMA *************************************************/ +/** + * @} + */ + +/** @defgroup HASHEx_Exported_Functions_Group4 HASHEx processing using DMA + * @{ + */ + HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HASHEx_SHA224_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout); HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HASHEx_SHA256_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout); -/* HASH-HMAC processing using DMA ********************************************/ +/** + * @} + */ + +/** @defgroup HASHEx_Exported_Functions_Group5 HMAC processing using DMA + * @{ + */ + HAL_StatusTypeDef HAL_HMACEx_SHA224_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); HAL_StatusTypeDef HAL_HMACEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size); - -/* Processing functions ******************************************************/ +/** + * @} + */ + +/** @defgroup HASHEx_Exported_Functions_Group6 HASHEx processing functions + * @{ + */ + void HAL_HASHEx_IRQHandler(HASH_HandleTypeDef *hhash); +/** + * @} + */ + +/** + * @} + */ + + /* Private types -------------------------------------------------------------*/ +/** @defgroup HASHEx_Private_Types HASHEx Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup HASHEx_Private_Variables HASHEx Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup HASHEx_Private_Constants HASHEx Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup HASHEx_Private_Macros HASHEx Private Macros + * @{ + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup HASHEx_Private_Functions HASHEx Private Functions + * @{ + */ + +/** + * @} + */ + #endif /* STM32F437xx || STM32F439xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.c index eba3d223de3..38994e10020 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_hcd.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief HCD HAL module driver. * This file provides firmware functions to manage the following * functionalities of the USB Peripheral Controller: @@ -43,7 +43,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -72,12 +72,12 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" + /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @defgroup HCD - * @brief HCD HAL module driver +/** @addtogroup HCD * @{ */ @@ -87,21 +87,27 @@ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ +/* Private function ----------------------------------------------------------*/ +/** @addtogroup HCD_Private_Functions + * @{ + */ static void HCD_HC_IN_IRQHandler(HCD_HandleTypeDef *hhcd, uint8_t chnum); static void HCD_HC_OUT_IRQHandler(HCD_HandleTypeDef *hhcd, uint8_t chnum); static void HCD_RXQLVL_IRQHandler(HCD_HandleTypeDef *hhcd); static void HCD_Port_IRQHandler(HCD_HandleTypeDef *hhcd); -/* Private functions ---------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup HCD_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup HCD_Exported_Functions * @{ */ -/** @defgroup HCD_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions +/** @addtogroup HCD_Exported_Functions_Group1 + * @brief Initialization and de-initialization functions * -@verbatim +@verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== @@ -126,27 +132,27 @@ HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd) /* Check the parameters */ assert_param(IS_HCD_ALL_INSTANCE(hhcd->Instance)); - + hhcd->State = HAL_HCD_STATE_BUSY; /* Init the low level hardware : GPIO, CLOCK, NVIC... */ HAL_HCD_MspInit(hhcd); - + /* Disable the Interrupts */ - __HAL_HCD_DISABLE(hhcd); - - /*Init the Core (common init.) */ - USB_CoreInit(hhcd->Instance, hhcd->Init); - - /* Force Host Mode*/ - USB_SetCurrentMode(hhcd->Instance , USB_OTG_HOST_MODE); - - /* Init Host */ - USB_HostInit(hhcd->Instance, hhcd->Init); - - hhcd->State= HAL_HCD_STATE_READY; - - return HAL_OK; + __HAL_HCD_DISABLE(hhcd); + + /* Init the Core (common init.) */ + USB_CoreInit(hhcd->Instance, hhcd->Init); + + /* Force Host Mode*/ + USB_SetCurrentMode(hhcd->Instance , USB_OTG_HOST_MODE); + + /* Init Host */ + USB_HostInit(hhcd->Instance, hhcd->Init); + + hhcd->State= HAL_HCD_STATE_READY; + + return HAL_OK; } /** @@ -166,7 +172,7 @@ HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd) * @param ep_type: Endpoint Type. * This parameter can be one of these values: * EP_TYPE_CTRL: Control type, - * EP_TYPE_ISOC: Isochrounous type, + * EP_TYPE_ISOC: Isochronous type, * EP_TYPE_BULK: Bulk type, * EP_TYPE_INTR: Interrupt type * @param mps: Max Packet Size. @@ -192,7 +198,7 @@ HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, hhcd->hc[ch_num].ep_num = epnum & 0x7F; hhcd->hc[ch_num].ep_is_in = ((epnum & 0x80) == 0x80); hhcd->hc[ch_num].speed = speed; - + status = USB_HC_Init(hhcd->Instance, ch_num, epnum, @@ -205,8 +211,6 @@ HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, return status; } - - /** * @brief Halt a host channel * @param hhcd: HCD handle @@ -214,8 +218,7 @@ HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, * This parameter can be a value from 1 to 15 * @retval HAL status */ -HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, - uint8_t ch_num) +HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, uint8_t ch_num) { HAL_StatusTypeDef status = HAL_OK; @@ -225,6 +228,7 @@ HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, return status; } + /** * @brief DeInitialize the host driver * @param hhcd: HCD handle @@ -243,7 +247,7 @@ HAL_StatusTypeDef HAL_HCD_DeInit(HCD_HandleTypeDef *hhcd) /* DeInit the low level hardware */ HAL_HCD_MspDeInit(hhcd); - __HAL_HCD_DISABLE(hhcd); + __HAL_HCD_DISABLE(hhcd); hhcd->State = HAL_HCD_STATE_RESET; @@ -258,7 +262,7 @@ HAL_StatusTypeDef HAL_HCD_DeInit(HCD_HandleTypeDef *hhcd) __weak void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_MspInit could be implenetd in the user file + the HAL_PCD_MspInit could be implemented in the user file */ } @@ -267,10 +271,10 @@ __weak void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd) * @param hhcd: HCD handle * @retval None */ -__weak void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhhcd) +__weak void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_MspDeInit could be implenetd in the user file + the HAL_PCD_MspDeInit could be implemented in the user file */ } @@ -278,7 +282,7 @@ __weak void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhhcd) * @} */ -/** @defgroup HCD_Group2 IO operation functions +/** @addtogroup HCD_Exported_Functions_Group2 * @brief HCD IO operation functions * @verbatim @@ -303,7 +307,7 @@ __weak void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhhcd) * @param ep_type: Endpoint Type. * This parameter can be one of these values: * EP_TYPE_CTRL: Control type/ - * EP_TYPE_ISOC: Isochrounous type/ + * EP_TYPE_ISOC: Isochronous type/ * EP_TYPE_BULK: Bulk type/ * EP_TYPE_INTR: Interrupt type/ * @param token: Endpoint Type. @@ -317,13 +321,13 @@ __weak void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhhcd) * @retval HAL status */ HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, - uint8_t ch_num, - uint8_t direction , - uint8_t ep_type, - uint8_t token, - uint8_t* pbuff, - uint16_t length, - uint8_t do_ping) + uint8_t ch_num, + uint8_t direction, + uint8_t ep_type, + uint8_t token, + uint8_t* pbuff, + uint16_t length, + uint8_t do_ping) { hhcd->hc[ch_num].ep_is_in = direction; hhcd->hc[ch_num].ep_type = ep_type; @@ -355,7 +359,7 @@ HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, } else { /* Put the PID 1 */ - hhcd->hc[ch_num].data_pid = HC_PID_DATA1 ; + hhcd->hc[ch_num].data_pid = HC_PID_DATA1; } if(hhcd->hc[ch_num].urb_state != URB_NOTREADY) { @@ -374,7 +378,7 @@ HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, } else { /* Put the PID 1 */ - hhcd->hc[ch_num].data_pid = HC_PID_DATA1 ; + hhcd->hc[ch_num].data_pid = HC_PID_DATA1; } if(hhcd->hc[ch_num].urb_state != URB_NOTREADY) { @@ -404,7 +408,7 @@ HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, } else { /* Put the PID 1 */ - hhcd->hc[ch_num].data_pid = HC_PID_DATA1 ; + hhcd->hc[ch_num].data_pid = HC_PID_DATA1; } } else @@ -422,14 +426,13 @@ HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, case EP_TYPE_ISOC: hhcd->hc[ch_num].data_pid = HC_PID_DATA0; - break; - + break; } hhcd->hc[ch_num].xfer_buff = pbuff; hhcd->hc[ch_num].xfer_len = length; hhcd->hc[ch_num].urb_state = URB_IDLE; - hhcd->hc[ch_num].xfer_count = 0 ; + hhcd->hc[ch_num].xfer_count = 0; hhcd->hc[ch_num].ch_num = ch_num; hhcd->hc[ch_num].state = HC_IDLE; @@ -446,10 +449,10 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) USB_OTG_GlobalTypeDef *USBx = hhcd->Instance; uint32_t i = 0 , interrupt = 0; - /* ensure that we are in device mode */ + /* Ensure that we are in device mode */ if (USB_GetMode(hhcd->Instance) == USB_OTG_MODE_HOST) { - /* avoid spurious interrupt */ + /* Avoid spurious interrupt */ if(__HAL_HCD_IS_INVALID_INTERRUPT(hhcd)) { return; @@ -457,25 +460,25 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) if(__HAL_HCD_GET_FLAG(hhcd, USB_OTG_GINTSTS_PXFR_INCOMPISOOUT)) { - /* incorrect mode, acknowledge the interrupt */ + /* Incorrect mode, acknowledge the interrupt */ __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_PXFR_INCOMPISOOUT); } if(__HAL_HCD_GET_FLAG(hhcd, USB_OTG_GINTSTS_IISOIXFR)) { - /* incorrect mode, acknowledge the interrupt */ + /* Incorrect mode, acknowledge the interrupt */ __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_IISOIXFR); } - + if(__HAL_HCD_GET_FLAG(hhcd, USB_OTG_GINTSTS_PTXFE)) { - /* incorrect mode, acknowledge the interrupt */ + /* Incorrect mode, acknowledge the interrupt */ __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_PTXFE); } if(__HAL_HCD_GET_FLAG(hhcd, USB_OTG_GINTSTS_MMIS)) { - /* incorrect mode, acknowledge the interrupt */ + /* Incorrect mode, acknowledge the interrupt */ __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_MMIS); } @@ -486,10 +489,10 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) /* Cleanup HPRT */ USBx_HPRT0 &= ~(USB_OTG_HPRT_PENA | USB_OTG_HPRT_PCDET |\ USB_OTG_HPRT_PENCHNG | USB_OTG_HPRT_POCCHNG ); - + /* Handle Host Port Interrupts */ HAL_HCD_Disconnect_Callback(hhcd); - USB_InitFSLSPClkSel(hhcd->Instance ,HCFG_48_MHZ ); + USB_InitFSLSPClkSel(hhcd->Instance ,HCFG_48_MHZ ); __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_DISCINT); } @@ -505,19 +508,18 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) HAL_HCD_SOF_Callback(hhcd); __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_SOF); } - + /* Handle Host channel Interrupts */ if(__HAL_HCD_GET_FLAG(hhcd, USB_OTG_GINTSTS_HCINT)) { - interrupt = USB_HC_ReadInterrupt(hhcd->Instance); - for (i = 0; i < hhcd->Init.Host_channels ; i++) + for (i = 0; i < hhcd->Init.Host_channels; i++) { if (interrupt & (1 << i)) { if ((USBx_HC(i)->HCCHAR) & USB_OTG_HCCHAR_EPDIR) { - HCD_HC_IN_IRQHandler (hhcd, i); + HCD_HC_IN_IRQHandler(hhcd, i); } else { @@ -528,7 +530,7 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) __HAL_HCD_CLEAR_FLAG(hhcd, USB_OTG_GINTSTS_HCINT); } - /* Handle Rx Queue Level Interrupts */ + /* Handle Rx Queue Level Interrupts */ if(__HAL_HCD_GET_FLAG(hhcd, USB_OTG_GINTSTS_RXFLVL)) { USB_MASK_INTERRUPT(hhcd->Instance, USB_OTG_GINTSTS_RXFLVL); @@ -537,7 +539,6 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) USB_UNMASK_INTERRUPT(hhcd->Instance, USB_OTG_GINTSTS_RXFLVL); } - } } @@ -549,7 +550,7 @@ void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd) __weak void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_HCD_SOF_Callback could be implenetd in the user file + the HAL_HCD_SOF_Callback could be implemented in the user file */ } @@ -561,19 +562,19 @@ __weak void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd) __weak void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_HCD_Connect_Callback could be implenetd in the user file + the HAL_HCD_Connect_Callback could be implemented in the user file */ } /** - * @brief Disonnexion Event callback. + * @brief Disconnexion Event callback. * @param hhcd: HCD handle * @retval None */ __weak void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_HCD_Disconnect_Callback could be implenetd in the user file + the HAL_HCD_Disconnect_Callback could be implemented in the user file */ } @@ -595,7 +596,7 @@ __weak void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd) __weak void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, uint8_t chnum, HCD_URBStateTypeDef urb_state) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_HCD_HC_NotifyURBChange_Callback could be implenetd in the user file + the HAL_HCD_HC_NotifyURBChange_Callback could be implemented in the user file */ } @@ -603,10 +604,10 @@ __weak void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, uint8_t * @} */ -/** @defgroup HCD_Group3 Peripheral Control functions - * @brief management functions +/** @addtogroup HCD_Exported_Functions_Group3 + * @brief Peripheral State functions * -@verbatim +@verbatim =============================================================================== ##### Peripheral Control functions ##### =============================================================================== @@ -660,10 +661,10 @@ HAL_StatusTypeDef HAL_HCD_ResetPort(HCD_HandleTypeDef *hhcd) * @} */ -/** @defgroup HCD_Group4 Peripheral State functions +/** @addtogroup HCD_Exported_Functions_Group4 * @brief Peripheral State functions * -@verbatim +@verbatim =============================================================================== ##### Peripheral State functions ##### =============================================================================== @@ -697,7 +698,7 @@ HCD_StateTypeDef HAL_HCD_GetState(HCD_HandleTypeDef *hhcd) * URB_NOTREADY/ * URB_NYET/ * URB_ERROR/ - * URB_STALL + * URB_STALL/ */ HCD_URBStateTypeDef HAL_HCD_HC_GetURBState(HCD_HandleTypeDef *hhcd, uint8_t chnum) { @@ -758,22 +759,28 @@ uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd) { return (USB_GetHostSpeed(hhcd->Instance)); } +/** + * @} + */ /** * @} */ +/** @addtogroup HCD_Private_Functions + * @{ + */ /** * @brief This function handles Host Channel IN interrupt requests. * @param hhcd: HCD handle * @param chnum: Channel number. * This parameter can be a value from 1 to 15 - * @retval none + * @retval None */ -static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) +static void HCD_HC_IN_IRQHandler(HCD_HandleTypeDef *hhcd, uint8_t chnum) { USB_OTG_GlobalTypeDef *USBx = hhcd->Instance; - + if ((USBx_HC(chnum)->HCINT) & USB_OTG_HCINT_AHBERR) { __HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_AHBERR); @@ -814,7 +821,7 @@ static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) if (hhcd->Init.dma_enable) { hhcd->hc[chnum].xfer_count = hhcd->hc[chnum].xfer_len - \ - (USBx_HC(chnum)->HCTSIZ & USB_OTG_HCTSIZ_XFRSIZ); + (USBx_HC(chnum)->HCTSIZ & USB_OTG_HCTSIZ_XFRSIZ); } hhcd->hc[chnum].state = HC_XFRC; @@ -877,10 +884,10 @@ static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) else if ((USBx_HC(chnum)->HCINT) & USB_OTG_HCINT_TXERR) { __HAL_HCD_UNMASK_HALT_HC_INT(chnum); - hhcd->hc[chnum].ErrCnt++; - hhcd->hc[chnum].state = HC_XACTERR; - USB_HC_Halt(hhcd->Instance, chnum); - __HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_TXERR); + hhcd->hc[chnum].ErrCnt++; + hhcd->hc[chnum].state = HC_XACTERR; + USB_HC_Halt(hhcd->Instance, chnum); + __HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_TXERR); } else if ((USBx_HC(chnum)->HCINT) & USB_OTG_HCINT_NAK) { @@ -895,10 +902,10 @@ static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) /* re-activate the channel */ USBx_HC(chnum)->HCCHAR &= ~USB_OTG_HCCHAR_CHDIS; USBx_HC(chnum)->HCCHAR |= USB_OTG_HCCHAR_CHENA; - + } hhcd->hc[chnum].state = HC_NAK; - __HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_NAK); + __HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_NAK); } } @@ -907,7 +914,7 @@ static void HCD_HC_IN_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) * @param hhcd: HCD handle * @param chnum: Channel number. * This parameter can be a value from 1 to 15 - * @retval none + * @retval None */ static void HCD_HC_OUT_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) { @@ -1047,21 +1054,21 @@ static void HCD_HC_OUT_IRQHandler (HCD_HandleTypeDef *hhcd, uint8_t chnum) /** * @brief This function handles Rx Queue Level interrupt requests. * @param hhcd: HCD handle - * @retval none + * @retval None */ -static void HCD_RXQLVL_IRQHandler (HCD_HandleTypeDef *hhcd) +static void HCD_RXQLVL_IRQHandler(HCD_HandleTypeDef *hhcd) { USB_OTG_GlobalTypeDef *USBx = hhcd->Instance; - uint8_t channelnum =0; - uint32_t pktsts; - uint32_t pktcnt; - uint32_t temp = 0; + uint8_t channelnum = 0; + uint32_t pktsts; + uint32_t pktcnt; + uint32_t temp = 0; - temp = hhcd->Instance->GRXSTSP ; + temp = hhcd->Instance->GRXSTSP; channelnum = temp & USB_OTG_GRXSTSP_EPNUM; pktsts = (temp & USB_OTG_GRXSTSP_PKTSTS) >> 17; pktcnt = (temp & USB_OTG_GRXSTSP_BCNT) >> 4; - + switch (pktsts) { case GRXSTS_PKTSTS_IN: @@ -1070,11 +1077,11 @@ static void HCD_RXQLVL_IRQHandler (HCD_HandleTypeDef *hhcd) { USB_ReadPacket(hhcd->Instance, hhcd->hc[channelnum].xfer_buff, pktcnt); - + /*manage multiple Xfer */ hhcd->hc[channelnum].xfer_buff += pktcnt; hhcd->hc[channelnum].xfer_count += pktcnt; - + if((USBx_HC(channelnum)->HCTSIZ & USB_OTG_HCTSIZ_PKTCNT) > 0) { /* re-activate the channel when more packets are expected */ @@ -1084,7 +1091,7 @@ static void HCD_RXQLVL_IRQHandler (HCD_HandleTypeDef *hhcd) } } break; - + case GRXSTS_PKTSTS_DATA_TOGGLE_ERR: break; case GRXSTS_PKTSTS_IN_XFER_COMP: @@ -1111,7 +1118,7 @@ static void HCD_Port_IRQHandler (HCD_HandleTypeDef *hhcd) hprt0_dup &= ~(USB_OTG_HPRT_PENA | USB_OTG_HPRT_PCDET |\ USB_OTG_HPRT_PENCHNG | USB_OTG_HPRT_POCCHNG ); - /* Check wether Port Connect Detected */ + /* Check whether Port Connect Detected */ if((hprt0 & USB_OTG_HPRT_PCDET) == USB_OTG_HPRT_PCDET) { if((hprt0 & USB_OTG_HPRT_PCSTS) == USB_OTG_HPRT_PCSTS) @@ -1165,7 +1172,7 @@ static void HCD_Port_IRQHandler (HCD_HandleTypeDef *hhcd) } } - /* Check For an overcurrent */ + /* Check for an overcurrent */ if((hprt0 & USB_OTG_HPRT_POCCHNG) == USB_OTG_HPRT_POCCHNG) { hprt0_dup |= USB_OTG_HPRT_POCCHNG; diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.h index 21da393f524..c9a353f0e01 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_hcd.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_hcd.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of HCD HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -50,15 +50,19 @@ * @{ */ -/** @addtogroup HCD +/** @defgroup HCD HCD + * @brief HCD HAL module driver * @{ - */ + */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup HCD_Exported_Types HCD Exported Types + * @{ + */ - /** - * @brief HCD Status structures structure definition - */ +/** @defgroup HCD_Exported_Types_Group1 HCD State Structure definition + * @{ + */ typedef enum { HAL_HCD_STATE_RESET = 0x00, @@ -73,9 +77,12 @@ typedef USB_OTG_CfgTypeDef HCD_InitTypeDef; typedef USB_OTG_HCTypeDef HCD_HCTypeDef ; typedef USB_OTG_URBStateTypeDef HCD_URBStateTypeDef ; typedef USB_OTG_HCStateTypeDef HCD_HCStateTypeDef ; +/** + * @} + */ -/** - * @brief HCD Handle Structure definition +/** @defgroup HCD_Exported_Types_Group2 HCD Handle Structure definition + * @{ */ typedef struct { @@ -84,42 +91,31 @@ typedef struct HCD_HCTypeDef hc[15]; /*!< Host channels parameters */ HAL_LockTypeDef Lock; /*!< HCD peripheral status */ __IO HCD_StateTypeDef State; /*!< HCD communication state */ - void *pData; /*!< Pointer Stack Handler */ - + void *pData; /*!< Pointer Stack Handler */ } HCD_HandleTypeDef; - -/* Exported constants --------------------------------------------------------*/ -/** @defgroup HCD_Exported_Constants - * @{ +/** + * @} */ -/** @defgroup HCD_Instance_definition - * @{ - */ - -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \ - ((INSTANCE) == USB_OTG_HS)) -#elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) - #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS)) -#endif - /** * @} - */ + */ -/** @defgroup HCD_Speed +/* Exported constants --------------------------------------------------------*/ +/** @defgroup HCD_Exported_Constants HCD Exported Constants + * @{ + */ +/** @defgroup HCD_Speed HCD Speed * @{ */ #define HCD_SPEED_HIGH 0 #define HCD_SPEED_LOW 2 #define HCD_SPEED_FULL 3 - /** * @} */ - - /** @defgroup HCD_PHY_Module + +/** @defgroup HCD_PHY_Module HCD PHY Module * @{ */ #define HCD_PHY_ULPI 1 @@ -127,94 +123,156 @@ typedef struct /** * @} */ + /** * @} */ - -/* Exported macro ------------------------------------------------------------*/ -/** @defgroup HCD_Interrupt_Clock +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup HCD_Exported_Macros HCD Exported Macros * @brief macros to handle interrupts and specific clock configurations * @{ */ -#define __HAL_HCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance) -#define __HAL_HCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance) - +#define __HAL_HCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance) +#define __HAL_HCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance) #define __HAL_HCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__)) #define __HAL_HCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__)) #define __HAL_HCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0) - - + #define __HAL_HCD_CLEAR_HC_INT(chnum, __INTERRUPT__) (USBx_HC(chnum)->HCINT = (__INTERRUPT__)) #define __HAL_HCD_MASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_CHHM) #define __HAL_HCD_UNMASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_CHHM) #define __HAL_HCD_MASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_ACKM) #define __HAL_HCD_UNMASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_ACKM) - /** * @} */ /* Exported functions --------------------------------------------------------*/ +/** @defgroup HCD_Exported_Functions HCD Exported Functions + * @{ + */ -/* Initialization/de-initialization functions **********************************/ -HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd); -HAL_StatusTypeDef HAL_HCD_DeInit (HCD_HandleTypeDef *hhcd); -HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, - uint8_t ch_num, - uint8_t epnum, - uint8_t dev_address, - uint8_t speed, - uint8_t ep_type, - uint16_t mps); - -HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, - uint8_t ch_num); - -void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd); -void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhcd); - -/* I/O operation functions *****************************************************/ -HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, - uint8_t pipe, - uint8_t direction , - uint8_t ep_type, - uint8_t token, - uint8_t* pbuff, - uint16_t length, - uint8_t do_ping); - - /* Non-Blocking mode: Interrupt */ -void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd); -void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd); -void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd); -void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd); -void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, - uint8_t chnum, - HCD_URBStateTypeDef urb_state); - -/* Peripheral Control functions ************************************************/ -HAL_StatusTypeDef HAL_HCD_ResetPort(HCD_HandleTypeDef *hhcd); -HAL_StatusTypeDef HAL_HCD_Start(HCD_HandleTypeDef *hhcd); -HAL_StatusTypeDef HAL_HCD_Stop(HCD_HandleTypeDef *hhcd); - -/* Peripheral State functions **************************************************/ -HCD_StateTypeDef HAL_HCD_GetState(HCD_HandleTypeDef *hhcd); -HCD_URBStateTypeDef HAL_HCD_HC_GetURBState(HCD_HandleTypeDef *hhcd, uint8_t chnum); -uint32_t HAL_HCD_HC_GetXferCount(HCD_HandleTypeDef *hhcd, uint8_t chnum); -HCD_HCStateTypeDef HAL_HCD_HC_GetState(HCD_HandleTypeDef *hhcd, uint8_t chnum); -uint32_t HAL_HCD_GetCurrentFrame(HCD_HandleTypeDef *hhcd); -uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd); +/** @defgroup HCD_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ +HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd); +HAL_StatusTypeDef HAL_HCD_DeInit(HCD_HandleTypeDef *hhcd); +HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, + uint8_t ch_num, + uint8_t epnum, + uint8_t dev_address, + uint8_t speed, + uint8_t ep_type, + uint16_t mps); +HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, uint8_t ch_num); +void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd); +void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhcd); /** * @} - */ + */ +/** @defgroup HCD_Exported_Functions_Group2 IO operation functions + * @{ + */ +HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, + uint8_t pipe, + uint8_t direction, + uint8_t ep_type, + uint8_t token, + uint8_t* pbuff, + uint16_t length, + uint8_t do_ping); + +/* Non-Blocking mode: Interrupt */ +void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd); +void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd); +void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd); +void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd); +void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, + uint8_t chnum, + HCD_URBStateTypeDef urb_state); /** * @} */ - + +/** @defgroup HCD_Exported_Functions_Group3 Peripheral Control functions + * @{ + */ +HAL_StatusTypeDef HAL_HCD_ResetPort(HCD_HandleTypeDef *hhcd); +HAL_StatusTypeDef HAL_HCD_Start(HCD_HandleTypeDef *hhcd); +HAL_StatusTypeDef HAL_HCD_Stop(HCD_HandleTypeDef *hhcd); +/** + * @} + */ + +/** @defgroup HCD_Exported_Functions_Group4 Peripheral State functions + * @{ + */ +HCD_StateTypeDef HAL_HCD_GetState(HCD_HandleTypeDef *hhcd); +HCD_URBStateTypeDef HAL_HCD_HC_GetURBState(HCD_HandleTypeDef *hhcd, uint8_t chnum); +uint32_t HAL_HCD_HC_GetXferCount(HCD_HandleTypeDef *hhcd, uint8_t chnum); +HCD_HCStateTypeDef HAL_HCD_HC_GetState(HCD_HandleTypeDef *hhcd, uint8_t chnum); +uint32_t HAL_HCD_GetCurrentFrame(HCD_HandleTypeDef *hhcd); +uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd); +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup HCD_Private_Macros HCD Private Macros + * @{ + */ +/** @defgroup HCD_Instance_definition HCD Instance definition + * @{ + */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) ||\ + defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) + #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \ + ((INSTANCE) == USB_OTG_HS)) +#elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS)) +#endif +/** + * @} + */ + +/** + * @} + */ + +/* Private functions prototypes ----------------------------------------------*/ +/** @defgroup HCD_Private_Functions_Prototypes HCD Private Functions Prototypes + * @{ + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup HCD_Private_Functions HCD Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.c index 1ef36398a52..88042f7de00 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_i2c.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief I2C HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Inter Integrated Circuit (I2C) peripheral: @@ -35,7 +35,7 @@ (+++) Enable the DMAx interface clock using (+++) Configure the DMA handle parameters (+++) Configure the DMA Tx or Rx Stream - (+++) Associate the initilalized DMA handle to the hi2c DMA Tx or Rx handle + (+++) Associate the initialized DMA handle to the hi2c DMA Tx or Rx handle (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx or Rx Stream @@ -43,7 +43,7 @@ Dual Addressing mode, Own Address2, General call and Nostretch mode in the hi2c Init structure. (#) Initialize the I2C registers by calling the HAL_I2C_Init(), configures also the low level Hardware - (GPIO, CLOCK, NVIC...etc) by calling the customed HAL_I2C_MspInit(&hi2c) API. + (GPIO, CLOCK, NVIC...etc) by calling the customized HAL_I2C_MspInit(&hi2c) API. (#) To check if target device is ready for communication, use the function HAL_I2C_IsDeviceReady() @@ -153,7 +153,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -187,7 +187,7 @@ * @{ */ -/** @defgroup I2C +/** @defgroup I2C I2C * @brief I2C HAL module driver * @{ */ @@ -196,12 +196,21 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup I2C_Private_Constants + * @{ + */ #define I2C_TIMEOUT_FLAG ((uint32_t)35) /* 35 ms */ #define I2C_TIMEOUT_ADDR_SLAVE ((uint32_t)10000) /* 10 s */ +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup I2C_Private_Functions + * @{ + */ static void I2C_DMAMasterTransmitCplt(DMA_HandleTypeDef *hdma); static void I2C_DMAMasterReceiveCplt(DMA_HandleTypeDef *hdma); static void I2C_DMASlaveTransmitCplt(DMA_HandleTypeDef *hdma); @@ -229,14 +238,16 @@ static HAL_StatusTypeDef I2C_SlaveReceive_BTF(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_Slave_ADDR(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_Slave_STOPF(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_Slave_AF(I2C_HandleTypeDef *hi2c); +/** + * @} + */ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup I2C_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup I2C_Exported_Functions I2C Exported Functions * @{ */ -/** @defgroup I2C_Group1 Initialization and de-initialization functions +/** @defgroup I2C_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -244,7 +255,7 @@ static HAL_StatusTypeDef I2C_Slave_AF(I2C_HandleTypeDef *hi2c); ##### Initialization and de-initialization functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to initialize and - de-initialiaze the I2Cx peripheral: + de-initialize the I2Cx peripheral: (+) User must Implement HAL_I2C_MspInit() function in which he configures all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC). @@ -261,7 +272,7 @@ static HAL_StatusTypeDef I2C_Slave_AF(I2C_HandleTypeDef *hi2c); (++) Nostretch mode (+) Call the function HAL_I2C_DeInit() to restore the default configuration - of the selected I2Cx periperal. + of the selected I2Cx peripheral. @endverbatim * @{ @@ -298,20 +309,22 @@ HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c) if(hi2c->State == HAL_I2C_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hi2c->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC */ HAL_I2C_MspInit(hi2c); } hi2c->State = HAL_I2C_STATE_BUSY; - /* Disble the selected I2C peripheral */ + /* Disable the selected I2C peripheral */ __HAL_I2C_DISABLE(hi2c); /* Get PCLK1 frequency */ pclk1 = HAL_RCC_GetPCLK1Freq(); /* Calculate frequency range */ - freqrange = __HAL_I2C_FREQRANGE(pclk1); + freqrange = I2C_FREQRANGE(pclk1); /*---------------------------- I2Cx CR2 Configuration ----------------------*/ /* Configure I2Cx: Frequency range */ @@ -319,11 +332,11 @@ HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c) /*---------------------------- I2Cx TRISE Configuration --------------------*/ /* Configure I2Cx: Rise Time */ - hi2c->Instance->TRISE = __HAL_I2C_RISE_TIME(freqrange, hi2c->Init.ClockSpeed); + hi2c->Instance->TRISE = I2C_RISE_TIME(freqrange, hi2c->Init.ClockSpeed); /*---------------------------- I2Cx CCR Configuration ----------------------*/ /* Configure I2Cx: Speed */ - hi2c->Instance->CCR = __HAL_I2C_SPEED(pclk1, hi2c->Init.ClockSpeed, hi2c->Init.DutyCycle); + hi2c->Instance->CCR = I2C_SPEED(pclk1, hi2c->Init.ClockSpeed, hi2c->Init.DutyCycle); /*---------------------------- I2Cx CR1 Configuration ----------------------*/ /* Configure I2Cx: Generalcall and NoStretch mode */ @@ -411,7 +424,7 @@ HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c) * @} */ -/** @defgroup I2C_Group2 IO operation functions +/** @defgroup I2C_Exported_Functions_Group2 IO operation functions * @brief Data transfers functions * @verbatim @@ -1266,7 +1279,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t hi2c->XferSize = Size; hi2c->XferCount = Size; - /* Set the I2C DMA transfert complete callback */ + /* Set the I2C DMA transfer complete callback */ hi2c->hdmatx->XferCpltCallback = I2C_DMAMasterTransmitCplt; /* Set the DMA error callback */ @@ -1342,7 +1355,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t D hi2c->XferSize = Size; hi2c->XferCount = Size; - /* Set the I2C DMA transfert complete callback */ + /* Set the I2C DMA transfer complete callback */ hi2c->hdmarx->XferCpltCallback = I2C_DMAMasterReceiveCplt; /* Set the DMA error callback */ @@ -1428,7 +1441,7 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *p hi2c->XferSize = Size; hi2c->XferCount = Size; - /* Set the I2C DMA transfert complete callback */ + /* Set the I2C DMA transfer complete callback */ hi2c->hdmatx->XferCpltCallback = I2C_DMASlaveTransmitCplt; /* Set the DMA error callback */ @@ -1513,7 +1526,7 @@ HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pD hi2c->XferSize = Size; hi2c->XferCount = Size; - /* Set the I2C DMA transfert complete callback */ + /* Set the I2C DMA transfer complete callback */ hi2c->hdmarx->XferCpltCallback = I2C_DMASlaveReceiveCplt; /* Set the DMA error callback */ @@ -2054,7 +2067,7 @@ HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAdd hi2c->XferSize = Size; hi2c->XferCount = Size; - /* Set the I2C DMA transfert complete callback */ + /* Set the I2C DMA transfer complete callback */ hi2c->hdmatx->XferCpltCallback = I2C_DMAMemTransmitCplt; /* Set the DMA error callback */ @@ -2132,7 +2145,7 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddr hi2c->XferSize = Size; hi2c->XferCount = Size; - /* Set the I2C DMA transfert complete callback */ + /* Set the I2C DMA transfer complete callback */ hi2c->hdmarx->XferCpltCallback = I2C_DMAMemReceiveCplt; /* Set the DMA error callback */ @@ -2225,7 +2238,7 @@ HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAdd } /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_7BIT_ADD_WRITE(DevAddress); + hi2c->Instance->DR = I2C_7BIT_ADD_WRITE(DevAddress); /* Wait until ADDR or AF flag are set */ /* Get tick */ @@ -2469,6 +2482,9 @@ void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c) { hi2c->State = HAL_I2C_STATE_READY; + /* Disable Pos bit in I2C CR1 when error occurred in Master/Mem Receive IT Process */ + hi2c->Instance->CR1 &= ~I2C_CR1_POS; + HAL_I2C_ErrorCallback(hi2c); } } @@ -2567,7 +2583,7 @@ __weak void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c) * @} */ -/** @defgroup I2C_Group3 Peripheral State and Errors functions +/** @defgroup I2C_Exported_Functions_Group3 Peripheral State and Errors functions * @brief Peripheral State and Errors functions * @verbatim @@ -2710,6 +2726,9 @@ static HAL_StatusTypeDef I2C_MasterReceive_RXNE(I2C_HandleTypeDef *hi2c) return HAL_TIMEOUT; } + /* Disable Pos */ + hi2c->Instance->CR1 &= ~I2C_CR1_POS; + if(hi2c->State == HAL_I2C_STATE_MEM_BUSY_RX) { hi2c->State = HAL_I2C_STATE_READY; @@ -2765,6 +2784,9 @@ static HAL_StatusTypeDef I2C_MasterReceive_BTF(I2C_HandleTypeDef *hi2c) return HAL_TIMEOUT; } + /* Disable Pos */ + hi2c->Instance->CR1 &= ~I2C_CR1_POS; + if(hi2c->State == HAL_I2C_STATE_MEM_BUSY_RX) { hi2c->State = HAL_I2C_STATE_READY; @@ -2932,6 +2954,7 @@ static HAL_StatusTypeDef I2C_Slave_AF(I2C_HandleTypeDef *hi2c) * @param hi2c: pointer to a I2C_HandleTypeDef structure that contains * the configuration information for I2C module * @param DevAddress: Target device address + * @param Timeout: Timeout duration * @retval HAL status */ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Timeout) @@ -2948,12 +2971,12 @@ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_ if(hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) { /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_7BIT_ADD_WRITE(DevAddress); + hi2c->Instance->DR = I2C_7BIT_ADD_WRITE(DevAddress); } else { /* Send header of slave address */ - hi2c->Instance->DR = __HAL_I2C_10BIT_HEADER_WRITE(DevAddress); + hi2c->Instance->DR = I2C_10BIT_HEADER_WRITE(DevAddress); /* Wait until ADD10 flag is set */ if(I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADD10, Timeout) != HAL_OK) @@ -2969,7 +2992,7 @@ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_ } /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_10BIT_ADDRESS(DevAddress); + hi2c->Instance->DR = I2C_10BIT_ADDRESS(DevAddress); } /* Wait until ADDR flag is set */ @@ -2993,6 +3016,7 @@ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_ * @param hi2c: pointer to a I2C_HandleTypeDef structure that contains * the configuration information for I2C module * @param DevAddress: Target device address + * @param Timeout: Timeout duration * @retval HAL status */ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Timeout) @@ -3012,12 +3036,12 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t if(hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) { /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_7BIT_ADD_READ(DevAddress); + hi2c->Instance->DR = I2C_7BIT_ADD_READ(DevAddress); } else { /* Send header of slave address */ - hi2c->Instance->DR = __HAL_I2C_10BIT_HEADER_WRITE(DevAddress); + hi2c->Instance->DR = I2C_10BIT_HEADER_WRITE(DevAddress); /* Wait until ADD10 flag is set */ if(I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADD10, Timeout) != HAL_OK) @@ -3033,7 +3057,7 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t } /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_10BIT_ADDRESS(DevAddress); + hi2c->Instance->DR = I2C_10BIT_ADDRESS(DevAddress); /* Wait until ADDR flag is set */ if(I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout) != HAL_OK) @@ -3061,7 +3085,7 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t } /* Send header of slave address */ - hi2c->Instance->DR = __HAL_I2C_10BIT_HEADER_READ(DevAddress); + hi2c->Instance->DR = I2C_10BIT_HEADER_READ(DevAddress); } /* Wait until ADDR flag is set */ @@ -3087,6 +3111,7 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t * @param DevAddress: Target device address * @param MemAddress: Internal memory address * @param MemAddSize: Size of internal memory address + * @param Timeout: Timeout duration * @retval HAL status */ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout) @@ -3101,7 +3126,7 @@ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_ } /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_7BIT_ADD_WRITE(DevAddress); + hi2c->Instance->DR = I2C_7BIT_ADD_WRITE(DevAddress); /* Wait until ADDR flag is set */ if(I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout) != HAL_OK) @@ -3129,13 +3154,13 @@ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_ if(MemAddSize == I2C_MEMADD_SIZE_8BIT) { /* Send Memory Address */ - hi2c->Instance->DR = __HAL_I2C_MEM_ADD_LSB(MemAddress); + hi2c->Instance->DR = I2C_MEM_ADD_LSB(MemAddress); } /* If Memory address size is 16Bit */ else { /* Send MSB of Memory Address */ - hi2c->Instance->DR = __HAL_I2C_MEM_ADD_MSB(MemAddress); + hi2c->Instance->DR = I2C_MEM_ADD_MSB(MemAddress); /* Wait until TXE flag is set */ if(I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TXE, RESET, Timeout) != HAL_OK) @@ -3144,7 +3169,7 @@ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_ } /* Send LSB of Memory Address */ - hi2c->Instance->DR = __HAL_I2C_MEM_ADD_LSB(MemAddress); + hi2c->Instance->DR = I2C_MEM_ADD_LSB(MemAddress); } return HAL_OK; @@ -3157,6 +3182,7 @@ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_ * @param DevAddress: Target device address * @param MemAddress: Internal memory address * @param MemAddSize: Size of internal memory address + * @param Timeout: Timeout duration * @retval HAL status */ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout) @@ -3174,7 +3200,7 @@ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t } /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_7BIT_ADD_WRITE(DevAddress); + hi2c->Instance->DR = I2C_7BIT_ADD_WRITE(DevAddress); /* Wait until ADDR flag is set */ if(I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout) != HAL_OK) @@ -3202,13 +3228,13 @@ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t if(MemAddSize == I2C_MEMADD_SIZE_8BIT) { /* Send Memory Address */ - hi2c->Instance->DR = __HAL_I2C_MEM_ADD_LSB(MemAddress); + hi2c->Instance->DR = I2C_MEM_ADD_LSB(MemAddress); } /* If Memory address size is 16Bit */ else { /* Send MSB of Memory Address */ - hi2c->Instance->DR = __HAL_I2C_MEM_ADD_MSB(MemAddress); + hi2c->Instance->DR = I2C_MEM_ADD_MSB(MemAddress); /* Wait until TXE flag is set */ if(I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TXE, RESET, Timeout) != HAL_OK) @@ -3217,7 +3243,7 @@ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t } /* Send LSB of Memory Address */ - hi2c->Instance->DR = __HAL_I2C_MEM_ADD_LSB(MemAddress); + hi2c->Instance->DR = I2C_MEM_ADD_LSB(MemAddress); } /* Wait until TXE flag is set */ @@ -3236,7 +3262,7 @@ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t } /* Send slave address */ - hi2c->Instance->DR = __HAL_I2C_7BIT_ADD_READ(DevAddress); + hi2c->Instance->DR = I2C_7BIT_ADD_READ(DevAddress); /* Wait until ADDR flag is set */ if(I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout) != HAL_OK) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.h index 3bfd8b85c41..4f2b8c1d9b3 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_i2c.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of I2C HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,7 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup I2C_Exported_Types I2C Exported Types + * @{ + */ + /** * @brief I2C Configuration Structure definition */ @@ -104,21 +107,6 @@ typedef enum }HAL_I2C_StateTypeDef; -/** - * @brief HAL I2C Error Code structure definition - */ -typedef enum -{ - HAL_I2C_ERROR_NONE = 0x00, /*!< No error */ - HAL_I2C_ERROR_BERR = 0x01, /*!< BERR error */ - HAL_I2C_ERROR_ARLO = 0x02, /*!< ARLO error */ - HAL_I2C_ERROR_AF = 0x04, /*!< AF error */ - HAL_I2C_ERROR_OVR = 0x08, /*!< OVR error */ - HAL_I2C_ERROR_DMA = 0x10, /*!< DMA transfer error */ - HAL_I2C_ERROR_TIMEOUT = 0x20 /*!< Timeout error */ - -}HAL_I2C_ErrorTypeDef; - /** * @brief I2C handle Structure definition */ @@ -142,89 +130,88 @@ typedef struct __IO HAL_I2C_StateTypeDef State; /*!< I2C communication state */ - __IO HAL_I2C_ErrorTypeDef ErrorCode; /* I2C Error code */ + __IO uint32_t ErrorCode; /*!< I2C Error code */ }I2C_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ +/** @defgroup I2C_Exported_Constants I2C Exported Constants + * @{ + */ -/** @defgroup I2C_Exported_Constants +/** @defgroup I2C_Error_Code I2C Error Code + * @brief I2C Error Code * @{ + */ +#define HAL_I2C_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_I2C_ERROR_BERR ((uint32_t)0x00000001) /*!< BERR error */ +#define HAL_I2C_ERROR_ARLO ((uint32_t)0x00000002) /*!< ARLO error */ +#define HAL_I2C_ERROR_AF ((uint32_t)0x00000004) /*!< AF error */ +#define HAL_I2C_ERROR_OVR ((uint32_t)0x00000008) /*!< OVR error */ +#define HAL_I2C_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ +#define HAL_I2C_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout Error */ +/** + * @} */ -/** @defgroup I2C_duty_cycle_in_fast_mode +/** @defgroup I2C_duty_cycle_in_fast_mode I2C duty cycle in fast mode * @{ */ #define I2C_DUTYCYCLE_2 ((uint32_t)0x00000000) #define I2C_DUTYCYCLE_16_9 I2C_CCR_DUTY - -#define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DUTYCYCLE_2) || \ - ((CYCLE) == I2C_DUTYCYCLE_16_9)) /** * @} */ -/** @defgroup I2C_addressing_mode +/** @defgroup I2C_addressing_mode I2C addressing mode * @{ */ #define I2C_ADDRESSINGMODE_7BIT ((uint32_t)0x00004000) #define I2C_ADDRESSINGMODE_10BIT (I2C_OAR1_ADDMODE | ((uint32_t)0x00004000)) - -#define IS_I2C_ADDRESSING_MODE(ADDRESS) (((ADDRESS) == I2C_ADDRESSINGMODE_7BIT) || \ - ((ADDRESS) == I2C_ADDRESSINGMODE_10BIT)) /** * @} */ -/** @defgroup I2C_dual_addressing_mode +/** @defgroup I2C_dual_addressing_mode I2C dual addressing mode * @{ */ -#define I2C_DUALADDRESS_DISABLED ((uint32_t)0x00000000) -#define I2C_DUALADDRESS_ENABLED I2C_OAR2_ENDUAL - -#define IS_I2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == I2C_DUALADDRESS_DISABLED) || \ - ((ADDRESS) == I2C_DUALADDRESS_ENABLED)) +#define I2C_DUALADDRESS_DISABLE ((uint32_t)0x00000000) +#define I2C_DUALADDRESS_ENABLE I2C_OAR2_ENDUAL /** * @} */ -/** @defgroup I2C_general_call_addressing_mode +/** @defgroup I2C_general_call_addressing_mode I2C general call addressing mode * @{ */ -#define I2C_GENERALCALL_DISABLED ((uint32_t)0x00000000) -#define I2C_GENERALCALL_ENABLED I2C_CR1_ENGC - -#define IS_I2C_GENERAL_CALL(CALL) (((CALL) == I2C_GENERALCALL_DISABLED) || \ - ((CALL) == I2C_GENERALCALL_ENABLED)) +#define I2C_GENERALCALL_DISABLE ((uint32_t)0x00000000) +#define I2C_GENERALCALL_ENABLE I2C_CR1_ENGC /** * @} */ -/** @defgroup I2C_nostretch_mode +/** @defgroup I2C_nostretch_mode I2C nostretch mode * @{ */ -#define I2C_NOSTRETCH_DISABLED ((uint32_t)0x00000000) -#define I2C_NOSTRETCH_ENABLED I2C_CR1_NOSTRETCH - -#define IS_I2C_NO_STRETCH(STRETCH) (((STRETCH) == I2C_NOSTRETCH_DISABLED) || \ - ((STRETCH) == I2C_NOSTRETCH_ENABLED)) +#define I2C_NOSTRETCH_DISABLE ((uint32_t)0x00000000) +#define I2C_NOSTRETCH_ENABLE I2C_CR1_NOSTRETCH /** * @} */ -/** @defgroup I2C_Memory_Address_Size +/** @defgroup I2C_Memory_Address_Size I2C Memory Address Size * @{ */ #define I2C_MEMADD_SIZE_8BIT ((uint32_t)0x00000001) #define I2C_MEMADD_SIZE_16BIT ((uint32_t)0x00000010) - -#define IS_I2C_MEMADD_SIZE(SIZE) (((SIZE) == I2C_MEMADD_SIZE_8BIT) || \ - ((SIZE) == I2C_MEMADD_SIZE_16BIT)) /** * @} */ -/** @defgroup I2C_Interrupt_configuration_definition +/** @defgroup I2C_Interrupt_configuration_definition I2C Interrupt configuration definition * @{ */ #define I2C_IT_BUF I2C_CR2_ITBUFEN @@ -234,7 +221,7 @@ typedef struct * @} */ -/** @defgroup I2C_Flag_definition +/** @defgroup I2C_Flag_definition I2C Flag definition * @{ */ #define I2C_FLAG_SMBALERT ((uint32_t)0x00018000) @@ -267,6 +254,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup I2C_Exported_Macros I2C Exported Macros + * @{ + */ /** @brief Reset I2C handle state * @param __HANDLE__: specifies the I2C Handle. @@ -285,7 +275,6 @@ typedef struct * @arg I2C_IT_ERR: Error interrupt enable * @retval None */ - #define __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR2 |= (__INTERRUPT__)) #define __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR2 &= (~(__INTERRUPT__))) @@ -330,7 +319,6 @@ typedef struct * @arg I2C_FLAG_MSL: Master/Slave flag * @retval The new state of __FLAG__ (TRUE or FALSE). */ -#define I2C_FLAG_MASK ((uint32_t)0x0000FFFF) #define __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) ((((uint8_t)((__FLAG__) >> 16)) == 0x01)?((((__HANDLE__)->Instance->SR1) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK)): \ ((((__HANDLE__)->Instance->SR2) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK))) @@ -355,53 +343,57 @@ typedef struct * This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral. * @retval None */ - -#define __HAL_I2C_CLEAR_ADDRFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR1;\ - (__HANDLE__)->Instance->SR2;}while(0) +#define __HAL_I2C_CLEAR_ADDRFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR1; \ + tmpreg = (__HANDLE__)->Instance->SR2; \ + UNUSED(tmpreg); \ + } while(0) /** @brief Clears the I2C STOPF pending flag. * @param __HANDLE__: specifies the I2C Handle. * This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral. * @retval None */ -#define __HAL_I2C_CLEAR_STOPFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR1;\ - (__HANDLE__)->Instance->CR1 |= I2C_CR1_PE;}while(0) - +#define __HAL_I2C_CLEAR_STOPFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR1; \ + (__HANDLE__)->Instance->CR1 |= I2C_CR1_PE; \ + UNUSED(tmpreg); \ + } while(0) + #define __HAL_I2C_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= I2C_CR1_PE) #define __HAL_I2C_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~I2C_CR1_PE) -#define __HAL_I2C_FREQRANGE(__PCLK__) ((__PCLK__)/1000000) -#define __HAL_I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (((__SPEED__) <= 100000) ? ((__FREQRANGE__) + 1) : ((((__FREQRANGE__) * 300) / 1000) + 1)) -#define __HAL_I2C_SPEED_STANDARD(__PCLK__, __SPEED__) (((((__PCLK__)/((__SPEED__) << 1)) & I2C_CCR_CCR) < 4)? 4:((__PCLK__) / ((__SPEED__) << 1))) -#define __HAL_I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? ((__PCLK__) / ((__SPEED__) * 3)) : (((__PCLK__) / ((__SPEED__) * 25)) | I2C_DUTYCYCLE_16_9)) -#define __HAL_I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__SPEED__) <= 100000)? (__HAL_I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \ - ((__HAL_I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0)? 1 : \ - ((__HAL_I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS)) - -#define __HAL_I2C_7BIT_ADD_WRITE(__ADDRESS__) ((uint8_t)((__ADDRESS__) & (~I2C_OAR1_ADD0))) -#define __HAL_I2C_7BIT_ADD_READ(__ADDRESS__) ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0)) - -#define __HAL_I2C_10BIT_ADDRESS(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) -#define __HAL_I2C_10BIT_HEADER_WRITE(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF0)))) -#define __HAL_I2C_10BIT_HEADER_READ(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF1)))) - -#define __HAL_I2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00))) >> 8))) -#define __HAL_I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) - -#define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) > 0) && ((SPEED) <= 400000)) -#define IS_I2C_OWN_ADDRESS1(ADDRESS1) (((ADDRESS1) & (uint32_t)(0xFFFFFC00)) == 0) -#define IS_I2C_OWN_ADDRESS2(ADDRESS2) (((ADDRESS2) & (uint32_t)(0xFFFFFF01)) == 0) +/** + * @} + */ /* Include I2C HAL Extension module */ #include "stm32f4xx_hal_i2c_ex.h" /* Exported functions --------------------------------------------------------*/ +/** @addtogroup I2C_Exported_Functions + * @{ + */ + +/** @addtogroup I2C_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c); HAL_StatusTypeDef HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c); void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c); void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c); +/** + * @} + */ +/** @addtogroup I2C_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions *****************************************************/ /******* Blocking mode: Polling */ HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout); @@ -438,10 +430,92 @@ void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c); void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c); void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c); void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c); +/** + * @} + */ +/** @addtogroup I2C_Exported_Functions_Group3 + * @{ + */ /* Peripheral Control and State functions **************************************/ HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c); -uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c); +uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c); + +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2C_Private_Constants I2C Private Constants + * @{ + */ +#define I2C_FLAG_MASK ((uint32_t)0x0000FFFF) +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2C_Private_Macros I2C Private Macros + * @{ + */ + +#define I2C_FREQRANGE(__PCLK__) ((__PCLK__)/1000000) +#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (((__SPEED__) <= 100000) ? ((__FREQRANGE__) + 1) : ((((__FREQRANGE__) * 300) / 1000) + 1)) +#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__) (((((__PCLK__)/((__SPEED__) << 1)) & I2C_CCR_CCR) < 4)? 4:((__PCLK__) / ((__SPEED__) << 1))) +#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? ((__PCLK__) / ((__SPEED__) * 3)) : (((__PCLK__) / ((__SPEED__) * 25)) | I2C_DUTYCYCLE_16_9)) +#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__SPEED__) <= 100000)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \ + ((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0)? 1 : \ + ((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS)) + +#define I2C_7BIT_ADD_WRITE(__ADDRESS__) ((uint8_t)((__ADDRESS__) & (~I2C_OAR1_ADD0))) +#define I2C_7BIT_ADD_READ(__ADDRESS__) ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0)) + +#define I2C_10BIT_ADDRESS(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) +#define I2C_10BIT_HEADER_WRITE(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF0)))) +#define I2C_10BIT_HEADER_READ(__ADDRESS__) ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF1)))) + +#define I2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00))) >> 8))) +#define I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF)))) + +/** @defgroup I2C_IS_RTC_Definitions I2C Private macros to check input parameters + * @{ + */ +#define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DUTYCYCLE_2) || \ + ((CYCLE) == I2C_DUTYCYCLE_16_9)) +#define IS_I2C_ADDRESSING_MODE(ADDRESS) (((ADDRESS) == I2C_ADDRESSINGMODE_7BIT) || \ + ((ADDRESS) == I2C_ADDRESSINGMODE_10BIT)) +#define IS_I2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == I2C_DUALADDRESS_DISABLE) || \ + ((ADDRESS) == I2C_DUALADDRESS_ENABLE)) +#define IS_I2C_GENERAL_CALL(CALL) (((CALL) == I2C_GENERALCALL_DISABLE) || \ + ((CALL) == I2C_GENERALCALL_ENABLE)) +#define IS_I2C_NO_STRETCH(STRETCH) (((STRETCH) == I2C_NOSTRETCH_DISABLE) || \ + ((STRETCH) == I2C_NOSTRETCH_ENABLE)) +#define IS_I2C_MEMADD_SIZE(SIZE) (((SIZE) == I2C_MEMADD_SIZE_8BIT) || \ + ((SIZE) == I2C_MEMADD_SIZE_16BIT)) +#define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) > 0) && ((SPEED) <= 400000)) +#define IS_I2C_OWN_ADDRESS1(ADDRESS1) (((ADDRESS1) & (uint32_t)(0xFFFFFC00)) == 0) +#define IS_I2C_OWN_ADDRESS2(ADDRESS2) (((ADDRESS2) & (uint32_t)(0xFFFFFF01)) == 0) +/** + * @} + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup I2C_Private_Functions I2C Private Functions + * @{ + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.c index fbac85c7b14..9338c157aeb 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_i2c_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief I2C Extension HAL module driver. * This file provides firmware functions to manage the following * functionalities of I2C extension peripheral: @@ -30,7 +30,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -64,28 +64,27 @@ * @{ */ -/** @defgroup I2CEx +/** @defgroup I2CEx I2CEx * @brief I2C HAL module driver * @{ */ #ifdef HAL_I2C_MODULE_ENABLED -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup I2CEx_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup I2CEx_Exported_Functions I2C Exported Functions * @{ */ -/** @defgroup I2CEx_Group1 Extension features functions +/** @defgroup I2CEx_Exported_Functions_Group1 Extension features functions * @brief Extension features functions * @verbatim @@ -106,7 +105,7 @@ * @param AnalogFilter: new state of the Analog filter. * @retval HAL status */ -HAL_StatusTypeDef HAL_I2CEx_AnalogFilter_Config(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter) +HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter) { uint32_t tmp = 0; @@ -145,7 +144,7 @@ HAL_StatusTypeDef HAL_I2CEx_AnalogFilter_Config(I2C_HandleTypeDef *hi2c, uint32_ * @param DigitalFilter: Coefficient of digital noise filter between 0x00 and 0x0F. * @retval HAL status */ -HAL_StatusTypeDef HAL_I2CEx_DigitalFilter_Config(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter) +HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter) { uint16_t tmpreg = 0; uint32_t tmp = 0; @@ -191,7 +190,7 @@ HAL_StatusTypeDef HAL_I2CEx_DigitalFilter_Config(I2C_HandleTypeDef *hi2c, uint32 /** * @} */ -#endif /* STM32F427xx || STM32F429xx || STM32F437xx || STM32F439xx || STM32F401xC || STM32F401xE */ +#endif /* STM32F427xx || STM32F429xx || STM32F437xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F446xx */ #endif /* HAL_I2C_MODULE_ENABLED */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.h index c5e5e8a1485..87cff0d1ad2 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2c_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_i2c_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of I2C HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,8 +43,8 @@ extern "C" { #endif -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" @@ -58,50 +58,74 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ - -/** @defgroup I2CEx_Exported_Constants +/** @defgroup I2CEx_Exported_Constants I2C Exported Constants * @{ */ -/** @defgroup I2CEx_Analog_Filter +/** @defgroup I2CEx_Analog_Filter I2C Analog Filter * @{ */ -#define I2C_ANALOGFILTER_ENABLED ((uint32_t)0x00000000) -#define I2C_ANALOGFILTER_DISABLED I2C_FLTR_ANOFF - -#define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLED) || \ - ((FILTER) == I2C_ANALOGFILTER_DISABLED)) +#define I2C_ANALOGFILTER_ENABLE ((uint32_t)0x00000000) +#define I2C_ANALOGFILTER_DISABLE I2C_FLTR_ANOFF /** * @} */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup I2CEx_Exported_Functions + * @{ + */ -/** @defgroup I2CEx_Digital_Filter +/** @addtogroup I2CEx_Exported_Functions_Group1 * @{ */ -#define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000F) +/* Peripheral Control functions ************************************************/ +HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); +HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); /** * @} */ - + /** * @} */ - -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions --------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Constants I2C Private Constants + * @{ + */ -/* Peripheral Control functions ************************************************/ -HAL_StatusTypeDef HAL_I2CEx_AnalogFilter_Config(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); -HAL_StatusTypeDef HAL_I2CEx_DigitalFilter_Config(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Macros I2C Private Macros + * @{ + */ +#define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ + ((FILTER) == I2C_ANALOGFILTER_DISABLE)) +#define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000F) +/** + * @} + */ /** * @} */ -#endif /* STM32F427xx || STM32F429xx || STM32F437xx || STM32F439xx || STM32F401xC || STM32F401xE */ + /** * @} */ - + +#endif /* STM32F427xx || STM32F429xx || STM32F437xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.c index 5adee350941..aecc11ae3fc 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_i2s.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief I2S HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Integrated Interchip Sound (I2S) peripheral: @@ -33,7 +33,7 @@ (+++) Enable the DMAx interface clock. (+++) Configure the declared DMA handle structure with the required Tx/Rx parameters. (+++) Configure the DMA Tx/Rx Stream. - (+++) Associate the initilalized DMA handle to the I2S DMA Tx/Rx handle. + (+++) Associate the initialized DMA handle to the I2S DMA Tx/Rx handle. (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx/Rx Stream. @@ -109,7 +109,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -143,7 +143,7 @@ * @{ */ -/** @defgroup I2S +/** @defgroup I2S I2S * @brief I2S HAL module driver * @{ */ @@ -155,23 +155,28 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -static HAL_StatusTypeDef I2S_Transmit_IT(I2S_HandleTypeDef *hi2s); -static HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s); -/* Private functions ---------------------------------------------------------*/ +/** @addtogroup I2S_Private_Functions + * @{ + */ -/** @defgroup I2S_Private_Functions +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup I2S_Exported_Functions I2S Exported Functions * @{ */ -/** @defgroup I2S_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions - * -@verbatim +/** @defgroup I2S_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to initialize and - de-initialiaze the I2Sx peripheral in simplex mode: + de-initialize the I2Sx peripheral in simplex mode: (+) User must Implement HAL_I2S_MspInit() function in which he configures all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ). @@ -184,10 +189,9 @@ static HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s); (++) MCLK Output (++) Audio frequency (++) Polarity - (++) Full duplex mode (+) Call the function HAL_I2S_DeInit() to restore the default configuration - of the selected I2Sx periperal. + of the selected I2Sx peripheral. @endverbatim * @{ */ @@ -199,7 +203,7 @@ static HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s); * the configuration information for I2S module * @retval HAL status */ -HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) +__weak HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) { uint32_t tmpreg = 0, i2sdiv = 2, i2sodd = 0, packetlength = 1; uint32_t tmp = 0, i2sclk = 0; @@ -211,6 +215,7 @@ HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) } /* Check the I2S parameters */ + assert_param(IS_I2S_ALL_INSTANCE(hi2s->Instance)); assert_param(IS_I2S_MODE(hi2s->Init.Mode)); assert_param(IS_I2S_STANDARD(hi2s->Init.Standard)); assert_param(IS_I2S_DATA_FORMAT(hi2s->Init.DataFormat)); @@ -218,10 +223,11 @@ HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) assert_param(IS_I2S_AUDIO_FREQ(hi2s->Init.AudioFreq)); assert_param(IS_I2S_CPOL(hi2s->Init.CPOL)); assert_param(IS_I2S_CLOCKSOURCE(hi2s->Init.ClockSource)); - assert_param(IS_I2S_FULLDUPLEX_MODE(hi2s->Init.FullDuplexMode)); if(hi2s->State == HAL_I2S_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hi2s->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ HAL_I2S_MspInit(hi2s); } @@ -252,47 +258,7 @@ HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) /* Get I2S source Clock frequency ****************************************/ /* If an external I2S clock has to be used, the specific define should be set in the project configuration or in the stm32f4xx_conf.h file */ - if(hi2s->Init.ClockSource == I2S_CLOCK_EXTERNAL) - { - /* Set external clock as I2S clock source */ - if((RCC->CFGR & RCC_CFGR_I2SSRC) == 0) - { - RCC->CFGR |= (uint32_t)RCC_CFGR_I2SSRC; - } - - /* Set the I2S clock to the external clock value */ - i2sclk = EXTERNAL_CLOCK_VALUE; - } - else - { - /* Check if PLLI2S is enabled or Not */ - if((RCC->CR & RCC_CR_PLLI2SON) != RCC_CR_PLLI2SON) - { - hi2s->State= HAL_I2S_STATE_READY; - - return HAL_ERROR; - } - - /* Set PLLI2S as I2S clock source */ - if((RCC->CFGR & RCC_CFGR_I2SSRC) != 0) - { - RCC->CFGR &= ~(uint32_t)RCC_CFGR_I2SSRC; - } - - /* Get the PLLM value */ - if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSE) - { - /* Get the I2S source clock value */ - i2sclk = (uint32_t)(HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); - } - else - { - /* Get the I2S source clock value */ - i2sclk = (uint32_t)(HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); - } - i2sclk *= (uint32_t)(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6) & (RCC_PLLI2SCFGR_PLLI2SN >> 6)); - i2sclk /= (uint32_t)(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> 28) & (RCC_PLLI2SCFGR_PLLI2SR >> 28)); - } + i2sclk = I2S_GetInputClock(hi2s); /* Compute the Real divider depending on the MCLK output state, with a floating point */ if(hi2s->Init.MCLKOutput == I2S_MCLKOUTPUT_ENABLE) @@ -333,40 +299,21 @@ HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) /* Configure the I2S with the I2S_InitStruct values */ tmpreg |= (uint32_t)(SPI_I2SCFGR_I2SMOD | hi2s->Init.Mode | hi2s->Init.Standard | hi2s->Init.DataFormat | hi2s->Init.CPOL); +#if defined(SPI_I2SCFGR_ASTRTEN) + if (hi2s->Init.Standard == I2S_STANDARD_PCM_SHORT) + { /* Write to SPIx I2SCFGR */ - hi2s->Instance->I2SCFGR = tmpreg; - - /* Configure the I2S extended if the full duplex mode is enabled */ - if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) - { - /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */ - I2SxEXT(hi2s->Instance)->I2SCFGR &= ~(SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CKPOL | \ - SPI_I2SCFGR_I2SSTD | SPI_I2SCFGR_PCMSYNC | SPI_I2SCFGR_I2SCFG | \ - SPI_I2SCFGR_I2SE | SPI_I2SCFGR_I2SMOD); - I2SxEXT(hi2s->Instance)->I2SPR = 2; - - /* Get the I2SCFGR register value */ - tmpreg = I2SxEXT(hi2s->Instance)->I2SCFGR; - - /* Get the mode to be configured for the extended I2S */ - if((hi2s->Init.Mode == I2S_MODE_MASTER_TX) || (hi2s->Init.Mode == I2S_MODE_SLAVE_TX)) - { - tmp = I2S_MODE_SLAVE_RX; - } - else - { - if((hi2s->Init.Mode == I2S_MODE_MASTER_RX) || (hi2s->Init.Mode == I2S_MODE_SLAVE_RX)) - { - tmp = I2S_MODE_SLAVE_TX; - } - } - - /* Configure the I2S Slave with the I2S Master parameter values */ - tmpreg |= (uint32_t)(SPI_I2SCFGR_I2SMOD | tmp | hi2s->Init.Standard | hi2s->Init.DataFormat | hi2s->Init.CPOL); - - /* Write to SPIx I2SCFGR */ - I2SxEXT(hi2s->Instance)->I2SCFGR = tmpreg; + hi2s->Instance->I2SCFGR = tmpreg | SPI_I2SCFGR_ASTRTEN; + } + else + { + /* Write to SPIx I2SCFGR */ + hi2s->Instance->I2SCFGR = tmpreg; } +#else + /* Write to SPIx I2SCFGR */ + hi2s->Instance->I2SCFGR = tmpreg; +#endif hi2s->ErrorCode = HAL_I2S_ERROR_NONE; hi2s->State= HAL_I2S_STATE_READY; @@ -411,7 +358,7 @@ HAL_StatusTypeDef HAL_I2S_DeInit(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_MspInit could be implenetd in the user file + the HAL_I2S_MspInit could be implemented in the user file */ } @@ -424,17 +371,16 @@ HAL_StatusTypeDef HAL_I2S_DeInit(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_MspDeInit could be implenetd in the user file + the HAL_I2S_MspDeInit could be implemented in the user file */ } - /** * @} */ -/** @defgroup I2S_Group2 IO operation functions - * @brief Data transfers functions - * +/** @defgroup I2S_Exported_Functions_Group2 IO operation functions + * @brief Data transfers functions + * @verbatim =============================================================================== ##### IO operation functions ##### @@ -568,7 +514,7 @@ HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uin * @note The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization * between Master and Slave(example: audio streaming). * @note In I2S Master Receiver mode, just after enabling the peripheral the clock will be generate - * in continouse way and as the I2S is not disabled at the end of the I2S transaction. + * in continuous way and as the I2S is not disabled at the end of the I2S transaction. * @retval HAL status */ HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout) @@ -821,10 +767,10 @@ HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, hi2s->State = HAL_I2S_STATE_BUSY_TX; hi2s->ErrorCode = HAL_I2S_ERROR_NONE; - /* Set the I2S Tx DMA Half transfert complete callback */ + /* Set the I2S Tx DMA Half transfer complete callback */ hi2s->hdmatx->XferHalfCpltCallback = I2S_DMATxHalfCplt; - /* Set the I2S Tx DMA transfert complete callback */ + /* Set the I2S Tx DMA transfer complete callback */ hi2s->hdmatx->XferCpltCallback = I2S_DMATxCplt; /* Set the DMA error callback */ @@ -905,10 +851,10 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, hi2s->State = HAL_I2S_STATE_BUSY_RX; hi2s->ErrorCode = HAL_I2S_ERROR_NONE; - /* Set the I2S Rx DMA Half transfert complete callback */ + /* Set the I2S Rx DMA Half transfer complete callback */ hi2s->hdmarx->XferHalfCpltCallback = I2S_DMARxHalfCplt; - /* Set the I2S Rx DMA transfert complete callback */ + /* Set the I2S Rx DMA transfer complete callback */ hi2s->hdmarx->XferCpltCallback = I2S_DMARxCplt; /* Set the DMA error callback */ @@ -957,7 +903,7 @@ HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, * the configuration information for I2S module * @retval HAL status */ -HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) +__weak HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) { /* Process Locked */ __HAL_LOCK(hi2s); @@ -978,15 +924,11 @@ HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) { /* Disable the I2S DMA Tx request */ hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); - /* Disable the I2SEx Rx DMA Request */ - I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); } else { /* Disable the I2S DMA Rx request */ hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - /* Disable the I2SEx Tx DMA Request */ - I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); } } @@ -1002,7 +944,7 @@ HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) * the configuration information for I2S module * @retval HAL status */ -HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) +__weak HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) { /* Process Locked */ __HAL_LOCK(hi2s); @@ -1023,15 +965,11 @@ HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) { /* Enable the I2S DMA Tx request */ hi2s->Instance->CR2 |= SPI_CR2_TXDMAEN; - /* Disable the I2SEx Rx DMA Request */ - I2SxEXT(hi2s->Instance)->CR2 |= SPI_CR2_RXDMAEN; } else { /* Enable the I2S DMA Rx request */ hi2s->Instance->CR2 |= SPI_CR2_RXDMAEN; - /* Enable the I2SEx Tx DMA Request */ - I2SxEXT(hi2s->Instance)->CR2 |= SPI_CR2_TXDMAEN; } } @@ -1054,7 +992,7 @@ HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) * the configuration information for I2S module * @retval HAL status */ -HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) +__weak HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) { /* Process Locked */ __HAL_LOCK(hi2s); @@ -1062,14 +1000,7 @@ HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) /* Disable the I2S Tx/Rx DMA requests */ hi2s->Instance->CR2 &= ~SPI_CR2_TXDMAEN; hi2s->Instance->CR2 &= ~SPI_CR2_RXDMAEN; - - if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) - { - /* Disable the I2S extended Tx/Rx DMA requests */ - I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); - I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - } - + /* Abort the I2S DMA Stream tx */ if(hi2s->hdmatx != HAL_NULL) { @@ -1084,12 +1015,6 @@ HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) /* Disable I2S peripheral */ __HAL_I2S_DISABLE(hi2s); - if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) - { - /* Disable the I2Sext peripheral */ - I2SxEXT(hi2s->Instance)->I2SCFGR &= ~SPI_I2SCFGR_I2SE; - } - hi2s->State = HAL_I2S_STATE_READY; /* Process Unlocked */ @@ -1104,11 +1029,10 @@ HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) * the configuration information for I2S module * @retval None */ -void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) +__weak void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) { - uint32_t tmp1 = 0, tmp2 = 0; - if(hi2s->Init.FullDuplexMode != I2S_FULLDUPLEXMODE_ENABLE) - { + uint32_t tmp1 = 0, tmp2 = 0; + if(hi2s->State == HAL_I2S_STATE_BUSY_RX) { tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXNE); @@ -1133,68 +1057,10 @@ void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) { tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXE); tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_TXE); - /* I2S in mode Tramitter -----------------------------------------------*/ + /* I2S in mode Transmitter -----------------------------------------------*/ if((tmp1 != RESET) && (tmp2 != RESET)) { I2S_Transmit_IT(hi2s); - } - - tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR); - tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR); - /* I2S Underrun error interrupt occurred --------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - __HAL_I2S_CLEAR_UDRFLAG(hi2s); - hi2s->ErrorCode |= HAL_I2S_ERROR_UDR; - } - } - } - else - { - tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - /* Check if the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX Mode is selected */ - if((tmp1 == I2S_MODE_MASTER_TX) || (tmp2 == I2S_MODE_SLAVE_TX)) - { - tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_RXNE; - tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_RXNE; - /* I2Sext in mode Receiver ---------------------------------------------*/ - if((tmp1 == SPI_SR_RXNE) && (tmp2 == I2S_IT_RXNE)) - { - tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - /* When the I2S mode is configured as I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX, - the I2Sext RXNE interrupt will be generated to manage the full-duplex receive phase. */ - if((tmp1 == I2S_MODE_MASTER_TX) || (tmp2 == I2S_MODE_SLAVE_TX)) - { - I2SEx_TransmitReceive_IT(hi2s); - } - } - - tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_OVR; - tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_ERR; - /* I2Sext Overrun error interrupt occurred ------------------------------*/ - if((tmp1 == SPI_SR_OVR) && (tmp2 == I2S_IT_ERR)) - { - /* Clear I2Sext OVR Flag */ - I2SxEXT(hi2s->Instance)->DR; - I2SxEXT(hi2s->Instance)->SR; - hi2s->ErrorCode |= HAL_I2SEX_ERROR_OVR; - } - - tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXE); - tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_TXE); - /* I2S in mode Tramitter -----------------------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - /* When the I2S mode is configured as I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX, - the I2S TXE interrupt will be generated to manage the full-duplex transmit phase. */ - if((tmp1 == I2S_MODE_MASTER_TX) || (tmp2 == I2S_MODE_SLAVE_TX)) - { - I2SEx_TransmitReceive_IT(hi2s); - } } tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR); @@ -1204,59 +1070,6 @@ void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) { __HAL_I2S_CLEAR_UDRFLAG(hi2s); hi2s->ErrorCode |= HAL_I2S_ERROR_UDR; - } - } - /* The I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX Mode is selected */ - else - { - tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXNE); - tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_RXNE); - /* I2S in mode Receiver ------------------------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - /* When the I2S mode is configured as I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX, - the I2S RXNE interrupt will be generated to manage the full-duplex receive phase. */ - if((tmp1 == I2S_MODE_MASTER_RX) || (tmp2 == I2S_MODE_SLAVE_RX)) - { - I2SEx_TransmitReceive_IT(hi2s); - } - } - - tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR); - tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR); - /* I2S Overrun error interrupt occurred ---------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - __HAL_I2S_CLEAR_OVRFLAG(hi2s); - hi2s->ErrorCode |= HAL_I2S_ERROR_OVR; - } - - tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_TXE; - tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_TXE; - /* I2Sext in mode Tramitter --------------------------------------------*/ - if((tmp1 == SPI_SR_TXE) && (tmp2 == I2S_IT_TXE)) - { - tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; - /* When the I2S mode is configured as I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX, - the I2Sext TXE interrupt will be generated to manage the full-duplex transmit phase. */ - if((tmp1 == I2S_MODE_MASTER_RX) || (tmp2 == I2S_MODE_SLAVE_RX)) - { - I2SEx_TransmitReceive_IT(hi2s); - } - } - - tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_UDR; - tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_ERR; - /* I2Sext Underrun error interrupt occurred -----------------------------*/ - if((tmp1 == SPI_SR_UDR) && (tmp2 == I2S_IT_ERR)) - { - /* Clear I2Sext UDR Flag */ - I2SxEXT(hi2s->Instance)->SR; - hi2s->ErrorCode |= HAL_I2SEX_ERROR_UDR; - } } } @@ -1278,7 +1091,7 @@ void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_TxHalfCpltCallback could be implenetd in the user file + the HAL_I2S_TxHalfCpltCallback could be implemented in the user file */ } @@ -1291,7 +1104,7 @@ void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_TxCpltCallback could be implenetd in the user file + the HAL_I2S_TxCpltCallback could be implemented in the user file */ } @@ -1304,7 +1117,7 @@ void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_RxCpltCallback could be implenetd in the user file + the HAL_I2S_RxCpltCallback could be implemented in the user file */ } @@ -1317,7 +1130,7 @@ __weak void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_RxCpltCallback could be implenetd in the user file + the HAL_I2S_RxCpltCallback could be implemented in the user file */ } @@ -1330,7 +1143,7 @@ __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) __weak void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_I2S_ErrorCallback could be implenetd in the user file + the HAL_I2S_ErrorCallback could be implemented in the user file */ } @@ -1338,9 +1151,8 @@ __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) * @} */ -/** @defgroup I2S_Group3 Peripheral State and Errors functions - * @brief Peripheral State functions - * +/** @defgroup I2S_Exported_Functions_Group3 Peripheral State and Errors functions + * @brief Peripheral State functions @verbatim =============================================================================== ##### Peripheral State and Errors functions ##### @@ -1370,103 +1182,27 @@ HAL_I2S_StateTypeDef HAL_I2S_GetState(I2S_HandleTypeDef *hi2s) * the configuration information for I2S module * @retval I2S Error Code */ -HAL_I2S_ErrorTypeDef HAL_I2S_GetError(I2S_HandleTypeDef *hi2s) +uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s) { return hi2s->ErrorCode; } - /** * @} */ -/** - * @brief DMA I2S transmit process complete callback - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. - * @retval None - */ -void I2S_DMATxCplt(DMA_HandleTypeDef *hdma) -{ - I2S_HandleTypeDef* hi2s = (I2S_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - - if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) - { - hi2s->TxXferCount = 0; - - /* Disable Tx DMA Request */ - hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); - - if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) - { - /* Disable Rx DMA Request for the slave*/ - I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - } - - if(hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) - { - if(hi2s->RxXferCount == 0) - { - hi2s->State = HAL_I2S_STATE_READY; - } - } - else - { - hi2s->State = HAL_I2S_STATE_READY; - } - } - HAL_I2S_TxCpltCallback(hi2s); -} - /** * @brief DMA I2S transmit process half complete callback * @param hdma: pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ -void I2S_DMATxHalfCplt(DMA_HandleTypeDef *hdma) + void I2S_DMATxHalfCplt(DMA_HandleTypeDef *hdma) { I2S_HandleTypeDef* hi2s = (I2S_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; HAL_I2S_TxHalfCpltCallback(hi2s); } -/** - * @brief DMA I2S receive process complete callback - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. - * @retval None - */ -void I2S_DMARxCplt(DMA_HandleTypeDef *hdma) -{ - I2S_HandleTypeDef* hi2s = (I2S_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; - - if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) - { - /* Disable Rx DMA Request */ - hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - - if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) - { - /* Disable Tx DMA Request for the slave*/ - I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); - } - - hi2s->RxXferCount = 0; - if(hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) - { - if(hi2s->TxXferCount == 0) - { - hi2s->State = HAL_I2S_STATE_READY; - } - } - else - { - hi2s->State = HAL_I2S_STATE_READY; - } - } - HAL_I2S_RxCpltCallback(hi2s); -} - /** * @brief DMA I2S receive process half complete callback * @param hdma: pointer to a DMA_HandleTypeDef structure that contains @@ -1505,7 +1241,7 @@ void I2S_DMAError(DMA_HandleTypeDef *hdma) * the configuration information for I2S module * @retval HAL status */ -static HAL_StatusTypeDef I2S_Transmit_IT(I2S_HandleTypeDef *hi2s) +HAL_StatusTypeDef I2S_Transmit_IT(I2S_HandleTypeDef *hi2s) { if(hi2s->State == HAL_I2S_STATE_BUSY_TX) { @@ -1549,7 +1285,7 @@ static HAL_StatusTypeDef I2S_Transmit_IT(I2S_HandleTypeDef *hi2s) * the configuration information for I2S module * @retval HAL status */ -static HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s) +HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s) { if(hi2s->State == HAL_I2S_STATE_BUSY_RX) { @@ -1600,7 +1336,7 @@ static HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s) * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains * the configuration information for I2S module * @param Flag: Flag checked - * @param State: Value of the flag expected + * @param Status: Value of the flag expected * @param Timeout: Duration of the timeout * @retval HAL status */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.h index 86a9acdbf9c..35e65903ec5 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_i2s.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of I2S HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,7 +54,11 @@ * @{ */ -/* Exported types ------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup I2S_Exported_Types I2S Exported Types + * @{ + */ + /** * @brief I2S Init structure definition */ @@ -102,20 +106,6 @@ typedef enum }HAL_I2S_StateTypeDef; -/** - * @brief HAL I2S Error Code structure definition - */ -typedef enum -{ - HAL_I2S_ERROR_NONE = 0x00, /*!< No error */ - HAL_I2S_ERROR_UDR = 0x01, /*!< I2S Underrun error */ - HAL_I2S_ERROR_OVR = 0x02, /*!< I2S Overrun error */ - HAL_I2SEX_ERROR_UDR = 0x04, /*!< I2S extended Underrun error */ - HAL_I2SEX_ERROR_OVR = 0x08, /*!< I2S extended Overrun error */ - HAL_I2S_ERROR_FRE = 0x10, /*!< I2S Frame format error */ - HAL_I2S_ERROR_DMA = 0x20 /*!< DMA transfer error */ -}HAL_I2S_ErrorTypeDef; - /** * @brief I2S handle Structure definition */ @@ -145,46 +135,56 @@ typedef struct __IO HAL_I2S_StateTypeDef State; /* I2S communication state */ - __IO HAL_I2S_ErrorTypeDef ErrorCode; /* I2S Error code */ - + __IO uint32_t ErrorCode; /* I2S Error code */ + }I2S_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ +/** @defgroup I2S_Exported_Constants I2S Exported Constants + * @{ + */ -/** @defgroup I2S_Exported_Constants +/** @defgroup I2S_Error_Code I2S Error Code + * @brief I2S Error Code * @{ + */ +#define HAL_I2S_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_I2S_ERROR_UDR ((uint32_t)0x00000001) /*!< I2S Underrun error */ +#define HAL_I2S_ERROR_OVR ((uint32_t)0x00000002) /*!< I2S Overrun error */ +#define HAL_I2SEX_ERROR_UDR ((uint32_t)0x00000004) /*!< I2S extended Underrun error */ +#define HAL_I2SEX_ERROR_OVR ((uint32_t)0x00000008) /*!< I2S extended Overrun error */ +#define HAL_I2S_ERROR_FRE ((uint32_t)0x00000010) /*!< I2S Frame format error */ +#define HAL_I2S_ERROR_DMA ((uint32_t)0x00000020) /*!< DMA transfer error */ +/** + * @} */ -#define I2SxEXT(__INSTANCE__) ((__INSTANCE__) == (SPI2)? (SPI_TypeDef *)(I2S2ext_BASE): (SPI_TypeDef *)(I2S3ext_BASE)) -/** @defgroup I2S_Clock_Source +/** @defgroup I2S_Clock_Source I2S Clock Source * @{ */ #define I2S_CLOCK_PLL ((uint32_t)0x00000000) #define I2S_CLOCK_EXTERNAL ((uint32_t)0x00000001) - -#define IS_I2S_CLOCKSOURCE(CLOCK) (((CLOCK) == I2S_CLOCK_EXTERNAL) || \ - ((CLOCK) == I2S_CLOCK_PLL)) +#define I2S_CLOCK_PLLR ((uint32_t)0x00000002) +#define I2S_CLOCK_PLLSRC ((uint32_t)0x00000003) /** * @} */ -/** @defgroup I2S_Mode +/** @defgroup I2S_Mode I2S Mode * @{ */ #define I2S_MODE_SLAVE_TX ((uint32_t)0x00000000) #define I2S_MODE_SLAVE_RX ((uint32_t)0x00000100) #define I2S_MODE_MASTER_TX ((uint32_t)0x00000200) #define I2S_MODE_MASTER_RX ((uint32_t)0x00000300) - -#define IS_I2S_MODE(MODE) (((MODE) == I2S_MODE_SLAVE_TX) || \ - ((MODE) == I2S_MODE_SLAVE_RX) || \ - ((MODE) == I2S_MODE_MASTER_TX) || \ - ((MODE) == I2S_MODE_MASTER_RX)) /** * @} */ -/** @defgroup I2S_Standard +/** @defgroup I2S_Standard I2S Standard * @{ */ #define I2S_STANDARD_PHILIPS ((uint32_t)0x00000000) @@ -192,53 +192,31 @@ typedef struct #define I2S_STANDARD_LSB ((uint32_t)0x00000020) #define I2S_STANDARD_PCM_SHORT ((uint32_t)0x00000030) #define I2S_STANDARD_PCM_LONG ((uint32_t)0x000000B0) - -#define IS_I2S_STANDARD(STANDARD) (((STANDARD) == I2S_STANDARD_PHILIPS) || \ - ((STANDARD) == I2S_STANDARD_MSB) || \ - ((STANDARD) == I2S_STANDARD_LSB) || \ - ((STANDARD) == I2S_STANDARD_PCM_SHORT) || \ - ((STANDARD) == I2S_STANDARD_PCM_LONG)) -/** @defgroup I2S_Legacy - * @{ - */ -#define I2S_STANDARD_PHILLIPS I2S_STANDARD_PHILIPS -/** - * @} - */ - /** * @} */ -/** @defgroup I2S_Data_Format +/** @defgroup I2S_Data_Format I2S Data Format * @{ */ #define I2S_DATAFORMAT_16B ((uint32_t)0x00000000) #define I2S_DATAFORMAT_16B_EXTENDED ((uint32_t)0x00000001) #define I2S_DATAFORMAT_24B ((uint32_t)0x00000003) #define I2S_DATAFORMAT_32B ((uint32_t)0x00000005) - -#define IS_I2S_DATA_FORMAT(FORMAT) (((FORMAT) == I2S_DATAFORMAT_16B) || \ - ((FORMAT) == I2S_DATAFORMAT_16B_EXTENDED) || \ - ((FORMAT) == I2S_DATAFORMAT_24B) || \ - ((FORMAT) == I2S_DATAFORMAT_32B)) /** * @} */ -/** @defgroup I2S_MCLK_Output +/** @defgroup I2S_MCLK_Output I2S Mclk Output * @{ */ #define I2S_MCLKOUTPUT_ENABLE ((uint32_t)SPI_I2SPR_MCKOE) #define I2S_MCLKOUTPUT_DISABLE ((uint32_t)0x00000000) - -#define IS_I2S_MCLK_OUTPUT(OUTPUT) (((OUTPUT) == I2S_MCLKOUTPUT_ENABLE) || \ - ((OUTPUT) == I2S_MCLKOUTPUT_DISABLE)) /** * @} */ -/** @defgroup I2S_Audio_Frequency +/** @defgroup I2S_Audio_Frequency I2S Audio Frequency * @{ */ #define I2S_AUDIOFREQ_192K ((uint32_t)192000) @@ -251,39 +229,29 @@ typedef struct #define I2S_AUDIOFREQ_11K ((uint32_t)11025) #define I2S_AUDIOFREQ_8K ((uint32_t)8000) #define I2S_AUDIOFREQ_DEFAULT ((uint32_t)2) - -#define IS_I2S_AUDIO_FREQ(FREQ) ((((FREQ) >= I2S_AUDIOFREQ_8K) && \ - ((FREQ) <= I2S_AUDIOFREQ_192K)) || \ - ((FREQ) == I2S_AUDIOFREQ_DEFAULT)) /** * @} */ -/** @defgroup I2S_FullDuplex_Mode +/** @defgroup I2S_FullDuplex_Mode I2S FullDuplex Mode * @{ */ #define I2S_FULLDUPLEXMODE_DISABLE ((uint32_t)0x00000000) #define I2S_FULLDUPLEXMODE_ENABLE ((uint32_t)0x00000001) - -#define IS_I2S_FULLDUPLEX_MODE(MODE) (((MODE) == I2S_FULLDUPLEXMODE_DISABLE) || \ - ((MODE) == I2S_FULLDUPLEXMODE_ENABLE)) /** * @} */ -/** @defgroup I2S_Clock_Polarity +/** @defgroup I2S_Clock_Polarity I2S Clock Polarity * @{ */ #define I2S_CPOL_LOW ((uint32_t)0x00000000) #define I2S_CPOL_HIGH ((uint32_t)SPI_I2SCFGR_CKPOL) - -#define IS_I2S_CPOL(CPOL) (((CPOL) == I2S_CPOL_LOW) || \ - ((CPOL) == I2S_CPOL_HIGH)) /** * @} */ -/** @defgroup I2S_Interrupt_configuration_definition +/** @defgroup I2S_Interrupts_Definition I2S Interrupts Definition * @{ */ #define I2S_IT_TXE SPI_CR2_TXEIE @@ -293,7 +261,7 @@ typedef struct * @} */ -/** @defgroup I2S_Flag_definition +/** @defgroup I2S_Flags_Definition I2S Flags Definition * @{ */ #define I2S_FLAG_TXE SPI_SR_TXE @@ -312,9 +280,11 @@ typedef struct /** * @} */ - -/* Exported macro ------------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup I2S_Exported_Macros I2S Exported Macros + * @{ + */ /** @brief Reset I2S handle state * @param __HANDLE__: specifies the I2S Handle. @@ -372,27 +342,53 @@ typedef struct * @param __HANDLE__: specifies the I2S Handle. * @retval None */ -#define __HAL_I2S_CLEAR_OVRFLAG(__HANDLE__) do{(__HANDLE__)->Instance->DR;\ - (__HANDLE__)->Instance->SR;}while(0) +#define __HAL_I2S_CLEAR_OVRFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->DR; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + UNUSED(tmpreg); \ + } while(0) + /** @brief Clears the I2S UDR pending flag. * @param __HANDLE__: specifies the I2S Handle. * @retval None */ -#define __HAL_I2S_CLEAR_UDRFLAG(__HANDLE__)((__HANDLE__)->Instance->SR) - +#define __HAL_I2S_CLEAR_UDRFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + UNUSED(tmpreg); \ + } while(0) +/** + * @} + */ + /* Include I2S Extension module */ #include "stm32f4xx_hal_i2s_ex.h" /* Exported functions --------------------------------------------------------*/ +/** @addtogroup I2S_Exported_Functions + * @{ + */ +/** @addtogroup I2S_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s); HAL_StatusTypeDef HAL_I2S_DeInit (I2S_HandleTypeDef *hi2s); void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s); void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s); +/** + * @} + */ +/** @addtogroup I2S_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions *****************************************************/ - /* Blocking mode: Polling */ +/* Blocking mode: Polling */ HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout); @@ -411,7 +407,7 @@ HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s); /* Peripheral Control and State functions **************************************/ HAL_I2S_StateTypeDef HAL_I2S_GetState(I2S_HandleTypeDef *hi2s); -HAL_I2S_ErrorTypeDef HAL_I2S_GetError(I2S_HandleTypeDef *hi2s); +uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s); /* Callbacks used in non blocking modes (Interrupt and DMA) *******************/ void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s); @@ -419,13 +415,83 @@ void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2S_Private_Constants I2S Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2S_Private_Macros I2S Private Macros + * @{ + */ +#define IS_I2S_CLOCKSOURCE(CLOCK) (((CLOCK) == I2S_CLOCK_EXTERNAL) || \ + ((CLOCK) == I2S_CLOCK_PLLR) ||\ + ((CLOCK) == I2S_CLOCK_PLLSRC) ||\ + ((CLOCK) == I2S_CLOCK_PLL)) + +#define IS_I2S_MODE(MODE) (((MODE) == I2S_MODE_SLAVE_TX) || \ + ((MODE) == I2S_MODE_SLAVE_RX) || \ + ((MODE) == I2S_MODE_MASTER_TX) || \ + ((MODE) == I2S_MODE_MASTER_RX)) + +#define IS_I2S_STANDARD(STANDARD) (((STANDARD) == I2S_STANDARD_PHILIPS) || \ + ((STANDARD) == I2S_STANDARD_MSB) || \ + ((STANDARD) == I2S_STANDARD_LSB) || \ + ((STANDARD) == I2S_STANDARD_PCM_SHORT) || \ + ((STANDARD) == I2S_STANDARD_PCM_LONG)) + +#define IS_I2S_DATA_FORMAT(FORMAT) (((FORMAT) == I2S_DATAFORMAT_16B) || \ + ((FORMAT) == I2S_DATAFORMAT_16B_EXTENDED) || \ + ((FORMAT) == I2S_DATAFORMAT_24B) || \ + ((FORMAT) == I2S_DATAFORMAT_32B)) + +#define IS_I2S_MCLK_OUTPUT(OUTPUT) (((OUTPUT) == I2S_MCLKOUTPUT_ENABLE) || \ + ((OUTPUT) == I2S_MCLKOUTPUT_DISABLE)) + +#define IS_I2S_AUDIO_FREQ(FREQ) ((((FREQ) >= I2S_AUDIOFREQ_8K) && \ + ((FREQ) <= I2S_AUDIOFREQ_192K)) || \ + ((FREQ) == I2S_AUDIOFREQ_DEFAULT)) + +#define IS_I2S_FULLDUPLEX_MODE(MODE) (((MODE) == I2S_FULLDUPLEXMODE_DISABLE) || \ + ((MODE) == I2S_FULLDUPLEXMODE_ENABLE)) + +#define IS_I2S_CPOL(CPOL) (((CPOL) == I2S_CPOL_LOW) || \ + ((CPOL) == I2S_CPOL_HIGH)) + +#define I2SxEXT(__INSTANCE__) ((__INSTANCE__) == (SPI2)? (SPI_TypeDef *)(I2S2ext_BASE): (SPI_TypeDef *)(I2S3ext_BASE)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup I2S_Private_Functions I2S Private Functions + * @{ + */ void I2S_DMATxCplt(DMA_HandleTypeDef *hdma); void I2S_DMATxHalfCplt(DMA_HandleTypeDef *hdma); void I2S_DMARxCplt(DMA_HandleTypeDef *hdma); void I2S_DMARxHalfCplt(DMA_HandleTypeDef *hdma); void I2S_DMAError(DMA_HandleTypeDef *hdma); HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, uint32_t Status, uint32_t Timeout); +HAL_StatusTypeDef I2S_Transmit_IT(I2S_HandleTypeDef *hi2s); +HAL_StatusTypeDef I2S_Receive_IT(I2S_HandleTypeDef *hi2s); +/** + * @} + */ /** * @} @@ -433,7 +499,7 @@ HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_ /** * @} - */ + */ #ifdef __cplusplus } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.c index 005b3b377de..d35ae242c28 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_i2s_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief I2S HAL module driver. * This file provides firmware functions to manage the following * functionalities of I2S extension peripheral: @@ -74,7 +74,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -108,21 +108,32 @@ * @{ */ -/** @defgroup I2SEx +/** @defgroup I2SEx I2SEx * @brief I2S HAL module driver * @{ */ #ifdef HAL_I2S_MODULE_ENABLED +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ +/** @addtogroup I2SEx_Private_Functions + * @{ + */ +/** + * @} + */ -/** @defgroup I2SEx_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup I2SEx_Exported_Functions I2S Exported Functions * @{ */ @@ -164,6 +175,160 @@ @endverbatim * @{ */ +/** + * @brief Initializes the I2S according to the specified parameters + * in the I2S_InitTypeDef and create the associated handle. + * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains + * the configuration information for I2S module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) +{ + uint32_t tmpreg = 0, i2sdiv = 2, i2sodd = 0, packetlength = 1; + uint32_t tmp = 0, i2sclk = 0; + + /* Check the I2S handle allocation */ + if(hi2s == HAL_NULL) + { + return HAL_ERROR; + } + + /* Check the I2S parameters */ + assert_param(IS_I2S_MODE(hi2s->Init.Mode)); + assert_param(IS_I2S_STANDARD(hi2s->Init.Standard)); + assert_param(IS_I2S_DATA_FORMAT(hi2s->Init.DataFormat)); + assert_param(IS_I2S_MCLK_OUTPUT(hi2s->Init.MCLKOutput)); + assert_param(IS_I2S_AUDIO_FREQ(hi2s->Init.AudioFreq)); + assert_param(IS_I2S_CPOL(hi2s->Init.CPOL)); + assert_param(IS_I2S_CLOCKSOURCE(hi2s->Init.ClockSource)); + + if(hi2s->State == HAL_I2S_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hi2s->Lock = HAL_UNLOCKED; + /* Init the low level hardware : GPIO, CLOCK, CORTEX */ + HAL_I2S_MspInit(hi2s); + } + + hi2s->State = HAL_I2S_STATE_BUSY; + + /*----------------------- SPIx I2SCFGR & I2SPR Configuration ---------------*/ + /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */ + hi2s->Instance->I2SCFGR &= ~(SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CKPOL | \ + SPI_I2SCFGR_I2SSTD | SPI_I2SCFGR_PCMSYNC | SPI_I2SCFGR_I2SCFG | \ + SPI_I2SCFGR_I2SE | SPI_I2SCFGR_I2SMOD); + hi2s->Instance->I2SPR = 0x0002; + + /* Get the I2SCFGR register value */ + tmpreg = hi2s->Instance->I2SCFGR; + + /* If the default frequency value has to be written, reinitialize i2sdiv and i2sodd */ + /* If the requested audio frequency is not the default, compute the prescaler */ + if(hi2s->Init.AudioFreq != I2S_AUDIOFREQ_DEFAULT) + { + /* Check the frame length (For the Prescaler computing) *******************/ + if(hi2s->Init.DataFormat != I2S_DATAFORMAT_16B) + { + /* Packet length is 32 bits */ + packetlength = 2; + } + + /* Get I2S source Clock frequency ****************************************/ + i2sclk = I2S_GetInputClock(hi2s); + + /* Compute the Real divider depending on the MCLK output state, with a floating point */ + if(hi2s->Init.MCLKOutput == I2S_MCLKOUTPUT_ENABLE) + { + /* MCLK output is enabled */ + tmp = (uint32_t)(((((i2sclk / 256) * 10) / hi2s->Init.AudioFreq)) + 5); + } + else + { + /* MCLK output is disabled */ + tmp = (uint32_t)(((((i2sclk / (32 * packetlength)) *10 ) / hi2s->Init.AudioFreq)) + 5); + } + + /* Remove the flatting point */ + tmp = tmp / 10; + + /* Check the parity of the divider */ + i2sodd = (uint32_t)(tmp & (uint32_t)1); + + /* Compute the i2sdiv prescaler */ + i2sdiv = (uint32_t)((tmp - i2sodd) / 2); + + /* Get the Mask for the Odd bit (SPI_I2SPR[8]) register */ + i2sodd = (uint32_t) (i2sodd << 8); + } + + /* Test if the divider is 1 or 0 or greater than 0xFF */ + if((i2sdiv < 2) || (i2sdiv > 0xFF)) + { + /* Set the default values */ + i2sdiv = 2; + i2sodd = 0; + } + + /* Write to SPIx I2SPR register the computed value */ + hi2s->Instance->I2SPR = (uint32_t)((uint32_t)i2sdiv | (uint32_t)(i2sodd | (uint32_t)hi2s->Init.MCLKOutput)); + + /* Configure the I2S with the I2S_InitStruct values */ + tmpreg |= (uint32_t)(SPI_I2SCFGR_I2SMOD | hi2s->Init.Mode | hi2s->Init.Standard | hi2s->Init.DataFormat | hi2s->Init.CPOL); + +#if defined(SPI_I2SCFGR_ASTRTEN) + if (hi2s->Init.Standard == I2S_STANDARD_PCM_SHORT) + { + /* Write to SPIx I2SCFGR */ + hi2s->Instance->I2SCFGR = tmpreg | SPI_I2SCFGR_ASTRTEN; + } + else + { + /* Write to SPIx I2SCFGR */ + hi2s->Instance->I2SCFGR = tmpreg; + } +#else + /* Write to SPIx I2SCFGR */ + hi2s->Instance->I2SCFGR = tmpreg; +#endif + + /* Configure the I2S extended if the full duplex mode is enabled */ + assert_param(IS_I2S_FULLDUPLEX_MODE(hi2s->Init.FullDuplexMode)); + if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) + { + /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */ + I2SxEXT(hi2s->Instance)->I2SCFGR &= ~(SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CKPOL | \ + SPI_I2SCFGR_I2SSTD | SPI_I2SCFGR_PCMSYNC | SPI_I2SCFGR_I2SCFG | \ + SPI_I2SCFGR_I2SE | SPI_I2SCFGR_I2SMOD); + I2SxEXT(hi2s->Instance)->I2SPR = 2; + + /* Get the I2SCFGR register value */ + tmpreg = I2SxEXT(hi2s->Instance)->I2SCFGR; + + /* Get the mode to be configured for the extended I2S */ + if((hi2s->Init.Mode == I2S_MODE_MASTER_TX) || (hi2s->Init.Mode == I2S_MODE_SLAVE_TX)) + { + tmp = I2S_MODE_SLAVE_RX; + } + else + { + if((hi2s->Init.Mode == I2S_MODE_MASTER_RX) || (hi2s->Init.Mode == I2S_MODE_SLAVE_RX)) + { + tmp = I2S_MODE_SLAVE_TX; + } + } + + /* Configure the I2S Slave with the I2S Master parameter values */ + tmpreg |= (uint32_t)(SPI_I2SCFGR_I2SMOD | tmp | hi2s->Init.Standard | hi2s->Init.DataFormat | hi2s->Init.CPOL); + + /* Write to SPIx I2SCFGR */ + I2SxEXT(hi2s->Instance)->I2SCFGR = tmpreg; + } + + hi2s->ErrorCode = HAL_I2S_ERROR_NONE; + hi2s->State= HAL_I2S_STATE_READY; + + return HAL_OK; +} /** * @brief Full-Duplex Transmit/Receive data in blocking mode. @@ -464,7 +629,6 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, uint16_t } } - /** * @brief Full-Duplex Transmit/Receive data in non-blocking mode using DMA * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains @@ -523,19 +687,19 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_ hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; hi2s->ErrorCode = HAL_I2S_ERROR_NONE; - /* Set the I2S Rx DMA Half transfert complete callback */ + /* Set the I2S Rx DMA Half transfer complete callback */ hi2s->hdmarx->XferHalfCpltCallback = I2S_DMARxHalfCplt; - /* Set the I2S Rx DMA transfert complete callback */ + /* Set the I2S Rx DMA transfer complete callback */ hi2s->hdmarx->XferCpltCallback = I2S_DMARxCplt; /* Set the I2S Rx DMA error callback */ hi2s->hdmarx->XferErrorCallback = I2S_DMAError; - /* Set the I2S Tx DMA Half transfert complete callback */ + /* Set the I2S Tx DMA Half transfer complete callback */ hi2s->hdmatx->XferHalfCpltCallback = I2S_DMATxHalfCplt; - /* Set the I2S Tx DMA transfert complete callback */ + /* Set the I2S Tx DMA transfer complete callback */ hi2s->hdmatx->XferCpltCallback = I2S_DMATxCplt; /* Set the I2S Tx DMA error callback */ @@ -618,10 +782,331 @@ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_ } } +/** + * @brief Pauses the audio stream playing from the Media. + * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains + * the configuration information for I2S module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) +{ + /* Process Locked */ + __HAL_LOCK(hi2s); + + if(hi2s->State == HAL_I2S_STATE_BUSY_TX) + { + /* Disable the I2S DMA Tx request */ + hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + } + else if(hi2s->State == HAL_I2S_STATE_BUSY_RX) + { + /* Disable the I2S DMA Rx request */ + hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); + } + else if(hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) + { + if((hi2s->Init.Mode == I2S_MODE_SLAVE_TX)||(hi2s->Init.Mode == I2S_MODE_MASTER_TX)) + { + /* Disable the I2S DMA Tx request */ + hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + /* Disable the I2SEx Rx DMA Request */ + I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); + } + else + { + /* Disable the I2S DMA Rx request */ + hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); + /* Disable the I2SEx Tx DMA Request */ + I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + } + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2s); + + return HAL_OK; +} + +/** + * @brief Resumes the audio stream playing from the Media. + * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains + * the configuration information for I2S module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) +{ + /* Process Locked */ + __HAL_LOCK(hi2s); + + if(hi2s->State == HAL_I2S_STATE_BUSY_TX) + { + /* Enable the I2S DMA Tx request */ + hi2s->Instance->CR2 |= SPI_CR2_TXDMAEN; + } + else if(hi2s->State == HAL_I2S_STATE_BUSY_RX) + { + /* Enable the I2S DMA Rx request */ + hi2s->Instance->CR2 |= SPI_CR2_RXDMAEN; + } + else if(hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) + { + if((hi2s->Init.Mode == I2S_MODE_SLAVE_TX)||(hi2s->Init.Mode == I2S_MODE_MASTER_TX)) + { + /* Enable the I2S DMA Tx request */ + hi2s->Instance->CR2 |= SPI_CR2_TXDMAEN; + /* Disable the I2SEx Rx DMA Request */ + I2SxEXT(hi2s->Instance)->CR2 |= SPI_CR2_RXDMAEN; + } + else + { + /* Enable the I2S DMA Rx request */ + hi2s->Instance->CR2 |= SPI_CR2_RXDMAEN; + /* Enable the I2SEx Tx DMA Request */ + I2SxEXT(hi2s->Instance)->CR2 |= SPI_CR2_TXDMAEN; + } + } + + /* If the I2S peripheral is still not enabled, enable it */ + if ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SE) == 0) + { + /* Enable I2S peripheral */ + __HAL_I2S_ENABLE(hi2s); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2s); + + return HAL_OK; +} + +/** + * @brief Resumes the audio stream playing from the Media. + * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains + * the configuration information for I2S module + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) +{ + /* Process Locked */ + __HAL_LOCK(hi2s); + + /* Disable the I2S Tx/Rx DMA requests */ + hi2s->Instance->CR2 &= ~SPI_CR2_TXDMAEN; + hi2s->Instance->CR2 &= ~SPI_CR2_RXDMAEN; + + if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) + { + /* Disable the I2S extended Tx/Rx DMA requests */ + I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); + } + + /* Abort the I2S DMA Stream tx */ + if(hi2s->hdmatx != HAL_NULL) + { + HAL_DMA_Abort(hi2s->hdmatx); + } + /* Abort the I2S DMA Stream rx */ + if(hi2s->hdmarx != HAL_NULL) + { + HAL_DMA_Abort(hi2s->hdmarx); + } + + /* Disable I2S peripheral */ + __HAL_I2S_DISABLE(hi2s); + + if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) + { + /* Disable the I2Sext peripheral */ + I2SxEXT(hi2s->Instance)->I2SCFGR &= ~SPI_I2SCFGR_I2SE; + } + hi2s->State = HAL_I2S_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2s); + + return HAL_OK; +} + +/** + * @brief This function handles I2S interrupt request. + * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains + * the configuration information for I2S module + * @retval None + */ +void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) +{ + uint32_t tmp1 = 0, tmp2 = 0; + __IO uint32_t tmpreg1 = 0; + if(hi2s->Init.FullDuplexMode != I2S_FULLDUPLEXMODE_ENABLE) + { + if(hi2s->State == HAL_I2S_STATE_BUSY_RX) + { + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXNE); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_RXNE); + /* I2S in mode Receiver ------------------------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + I2S_Receive_IT(hi2s); + } + + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR); + /* I2S Overrun error interrupt occurred ---------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + __HAL_I2S_CLEAR_OVRFLAG(hi2s); + hi2s->ErrorCode |= HAL_I2S_ERROR_OVR; + } + } + + if(hi2s->State == HAL_I2S_STATE_BUSY_TX) + { + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXE); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_TXE); + /* I2S in mode Tramitter -----------------------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + I2S_Transmit_IT(hi2s); + } + + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR); + /* I2S Underrun error interrupt occurred --------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + __HAL_I2S_CLEAR_UDRFLAG(hi2s); + hi2s->ErrorCode |= HAL_I2S_ERROR_UDR; + } + } + } + else + { + tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + /* Check if the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX Mode is selected */ + if((tmp1 == I2S_MODE_MASTER_TX) || (tmp2 == I2S_MODE_SLAVE_TX)) + { + tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_RXNE; + tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_RXNE; + /* I2Sext in mode Receiver ---------------------------------------------*/ + if((tmp1 == SPI_SR_RXNE) && (tmp2 == I2S_IT_RXNE)) + { + tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + /* When the I2S mode is configured as I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX, + the I2Sext RXNE interrupt will be generated to manage the full-duplex receive phase. */ + if((tmp1 == I2S_MODE_MASTER_TX) || (tmp2 == I2S_MODE_SLAVE_TX)) + { + I2SEx_TransmitReceive_IT(hi2s); + } + } + + tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_OVR; + tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_ERR; + /* I2Sext Overrun error interrupt occurred ------------------------------*/ + if((tmp1 == SPI_SR_OVR) && (tmp2 == I2S_IT_ERR)) + { + /* Clear I2Sext OVR Flag */ + tmpreg1 = I2SxEXT(hi2s->Instance)->DR; + tmpreg1 = I2SxEXT(hi2s->Instance)->SR; + hi2s->ErrorCode |= HAL_I2SEX_ERROR_OVR; + UNUSED(tmpreg1); + } + + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXE); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_TXE); + /* I2S in mode Tramitter -----------------------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + /* When the I2S mode is configured as I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX, + the I2S TXE interrupt will be generated to manage the full-duplex transmit phase. */ + if((tmp1 == I2S_MODE_MASTER_TX) || (tmp2 == I2S_MODE_SLAVE_TX)) + { + I2SEx_TransmitReceive_IT(hi2s); + } + } + + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR); + /* I2S Underrun error interrupt occurred --------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + __HAL_I2S_CLEAR_UDRFLAG(hi2s); + hi2s->ErrorCode |= HAL_I2S_ERROR_UDR; + } + } + /* The I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX Mode is selected */ + else + { + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXNE); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_RXNE); + /* I2S in mode Receiver ------------------------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + /* When the I2S mode is configured as I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX, + the I2S RXNE interrupt will be generated to manage the full-duplex receive phase. */ + if((tmp1 == I2S_MODE_MASTER_RX) || (tmp2 == I2S_MODE_SLAVE_RX)) + { + I2SEx_TransmitReceive_IT(hi2s); + } + } + + tmp1 = __HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR); + tmp2 = __HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR); + /* I2S Overrun error interrupt occurred ---------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + __HAL_I2S_CLEAR_OVRFLAG(hi2s); + hi2s->ErrorCode |= HAL_I2S_ERROR_OVR; + } + + tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_TXE; + tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_TXE; + /* I2Sext in mode Tramitter --------------------------------------------*/ + if((tmp1 == SPI_SR_TXE) && (tmp2 == I2S_IT_TXE)) + { + tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + tmp2 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG; + /* When the I2S mode is configured as I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX, + the I2Sext TXE interrupt will be generated to manage the full-duplex transmit phase. */ + if((tmp1 == I2S_MODE_MASTER_RX) || (tmp2 == I2S_MODE_SLAVE_RX)) + { + I2SEx_TransmitReceive_IT(hi2s); + } + } + + tmp1 = I2SxEXT(hi2s->Instance)->SR & SPI_SR_UDR; + tmp2 = I2SxEXT(hi2s->Instance)->CR2 & I2S_IT_ERR; + /* I2Sext Underrun error interrupt occurred -----------------------------*/ + if((tmp1 == SPI_SR_UDR) && (tmp2 == I2S_IT_ERR)) + { + /* Clear I2Sext UDR Flag */ + tmpreg1 = I2SxEXT(hi2s->Instance)->SR; + hi2s->ErrorCode |= HAL_I2SEX_ERROR_UDR; + UNUSED(tmpreg1); + } + } + } + + /* Call the Error call Back in case of Errors */ + if(hi2s->ErrorCode != HAL_I2S_ERROR_NONE) + { + /* Set the I2S state ready to be able to start again the process */ + hi2s->State= HAL_I2S_STATE_READY; + HAL_I2S_ErrorCallback(hi2s); + } +} + /** * @} */ + /** * @brief Full-Duplex Transmit/Receive data in non-blocking mode using Interrupt * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains @@ -735,7 +1220,249 @@ HAL_StatusTypeDef I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s) return HAL_BUSY; } } +#endif /* STM32F40xxx/ STM32F41xxx/ STM32F42xxx/ STM32F43xxx/ STM32F401xx/ STM32F411xx */ +/** + * @brief DMA I2S transmit process complete callback + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +void I2S_DMATxCplt(DMA_HandleTypeDef *hdma) +{ + I2S_HandleTypeDef* hi2s = (I2S_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) + { + hi2s->TxXferCount = 0; + + /* Disable Tx DMA Request */ + hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) + { + /* Disable Rx DMA Request for the slave*/ + I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); + } +#endif /* STM32F40xxx/ STM32F41xxx/ STM32F42xxx/ STM32F43xxx/ STM32F401xx/ STM32F411xx */ + if(hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) + { + if(hi2s->RxXferCount == 0) + { + hi2s->State = HAL_I2S_STATE_READY; + } + } + else + { + hi2s->State = HAL_I2S_STATE_READY; + } + } + HAL_I2S_TxCpltCallback(hi2s); +} + +/** + * @brief DMA I2S receive process complete callback + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +void I2S_DMARxCplt(DMA_HandleTypeDef *hdma) +{ + I2S_HandleTypeDef* hi2s = (I2S_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) + { + /* Disable Rx DMA Request */ + hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + if(hi2s->Init.FullDuplexMode == I2S_FULLDUPLEXMODE_ENABLE) + { + /* Disable Tx DMA Request for the slave*/ + I2SxEXT(hi2s->Instance)->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + } +#endif /* STM32F40xxx/ STM32F41xxx/ STM32F42xxx/ STM32F43xxx/ STM32F401xx/ STM32F411xx */ + hi2s->RxXferCount = 0; + if(hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) + { + if(hi2s->TxXferCount == 0) + { + hi2s->State = HAL_I2S_STATE_READY; + } + } + else + { + hi2s->State = HAL_I2S_STATE_READY; + } + } + HAL_I2S_RxCpltCallback(hi2s); +} + +/** + * @brief Get I2S clock Input based on Source clock selection in RCC + * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains + * the configuration information for I2S module + * @retval I2S Clock Input + */ +uint32_t I2S_GetInputClock(I2S_HandleTypeDef *hi2s) +{ + /* This variable used to store the VCO Input (value in Hz) */ + uint32_t vcoinput = 0; + /* This variable used to store the VCO Output (value in Hz) */ + uint32_t vcooutput = 0; + /* This variable used to store the I2S_CK_x (value in Hz) */ + uint32_t i2ssourceclock = 0; + + /* Configure SAI Clock based on SAI source clock selection */ +#if defined(STM32F446xx) + switch(hi2s->Init.ClockSource) + { + case I2S_CLOCK_EXTERNAL : + { + /* Set the I2S clock to the external clock value */ + i2ssourceclock = EXTERNAL_CLOCK_VALUE; + break; + } + case I2S_CLOCK_PLL : + { + /* Configure the PLLI2S division factor */ + /* PLLI2S_VCO Input = PLL_SOURCE/PLLI2SM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSE) + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSE_VALUE / (uint32_t)(RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM)); + } + else + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSI_VALUE / (uint32_t)(RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM)); + } + + /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ + vcooutput = (uint32_t)(vcoinput * (((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6) & (RCC_PLLI2SCFGR_PLLI2SN >> 6))); + /* I2S_CLK = PLLI2S_VCO Output/PLLI2SR */ + i2ssourceclock = (uint32_t)(vcooutput /(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> 28) & (RCC_PLLI2SCFGR_PLLI2SR >> 28))); + break; + } + case I2S_CLOCK_PLLR : + { + /* Configure the PLLI2S division factor */ + /* PLL_VCO Input = PLL_SOURCE/PLLM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSE) + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); + } + else + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); + } + + /* PLL_VCO Output = PLL_VCO Input * PLLN */ + vcooutput = (uint32_t)(vcoinput * (((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6) & (RCC_PLLCFGR_PLLN >> 6))); + /* I2S_CLK = PLLI2S_VCO Output/PLLI2SR */ + i2ssourceclock = (uint32_t)(vcooutput /(((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 28) & (RCC_PLLCFGR_PLLR >> 28))); + break; + } + case I2S_CLOCK_PLLSRC : + { + /* Configure the PLLI2S division factor */ + /* PLL_VCO Input = PLL_SOURCE/PLLM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSE) + { + /* Get the I2S source clock value */ + i2ssourceclock = (uint32_t)(HSE_VALUE); + } + else + { + /* Get the I2S source clock value */ + i2ssourceclock = (uint32_t)(HSI_VALUE); + } + break; + } + default : + { + break; + } + } +#endif /* STM32F446xx */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) + + /* If an external I2S clock has to be used, the specific define should be set + in the project configuration or in the stm32f4xx_conf.h file */ + if(hi2s->Init.ClockSource == I2S_CLOCK_EXTERNAL) + { + /* Enable the External Clock selection */ + __HAL_RCC_I2S_CONFIG(RCC_I2SCLKSOURCE_EXT); + + /* Set the I2S clock to the external clock value */ + i2ssourceclock = EXTERNAL_CLOCK_VALUE; + } + else + { + /* Configure the PLLI2S division factor */ + /* PLLI2S_VCO Input = PLL_SOURCE/PLLM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSE) + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); + } + else + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); + } + + /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ + vcooutput = (uint32_t)(vcoinput * (((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6) & (RCC_PLLI2SCFGR_PLLI2SN >> 6))); + /* I2S_CLK = PLLI2S_VCO Output/PLLI2SR */ + i2ssourceclock = (uint32_t)(vcooutput /(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> 28) & (RCC_PLLI2SCFGR_PLLI2SR >> 28))); + } +#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx */ +#if defined(STM32F411xE) + + /* If an external I2S clock has to be used, the specific define should be set + in the project configuration or in the stm32f4xx_conf.h file */ + if(hi2s->Init.ClockSource == I2S_CLOCK_EXTERNAL) + { + /* Enable the External Clock selection */ + __HAL_RCC_I2S_CONFIG(RCC_I2SCLKSOURCE_EXT); + + /* Set the I2S clock to the external clock value */ + i2ssourceclock = EXTERNAL_CLOCK_VALUE; + } + else + { + /* Configure the PLLI2S division factor */ + /* PLLI2S_VCO Input = PLL_SOURCE/PLLI2SM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSE) + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSE_VALUE / (uint32_t)(RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM)); + } + else + { + /* Get the I2S source clock value */ + vcoinput = (uint32_t)(HSI_VALUE / (uint32_t)(RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM)); + } + + /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ + vcooutput = (uint32_t)(vcoinput * (((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6) & (RCC_PLLI2SCFGR_PLLI2SN >> 6))); + /* I2S_CLK = PLLI2S_VCO Output/PLLI2SR */ + i2ssourceclock = (uint32_t)(vcooutput /(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> 28) & (RCC_PLLI2SCFGR_PLLI2SR >> 28))); + } +#endif /* STM32F411xE */ + + /* the return result is the value of SAI clock */ + return i2ssourceclock; + +} /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.h index 2bfe793eb25..45e53e0925b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_i2s_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_i2s_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of I2S HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,20 +54,82 @@ * @{ */ -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup I2SEx_Exported_Types I2S Exported Types + * @{ + */ +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup I2SEx_Exported_Constants I2S Exported Constants + * @{ + */ +/** + * @} + */ + /* Exported macro ------------------------------------------------------------*/ +/** @defgroup I2SEx_Exported_Macros I2S Exported Macros + * @{ + */ + +/** + * @} + */ + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup I2SEx_Exported_Functions + * @{ + */ + +/** @addtogroup I2SEx_Exported_Functions_Group1 + * @{ + */ /* Extended features functions **************************************************/ - /* Blocking mode: Polling */ +/* Blocking mode: Polling */ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size, uint32_t Timeout); - /* Non-Blocking mode: Interrupt */ +/* Non-Blocking mode: Interrupt */ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size); /* Non-Blocking mode: DMA */ HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2SEx_Private_Constants I2S Private Constants + * @{ + */ +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2SEx_Private_Macros I2S Private Macros + * @{ + */ +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup I2SEx_Private_Functions I2S Private Functions + * @{ + */ HAL_StatusTypeDef I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s); +uint32_t I2S_GetInputClock(I2S_HandleTypeDef *hi2s); +/** + * @} + */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.c index 1e028b73362..126ff243b38 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_irda.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief IRDA HAL module driver. * This file provides firmware functions to manage the following * functionalities of the IrDA SIR ENDEC block (IrDA): @@ -34,7 +34,7 @@ (+++) Enable the DMAx interface clock. (+++) Configure the declared DMA handle structure with the required Tx/Rx parameters. (+++) Configure the DMA Tx/Rx Stream. - (+++) Associate the initilalized DMA handle to the IRDA DMA Tx/Rx handle. + (+++) Associate the initialized DMA handle to the IRDA DMA Tx/Rx handle. (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx/Rx Stream. (#) Program the Baud Rate, Word Length, Parity, IrDA Mode, Prescaler @@ -42,7 +42,7 @@ (#) Initialize the IRDA registers by calling the HAL_IRDA_Init() API: (++) This API configures also the low level Hardware GPIO, CLOCK, CORTEX...etc) - by calling the customed HAL_IRDA_MspInit() API. + by calling the customized HAL_IRDA_MspInit() API. -@@- The specific IRDA interrupts (Transmission complete interrupt, RXNE interrupt and Error Interrupts) will be managed using the macros __HAL_IRDA_ENABLE_IT() and __HAL_IRDA_DISABLE_IT() inside the transmit and receive process. @@ -97,7 +97,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -131,7 +131,7 @@ * @{ */ -/** @defgroup IRDA +/** @defgroup IRDA IRDA * @brief HAL IRDA module driver * @{ */ @@ -140,12 +140,22 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup IRDA_Private_Constants + * @{ + */ #define IRDA_TIMEOUT_VALUE 22000 +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup IRDA_Private_Functions + * @{ + */ static void IRDA_SetConfig (IRDA_HandleTypeDef *hirda); static HAL_StatusTypeDef IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda); +static HAL_StatusTypeDef IRDA_EndTransmit_IT(IRDA_HandleTypeDef *hirda); static HAL_StatusTypeDef IRDA_Receive_IT(IRDA_HandleTypeDef *hirda); static void IRDA_DMATransmitCplt(DMA_HandleTypeDef *hdma); static void IRDA_DMATransmitHalfCplt(DMA_HandleTypeDef *hdma); @@ -153,14 +163,15 @@ static void IRDA_DMAReceiveCplt(DMA_HandleTypeDef *hdma); static void IRDA_DMAReceiveHalfCplt(DMA_HandleTypeDef *hdma); static void IRDA_DMAError(DMA_HandleTypeDef *hdma); static HAL_StatusTypeDef IRDA_WaitOnFlagUntilTimeout(IRDA_HandleTypeDef *hirda, uint32_t Flag, FlagStatus Status, uint32_t Timeout); - -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup IRDA_Private_Functions +/** + * @} + */ +/* Exported functions --------------------------------------------------------*/ +/** @defgroup IRDA_Exported_Functions IrDA Exported Functions * @{ */ -/** @defgroup IRDA_Group1 IrDA Initialization and de-initialization functions +/** @defgroup IRDA_Exported_Functions_Group1 IrDA Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -214,6 +225,8 @@ HAL_StatusTypeDef HAL_IRDA_Init(IRDA_HandleTypeDef *hirda) if(hirda->State == HAL_IRDA_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hirda->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ HAL_IRDA_MspInit(hirda); } @@ -221,7 +234,7 @@ HAL_StatusTypeDef HAL_IRDA_Init(IRDA_HandleTypeDef *hirda) hirda->State = HAL_IRDA_STATE_BUSY; /* Disable the IRDA peripheral */ - __IRDA_DISABLE(hirda); + __HAL_IRDA_DISABLE(hirda); /* Set the IRDA communication parameters */ IRDA_SetConfig(hirda); @@ -233,7 +246,7 @@ HAL_StatusTypeDef HAL_IRDA_Init(IRDA_HandleTypeDef *hirda) hirda->Instance->CR3 &= ~(USART_CR3_SCEN | USART_CR3_HDSEL); /* Enable the IRDA peripheral */ - __IRDA_ENABLE(hirda); + __HAL_IRDA_ENABLE(hirda); /* Set the prescaler */ MODIFY_REG(hirda->Instance->GTPR, USART_GTPR_PSC, hirda->Init.Prescaler); @@ -270,6 +283,9 @@ HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda) hirda->State = HAL_IRDA_STATE_BUSY; + /* Disable the Peripheral */ + __HAL_IRDA_DISABLE(hirda); + /* DeInit the low level hardware */ HAL_IRDA_MspDeInit(hirda); @@ -292,7 +308,7 @@ HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda) __weak void HAL_IRDA_MspInit(IRDA_HandleTypeDef *hirda) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_IRDA_MspInit could be implenetd in the user file + the HAL_IRDA_MspInit could be implemented in the user file */ } @@ -305,7 +321,7 @@ HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda) __weak void HAL_IRDA_MspDeInit(IRDA_HandleTypeDef *hirda) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_IRDA_MspDeInit could be implenetd in the user file + the HAL_IRDA_MspDeInit could be implemented in the user file */ } @@ -313,7 +329,7 @@ HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda) * @} */ -/** @defgroup IRDA_Group2 IO operation functions +/** @defgroup IRDA_Exported_Functions_Group2 IO operation functions * @brief IRDA Transmit/Receive functions * @verbatim @@ -338,7 +354,7 @@ HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda) dedicated IRDA IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_IRDA_TxCpltCallback(), HAL_IRDA_RxCpltCallback() user callbacks - will be executed respectivelly at the end of the transmit or Receive process + will be executed respectively at the end of the transmit or Receive process The HAL_IRDA_ErrorCallback() user callback will be executed when a communication error is detected (#) Blocking mode API's are : @@ -584,15 +600,12 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData hirda->State = HAL_IRDA_STATE_BUSY_TX; } - /* Enable the IRDA Parity Error Interrupt */ - __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_PE); - + /* Process Unlocked */ + __HAL_UNLOCK(hirda); + /* Enable the IRDA Error Interrupt: (Frame error, noise error, overrun error) */ __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_ERR); - - /* Process Unlocked */ - __HAL_UNLOCK(hirda); - + /* Enable the IRDA Transmit Data Register Empty Interrupt */ __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_TXE); @@ -640,18 +653,18 @@ HAL_StatusTypeDef HAL_IRDA_Receive_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, hirda->State = HAL_IRDA_STATE_BUSY_RX; } + /* Process Unlocked */ + __HAL_UNLOCK(hirda); + /* Enable the IRDA Data Register not empty Interrupt */ __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_RXNE); - + /* Enable the IRDA Parity Error Interrupt */ __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_PE); - + /* Enable the IRDA Error Interrupt: (Frame error, noise error, overrun error) */ __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_ERR); - /* Process Unlocked */ - __HAL_UNLOCK(hirda); - return HAL_OK; } else @@ -698,10 +711,10 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pDat hirda->State = HAL_IRDA_STATE_BUSY_TX; } - /* Set the IRDA DMA transfert complete callback */ + /* Set the IRDA DMA transfer complete callback */ hirda->hdmatx->XferCpltCallback = IRDA_DMATransmitCplt; - /* Set the IRDA DMA half transfert complete callback */ + /* Set the IRDA DMA half transfer complete callback */ hirda->hdmatx->XferHalfCpltCallback = IRDA_DMATransmitHalfCplt; /* Set the DMA error callback */ @@ -711,6 +724,9 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pDat tmp = (uint32_t*)&pData; HAL_DMA_Start_IT(hirda->hdmatx, *(uint32_t*)tmp, (uint32_t)&hirda->Instance->DR, Size); + /* Clear the TC flag in the SR register by writing 0 to it */ + __HAL_IRDA_CLEAR_FLAG(hirda, IRDA_FLAG_TC); + /* Enable the DMA transfer for transmit request by setting the DMAT bit in the USART CR3 register */ hirda->Instance->CR3 |= USART_CR3_DMAT; @@ -763,10 +779,10 @@ HAL_StatusTypeDef HAL_IRDA_Receive_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData hirda->State = HAL_IRDA_STATE_BUSY_RX; } - /* Set the IRDA DMA transfert complete callback */ + /* Set the IRDA DMA transfer complete callback */ hirda->hdmarx->XferCpltCallback = IRDA_DMAReceiveCplt; - /* Set the IRDA DMA half transfert complete callback */ + /* Set the IRDA DMA half transfer complete callback */ hirda->hdmarx->XferHalfCpltCallback = IRDA_DMAReceiveHalfCplt; /* Set the DMA error callback */ @@ -818,6 +834,13 @@ HAL_StatusTypeDef HAL_IRDA_DMAPause(IRDA_HandleTypeDef *hirda) hirda->Instance->CR3 &= (uint32_t)(~USART_CR3_DMAT); hirda->Instance->CR3 &= (uint32_t)(~USART_CR3_DMAR); } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hirda); + + return HAL_ERROR; + } /* Process Unlocked */ __HAL_UNLOCK(hirda); @@ -843,20 +866,27 @@ HAL_StatusTypeDef HAL_IRDA_DMAResume(IRDA_HandleTypeDef *hirda) } else if(hirda->State == HAL_IRDA_STATE_BUSY_RX) { - /* Clear the Overrun flag before resumming the Rx transfer*/ + /* Clear the Overrun flag before resuming the Rx transfer */ __HAL_IRDA_CLEAR_OREFLAG(hirda); /* Enable the UART DMA Rx request */ hirda->Instance->CR3 |= USART_CR3_DMAR; } else if(hirda->State == HAL_IRDA_STATE_BUSY_TX_RX) { - /* Clear the Overrun flag before resumming the Rx transfer*/ + /* Clear the Overrun flag before resuming the Rx transfer */ __HAL_IRDA_CLEAR_OREFLAG(hirda); /* Enable the UART DMA Tx & Rx request */ hirda->Instance->CR3 |= USART_CR3_DMAT; hirda->Instance->CR3 |= USART_CR3_DMAR; } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hirda); + return HAL_ERROR; + } + /* Process Unlocked */ __HAL_UNLOCK(hirda); @@ -966,6 +996,14 @@ void HAL_IRDA_IRQHandler(IRDA_HandleTypeDef *hirda) { IRDA_Transmit_IT(hirda); } + + tmp1 = __HAL_IRDA_GET_FLAG(hirda, IRDA_FLAG_TC); + tmp2 = __HAL_IRDA_GET_IT_SOURCE(hirda, IRDA_IT_TC); + /* IRDA in mode Transmitter (transmission end) -----------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + IRDA_EndTransmit_IT(hirda); + } } /** @@ -1037,7 +1075,7 @@ __weak void HAL_IRDA_RxHalfCpltCallback(IRDA_HandleTypeDef *hirda) * @} */ -/** @defgroup IRDA_Group3 Peripheral State and Errors functions +/** @defgroup IRDA_Exported_Functions_Group3 Peripheral State and Errors functions * @brief IRDA State and Errors functions * @verbatim @@ -1097,27 +1135,8 @@ static void IRDA_DMATransmitCplt(DMA_HandleTypeDef *hdma) in the IRDA CR3 register */ hirda->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_DMAT); - /* Wait for IRDA TC Flag */ - if(IRDA_WaitOnFlagUntilTimeout(hirda, IRDA_FLAG_TC, RESET, IRDA_TIMEOUT_VALUE) != HAL_OK) - { - /* Timeout occurred */ - hirda->State = HAL_IRDA_STATE_TIMEOUT; - HAL_IRDA_ErrorCallback(hirda); - } - else - { - /* No Timeout */ - /* Check if a receive process is ongoing or not */ - if(hirda->State == HAL_IRDA_STATE_BUSY_TX_RX) - { - hirda->State = HAL_IRDA_STATE_BUSY_RX; - } - else - { - hirda->State = HAL_IRDA_STATE_READY; - } - HAL_IRDA_TxCpltCallback(hirda); - } + /* Enable the IRDA Transmit Complete Interrupt */ + __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_TC); } /* DMA Circular mode */ else @@ -1306,36 +1325,45 @@ static HAL_StatusTypeDef IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda) /* Disable the IRDA Transmit Data Register Empty Interrupt */ __HAL_IRDA_DISABLE_IT(hirda, IRDA_IT_TXE); - if(hirda->State == HAL_IRDA_STATE_BUSY_TX_RX) - { - hirda->State = HAL_IRDA_STATE_BUSY_RX; - } - else - { - /* Disable the IRDA Parity Error Interrupt */ - __HAL_IRDA_DISABLE_IT(hirda, IRDA_IT_PE); - - /* Disable the IRDA Error Interrupt: (Frame error, noise error, overrun error) */ - __HAL_IRDA_DISABLE_IT(hirda, IRDA_IT_ERR); - - hirda->State = HAL_IRDA_STATE_READY; - } - /* Wait on TC flag to be able to start a second transfer */ - if(IRDA_WaitOnFlagUntilTimeout(hirda, IRDA_FLAG_TC, RESET, IRDA_TIMEOUT_VALUE) != HAL_OK) - { - return HAL_TIMEOUT; - } - HAL_IRDA_TxCpltCallback(hirda); - - return HAL_OK; + /* Enable the IRDA Transmit Complete Interrupt */ + __HAL_IRDA_ENABLE_IT(hirda, IRDA_IT_TC); } return HAL_OK; } else { - return HAL_BUSY; + return HAL_BUSY; + } +} + +/** + * @brief Wraps up transmission in non blocking mode. + * @param hirda: pointer to a IRDA_HandleTypeDef structure that contains + * the configuration information for the specified IRDA module. + * @retval HAL status + */ +static HAL_StatusTypeDef IRDA_EndTransmit_IT(IRDA_HandleTypeDef *hirda) +{ + /* Disable the IRDA Transmit Complete Interrupt */ + __HAL_IRDA_DISABLE_IT(hirda, IRDA_IT_TC); + + /* Check if a receive process is ongoing or not */ + if(hirda->State == HAL_IRDA_STATE_BUSY_TX_RX) + { + hirda->State = HAL_IRDA_STATE_BUSY_RX; + } + else + { + /* Disable the IRDA Error Interrupt: (Frame error, noise error, overrun error) */ + __HAL_IRDA_DISABLE_IT(hirda, IRDA_IT_ERR); + + hirda->State = HAL_IRDA_STATE_READY; } + + HAL_IRDA_TxCpltCallback(hirda); + + return HAL_OK; } /** @@ -1453,23 +1481,22 @@ static void IRDA_SetConfig(IRDA_HandleTypeDef *hirda) /*-------------------------- USART BRR Configuration -----------------------*/ if((hirda->Instance == USART1) || (hirda->Instance == USART6)) { - hirda->Instance->BRR = __IRDA_BRR(HAL_RCC_GetPCLK2Freq(), hirda->Init.BaudRate); + hirda->Instance->BRR = IRDA_BRR(HAL_RCC_GetPCLK2Freq(), hirda->Init.BaudRate); } else { - hirda->Instance->BRR = __IRDA_BRR(HAL_RCC_GetPCLK1Freq(), hirda->Init.BaudRate); + hirda->Instance->BRR = IRDA_BRR(HAL_RCC_GetPCLK1Freq(), hirda->Init.BaudRate); } } /** * @} */ +#endif /* HAL_IRDA_MODULE_ENABLED */ /** * @} */ -#endif /* HAL_IRDA_MODULE_ENABLED */ - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.h index 4c9cd62db27..bc99fd4621b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_irda.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_irda.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of IRDA HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,7 +55,9 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup IRDA_Exported_Types IRDA Exported Types + * @{ + */ /** * @brief IRDA Init Structure definition */ @@ -83,7 +85,7 @@ typedef struct uint8_t Prescaler; /*!< Specifies the Prescaler */ uint32_t IrDAMode; /*!< Specifies the IrDA mode - This parameter can be a value of @ref IrDA_Low_Power */ + This parameter can be a value of @ref IRDA_Low_Power */ }IRDA_InitTypeDef; /** @@ -93,7 +95,7 @@ typedef enum { HAL_IRDA_STATE_RESET = 0x00, /*!< Peripheral is not yet Initialized */ HAL_IRDA_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */ - HAL_IRDA_STATE_BUSY = 0x02, /*!< an internal process is ongoing */ + HAL_IRDA_STATE_BUSY = 0x02, /*!< An internal process is ongoing */ HAL_IRDA_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */ HAL_IRDA_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */ HAL_IRDA_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */ @@ -102,20 +104,7 @@ typedef enum }HAL_IRDA_StateTypeDef; /** - * @brief HAL IRDA Error Code structure definition - */ -typedef enum -{ - HAL_IRDA_ERROR_NONE = 0x00, /*!< No error */ - HAL_IRDA_ERROR_PE = 0x01, /*!< Parity error */ - HAL_IRDA_ERROR_NE = 0x02, /*!< Noise error */ - HAL_IRDA_ERROR_FE = 0x04, /*!< frame error */ - HAL_IRDA_ERROR_ORE = 0x08, /*!< Overrun error */ - HAL_IRDA_ERROR_DMA = 0x10 /*!< DMA transfer error */ -}HAL_IRDA_ErrorTypeDef; - -/** - * @brief IRDA handle Structure definition + * @brief IRDA handle Structure definition */ typedef struct { @@ -139,68 +128,74 @@ typedef struct DMA_HandleTypeDef *hdmarx; /* IRDA Rx DMA Handle parameters */ - HAL_LockTypeDef Lock; /* Locking object */ - - __IO HAL_IRDA_StateTypeDef State; /* IRDA communication state */ + HAL_LockTypeDef Lock; /* Locking object */ - __IO HAL_IRDA_ErrorTypeDef ErrorCode; /* IRDA Error code */ + __IO HAL_IRDA_StateTypeDef State; /* IRDA communication state */ + __IO uint32_t ErrorCode; /* IRDA Error code */ + }IRDA_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup IRDA_Exported_Constants +/** @defgroup IRDA_Exported_Constants IRDA Exported constants * @{ */ +/** @defgroup IRDA_Error_Code IRDA Error Code + * @brief IRDA Error Code + * @{ + */ +#define HAL_IRDA_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_IRDA_ERROR_PE ((uint32_t)0x00000001) /*!< Parity error */ +#define HAL_IRDA_ERROR_NE ((uint32_t)0x00000002) /*!< Noise error */ +#define HAL_IRDA_ERROR_FE ((uint32_t)0x00000004) /*!< Frame error */ +#define HAL_IRDA_ERROR_ORE ((uint32_t)0x00000008) /*!< Overrun error */ +#define HAL_IRDA_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ +/** + * @} + */ -/** @defgroup IRDA_Word_Length +/** @defgroup IRDA_Word_Length IRDA Word Length * @{ */ #define IRDA_WORDLENGTH_8B ((uint32_t)0x00000000) #define IRDA_WORDLENGTH_9B ((uint32_t)USART_CR1_M) -#define IS_IRDA_WORD_LENGTH(LENGTH) (((LENGTH) == IRDA_WORDLENGTH_8B) || \ - ((LENGTH) == IRDA_WORDLENGTH_9B)) /** * @} */ - -/** @defgroup IRDA_Parity +/** @defgroup IRDA_Parity IRDA Parity * @{ */ #define IRDA_PARITY_NONE ((uint32_t)0x00000000) #define IRDA_PARITY_EVEN ((uint32_t)USART_CR1_PCE) #define IRDA_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) -#define IS_IRDA_PARITY(PARITY) (((PARITY) == IRDA_PARITY_NONE) || \ - ((PARITY) == IRDA_PARITY_EVEN) || \ - ((PARITY) == IRDA_PARITY_ODD)) /** * @} */ - -/** @defgroup IRDA_Mode +/** @defgroup IRDA_Mode IRDA Transfer Mode * @{ */ #define IRDA_MODE_RX ((uint32_t)USART_CR1_RE) #define IRDA_MODE_TX ((uint32_t)USART_CR1_TE) #define IRDA_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE)) -#define IS_IRDA_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) /** * @} */ -/** @defgroup IrDA_Low_Power +/** @defgroup IRDA_Low_Power IRDA Low Power * @{ */ #define IRDA_POWERMODE_LOWPOWER ((uint32_t)USART_CR3_IRLP) #define IRDA_POWERMODE_NORMAL ((uint32_t)0x00000000) -#define IS_IRDA_POWERMODE(MODE) (((MODE) == IRDA_POWERMODE_LOWPOWER) || \ - ((MODE) == IRDA_POWERMODE_NORMAL)) /** * @} */ -/** @defgroup IRDA_Flags +/** @defgroup IRDA_Flags IRDA Flags * Elements values convention: 0xXXXX * - 0xXXXX : Flag mask in the SR register * @{ @@ -217,28 +212,25 @@ typedef struct * @} */ -/** @defgroup IRDA_Interrupt_definition +/** @defgroup IRDA_Interrupt_definition IRDA Interrupt Definitions * Elements values convention: 0xY000XXXX * - XXXX : Interrupt mask in the XX register * - Y : Interrupt source register (2bits) * - 01: CR1 register * - 10: CR2 register * - 11: CR3 register - * * @{ */ - -#define IRDA_IT_PE ((uint32_t)0x10000100) -#define IRDA_IT_TXE ((uint32_t)0x10000080) -#define IRDA_IT_TC ((uint32_t)0x10000040) -#define IRDA_IT_RXNE ((uint32_t)0x10000020) -#define IRDA_IT_IDLE ((uint32_t)0x10000010) +#define IRDA_IT_PE ((uint32_t)(IRDA_CR1_REG_INDEX << 28 | USART_CR1_PEIE)) +#define IRDA_IT_TXE ((uint32_t)(IRDA_CR1_REG_INDEX << 28 | USART_CR1_TXEIE)) +#define IRDA_IT_TC ((uint32_t)(IRDA_CR1_REG_INDEX << 28 | USART_CR1_TCIE)) +#define IRDA_IT_RXNE ((uint32_t)(IRDA_CR1_REG_INDEX << 28 | USART_CR1_RXNEIE)) +#define IRDA_IT_IDLE ((uint32_t)(IRDA_CR1_REG_INDEX << 28 | USART_CR1_IDLEIE)) -#define IRDA_IT_LBD ((uint32_t)0x20000040) - -#define IRDA_IT_CTS ((uint32_t)0x30000400) -#define IRDA_IT_ERR ((uint32_t)0x30000001) +#define IRDA_IT_LBD ((uint32_t)(IRDA_CR2_REG_INDEX << 28 | USART_CR2_LBDIE)) +#define IRDA_IT_CTS ((uint32_t)(IRDA_CR3_REG_INDEX << 28 | USART_CR3_CTSIE)) +#define IRDA_IT_ERR ((uint32_t)(IRDA_CR3_REG_INDEX << 28 | USART_CR3_EIE)) /** * @} */ @@ -248,6 +240,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup IRDA_Exported_Macros IRDA Exported Macros + * @{ + */ /** @brief Reset IRDA handle state * @param __HANDLE__: specifies the USART Handle. @@ -310,8 +305,13 @@ typedef struct * UART peripheral. * @retval None */ -#define __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR;\ - (__HANDLE__)->Instance->DR;}while(0) +#define __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + UNUSED(tmpreg); \ + } while(0) + /** @brief Clear the IRDA FE pending flag. * @param __HANDLE__: specifies the USART Handle. * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or @@ -356,17 +356,14 @@ typedef struct * @arg IRDA_IT_IDLE: Idle line detection interrupt * @arg IRDA_IT_PE: Parity Error interrupt * @arg IRDA_IT_ERR: Error interrupt(Frame error, noise error, overrun error) - * @param NewState: new state of the specified IRDA interrupt. - * This parameter can be: ENABLE or DISABLE. * @retval None */ -#define IRDA_IT_MASK ((uint32_t)0x0000FFFF) #define __HAL_IRDA_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & IRDA_IT_MASK)): \ - (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 |= ((__INTERRUPT__) & IRDA_IT_MASK)): \ + (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 |= ((__INTERRUPT__) & IRDA_IT_MASK)): \ ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & IRDA_IT_MASK))) #define __HAL_IRDA_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & IRDA_IT_MASK)): \ - (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & IRDA_IT_MASK)): \ - ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & IRDA_IT_MASK))) + (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & IRDA_IT_MASK)): \ + ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & IRDA_IT_MASK))) /** @brief Checks whether the specified IRDA interrupt has occurred or not. * @param __HANDLE__: specifies the USART Handle. @@ -385,26 +382,58 @@ typedef struct #define __HAL_IRDA_GET_IT_SOURCE(__HANDLE__, __IT__) (((((__IT__) >> 28) == 1)? (__HANDLE__)->Instance->CR1:(((((uint32_t)(__IT__)) >> 28) == 2)? \ (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & (((uint32_t)(__IT__)) & IRDA_IT_MASK)) +/** @brief Macro to enable the IRDA's one bit sample method + * @param __HANDLE__: specifies the IRDA Handle. + * @retval None + */ +#define __HAL_IRDA_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) +/** @brief Macro to disable the IRDA's one bit sample method + * @param __HANDLE__: specifies the IRDA Handle. + * @retval None + */ +#define __HAL_IRDA_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT)) -#define __IRDA_ENABLE(__HANDLE__) ( (__HANDLE__)->Instance->CR1 |= USART_CR1_UE) -#define __IRDA_DISABLE(__HANDLE__) ( (__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) - -#define __DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) -#define __DIVMANT(_PCLK_, _BAUD_) (__DIV((_PCLK_), (_BAUD_))/100) -#define __DIVFRAQ(_PCLK_, _BAUD_) (((__DIV((_PCLK_), (_BAUD_)) - (__DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) -#define __IRDA_BRR(_PCLK_, _BAUD_) ((__DIVMANT((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) +/** @brief Enable UART/USART associated to IRDA Handle + * @param __HANDLE__: specifies the IRDA Handle. + * IRDA Handle selects the USARTx or UARTy peripheral + * (USART,UART availability and x,y values depending on device). + * @retval None + */ +#define __HAL_IRDA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) -#define IS_IRDA_BAUDRATE(BAUDRATE) ((BAUDRATE) < 115201) - +/** @brief Disable UART/USART associated to IRDA Handle + * @param __HANDLE__: specifies the IRDA Handle. + * IRDA Handle selects the USARTx or UARTy peripheral + * (USART,UART availability and x,y values depending on device). + * @retval None + */ +#define __HAL_IRDA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) + +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup IRDA_Exported_Functions + * @{ + */ + +/** @addtogroup IRDA_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_IRDA_Init(IRDA_HandleTypeDef *hirda); HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda); void HAL_IRDA_MspInit(IRDA_HandleTypeDef *hirda); void HAL_IRDA_MspDeInit(IRDA_HandleTypeDef *hirda); +/** + * @} + */ +/** @addtogroup IRDA_Exported_Functions_Group2 + * @{ + */ /* IO operation functions *******************************************************/ HAL_StatusTypeDef HAL_IRDA_Transmit(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_IRDA_Receive(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size, uint32_t Timeout); @@ -421,10 +450,76 @@ void HAL_IRDA_RxCpltCallback(IRDA_HandleTypeDef *hirda); void HAL_IRDA_TxHalfCpltCallback(IRDA_HandleTypeDef *hirda); void HAL_IRDA_RxHalfCpltCallback(IRDA_HandleTypeDef *hirda); void HAL_IRDA_ErrorCallback(IRDA_HandleTypeDef *hirda); +/** + * @} + */ +/** @addtogroup IRDA_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions **************************************************/ HAL_IRDA_StateTypeDef HAL_IRDA_GetState(IRDA_HandleTypeDef *hirda); -uint32_t HAL_IRDA_GetError(IRDA_HandleTypeDef *hirda); +uint32_t HAL_IRDA_GetError(IRDA_HandleTypeDef *hirda); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup IRDA_Private_Constants IRDA Private Constants + * @{ + */ + +/** @brief IRDA interruptions flag mask + * + */ +#define IRDA_IT_MASK ((uint32_t) USART_CR1_PEIE | USART_CR1_TXEIE | USART_CR1_TCIE | USART_CR1_RXNEIE | \ + USART_CR1_IDLEIE | USART_CR2_LBDIE | USART_CR3_CTSIE | USART_CR3_EIE ) + + +#define IRDA_CR1_REG_INDEX 1 +#define IRDA_CR2_REG_INDEX 2 +#define IRDA_CR3_REG_INDEX 3 +/** + * @} + */ + +/* Private macros --------------------------------------------------------*/ +/** @defgroup IRDA_Private_Macros IRDA Private Macros + * @{ + */ +#define IS_IRDA_WORD_LENGTH(LENGTH) (((LENGTH) == IRDA_WORDLENGTH_8B) || \ + ((LENGTH) == IRDA_WORDLENGTH_9B)) +#define IS_IRDA_PARITY(PARITY) (((PARITY) == IRDA_PARITY_NONE) || \ + ((PARITY) == IRDA_PARITY_EVEN) || \ + ((PARITY) == IRDA_PARITY_ODD)) +#define IS_IRDA_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) +#define IS_IRDA_POWERMODE(MODE) (((MODE) == IRDA_POWERMODE_LOWPOWER) || \ + ((MODE) == IRDA_POWERMODE_NORMAL)) +#define IS_IRDA_BAUDRATE(BAUDRATE) ((BAUDRATE) < 115201) + +#define IRDA_DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) +#define IRDA_DIVMANT(_PCLK_, _BAUD_) (IRDA_DIV((_PCLK_), (_BAUD_))/100) +#define IRDA_DIVFRAQ(_PCLK_, _BAUD_) (((IRDA_DIV((_PCLK_), (_BAUD_)) - (IRDA_DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) +#define IRDA_BRR(_PCLK_, _BAUD_) ((IRDA_DIVMANT((_PCLK_), (_BAUD_)) << 4)|(IRDA_DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup IRDA_Private_Functions IRDA Private Functions + * @{ + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.c index add9f64b4d3..5386723c065 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.c @@ -2,18 +2,18 @@ ****************************************************************************** * @file stm32f4xx_hal_iwdg.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief IWDG HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Independent Watchdog (IWDG) peripheral: - * + Initialization and de-initialization functions + * + Initialization and Configuration functions * + IO operation functions * + Peripheral State functions * @verbatim ============================================================================== - ##### IWDG Generic features ##### + ##### IWDG Specific features ##### ============================================================================== [..] (+) The IWDG can be started by either software or hardware (configurable @@ -76,15 +76,13 @@ (+) __HAL_IWDG_START: Enable the IWDG peripheral (+) __HAL_IWDG_RELOAD_COUNTER: Reloads IWDG counter with value defined in the reload register - (+) __HAL_IWDG_ENABLE_WRITE_ACCESS : Enable write access to IWDG_PR and IWDG_RLR registers - (+) __HAL_IWDG_DISABLE_WRITE_ACCESS : Disable write access to IWDG_PR and IWDG_RLR registers (+) __HAL_IWDG_GET_FLAG: Get the selected IWDG's flag status @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -118,7 +116,7 @@ * @{ */ -/** @defgroup IWDG +/** @defgroup IWDG IWDG * @brief IWDG HAL module driver. * @{ */ @@ -127,17 +125,23 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ + /** @addtogroup IWDG_Private_Constants + * @{ + */ #define IWDG_TIMEOUT_FLAG ((uint32_t)1000) /* 1 s */ +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup IWDG_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup IWDG_Exported_Functions IWDG Exported Functions * @{ */ -/** @defgroup IWDG_Group1 Initialization and de-initialization functions +/** @defgroup IWDG_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions. * @verbatim @@ -176,6 +180,8 @@ HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg) if(hiwdg->State == HAL_IWDG_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hiwdg->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_IWDG_MspInit(hiwdg); } @@ -184,7 +190,7 @@ HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg) hiwdg->State = HAL_IWDG_STATE_BUSY; /* Enable write access to IWDG_PR and IWDG_RLR registers */ - __HAL_IWDG_ENABLE_WRITE_ACCESS(hiwdg); + IWDG_ENABLE_WRITE_ACCESS(hiwdg); /* Write to IWDG registers the IWDG_Prescaler & IWDG_Reload values to work with */ MODIFY_REG(hiwdg->Instance->PR, IWDG_PR_PR, hiwdg->Init.Prescaler); @@ -214,7 +220,7 @@ __weak void HAL_IWDG_MspInit(IWDG_HandleTypeDef *hiwdg) * @} */ -/** @defgroup IWDG_Group2 IO operation functions +/** @defgroup IWDG_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -309,7 +315,7 @@ HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg) * @} */ -/** @defgroup IWDG_Group3 Peripheral State functions +/** @defgroup IWDG_Exported_Functions_Group3 Peripheral State functions * @brief Peripheral State functions. * @verbatim diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.h index dbbce963359..40b17f83aa1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_iwdg.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_iwdg.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of IWDG HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,7 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup IWDG_Exported_Types IWDG Exported Types + * @{ + */ + /** * @brief IWDG HAL State Structure definition */ @@ -66,7 +69,6 @@ typedef enum HAL_IWDG_STATE_BUSY = 0x02, /*!< IWDG internal process is ongoing */ HAL_IWDG_STATE_TIMEOUT = 0x03, /*!< IWDG timeout state */ HAL_IWDG_STATE_ERROR = 0x04 /*!< IWDG error state */ - }HAL_IWDG_StateTypeDef; /** @@ -79,11 +81,10 @@ typedef struct uint32_t Reload; /*!< Specifies the IWDG down-counter reload value. This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */ - }IWDG_InitTypeDef; /** - * @brief IWDG handle Structure definition + * @brief IWDG Handle Structure definition */ typedef struct { @@ -91,49 +92,44 @@ typedef struct IWDG_InitTypeDef Init; /*!< IWDG required parameters */ - HAL_LockTypeDef Lock; /*!< IWDG locking object */ + HAL_LockTypeDef Lock; /*!< IWDG Locking object */ __IO HAL_IWDG_StateTypeDef State; /*!< IWDG communication state */ - }IWDG_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup IWDG_Exported_Constants +/** @defgroup IWDG_Exported_Constants IWDG Exported Constants * @{ */ -/** @defgroup IWDG_Registers_BitMask +/** @defgroup IWDG_Registers_BitMask IWDG Registers BitMask + * @brief IWDG registers bit mask * @{ */ /* --- KR Register ---*/ /* KR register bit mask */ -#define KR_KEY_RELOAD ((uint32_t)0xAAAA) /*!< IWDG reload counter enable */ -#define KR_KEY_ENABLE ((uint32_t)0xCCCC) /*!< IWDG peripheral enable */ -#define KR_KEY_EWA ((uint32_t)0x5555) /*!< IWDG KR write Access enable */ -#define KR_KEY_DWA ((uint32_t)0x0000) /*!< IWDG KR write Access disable */ - -#define IS_IWDG_KR(__KR__) (((__KR__) == KR_KEY_RELOAD) || \ - ((__KR__) == KR_KEY_ENABLE))|| \ - ((__KR__) == KR_KEY_EWA)) || \ - ((__KR__) == KR_KEY_DWA)) +#define IWDG_KEY_RELOAD ((uint32_t)0xAAAA) /*!< IWDG Reload Counter Enable */ +#define IWDG_KEY_ENABLE ((uint32_t)0xCCCC) /*!< IWDG Peripheral Enable */ +#define IWDG_KEY_WRITE_ACCESS_ENABLE ((uint32_t)0x5555) /*!< IWDG KR Write Access Enable */ +#define IWDG_KEY_WRITE_ACCESS_DISABLE ((uint32_t)0x0000) /*!< IWDG KR Write Access Disable */ /** * @} */ -/** @defgroup IWDG_Flag_definition +/** @defgroup IWDG_Flag_definition IWDG Flag definition * @{ */ -#define IWDG_FLAG_PVU ((uint32_t)0x0001) /*!< Watchdog counter prescaler value update flag */ -#define IWDG_FLAG_RVU ((uint32_t)0x0002) /*!< Watchdog counter reload value update flag */ - -#define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || \ - ((FLAG) == IWDG_FLAG_RVU)) - +#define IWDG_FLAG_PVU ((uint32_t)IWDG_SR_PVU) /*!< Watchdog counter prescaler value update Flag */ +#define IWDG_FLAG_RVU ((uint32_t)IWDG_SR_RVU) /*!< Watchdog counter reload value update Flag */ /** * @} */ -/** @defgroup IWDG_Prescaler +/** @defgroup IWDG_Prescaler IWDG Prescaler * @{ */ #define IWDG_PRESCALER_4 ((uint8_t)0x00) /*!< IWDG prescaler set to 4 */ @@ -143,25 +139,6 @@ typedef struct #define IWDG_PRESCALER_64 ((uint8_t)(IWDG_PR_PR_2)) /*!< IWDG prescaler set to 64 */ #define IWDG_PRESCALER_128 ((uint8_t)(IWDG_PR_PR_2 | IWDG_PR_PR_0)) /*!< IWDG prescaler set to 128 */ #define IWDG_PRESCALER_256 ((uint8_t)(IWDG_PR_PR_2 | IWDG_PR_PR_1)) /*!< IWDG prescaler set to 256 */ - - -#define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_PRESCALER_4) || \ - ((PRESCALER) == IWDG_PRESCALER_8) || \ - ((PRESCALER) == IWDG_PRESCALER_16) || \ - ((PRESCALER) == IWDG_PRESCALER_32) || \ - ((PRESCALER) == IWDG_PRESCALER_64) || \ - ((PRESCALER) == IWDG_PRESCALER_128)|| \ - ((PRESCALER) == IWDG_PRESCALER_256)) - -/** - * @} - */ - -/** @defgroup IWDG_Reload_Value - * @{ - */ -#define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) - /** * @} */ @@ -170,10 +147,13 @@ typedef struct * @} */ -/* Exported macro ------------------------------------------------------------*/ +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup IWDG_Exported_Macros IWDG Exported Macros + * @{ + */ /** @brief Reset IWDG handle state - * @param __HANDLE__: IWDG handle + * @param __HANDLE__: IWDG handle. * @retval None */ #define __HAL_IWDG_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_IWDG_STATE_RESET) @@ -183,7 +163,7 @@ typedef struct * @param __HANDLE__: IWDG handle * @retval None */ -#define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, KR_KEY_ENABLE) +#define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE) /** * @brief Reloads IWDG counter with value defined in the reload register @@ -191,21 +171,7 @@ typedef struct * @param __HANDLE__: IWDG handle * @retval None */ -#define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, KR_KEY_RELOAD) - -/** - * @brief Enables write access to IWDG_PR and IWDG_RLR registers. - * @param __HANDLE__: IWDG handle - * @retval None - */ -#define __HAL_IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, KR_KEY_EWA) - -/** - * @brief Disables write access to IWDG_PR and IWDG_RLR registers. - * @param __HANDLE__: IWDG handle - * @retval None - */ -#define __HAL_IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, KR_KEY_DWA) +#define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD) /** * @brief Gets the selected IWDG's flag status. @@ -218,19 +184,93 @@ typedef struct */ #define __HAL_IWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) +/** + * @} + */ + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup IWDG_Exported_Functions + * @{ + */ +/** @addtogroup IWDG_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions ********************************/ HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg); void HAL_IWDG_MspInit(IWDG_HandleTypeDef *hiwdg); +/** + * @} + */ +/** @addtogroup IWDG_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions ****************************************************/ HAL_StatusTypeDef HAL_IWDG_Start(IWDG_HandleTypeDef *hiwdg); HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg); +/** + * @} + */ +/** @addtogroup IWDG_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions ************************************************/ HAL_IWDG_StateTypeDef HAL_IWDG_GetState(IWDG_HandleTypeDef *hiwdg); +/** + * @} + */ + +/** + * @} + */ + +/* Private macro -------------------------------------------------------------*/ +/** @defgroup IWDG_Private_Macros IWDG Private Macros + * @{ + */ + +/** + * @brief Enables write access to IWDG_PR and IWDG_RLR registers. + * @param __HANDLE__: IWDG handle + * @retval None + */ +#define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE) + +/** + * @brief Disables write access to IWDG_PR and IWDG_RLR registers. + * @param __HANDLE__: IWDG handle + * @retval None + */ +#define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE) + + +#define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \ + ((__PRESCALER__) == IWDG_PRESCALER_8) || \ + ((__PRESCALER__) == IWDG_PRESCALER_16) || \ + ((__PRESCALER__) == IWDG_PRESCALER_32) || \ + ((__PRESCALER__) == IWDG_PRESCALER_64) || \ + ((__PRESCALER__) == IWDG_PRESCALER_128)|| \ + ((__PRESCALER__) == IWDG_PRESCALER_256)) + + +#define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= 0xFFF) + +/** + * @} + */ + +/* Private define ------------------------------------------------------------*/ + /** @defgroup IWDG_Private_Constants IWDG Private Constants + * @{ + */ + +/** + * @} + */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.c index cfe7c6ed413..83972df09d6 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_ltdc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief LTDC HAL module driver. * This file provides firmware functions to manage the following * functionalities of the LTDC peripheral: @@ -35,7 +35,7 @@ (#) Optionally, configure and enable the Color keying using HAL_LTDC_ConfigColorKeying() and HAL_LTDC_EnableColorKeying functions. - (#) Optionally, configure LineInterrupt using HAL_LTDC_ProgramLineInterrupt() + (#) Optionally, configure LineInterrupt using HAL_LTDC_ProgramLineEvent() function (#) If needed, reconfigure and change the pixel format value, the alpha value @@ -69,7 +69,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -102,7 +102,7 @@ /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @defgroup LTDC +/** @defgroup LTDC LTDC * @brief LTDC HAL module driver * @{ */ @@ -119,11 +119,11 @@ static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx); /* Private functions ---------------------------------------------------------*/ -/** @defgroup LTDC_Private_Functions +/** @defgroup LTDC_Exported_Functions LTDC Exported Functions * @{ */ -/** @defgroup LTDC_Group1 Initialization and Configuration functions +/** @defgroup LTDC_Exported_Functions_Group1 Initialization and Configuration functions * @brief Initialization and Configuration functions * @verbatim @@ -172,6 +172,8 @@ HAL_StatusTypeDef HAL_LTDC_Init(LTDC_HandleTypeDef *hltdc) if(hltdc->State == HAL_LTDC_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hltdc->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_LTDC_MspInit(hltdc); } @@ -219,7 +221,7 @@ HAL_StatusTypeDef HAL_LTDC_Init(LTDC_HandleTypeDef *hltdc) /* Enable LTDC by setting LTDCEN bit */ __HAL_LTDC_ENABLE(hltdc); - /* Initialise the error code */ + /* Initialize the error code */ hltdc->ErrorCode = HAL_LTDC_ERROR_NONE; /* Initialize the LTDC state*/ @@ -241,7 +243,7 @@ HAL_StatusTypeDef HAL_LTDC_DeInit(LTDC_HandleTypeDef *hltdc) /* DeInit the low level hardware */ HAL_LTDC_MspDeInit(hltdc); - /* Initialise the error code */ + /* Initialize the error code */ hltdc->ErrorCode = HAL_LTDC_ERROR_NONE; /* Initialize the LTDC state*/ @@ -283,7 +285,7 @@ __weak void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc) * @} */ -/** @defgroup LTDC_Group2 IO operation functions +/** @defgroup LTDC_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -405,7 +407,7 @@ __weak void HAL_LTDC_LineEvenCallback(LTDC_HandleTypeDef *hltdc) * @} */ -/** @defgroup LTDC_Group3 Peripheral Control functions +/** @defgroup LTDC_Exported_Functions_Group3 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -502,8 +504,8 @@ HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t assert_param(IS_LTDC_LAYER(LayerIdx)); /* Configures the default color values */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CKCR &= ~(LTDC_LxCKCR_CKBLUE | LTDC_LxCKCR_CKGREEN | LTDC_LxCKCR_CKRED); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CKCR = RGBValue; + LTDC_LAYER(hltdc, LayerIdx)->CKCR &= ~(LTDC_LxCKCR_CKBLUE | LTDC_LxCKCR_CKGREEN | LTDC_LxCKCR_CKRED); + LTDC_LAYER(hltdc, LayerIdx)->CKCR = RGBValue; /* Sets the Reload type */ hltdc->Instance->SRCR = LTDC_SRCR_IMR; @@ -545,12 +547,19 @@ HAL_StatusTypeDef HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef *hltdc, uint32_t *pCLUT for(counter = 0; (counter < CLUTSize); counter++) { - tmp = ((counter << 24) | ((uint32_t)(*pCLUT) & 0xFF) | ((uint32_t)(*pCLUT) & 0xFF00) | ((uint32_t)(*pCLUT) & 0xFF0000)); + if(hltdc->LayerCfg[LayerIdx].PixelFormat == LTDC_PIXEL_FORMAT_AL44) + { + tmp = (((counter + 16*counter) << 24) | ((uint32_t)(*pCLUT) & 0xFF) | ((uint32_t)(*pCLUT) & 0xFF00) | ((uint32_t)(*pCLUT) & 0xFF0000)); + } + else + { + tmp = ((counter << 24) | ((uint32_t)(*pCLUT) & 0xFF) | ((uint32_t)(*pCLUT) & 0xFF00) | ((uint32_t)(*pCLUT) & 0xFF0000)); + } pcounter = (uint32_t)pCLUT + sizeof(*pCLUT); pCLUT = (uint32_t *)pcounter; /* Specifies the C-LUT address and RGB value */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CLUTWR = tmp; + LTDC_LAYER(hltdc, LayerIdx)->CLUTWR = tmp; } /* Change the LTDC state*/ @@ -583,7 +592,7 @@ HAL_StatusTypeDef HAL_LTDC_EnableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t assert_param(IS_LTDC_LAYER(LayerIdx)); /* Enable LTDC color keying by setting COLKEN bit */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_COLKEN; + LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_COLKEN; /* Sets the Reload type */ hltdc->Instance->SRCR = LTDC_SRCR_IMR; @@ -618,7 +627,7 @@ HAL_StatusTypeDef HAL_LTDC_DisableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_ assert_param(IS_LTDC_LAYER(LayerIdx)); /* Disable LTDC color keying by setting COLKEN bit */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_COLKEN; + LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_COLKEN; /* Sets the Reload type */ hltdc->Instance->SRCR = LTDC_SRCR_IMR; @@ -654,7 +663,7 @@ HAL_StatusTypeDef HAL_LTDC_EnableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerI assert_param(IS_LTDC_LAYER(LayerIdx)); /* Disable LTDC color lookup table by setting CLUTEN bit */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_CLUTEN; + LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_CLUTEN; /* Sets the Reload type */ hltdc->Instance->SRCR = LTDC_SRCR_IMR; @@ -690,7 +699,7 @@ HAL_StatusTypeDef HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t Layer assert_param(IS_LTDC_LAYER(LayerIdx)); /* Disable LTDC color lookup table by setting CLUTEN bit */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_CLUTEN; + LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_CLUTEN; /* Sets the Reload type */ hltdc->Instance->SRCR = LTDC_SRCR_IMR; @@ -1044,7 +1053,7 @@ HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef *hltdc, uint32_t * @} */ -/** @defgroup LTDC_Group4 Peripheral State and Errors functions +/** @defgroup LTDC_Exported_Functions_Group4 Peripheral State and Errors functions * @brief Peripheral State and Errors functions * @verbatim @@ -1090,7 +1099,7 @@ uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef *hltdc) * @brief Configures the LTDC peripheral * @param hltdc : Pointer to a LTDC_HandleTypeDef structure that contains * the configuration information for the LTDC. - * @param pLayerCfg: Pointer LTDC Layer Configuration strusture + * @param pLayerCfg: Pointer LTDC Layer Configuration structure * @param LayerIdx: LTDC Layer index. * This parameter can be one of the following values: 0 or 1 * @retval None @@ -1103,36 +1112,36 @@ static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLay /* Configures the horizontal start and stop position */ tmp = ((pLayerCfg->WindowX1 + ((hltdc->Instance->BPCR & LTDC_BPCR_AHBP) >> 16)) << 16); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->WHPCR &= ~(LTDC_LxWHPCR_WHSTPOS | LTDC_LxWHPCR_WHSPPOS); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->WHPCR = ((pLayerCfg->WindowX0 + ((hltdc->Instance->BPCR & LTDC_BPCR_AHBP) >> 16) + 1) | tmp); + LTDC_LAYER(hltdc, LayerIdx)->WHPCR &= ~(LTDC_LxWHPCR_WHSTPOS | LTDC_LxWHPCR_WHSPPOS); + LTDC_LAYER(hltdc, LayerIdx)->WHPCR = ((pLayerCfg->WindowX0 + ((hltdc->Instance->BPCR & LTDC_BPCR_AHBP) >> 16) + 1) | tmp); /* Configures the vertical start and stop position */ tmp = ((pLayerCfg->WindowY1 + (hltdc->Instance->BPCR & LTDC_BPCR_AVBP)) << 16); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->WVPCR &= ~(LTDC_LxWVPCR_WVSTPOS | LTDC_LxWVPCR_WVSPPOS); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->WVPCR = ((pLayerCfg->WindowY0 + (hltdc->Instance->BPCR & LTDC_BPCR_AVBP) + 1) | tmp); + LTDC_LAYER(hltdc, LayerIdx)->WVPCR &= ~(LTDC_LxWVPCR_WVSTPOS | LTDC_LxWVPCR_WVSPPOS); + LTDC_LAYER(hltdc, LayerIdx)->WVPCR = ((pLayerCfg->WindowY0 + (hltdc->Instance->BPCR & LTDC_BPCR_AVBP) + 1) | tmp); /* Specifies the pixel format */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->PFCR &= ~(LTDC_LxPFCR_PF); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->PFCR = (pLayerCfg->PixelFormat); + LTDC_LAYER(hltdc, LayerIdx)->PFCR &= ~(LTDC_LxPFCR_PF); + LTDC_LAYER(hltdc, LayerIdx)->PFCR = (pLayerCfg->PixelFormat); /* Configures the default color values */ tmp = ((uint32_t)(pLayerCfg->Backcolor.Green) << 8); tmp1 = ((uint32_t)(pLayerCfg->Backcolor.Red) << 16); tmp2 = (pLayerCfg->Alpha0 << 24); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->DCCR &= ~(LTDC_LxDCCR_DCBLUE | LTDC_LxDCCR_DCGREEN | LTDC_LxDCCR_DCRED | LTDC_LxDCCR_DCALPHA); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->DCCR = (pLayerCfg->Backcolor.Blue | tmp | tmp1 | tmp2); + LTDC_LAYER(hltdc, LayerIdx)->DCCR &= ~(LTDC_LxDCCR_DCBLUE | LTDC_LxDCCR_DCGREEN | LTDC_LxDCCR_DCRED | LTDC_LxDCCR_DCALPHA); + LTDC_LAYER(hltdc, LayerIdx)->DCCR = (pLayerCfg->Backcolor.Blue | tmp | tmp1 | tmp2); /* Specifies the constant alpha value */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CACR &= ~(LTDC_LxCACR_CONSTA); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CACR = (pLayerCfg->Alpha); + LTDC_LAYER(hltdc, LayerIdx)->CACR &= ~(LTDC_LxCACR_CONSTA); + LTDC_LAYER(hltdc, LayerIdx)->CACR = (pLayerCfg->Alpha); /* Specifies the blending factors */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->BFCR &= ~(LTDC_LxBFCR_BF2 | LTDC_LxBFCR_BF1); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->BFCR = (pLayerCfg->BlendingFactor1 | pLayerCfg->BlendingFactor2); + LTDC_LAYER(hltdc, LayerIdx)->BFCR &= ~(LTDC_LxBFCR_BF2 | LTDC_LxBFCR_BF1); + LTDC_LAYER(hltdc, LayerIdx)->BFCR = (pLayerCfg->BlendingFactor1 | pLayerCfg->BlendingFactor2); /* Configures the color frame buffer start address */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CFBAR &= ~(LTDC_LxCFBAR_CFBADD); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CFBAR = (pLayerCfg->FBStartAdress); + LTDC_LAYER(hltdc, LayerIdx)->CFBAR &= ~(LTDC_LxCFBAR_CFBADD); + LTDC_LAYER(hltdc, LayerIdx)->CFBAR = (pLayerCfg->FBStartAdress); if(pLayerCfg->PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888) { @@ -1155,15 +1164,15 @@ static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLay } /* Configures the color frame buffer pitch in byte */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CFBLR &= ~(LTDC_LxCFBLR_CFBLL | LTDC_LxCFBLR_CFBP); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CFBLR = (((pLayerCfg->ImageWidth * tmp) << 16) | ((pLayerCfg->ImageWidth * tmp) + 3)); + LTDC_LAYER(hltdc, LayerIdx)->CFBLR &= ~(LTDC_LxCFBLR_CFBLL | LTDC_LxCFBLR_CFBP); + LTDC_LAYER(hltdc, LayerIdx)->CFBLR = (((pLayerCfg->ImageWidth * tmp) << 16) | (((pLayerCfg->WindowX1 - pLayerCfg->WindowX0) * tmp) + 3)); /* Configures the frame buffer line number */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CFBLNR &= ~(LTDC_LxCFBLNR_CFBLNBR); - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CFBLNR = (pLayerCfg->ImageHeight); + LTDC_LAYER(hltdc, LayerIdx)->CFBLNR &= ~(LTDC_LxCFBLNR_CFBLNBR); + LTDC_LAYER(hltdc, LayerIdx)->CFBLNR = (pLayerCfg->ImageHeight); /* Enable LTDC_Layer by setting LEN bit */ - __HAL_LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_LEN; + LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_LEN; } /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.h index 5d5046051af..1b5e4877980 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_ltdc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_ltdc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of LTDC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -47,17 +47,19 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" - /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @addtogroup LTDC +/** @defgroup LTDC LTDC + * @brief LTDC HAL module driver * @{ */ - -/* Exported types ------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup LTDC_Exported_Types LTDC Exported Types + * @{ + */ #define MAX_LAYER 2 /** @@ -97,31 +99,30 @@ typedef struct uint32_t HorizontalSync; /*!< configures the number of Horizontal synchronization width. This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ - uint32_t VerticalSync; /*!< configures the number of Vertical synchronization heigh. + uint32_t VerticalSync; /*!< configures the number of Vertical synchronization height. This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */ uint32_t AccumulatedHBP; /*!< configures the accumulated horizontal back porch width. This parameter must be a number between Min_Data = LTDC_HorizontalSync and Max_Data = 0xFFF. */ - uint32_t AccumulatedVBP; /*!< configures the accumulated vertical back porch heigh. + uint32_t AccumulatedVBP; /*!< configures the accumulated vertical back porch height. This parameter must be a number between Min_Data = LTDC_VerticalSync and Max_Data = 0x7FF. */ uint32_t AccumulatedActiveW; /*!< configures the accumulated active width. This parameter must be a number between Min_Data = LTDC_AccumulatedHBP and Max_Data = 0xFFF. */ - uint32_t AccumulatedActiveH; /*!< configures the accumulated active heigh. + uint32_t AccumulatedActiveH; /*!< configures the accumulated active height. This parameter must be a number between Min_Data = LTDC_AccumulatedVBP and Max_Data = 0x7FF. */ uint32_t TotalWidth; /*!< configures the total width. This parameter must be a number between Min_Data = LTDC_AccumulatedActiveW and Max_Data = 0xFFF. */ - uint32_t TotalHeigh; /*!< configures the total heigh. + uint32_t TotalHeigh; /*!< configures the total height. This parameter must be a number between Min_Data = LTDC_AccumulatedActiveH and Max_Data = 0x7FF. */ LTDC_ColorTypeDef Backcolor; /*!< Configures the background color. */ } LTDC_InitTypeDef; - /** * @brief LTDC Layer structure definition */ @@ -195,135 +196,98 @@ typedef struct __IO uint32_t ErrorCode; /*!< LTDC Error code */ } LTDC_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup LTDC_Exported_Constants +/** @defgroup LTDC_Exported_Constants LTDC Exported Constants * @{ */ -/** @defgroup LTDC_Layer +/** @defgroup LTDC_Error_Code LTDC Error Code * @{ - */ -#define IS_LTDC_LAYER(LAYER) ((LAYER) <= MAX_LAYER) -/** - * @} */ - -/** @defgroup LTDC Error Code - * @{ - */ #define HAL_LTDC_ERROR_NONE ((uint32_t)0x00000000) /*!< LTDC No error */ #define HAL_LTDC_ERROR_TE ((uint32_t)0x00000001) /*!< LTDC Transfer error */ #define HAL_LTDC_ERROR_FU ((uint32_t)0x00000002) /*!< LTDC FIFO Underrun */ #define HAL_LTDC_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< LTDC Timeout error */ - /** * @} */ -/** @defgroup LTDC_HS_POLARITY +/** @defgroup LTDC_HS_POLARITY LTDC HS POLARITY * @{ */ #define LTDC_HSPOLARITY_AL ((uint32_t)0x00000000) /*!< Horizontal Synchronization is active low. */ #define LTDC_HSPOLARITY_AH LTDC_GCR_HSPOL /*!< Horizontal Synchronization is active high. */ - -#define IS_LTDC_HSPOL(HSPOL) (((HSPOL) == LTDC_HSPOLARITY_AL) || \ - ((HSPOL) == LTDC_HSPOLARITY_AH)) /** * @} */ -/** @defgroup LTDC_VS_POLARITY +/** @defgroup LTDC_VS_POLARITY LTDC VS POLARITY * @{ */ #define LTDC_VSPOLARITY_AL ((uint32_t)0x00000000) /*!< Vertical Synchronization is active low. */ #define LTDC_VSPOLARITY_AH LTDC_GCR_VSPOL /*!< Vertical Synchronization is active high. */ - -#define IS_LTDC_VSPOL(VSPOL) (((VSPOL) == LTDC_VSPOLARITY_AL) || \ - ((VSPOL) == LTDC_VSPOLARITY_AH)) /** * @} */ -/** @defgroup LTDC_DE_POLARITY +/** @defgroup LTDC_DE_POLARITY LTDC DE POLARITY * @{ */ #define LTDC_DEPOLARITY_AL ((uint32_t)0x00000000) /*!< Data Enable, is active low. */ #define LTDC_DEPOLARITY_AH LTDC_GCR_DEPOL /*!< Data Enable, is active high. */ - -#define IS_LTDC_DEPOL(DEPOL) (((DEPOL) == LTDC_DEPOLARITY_AL) || \ - ((DEPOL) == LTDC_DEPOLARITY_AH)) /** * @} */ -/** @defgroup LTDC_PC_POLARITY +/** @defgroup LTDC_PC_POLARITY LTDC PC POLARITY * @{ */ #define LTDC_PCPOLARITY_IPC ((uint32_t)0x00000000) /*!< input pixel clock. */ #define LTDC_PCPOLARITY_IIPC LTDC_GCR_PCPOL /*!< inverted input pixel clock. */ - -#define IS_LTDC_PCPOL(PCPOL) (((PCPOL) == LTDC_PCPOLARITY_IPC) || \ - ((PCPOL) == LTDC_PCPOLARITY_IIPC)) /** * @} */ -/** @defgroup LTDC_SYNC +/** @defgroup LTDC_SYNC LTDC SYNC * @{ */ #define LTDC_HORIZONTALSYNC (LTDC_SSCR_HSW >> 16) /*!< Horizontal synchronization width. */ -#define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization heigh. */ - -#define IS_LTDC_HSYNC(HSYNC) ((HSYNC) <= LTDC_HORIZONTALSYNC) -#define IS_LTDC_VSYNC(VSYNC) ((VSYNC) <= LTDC_VERTICALSYNC) -#define IS_LTDC_AHBP(AHBP) ((AHBP) <= LTDC_HORIZONTALSYNC) -#define IS_LTDC_AVBP(AVBP) ((AVBP) <= LTDC_VERTICALSYNC) -#define IS_LTDC_AAW(AAW) ((AAW) <= LTDC_HORIZONTALSYNC) -#define IS_LTDC_AAH(AAH) ((AAH) <= LTDC_VERTICALSYNC) -#define IS_LTDC_TOTALW(TOTALW) ((TOTALW) <= LTDC_HORIZONTALSYNC) -#define IS_LTDC_TOTALH(TOTALH) ((TOTALH) <= LTDC_VERTICALSYNC) +#define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization height. */ /** * @} */ -/** @defgroup LTDC_BACK_COLOR +/** @defgroup LTDC_BACK_COLOR LTDC BACK COLOR * @{ - */ -#define LTDC_COLOR ((uint32_t)0x000000FF) /*!< Color mask */ - -#define IS_LTDC_BLUEVALUE(BBLUE) ((BBLUE) <= LTDC_COLOR) -#define IS_LTDC_GREENVALUE(BGREEN) ((BGREEN) <= LTDC_COLOR) -#define IS_LTDC_REDVALUE(BRED) ((BRED) <= LTDC_COLOR) + */ +#define LTDC_COLOR ((uint32_t)0x000000FF) /*!< Color mask */ /** * @} */ -/** @defgroup LTDC_BlendingFactor1 +/** @defgroup LTDC_BlendingFactor1 LTDC Blending Factor1 * @{ */ #define LTDC_BLENDING_FACTOR1_CA ((uint32_t)0x00000400) /*!< Blending factor : Cte Alpha */ #define LTDC_BLENDING_FACTOR1_PAxCA ((uint32_t)0x00000600) /*!< Blending factor : Cte Alpha x Pixel Alpha*/ - -#define IS_LTDC_BLENDING_FACTOR1(BlendingFactor1) (((BlendingFactor1) == LTDC_BLENDING_FACTOR1_CA) || \ - ((BlendingFactor1) == LTDC_BLENDING_FACTOR1_PAxCA)) /** * @} */ -/** @defgroup LTDC_BlendingFactor2 +/** @defgroup LTDC_BlendingFactor2 LTDC Blending Factor2 * @{ */ #define LTDC_BLENDING_FACTOR2_CA ((uint32_t)0x00000005) /*!< Blending factor : Cte Alpha */ #define LTDC_BLENDING_FACTOR2_PAxCA ((uint32_t)0x00000007) /*!< Blending factor : Cte Alpha x Pixel Alpha*/ - -#define IS_LTDC_BLENDING_FACTOR2(BlendingFactor2) (((BlendingFactor2) == LTDC_BLENDING_FACTOR2_CA) || \ - ((BlendingFactor2) == LTDC_BLENDING_FACTOR2_PAxCA)) /** * @} */ -/** @defgroup LTDC_Pixelformat +/** @defgroup LTDC_Pixelformat LTDC Pixel format * @{ */ #define LTDC_PIXEL_FORMAT_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 LTDC pixel format */ @@ -334,26 +298,19 @@ typedef struct #define LTDC_PIXEL_FORMAT_L8 ((uint32_t)0x00000005) /*!< L8 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_AL44 ((uint32_t)0x00000006) /*!< AL44 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_AL88 ((uint32_t)0x00000007) /*!< AL88 LTDC pixel format */ - -#define IS_LTDC_PIXEL_FORMAT(Pixelformat) (((Pixelformat) == LTDC_PIXEL_FORMAT_ARGB8888) || ((Pixelformat) == LTDC_PIXEL_FORMAT_RGB888) || \ - ((Pixelformat) == LTDC_PIXEL_FORMAT_RGB565) || ((Pixelformat) == LTDC_PIXEL_FORMAT_ARGB1555) || \ - ((Pixelformat) == LTDC_PIXEL_FORMAT_ARGB4444) || ((Pixelformat) == LTDC_PIXEL_FORMAT_L8) || \ - ((Pixelformat) == LTDC_PIXEL_FORMAT_AL44) || ((Pixelformat) == LTDC_PIXEL_FORMAT_AL88)) /** * @} */ -/** @defgroup LTDC_Alpha +/** @defgroup LTDC_Alpha LTDC Alpha * @{ */ #define LTDC_ALPHA LTDC_LxCACR_CONSTA /*!< LTDC Cte Alpha mask */ - -#define IS_LTDC_ALPHA(ALPHA) ((ALPHA) <= LTDC_ALPHA) /** * @} */ -/** @defgroup LTDC_LAYER_Config +/** @defgroup LTDC_LAYER_Config LTDC LAYER Config * @{ */ #define LTDC_STOPPOSITION (LTDC_LxWHPCR_WHSPPOS >> 16) /*!< LTDC Layer stop position */ @@ -361,51 +318,28 @@ typedef struct #define LTDC_COLOR_FRAME_BUFFER LTDC_LxCFBLR_CFBLL /*!< LTDC Layer Line length */ #define LTDC_LINE_NUMBER LTDC_LxCFBLNR_CFBLNBR /*!< LTDC Layer Line number */ - -#define IS_LTDC_HCONFIGST(HCONFIGST) ((HCONFIGST) <= LTDC_STARTPOSITION) -#define IS_LTDC_HCONFIGSP(HCONFIGSP) ((HCONFIGSP) <= LTDC_STOPPOSITION) -#define IS_LTDC_VCONFIGST(VCONFIGST) ((VCONFIGST) <= LTDC_STARTPOSITION) -#define IS_LTDC_VCONFIGSP(VCONFIGSP) ((VCONFIGSP) <= LTDC_STOPPOSITION) - -#define IS_LTDC_CFBP(CFBP) ((CFBP) <= LTDC_COLOR_FRAME_BUFFER) -#define IS_LTDC_CFBLL(CFBLL) ((CFBLL) <= LTDC_COLOR_FRAME_BUFFER) - -#define IS_LTDC_CFBLNBR(CFBLNBR) ((CFBLNBR) <= LTDC_LINE_NUMBER) /** * @} */ -/** @defgroup LTDC_LIPosition - * @{ - */ -#define IS_LTDC_LIPOS(LIPOS) ((LIPOS) <= 0x7FF) -/** - * @} - */ - -/** @defgroup LTDC_Interrupts +/** @defgroup LTDC_Interrupts LTDC Interrupts * @{ */ #define LTDC_IT_LI LTDC_IER_LIE #define LTDC_IT_FU LTDC_IER_FUIE #define LTDC_IT_TE LTDC_IER_TERRIE #define LTDC_IT_RR LTDC_IER_RRIE - -#define IS_LTDC_IT(IT) ((((IT) & (uint32_t)0xFFFFFFF0) == 0x00) && ((IT) != 0x00)) /** * @} */ -/** @defgroup LTDC_Flag +/** @defgroup LTDC_Flag LTDC Flag * @{ */ #define LTDC_FLAG_LI LTDC_ISR_LIF #define LTDC_FLAG_FU LTDC_ISR_FUIF #define LTDC_FLAG_TE LTDC_ISR_TERRIF #define LTDC_FLAG_RR LTDC_ISR_RRIF - -#define IS_LTDC_FLAG(FLAG) (((FLAG) == LTDC_FLAG_LI) || ((FLAG) == LTDC_FLAG_FU) || \ - ((FLAG) == LTDC_FLAG_TERR) || ((FLAG) == LTDC_FLAG_RR)) /** * @} */ @@ -415,6 +349,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup LTDC_Exported_Macros LTDC Exported Macros + * @{ + */ /** @brief Reset LTDC handle state * @param __HANDLE__: specifies the LTDC handle. @@ -440,21 +377,19 @@ typedef struct * @brief Enable the LTDC Layer. * @param __HANDLE__: LTDC handle * @param __LAYER__: Specify the layer to be enabled - This parameter can be 0 or 1 + * This parameter can be 0 or 1 * @retval None. */ -#define __HAL_LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)(((uint32_t)((__HANDLE__)->Instance)) + 0x84 + (0x80*(__LAYER__)))) - -#define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((__HAL_LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN) +#define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN) /** * @brief Disable the LTDC Layer. * @param __HANDLE__: LTDC handle * @param __LAYER__: Specify the layer to be disabled - This parameter can be 0 or 1 + * This parameter can be 0 or 1 * @retval None. */ -#define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((__HAL_LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN) +#define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN) /** * @brief Reload Layer Configuration. @@ -528,9 +463,17 @@ typedef struct * @retval The state of INTERRUPT (SET or RESET). */ #define __HAL_LTDC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->ISR & (__INTERRUPT__)) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ - +/** @addtogroup LTDC_Exported_Functions + * @{ + */ +/** @addtogroup LTDC_Exported_Functions_Group1 + * @{ + */ /* Initialization and de-initialization functions *****************************/ HAL_StatusTypeDef HAL_LTDC_Init(LTDC_HandleTypeDef *hltdc); HAL_StatusTypeDef HAL_LTDC_DeInit(LTDC_HandleTypeDef *hltdc); @@ -538,10 +481,22 @@ void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc); void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc); void HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef *hltdc); void HAL_LTDC_LineEvenCallback(LTDC_HandleTypeDef *hltdc); +/** + * @} + */ +/** @addtogroup LTDC_Exported_Functions_Group2 + * @{ + */ /* IO operation functions *****************************************************/ void HAL_LTDC_IRQHandler(LTDC_HandleTypeDef *hltdc); +/** + * @} + */ +/** @addtogroup LTDC_Exported_Functions_Group3 + * @{ + */ /* Peripheral Control functions ***********************************************/ HAL_StatusTypeDef HAL_LTDC_ConfigLayer(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx); HAL_StatusTypeDef HAL_LTDC_SetWindowSize(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx); @@ -558,21 +513,115 @@ HAL_StatusTypeDef HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t Layer HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef *hltdc, uint32_t Line); HAL_StatusTypeDef HAL_LTDC_EnableDither(LTDC_HandleTypeDef *hltdc); HAL_StatusTypeDef HAL_LTDC_DisableDither(LTDC_HandleTypeDef *hltdc); +/** + * @} + */ +/** @addtogroup LTDC_Exported_Functions_Group4 + * @{ + */ /* Peripheral State functions *************************************************/ HAL_LTDC_StateTypeDef HAL_LTDC_GetState(LTDC_HandleTypeDef *hltdc); uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef *hltdc); +/** + * @} + */ -#endif /* STM32F429xx || STM32F439xx */ +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/** @defgroup LTDC_Private_Types LTDC Private Types + * @{ + */ /** * @} */ +/* Private variables ---------------------------------------------------------*/ +/** @defgroup LTDC_Private_Variables LTDC Private Variables + * @{ + */ + /** * @} */ - + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup LTDC_Private_Constants LTDC Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup LTDC_Private_Macros LTDC Private Macros + * @{ + */ +#define LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)((uint32_t)(((uint32_t)((__HANDLE__)->Instance)) + 0x84 + (0x80*(__LAYER__))))) +#define IS_LTDC_LAYER(LAYER) ((LAYER) <= MAX_LAYER) +#define IS_LTDC_HSPOL(HSPOL) (((HSPOL) == LTDC_HSPOLARITY_AL) || \ + ((HSPOL) == LTDC_HSPOLARITY_AH)) +#define IS_LTDC_VSPOL(VSPOL) (((VSPOL) == LTDC_VSPOLARITY_AL) || \ + ((VSPOL) == LTDC_VSPOLARITY_AH)) +#define IS_LTDC_DEPOL(DEPOL) (((DEPOL) == LTDC_DEPOLARITY_AL) || \ + ((DEPOL) == LTDC_DEPOLARITY_AH)) +#define IS_LTDC_PCPOL(PCPOL) (((PCPOL) == LTDC_PCPOLARITY_IPC) || \ + ((PCPOL) == LTDC_PCPOLARITY_IIPC)) +#define IS_LTDC_HSYNC(HSYNC) ((HSYNC) <= LTDC_HORIZONTALSYNC) +#define IS_LTDC_VSYNC(VSYNC) ((VSYNC) <= LTDC_VERTICALSYNC) +#define IS_LTDC_AHBP(AHBP) ((AHBP) <= LTDC_HORIZONTALSYNC) +#define IS_LTDC_AVBP(AVBP) ((AVBP) <= LTDC_VERTICALSYNC) +#define IS_LTDC_AAW(AAW) ((AAW) <= LTDC_HORIZONTALSYNC) +#define IS_LTDC_AAH(AAH) ((AAH) <= LTDC_VERTICALSYNC) +#define IS_LTDC_TOTALW(TOTALW) ((TOTALW) <= LTDC_HORIZONTALSYNC) +#define IS_LTDC_TOTALH(TOTALH) ((TOTALH) <= LTDC_VERTICALSYNC) +#define IS_LTDC_BLUEVALUE(BBLUE) ((BBLUE) <= LTDC_COLOR) +#define IS_LTDC_GREENVALUE(BGREEN) ((BGREEN) <= LTDC_COLOR) +#define IS_LTDC_REDVALUE(BRED) ((BRED) <= LTDC_COLOR) +#define IS_LTDC_BLENDING_FACTOR1(BlendingFactor1) (((BlendingFactor1) == LTDC_BLENDING_FACTOR1_CA) || \ + ((BlendingFactor1) == LTDC_BLENDING_FACTOR1_PAxCA)) +#define IS_LTDC_BLENDING_FACTOR2(BlendingFactor2) (((BlendingFactor2) == LTDC_BLENDING_FACTOR2_CA) || \ + ((BlendingFactor2) == LTDC_BLENDING_FACTOR2_PAxCA)) +#define IS_LTDC_PIXEL_FORMAT(Pixelformat) (((Pixelformat) == LTDC_PIXEL_FORMAT_ARGB8888) || ((Pixelformat) == LTDC_PIXEL_FORMAT_RGB888) || \ + ((Pixelformat) == LTDC_PIXEL_FORMAT_RGB565) || ((Pixelformat) == LTDC_PIXEL_FORMAT_ARGB1555) || \ + ((Pixelformat) == LTDC_PIXEL_FORMAT_ARGB4444) || ((Pixelformat) == LTDC_PIXEL_FORMAT_L8) || \ + ((Pixelformat) == LTDC_PIXEL_FORMAT_AL44) || ((Pixelformat) == LTDC_PIXEL_FORMAT_AL88)) +#define IS_LTDC_ALPHA(ALPHA) ((ALPHA) <= LTDC_ALPHA) +#define IS_LTDC_HCONFIGST(HCONFIGST) ((HCONFIGST) <= LTDC_STARTPOSITION) +#define IS_LTDC_HCONFIGSP(HCONFIGSP) ((HCONFIGSP) <= LTDC_STOPPOSITION) +#define IS_LTDC_VCONFIGST(VCONFIGST) ((VCONFIGST) <= LTDC_STARTPOSITION) +#define IS_LTDC_VCONFIGSP(VCONFIGSP) ((VCONFIGSP) <= LTDC_STOPPOSITION) +#define IS_LTDC_CFBP(CFBP) ((CFBP) <= LTDC_COLOR_FRAME_BUFFER) +#define IS_LTDC_CFBLL(CFBLL) ((CFBLL) <= LTDC_COLOR_FRAME_BUFFER) +#define IS_LTDC_CFBLNBR(CFBLNBR) ((CFBLNBR) <= LTDC_LINE_NUMBER) +#define IS_LTDC_LIPOS(LIPOS) ((LIPOS) <= 0x7FF) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup LTDC_Private_Functions LTDC Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* STM32F429xx || STM32F439xx */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_msp_template.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_msp_template.c new file mode 100644 index 00000000000..689f118eadd --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_msp_template.c @@ -0,0 +1,119 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_msp_template.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief This file contains the HAL System and Peripheral (PPP) MSP initialization + * and de-initialization functions. + * It should be copied to the application folder and renamed into 'stm32f4xx_hal_msp.c'. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @defgroup HAL_MSP HAL MSP + * @brief HAL MSP module. + * @{ + */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/** @defgroup HAL_MSP_Private_Functions HAL MSP Private Functions + * @{ + */ + +/** + * @brief Initializes the Global MSP. + * @note This function is called from HAL_Init() function to perform system + * level initialization (GPIOs, clock, DMA, interrupt). + * @retval None + */ +void HAL_MspInit(void) +{ + +} + +/** + * @brief DeInitializes the Global MSP. + * @note This functiona is called from HAL_DeInit() function to perform system + * level de-initialization (GPIOs, clock, DMA, interrupt). + * @retval None + */ +void HAL_MspDeInit(void) +{ + +} + +/** + * @brief Initializes the PPP MSP. + * @note This functiona is called from HAL_PPP_Init() function to perform + * peripheral(PPP) system level initialization (GPIOs, clock, DMA, interrupt) + * @retval None + */ +void HAL_PPP_MspInit(void) +{ + +} + +/** + * @brief DeInitializes the PPP MSP. + * @note This functiona is called from HAL_PPP_DeInit() function to perform + * peripheral(PPP) system level de-initialization (GPIOs, clock, DMA, interrupt) + * @retval None + */ +void HAL_PPP_MspDeInit(void) +{ + +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.c index 8ad41bb31f8..4ab61d4b255 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_nand.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief NAND HAL module driver. * This file provides a generic firmware to drive NAND memories mounted * as external device. @@ -55,7 +55,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -89,26 +89,44 @@ * @{ */ -/** @defgroup NAND - * @brief NAND driver modules - * @{ - */ + #ifdef HAL_NAND_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) + +/** @defgroup NAND NAND + * @brief NAND HAL module driver + * @{ + */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @defgroup NAND_Private_Constants NAND Private Constants + * @{ + */ + +/** + * @} + */ + /* Private macro -------------------------------------------------------------*/ +/** @defgroup NAND_Private_Macros NAND Private Macros + * @{ + */ + +/** + * @} + */ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup NAND_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup NAND_Exported_Functions NAND Exported Functions * @{ */ -/** @defgroup NAND_Group1 Initialization and de-initialization functions +/** @defgroup NAND_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -141,6 +159,8 @@ HAL_StatusTypeDef HAL_NAND_Init(NAND_HandleTypeDef *hnand, FMC_NAND_PCC_TimingT if(hnand->State == HAL_NAND_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hnand->Lock = HAL_UNLOCKED; /* Initialize the low level hardware (MSP) */ HAL_NAND_MspInit(hnand); } @@ -280,7 +300,7 @@ __weak void HAL_NAND_ITCallback(NAND_HandleTypeDef *hnand) * @} */ -/** @defgroup NAND_Group2 Input and Output functions +/** @defgroup NAND_Exported_Functions_Group2 Input and Output functions * @brief Input Output and memory control functions * @verbatim @@ -305,7 +325,7 @@ __weak void HAL_NAND_ITCallback(NAND_HandleTypeDef *hnand) HAL_StatusTypeDef HAL_NAND_Read_ID(NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pNAND_ID) { __IO uint32_t data = 0; - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnand); @@ -319,34 +339,34 @@ HAL_StatusTypeDef HAL_NAND_Read_ID(NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pN /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - deviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - deviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_BUSY; - /* Send Read ID command sequence */ - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_READID; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = 0x00; + /* Send Read ID command sequence */ + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_READID; + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = 0x00; - /* Read the electronic signature from NAND flash */ - data = *(__IO uint32_t *)deviceAddress; + /* Read the electronic signature from NAND flash */ + data = *(__IO uint32_t *)deviceaddress; /* Return the data read */ - pNAND_ID->Maker_Id = __ADDR_1st_CYCLE(data); - pNAND_ID->Device_Id = __ADDR_2nd_CYCLE(data); - pNAND_ID->Third_Id = __ADDR_3rd_CYCLE(data); - pNAND_ID->Fourth_Id = __ADDR_4th_CYCLE(data); + pNAND_ID->Maker_Id = ADDR_1ST_CYCLE(data); + pNAND_ID->Device_Id = ADDR_2ND_CYCLE(data); + pNAND_ID->Third_Id = ADDR_3RD_CYCLE(data); + pNAND_ID->Fourth_Id = ADDR_4TH_CYCLE(data); /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_READY; /* Process unlocked */ - __HAL_UNLOCK(hnand); + __HAL_UNLOCK(hnand); return HAL_OK; } @@ -359,44 +379,43 @@ HAL_StatusTypeDef HAL_NAND_Read_ID(NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pN */ HAL_StatusTypeDef HAL_NAND_Reset(NAND_HandleTypeDef *hnand) { - uint32_t deviceAddress = 0; - + uint32_t deviceaddress = 0; + /* Process Locked */ __HAL_LOCK(hnand); - + /* Check the NAND controller state */ if(hnand->State == HAL_NAND_STATE_BUSY) { return HAL_BUSY; } - /* Identify the device address */ + /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - deviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - deviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } - /* Update the NAND controller state */ + /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_BUSY; /* Send NAND reset command */ - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = 0xFF; - - - /* Update the NAND controller state */ + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = 0xFF; + + + /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_READY; /* Process unlocked */ - __HAL_UNLOCK(hnand); - + __HAL_UNLOCK(hnand); + return HAL_OK; - -} +} /** * @brief Read Page(s) from NAND memory block @@ -407,10 +426,12 @@ HAL_StatusTypeDef HAL_NAND_Reset(NAND_HandleTypeDef *hnand) * @param NumPageToRead : number of pages to read from block * @retval HAL status */ -HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumPageToRead) +HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToRead) { __IO uint32_t index = 0; - uint32_t deviceAddress = 0, numPagesRead = 0, nandAddress = 0, addressStatus = NAND_VALID_ADDRESS; + uint32_t deviceaddress = 0, size = 0, numpagesread = 0, addressstatus = NAND_VALID_ADDRESS; + NAND_AddressTypeDef nandaddress; + uint32_t addressoffset = 0; /* Process Locked */ __HAL_LOCK(hnand); @@ -424,61 +445,68 @@ HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressType /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - deviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - deviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } - /* Update the NAND controller state */ + /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_BUSY; - /* Page(s) read loop */ - while((NumPageToRead != 0) && (addressStatus == NAND_VALID_ADDRESS)) - { - /* NAND raw address calculation */ - nandAddress = __ARRAY_ADDRESS(pAddress, hnand); + /* Save the content of pAddress as it will be modified */ + nandaddress.Block = pAddress->Block; + nandaddress.Page = pAddress->Page; + nandaddress.Zone = pAddress->Zone; + + /* Page(s) read loop */ + while((NumPageToRead != 0) && (addressstatus == NAND_VALID_ADDRESS)) + { + /* update the buffer size */ + size = hnand->Info.PageSize + ((hnand->Info.PageSize) * numpagesread); + + /* Get the address offset */ + addressoffset = ARRAY_ADDRESS(&nandaddress, hnand); /* Send read page command sequence */ - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_AREA_A; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_AREA_A; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = 0x00; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_1st_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_2nd_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_3rd_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = 0x00; + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_1ST_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_2ND_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_3RD_CYCLE(addressoffset); - /* for 512 and 1 GB devices, 4th cycle is required */ - if(hnand->Info.BlockNbr > 1024) + /* for 512 and 1 GB devices, 4th cycle is required */ + if(hnand->Info.BlockNbr >= 1024) { - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_4th_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_4TH_CYCLE(addressoffset); } - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_AREA_TRUE1; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_AREA_TRUE1; /* Get Data into Buffer */ - for(index = 0 ; index < hnand->Info.PageSize; index++) + for(index = size; index != 0; index--) { - *(uint8_t *)pBuffer++ = *(uint8_t *)deviceAddress; + *(uint8_t *)pBuffer++ = *(uint8_t *)deviceaddress; } /* Increment read pages number */ - numPagesRead++; + numpagesread++; /* Decrement pages to read */ NumPageToRead--; /* Increment the NAND address */ - HAL_NAND_Address_Inc(hnand, pAddress); - + addressstatus = HAL_NAND_Address_Inc(hnand, &nandaddress); } - /* Update the NAND controller state */ + /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_READY; /* Process unlocked */ - __HAL_UNLOCK(hnand); - + __HAL_UNLOCK(hnand); + return HAL_OK; } @@ -492,11 +520,13 @@ HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressType * @param NumPageToWrite : number of pages to write to block * @retval HAL status */ -HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumPageToWrite) +HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToWrite) { - __IO uint32_t index = 0; + __IO uint32_t index = 0; uint32_t tickstart = 0; - uint32_t deviceAddress = 0 , numPagesWritten = 0, nandAddress = 0, addressStatus = NAND_VALID_ADDRESS; + uint32_t deviceaddress = 0 , size = 0, numpageswritten = 0, addressstatus = NAND_VALID_ADDRESS; + NAND_AddressTypeDef nandaddress; + uint32_t addressoffset = 0; /* Process Locked */ __HAL_LOCK(hnand); @@ -510,78 +540,84 @@ HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTyp /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - deviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - deviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_BUSY; + /* Save the content of pAddress as it will be modified */ + nandaddress.Block = pAddress->Block; + nandaddress.Page = pAddress->Page; + nandaddress.Zone = pAddress->Zone; + /* Page(s) write loop */ - while((NumPageToWrite != 0) && (addressStatus == NAND_VALID_ADDRESS)) - { - /* NAND raw address calculation */ - nandAddress = __ARRAY_ADDRESS(pAddress, hnand); - + while((NumPageToWrite != 0) && (addressstatus == NAND_VALID_ADDRESS)) + { + /* update the buffer size */ + size = hnand->Info.PageSize + ((hnand->Info.PageSize) * numpageswritten); + + /* Get the address offset */ + addressoffset = ARRAY_ADDRESS(&nandaddress, hnand); + /* Send write page command sequence */ - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_AREA_A; - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_WRITE0; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_AREA_A; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_WRITE0; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = 0x00; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_1st_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_2nd_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_3rd_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = 0x00; + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_1ST_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_2ND_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_3RD_CYCLE(addressoffset); /* for 512 and 1 GB devices, 4th cycle is required */ - if(hnand->Info.BlockNbr > 1024) + if(hnand->Info.BlockNbr >= 1024) { - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_4th_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_4TH_CYCLE(addressoffset); } /* Write data to memory */ - for(index = 0 ; index < hnand->Info.PageSize; index++) + for(index = size; index != 0; index--) { - *(__IO uint8_t *)deviceAddress = *(uint8_t *)pBuffer++; + *(__IO uint8_t *)deviceaddress = *(uint8_t *)pBuffer++; } - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_WRITE_TRUE1; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_WRITE_TRUE1; + + /* Get tick */ + tickstart = HAL_GetTick(); /* Read status until NAND is ready */ while(HAL_NAND_Read_Status(hnand) != NAND_READY) { - /* Get tick */ - tickstart = HAL_GetTick(); - if((HAL_GetTick() - tickstart ) > NAND_WRITE_TIMEOUT) { return HAL_TIMEOUT; - } - } + } + } /* Increment written pages number */ - numPagesWritten++; + numpageswritten++; /* Decrement pages to write */ NumPageToWrite--; /* Increment the NAND address */ - HAL_NAND_Address_Inc(hnand, pAddress); - + addressstatus = HAL_NAND_Address_Inc(hnand, &nandaddress); } /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_READY; /* Process unlocked */ - __HAL_UNLOCK(hnand); + __HAL_UNLOCK(hnand); return HAL_OK; } - /** * @brief Read Spare area(s) from NAND memory * @param hnand: pointer to a NAND_HandleTypeDef structure that contains @@ -591,10 +627,12 @@ HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTyp * @param NumSpareAreaToRead: Number of spare area to read * @retval HAL status */ -HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaToRead) +HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaToRead) { __IO uint32_t index = 0; - uint32_t deviceAddress = 0, numSpareAreaRead = 0, nandAddress = 0, addressStatus = NAND_VALID_ADDRESS; + uint32_t deviceaddress = 0, size = 0, num_spare_area_read = 0, addressstatus = NAND_VALID_ADDRESS; + NAND_AddressTypeDef nandaddress; + uint32_t addressoffset = 0; /* Process Locked */ __HAL_LOCK(hnand); @@ -608,59 +646,67 @@ HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_Addres /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - deviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - deviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } /* Update the NAND controller state */ - hnand->State = HAL_NAND_STATE_BUSY; + hnand->State = HAL_NAND_STATE_BUSY; + + /* Save the content of pAddress as it will be modified */ + nandaddress.Block = pAddress->Block; + nandaddress.Page = pAddress->Page; + nandaddress.Zone = pAddress->Zone; /* Spare area(s) read loop */ - while((NumSpareAreaToRead != 0) && (addressStatus == NAND_VALID_ADDRESS)) - { - /* NAND raw address calculation */ - nandAddress = __ARRAY_ADDRESS(pAddress, hnand); + while((NumSpareAreaToRead != 0) && (addressstatus == NAND_VALID_ADDRESS)) + { + /* update the buffer size */ + size = (hnand->Info.SpareAreaSize) + ((hnand->Info.SpareAreaSize) * num_spare_area_read); - /* Send read spare area command sequence */ - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_AREA_C; + /* Get the address offset */ + addressoffset = ARRAY_ADDRESS(&nandaddress, hnand); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = 0x00; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_1st_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_2nd_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_3rd_CYCLE(nandAddress); + /* Send read spare area command sequence */ + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_AREA_C; + + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = 0x00; + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_1ST_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_2ND_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_3RD_CYCLE(addressoffset); /* for 512 and 1 GB devices, 4th cycle is required */ - if(hnand->Info.BlockNbr > 1024) + if(hnand->Info.BlockNbr >= 1024) { - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_4th_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_4TH_CYCLE(addressoffset); } - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_AREA_TRUE1; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_AREA_TRUE1; /* Get Data into Buffer */ - for(index = 0 ; index < hnand->Info.SpareAreaSize; index++) + for (index = size ;index != 0; index--) { - *(uint8_t *)pBuffer++ = *(uint8_t *)deviceAddress; + *(uint8_t *)pBuffer++ = *(uint8_t *)deviceaddress; } /* Increment read spare areas number */ - numSpareAreaRead++; + num_spare_area_read++; /* Decrement spare areas to read */ NumSpareAreaToRead--; /* Increment the NAND address */ - HAL_NAND_Address_Inc(hnand, pAddress); + addressstatus = HAL_NAND_Address_Inc(hnand, &nandaddress); } /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_READY; /* Process unlocked */ - __HAL_UNLOCK(hnand); + __HAL_UNLOCK(hnand); return HAL_OK; } @@ -674,11 +720,13 @@ HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_Addres * @param NumSpareAreaTowrite : number of spare areas to write to block * @retval HAL status */ -HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaTowrite) +HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaTowrite) { __IO uint32_t index = 0; uint32_t tickstart = 0; - uint32_t deviceAddress = 0, numSpareAreaWritten = 0, nandAddress = 0, addressStatus = NAND_VALID_ADDRESS; + uint32_t deviceaddress = 0, size = 0, num_spare_area_written = 0, addressstatus = NAND_VALID_ADDRESS; + NAND_AddressTypeDef nandaddress; + uint32_t addressoffset = 0; /* Process Locked */ __HAL_LOCK(hnand); @@ -692,67 +740,73 @@ HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_Addre /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - deviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - deviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } /* Update the FMC_NAND controller state */ hnand->State = HAL_NAND_STATE_BUSY; + /* Save the content of pAddress as it will be modified */ + nandaddress.Block = pAddress->Block; + nandaddress.Page = pAddress->Page; + nandaddress.Zone = pAddress->Zone; + /* Spare area(s) write loop */ - while((NumSpareAreaTowrite != 0) && (addressStatus == NAND_VALID_ADDRESS)) - { - /* NAND raw address calculation */ - nandAddress = __ARRAY_ADDRESS(pAddress, hnand); + while((NumSpareAreaTowrite != 0) && (addressstatus == NAND_VALID_ADDRESS)) + { + /* update the buffer size */ + size = (hnand->Info.SpareAreaSize) + ((hnand->Info.SpareAreaSize) * num_spare_area_written); + + /* Get the address offset */ + addressoffset = ARRAY_ADDRESS(&nandaddress, hnand); /* Send write Spare area command sequence */ - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_AREA_C; - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_WRITE0; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_AREA_C; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_WRITE0; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = 0x00; - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_1st_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_2nd_CYCLE(nandAddress); - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_3rd_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = 0x00; + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_1ST_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_2ND_CYCLE(addressoffset); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_3RD_CYCLE(addressoffset); /* for 512 and 1 GB devices, 4th cycle is required */ if(hnand->Info.BlockNbr >= 1024) { - *(__IO uint8_t *)((uint32_t)(deviceAddress | ADDR_AREA)) = __ADDR_4th_CYCLE(nandAddress); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_4TH_CYCLE(addressoffset); } /* Write data to memory */ - for(index = 0 ; index < hnand->Info.SpareAreaSize; index++) + for(; index < size; index++) { - *(__IO uint8_t *)deviceAddress = *(uint8_t *)pBuffer++; + *(__IO uint8_t *)deviceaddress = *(uint8_t *)pBuffer++; } - *(__IO uint8_t *)((uint32_t)(deviceAddress | CMD_AREA)) = NAND_CMD_WRITE_TRUE1; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_WRITE_TRUE1; + + /* Get tick */ + tickstart = HAL_GetTick(); - /* Read status until NAND is ready */ while(HAL_NAND_Read_Status(hnand) != NAND_READY) { - /* Get tick */ - tickstart = HAL_GetTick(); - if((HAL_GetTick() - tickstart ) > NAND_WRITE_TIMEOUT) { return HAL_TIMEOUT; - } + } } /* Increment written spare areas number */ - numSpareAreaWritten++; + num_spare_area_written++; /* Decrement spare areas to write */ NumSpareAreaTowrite--; /* Increment the NAND address */ - HAL_NAND_Address_Inc(hnand, pAddress); - + addressstatus = HAL_NAND_Address_Inc(hnand, &nandaddress); } /* Update the NAND controller state */ @@ -761,7 +815,7 @@ HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_Addre /* Process unlocked */ __HAL_UNLOCK(hnand); - return HAL_OK; + return HAL_OK; } /** @@ -771,9 +825,10 @@ HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_Addre * @param pAddress : pointer to NAND address structure * @retval HAL status */ -HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress) +HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress) { - uint32_t DeviceAddress = 0; + uint32_t deviceaddress = 0; + uint32_t tickstart = 0; /* Process Locked */ __HAL_LOCK(hnand); @@ -787,41 +842,55 @@ HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTy /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - DeviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - DeviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_BUSY; /* Send Erase block command sequence */ - *(__IO uint8_t *)((uint32_t)(DeviceAddress | CMD_AREA)) = NAND_CMD_ERASE0; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_ERASE0; - *(__IO uint8_t *)((uint32_t)(DeviceAddress | ADDR_AREA)) = __ADDR_1st_CYCLE(__ARRAY_ADDRESS(pAddress, hnand)); - *(__IO uint8_t *)((uint32_t)(DeviceAddress | ADDR_AREA)) = __ADDR_2nd_CYCLE(__ARRAY_ADDRESS(pAddress, hnand)); - *(__IO uint8_t *)((uint32_t)(DeviceAddress | ADDR_AREA)) = __ADDR_3rd_CYCLE(__ARRAY_ADDRESS(pAddress, hnand)); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_1ST_CYCLE(ARRAY_ADDRESS(pAddress, hnand)); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_2ND_CYCLE(ARRAY_ADDRESS(pAddress, hnand)); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_3RD_CYCLE(ARRAY_ADDRESS(pAddress, hnand)); /* for 512 and 1 GB devices, 4th cycle is required */ if(hnand->Info.BlockNbr >= 1024) { - *(__IO uint8_t *)((uint32_t)(DeviceAddress | ADDR_AREA)) = __ADDR_4th_CYCLE(__ARRAY_ADDRESS(pAddress, hnand)); + *(__IO uint8_t *)((uint32_t)(deviceaddress | ADDR_AREA)) = ADDR_4TH_CYCLE(ARRAY_ADDRESS(pAddress, hnand)); } - - *(__IO uint8_t *)((uint32_t)(DeviceAddress | CMD_AREA)) = NAND_CMD_ERASE1; + + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_ERASE1; /* Update the NAND controller state */ hnand->State = HAL_NAND_STATE_READY; + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Read status until NAND is ready */ + while(HAL_NAND_Read_Status(hnand) != NAND_READY) + { + if((HAL_GetTick() - tickstart ) > NAND_WRITE_TIMEOUT) + { + /* Process unlocked */ + __HAL_UNLOCK(hnand); + + return HAL_TIMEOUT; + } + } + /* Process unlocked */ __HAL_UNLOCK(hnand); return HAL_OK; } - /** * @brief NAND memory read status * @param hnand: pointer to a NAND_HandleTypeDef structure that contains @@ -831,23 +900,23 @@ HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTy uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand) { uint32_t data = 0; - uint32_t DeviceAddress = 0; + uint32_t deviceaddress = 0; /* Identify the device address */ if(hnand->Init.NandBank == FMC_NAND_BANK2) { - DeviceAddress = NAND_DEVICE1; + deviceaddress = NAND_DEVICE1; } else { - DeviceAddress = NAND_DEVICE2; + deviceaddress = NAND_DEVICE2; } /* Send Read status operation command */ - *(__IO uint8_t *)((uint32_t)(DeviceAddress | CMD_AREA)) = NAND_CMD_STATUS; + *(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = NAND_CMD_STATUS; /* Read status register data */ - data = *(__IO uint8_t *)DeviceAddress; + data = *(__IO uint8_t *)deviceaddress; /* Return the status */ if((data & NAND_ERROR) == NAND_ERROR) @@ -860,19 +929,18 @@ uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand) } return NAND_BUSY; - } /** * @brief Increment the NAND memory address * @param hnand: pointer to a NAND_HandleTypeDef structure that contains * the configuration information for NAND module. - * @param pAddress: pointer to NAND adress structure + * @param pAddress: pointer to NAND address structure * @retval The new status of the increment address operation. It can be: * - NAND_VALID_ADDRESS: When the new address is valid address * - NAND_INVALID_ADDRESS: When the new address is invalid address */ -uint32_t HAL_NAND_Address_Inc(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress) +uint32_t HAL_NAND_Address_Inc(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress) { uint32_t status = NAND_VALID_ADDRESS; @@ -899,13 +967,11 @@ uint32_t HAL_NAND_Address_Inc(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pA return (status); } - - /** * @} */ -/** @defgroup NAND_Group3 Control functions +/** @defgroup NAND_Exported_Functions_Group3 Peripheral Control functions * @brief management functions * @verbatim @@ -944,17 +1010,16 @@ HAL_StatusTypeDef HAL_NAND_ECC_Enable(NAND_HandleTypeDef *hnand) /* Update the NAND state */ hnand->State = HAL_NAND_STATE_READY; - return HAL_OK; + return HAL_OK; } - /** * @brief Disables dynamically FMC_NAND ECC feature. * @param hnand: pointer to a NAND_HandleTypeDef structure that contains * the configuration information for NAND module. * @retval HAL status */ -HAL_StatusTypeDef HAL_NAND_ECC_Disable(NAND_HandleTypeDef *hnand) +HAL_StatusTypeDef HAL_NAND_ECC_Disable(NAND_HandleTypeDef *hnand) { /* Check the NAND controller state */ if(hnand->State == HAL_NAND_STATE_BUSY) @@ -1003,13 +1068,13 @@ HAL_StatusTypeDef HAL_NAND_GetECC(NAND_HandleTypeDef *hnand, uint32_t *ECCval, return status; } - + /** * @} */ -/** @defgroup NAND_Group4 State functions +/** @defgroup NAND_Exported_Functions_Group4 Peripheral State functions * @brief Peripheral State functions * @verbatim @@ -1042,13 +1107,17 @@ HAL_NAND_StateTypeDef HAL_NAND_GetState(NAND_HandleTypeDef *hnand) /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#endif /* HAL_NAND_MODULE_ENABLED */ /** * @} */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx */ + +#endif /* HAL_NAND_MODULE_ENABLED */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.h index d9ab490f956..7731e47588c 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nand.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_nand.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of NAND HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -44,13 +44,13 @@ #endif /* Includes ------------------------------------------------------------------*/ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) #include "stm32f4xx_ll_fsmc.h" #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) #include "stm32f4xx_ll_fmc.h" -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** @addtogroup STM32F4xx_HAL_Driver * @{ @@ -60,10 +60,15 @@ * @{ */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) + /* Exported typedef ----------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ +/** @defgroup NAND_Exported_Types NAND Exported Types + * @{ + */ /** * @brief HAL NAND State structures definition @@ -103,7 +108,7 @@ typedef struct uint16_t Block; /*!< NAND memory Block address */ -}NAND_AddressTypedef; +}NAND_AddressTypeDef; /** * @brief NAND Memory info Structure definition @@ -136,12 +141,99 @@ typedef struct NAND_InfoTypeDef Info; /*!< NAND characteristic information structure */ }NAND_HandleTypeDef; - +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup NAND_Exported_Constants +/* Exported macros ------------------------------------------------------------*/ +/** @defgroup NAND_Exported_Macros NAND Exported Macros * @{ */ + +/** @brief Reset NAND handle state + * @param __HANDLE__: specifies the NAND handle. + * @retval None + */ +#define __HAL_NAND_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_NAND_STATE_RESET) + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup NAND_Exported_Functions NAND Exported Functions + * @{ + */ + +/** @addtogroup NAND_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ + +/* Initialization/de-initialization functions ********************************/ +HAL_StatusTypeDef HAL_NAND_Init(NAND_HandleTypeDef *hnand, FMC_NAND_PCC_TimingTypeDef *ComSpace_Timing, FMC_NAND_PCC_TimingTypeDef *AttSpace_Timing); +HAL_StatusTypeDef HAL_NAND_DeInit(NAND_HandleTypeDef *hnand); +void HAL_NAND_MspInit(NAND_HandleTypeDef *hnand); +void HAL_NAND_MspDeInit(NAND_HandleTypeDef *hnand); +void HAL_NAND_IRQHandler(NAND_HandleTypeDef *hnand); +void HAL_NAND_ITCallback(NAND_HandleTypeDef *hnand); + +/** + * @} + */ + +/** @addtogroup NAND_Exported_Functions_Group2 Input and Output functions + * @{ + */ + +/* IO operation functions ****************************************************/ +HAL_StatusTypeDef HAL_NAND_Read_ID(NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pNAND_ID); +HAL_StatusTypeDef HAL_NAND_Reset(NAND_HandleTypeDef *hnand); +HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToRead); +HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToWrite); +HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaToRead); +HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaTowrite); +HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress); +uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand); +uint32_t HAL_NAND_Address_Inc(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress); + +/** + * @} + */ + +/** @addtogroup NAND_Exported_Functions_Group3 Peripheral Control functions + * @{ + */ + +/* NAND Control functions ****************************************************/ +HAL_StatusTypeDef HAL_NAND_ECC_Enable(NAND_HandleTypeDef *hnand); +HAL_StatusTypeDef HAL_NAND_ECC_Disable(NAND_HandleTypeDef *hnand); +HAL_StatusTypeDef HAL_NAND_GetECC(NAND_HandleTypeDef *hnand, uint32_t *ECCval, uint32_t Timeout); + +/** + * @} + */ + +/** @addtogroup NAND_Exported_Functions_Group4 Peripheral State functions + * @{ + */ +/* NAND State functions *******************************************************/ +HAL_NAND_StateTypeDef HAL_NAND_GetState(NAND_HandleTypeDef *hnand); +uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup NAND_Private_Constants NAND Private Constants + * @{ + */ #define NAND_DEVICE1 ((uint32_t)0x70000000) #define NAND_DEVICE2 ((uint32_t)0x80000000) #define NAND_WRITE_TIMEOUT ((uint32_t)0x01000000) @@ -149,16 +241,16 @@ typedef struct #define CMD_AREA ((uint32_t)(1<<16)) /* A16 = CLE high */ #define ADDR_AREA ((uint32_t)(1<<17)) /* A17 = ALE high */ -#define NAND_CMD_AREA_A ((uint8_t)0x00) -#define NAND_CMD_AREA_B ((uint8_t)0x01) +#define NAND_CMD_AREA_A ((uint8_t)0x00) +#define NAND_CMD_AREA_B ((uint8_t)0x01) #define NAND_CMD_AREA_C ((uint8_t)0x50) #define NAND_CMD_AREA_TRUE1 ((uint8_t)0x30) #define NAND_CMD_WRITE0 ((uint8_t)0x80) -#define NAND_CMD_WRITE_TRUE1 ((uint8_t)0x10) +#define NAND_CMD_WRITE_TRUE1 ((uint8_t)0x10) #define NAND_CMD_ERASE0 ((uint8_t)0x60) #define NAND_CMD_ERASE1 ((uint8_t)0xD0) -#define NAND_CMD_READID ((uint8_t)0x90) +#define NAND_CMD_READID ((uint8_t)0x90) #define NAND_CMD_STATUS ((uint8_t)0x70) #define NAND_CMD_LOCK_STATUS ((uint8_t)0x7A) #define NAND_CMD_RESET ((uint8_t)0xFF) @@ -170,18 +262,14 @@ typedef struct #define NAND_BUSY ((uint32_t)0x00000000) #define NAND_ERROR ((uint32_t)0x00000001) #define NAND_READY ((uint32_t)0x00000040) - /** * @} */ - -/* Exported macro ------------------------------------------------------------*/ -/** @brief Reset NAND handle state - * @param __HANDLE__: specifies the NAND handle. - * @retval None +/* Private macros ------------------------------------------------------------*/ +/** @defgroup NAND_Private_Macros NAND Private Macros + * @{ */ -#define __HAL_NAND_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_NAND_STATE_RESET) /** * @brief NAND memory address computation. @@ -189,50 +277,28 @@ typedef struct * @param __HANDLE__ : NAND handle. * @retval NAND Raw address value */ -#define __ARRAY_ADDRESS(__ADDRESS__ , __HANDLE__) ((__ADDRESS__)->Page + \ +#define ARRAY_ADDRESS(__ADDRESS__ , __HANDLE__) ((__ADDRESS__)->Page + \ (((__ADDRESS__)->Block + (((__ADDRESS__)->Zone) * ((__HANDLE__)->Info.ZoneSize)))* ((__HANDLE__)->Info.BlockSize))) - + /** * @brief NAND memory address cycling. * @param __ADDRESS__: NAND memory address. * @retval NAND address cycling value. */ -#define __ADDR_1st_CYCLE(__ADDRESS__) (uint8_t)(__ADDRESS__) /* 1st addressing cycle */ -#define __ADDR_2nd_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 8) /* 2nd addressing cycle */ -#define __ADDR_3rd_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 16) /* 3rd addressing cycle */ -#define __ADDR_4th_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 24) /* 4th addressing cycle */ - -/* Exported functions --------------------------------------------------------*/ - -/* Initialization/de-initialization functions ********************************/ -HAL_StatusTypeDef HAL_NAND_Init(NAND_HandleTypeDef *hnand, FMC_NAND_PCC_TimingTypeDef *ComSpace_Timing, FMC_NAND_PCC_TimingTypeDef *AttSpace_Timing); -HAL_StatusTypeDef HAL_NAND_DeInit(NAND_HandleTypeDef *hnand); -void HAL_NAND_MspInit(NAND_HandleTypeDef *hnand); -void HAL_NAND_MspDeInit(NAND_HandleTypeDef *hnand); -void HAL_NAND_IRQHandler(NAND_HandleTypeDef *hnand); -void HAL_NAND_ITCallback(NAND_HandleTypeDef *hnand); - -/* IO operation functions ****************************************************/ -HAL_StatusTypeDef HAL_NAND_Read_ID(NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pNAND_ID); -HAL_StatusTypeDef HAL_NAND_Reset(NAND_HandleTypeDef *hnand); -HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumPageToRead); -HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumPageToWrite); -HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaToRead); -HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaTowrite); -HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress); -uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand); -uint32_t HAL_NAND_Address_Inc(NAND_HandleTypeDef *hnand, NAND_AddressTypedef *pAddress); - -/* NAND Control functions ****************************************************/ -HAL_StatusTypeDef HAL_NAND_ECC_Enable(NAND_HandleTypeDef *hnand); -HAL_StatusTypeDef HAL_NAND_ECC_Disable(NAND_HandleTypeDef *hnand); -HAL_StatusTypeDef HAL_NAND_GetECC(NAND_HandleTypeDef *hnand, uint32_t *ECCval, uint32_t Timeout); - -/* NAND State functions *******************************************************/ -HAL_NAND_StateTypeDef HAL_NAND_GetState(NAND_HandleTypeDef *hnand); -uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand); - -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#define ADDR_1ST_CYCLE(__ADDRESS__) (uint8_t)(__ADDRESS__) /* 1st addressing cycle */ +#define ADDR_2ND_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 8) /* 2nd addressing cycle */ +#define ADDR_3RD_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 16) /* 3rd addressing cycle */ +#define ADDR_4TH_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 24) /* 4th addressing cycle */ +/** + * @} + */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx */ + +/** + * @} + */ /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.c index 49c6a591193..4549702ee97 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_nor.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief NOR HAL module driver. * This file provides a generic firmware to drive NOR memories mounted * as external device. @@ -49,13 +49,13 @@ [..] Below the list of most used macros in NOR HAL driver. - (+) __NOR_WRITE : NOR memory write data to specified address + (+) NOR_WRITE : NOR memory write data to specified address @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -89,27 +89,63 @@ * @{ */ -/** @defgroup NOR +/** @defgroup NOR NOR * @brief NOR driver modules * @{ */ #ifdef HAL_NOR_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ + +/** @defgroup NOR_Private_Defines NOR Private Defines + * @{ + */ + +/* Constants to define address to set to write a command */ +#define NOR_CMD_ADDRESS_FIRST (uint16_t)0x0555 +#define NOR_CMD_ADDRESS_FIRST_CFI (uint16_t)0x0055 +#define NOR_CMD_ADDRESS_SECOND (uint16_t)0x02AA +#define NOR_CMD_ADDRESS_THIRD (uint16_t)0x0555 +#define NOR_CMD_ADDRESS_FOURTH (uint16_t)0x0555 +#define NOR_CMD_ADDRESS_FIFTH (uint16_t)0x02AA +#define NOR_CMD_ADDRESS_SIXTH (uint16_t)0x0555 + +/* Constants to define data to program a command */ +#define NOR_CMD_DATA_READ_RESET (uint16_t)0x00F0 +#define NOR_CMD_DATA_FIRST (uint16_t)0x00AA +#define NOR_CMD_DATA_SECOND (uint16_t)0x0055 +#define NOR_CMD_DATA_AUTO_SELECT (uint16_t)0x0090 +#define NOR_CMD_DATA_PROGRAM (uint16_t)0x00A0 +#define NOR_CMD_DATA_CHIP_BLOCK_ERASE_THIRD (uint16_t)0x0080 +#define NOR_CMD_DATA_CHIP_BLOCK_ERASE_FOURTH (uint16_t)0x00AA +#define NOR_CMD_DATA_CHIP_BLOCK_ERASE_FIFTH (uint16_t)0x0055 +#define NOR_CMD_DATA_CHIP_ERASE (uint16_t)0x0010 +#define NOR_CMD_DATA_CFI (uint16_t)0x0098 + +#define NOR_CMD_DATA_BUFFER_AND_PROG (uint8_t)0x25 +#define NOR_CMD_DATA_BUFFER_AND_PROG_CONFIRM (uint8_t)0x29 +#define NOR_CMD_DATA_BLOCK_ERASE (uint8_t)0x30 + +/* Mask on NOR STATUS REGISTER */ +#define NOR_MASK_STATUS_DQ5 (uint16_t)0x0020 +#define NOR_MASK_STATUS_DQ6 (uint16_t)0x0040 +/** + * @} + */ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup NOR_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup NOR_Exported_Functions NOR Exported Functions * @{ */ -/** @defgroup NOR_Group1 Initialization and de-initialization functions +/** @defgroup NOR_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -141,10 +177,12 @@ HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDe if(hnor->State == HAL_NOR_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hnor->Lock = HAL_UNLOCKED; /* Initialize the low level hardware (MSP) */ HAL_NOR_MspInit(hnor); } - + /* Initialize NOR control Interface */ FMC_NORSRAM_Init(hnor->Instance, &(hnor->Init)); @@ -155,7 +193,7 @@ HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDe FMC_NORSRAM_Extended_Timing_Init(hnor->Extended, ExtTiming, hnor->Init.NSBank, hnor->Init.ExtendedMode); /* Enable the NORSRAM device */ - __FMC_NORSRAM_ENABLE(hnor->Instance, hnor->Init.NSBank); + __FMC_NORSRAM_ENABLE(hnor->Instance, hnor->Init.NSBank); /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -213,7 +251,7 @@ __weak void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor) } /** - * @brief NOR BSP Wait fro Ready/Busy signal + * @brief NOR BSP Wait for Ready/Busy signal * @param hnor: pointer to a NOR_HandleTypeDef structure that contains * the configuration information for NOR module. * @param Timeout: Maximum timeout value @@ -230,7 +268,7 @@ __weak void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout) * @} */ -/** @defgroup NOR_Group2 Input and Output functions +/** @defgroup NOR_Exported_Functions_Group2 Input and Output functions * @brief Input Output and memory control functions * @verbatim @@ -252,7 +290,7 @@ __weak void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout) */ HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_ID) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -266,34 +304,34 @@ HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_I /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send read ID command */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x0090); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_THIRD), NOR_CMD_DATA_AUTO_SELECT); /* Read the NOR IDs */ - pNOR_ID->Manufacturer_Code = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, MC_ADDRESS); - pNOR_ID->Device_Code1 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, DEVICE_CODE1_ADDR); - pNOR_ID->Device_Code2 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, DEVICE_CODE2_ADDR); - pNOR_ID->Device_Code3 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, DEVICE_CODE3_ADDR); + pNOR_ID->Manufacturer_Code = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, MC_ADDRESS); + pNOR_ID->Device_Code1 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, DEVICE_CODE1_ADDR); + pNOR_ID->Device_Code2 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, DEVICE_CODE2_ADDR); + pNOR_ID->Device_Code3 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, DEVICE_CODE3_ADDR); /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -311,7 +349,7 @@ HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_I */ HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -325,22 +363,22 @@ HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor) /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } - __NOR_WRITE(deviceAddress, 0x00F0); + NOR_WRITE(deviceaddress, NOR_CMD_DATA_READ_RESET); /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -360,7 +398,7 @@ HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor) */ HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -374,31 +412,31 @@ HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send read data command */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x00555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x002AA), 0x0055); - __NOR_WRITE(pAddress, 0x00F0); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); + __NOR_WRITE((uint32_t)pAddress, NOR_CMD_DATA_READ_RESET); /* Read the data */ - *pData = *(__IO uint32_t *)pAddress; + *pData = *(__IO uint32_t *)(uint32_t)pAddress; /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -418,7 +456,7 @@ HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint */ HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -432,31 +470,31 @@ HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, u /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send program data command */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00A0); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_THIRD), NOR_CMD_DATA_PROGRAM); /* Write the data */ - __NOR_WRITE(pAddress, *pData); + NOR_WRITE(pAddress, *pData); /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -478,7 +516,7 @@ HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, u */ HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -492,28 +530,28 @@ HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send read data command */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x00555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x002AA), 0x0055); - __NOR_WRITE(uwAddress, 0x00F0); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); + NOR_WRITE(uwAddress, 0x00F0); /* Read buffer */ while( uwBufferSize > 0) @@ -543,10 +581,9 @@ HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress */ HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize) { - uint32_t lastloadedaddress = 0; - uint32_t currentaddress = 0; - uint32_t endaddress = 0; - uint32_t deviceAddress = 0; + uint16_t * p_currentaddress = (uint16_t *)NULL; + uint16_t * p_endaddress = (uint16_t *)NULL; + uint32_t lastloadedaddress = 0, deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -560,49 +597,49 @@ HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddr /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Initialize variables */ - currentaddress = uwAddress; - endaddress = uwAddress + uwBufferSize - 1; - lastloadedaddress = uwAddress; + p_currentaddress = (uint16_t*)((uint32_t)(uwAddress)); + p_endaddress = p_currentaddress + (uwBufferSize-1); + lastloadedaddress = (uint32_t)(uwAddress); /* Issue unlock command sequence */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); /* Write Buffer Load Command */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, uwAddress), 0x25); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, uwAddress), (uwBufferSize - 1)); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, uwAddress), NOR_CMD_DATA_BUFFER_AND_PROG); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, uwAddress), (uwBufferSize - 1)); /* Load Data into NOR Buffer */ - while(currentaddress <= endaddress) + while(p_currentaddress <= p_endaddress) { /* Store last loaded address & data value (for polling) */ - lastloadedaddress = currentaddress; + lastloadedaddress = (uint32_t)p_currentaddress; - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, currentaddress), *pData++); + NOR_WRITE(p_currentaddress, *pData++); - currentaddress += 1; + p_currentaddress ++; } - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, lastloadedaddress), 0x29); + NOR_WRITE((uint32_t)(lastloadedaddress), NOR_CMD_DATA_BUFFER_AND_PROG_CONFIRM); /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -623,7 +660,7 @@ HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddr */ HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAddress, uint32_t Address) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -637,31 +674,31 @@ HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAdd /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send block erase command sequence */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x0080); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); - __NOR_WRITE((uint32_t)(BlockAddress + Address), 0x30); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_THIRD), NOR_CMD_DATA_CHIP_BLOCK_ERASE_THIRD); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FOURTH), NOR_CMD_DATA_CHIP_BLOCK_ERASE_FOURTH); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIFTH), NOR_CMD_DATA_CHIP_BLOCK_ERASE_FIFTH); + NOR_WRITE((uint32_t)(BlockAddress + Address), NOR_CMD_DATA_BLOCK_ERASE); /* Check the NOR memory status and update the controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -681,7 +718,7 @@ HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAdd */ HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -695,31 +732,31 @@ HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address) /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send NOR chip erase command sequence */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x0080); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x00AA); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x02AA), 0x0055); - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0555), 0x0010); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST), NOR_CMD_DATA_FIRST); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SECOND), NOR_CMD_DATA_SECOND); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_THIRD), NOR_CMD_DATA_CHIP_BLOCK_ERASE_THIRD); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FOURTH), NOR_CMD_DATA_CHIP_BLOCK_ERASE_FOURTH); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIFTH), NOR_CMD_DATA_CHIP_BLOCK_ERASE_FIFTH); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_SIXTH), NOR_CMD_DATA_CHIP_ERASE); /* Check the NOR memory status and update the controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -738,7 +775,7 @@ HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address) */ HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR_CFI) { - uint32_t deviceAddress = 0; + uint32_t deviceaddress = 0; /* Process Locked */ __HAL_LOCK(hnor); @@ -752,32 +789,32 @@ HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR /* Select the NOR device address */ if (hnor->Init.NSBank == FMC_NORSRAM_BANK1) { - deviceAddress = NOR_MEMORY_ADRESS1; + deviceaddress = NOR_MEMORY_ADRESS1; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK2) { - deviceAddress = NOR_MEMORY_ADRESS2; + deviceaddress = NOR_MEMORY_ADRESS2; } else if (hnor->Init.NSBank == FMC_NORSRAM_BANK3) { - deviceAddress = NOR_MEMORY_ADRESS3; + deviceaddress = NOR_MEMORY_ADRESS3; } else /* FMC_NORSRAM_BANK4 */ { - deviceAddress = NOR_MEMORY_ADRESS4; + deviceaddress = NOR_MEMORY_ADRESS4; } /* Update the NOR controller state */ hnor->State = HAL_NOR_STATE_BUSY; /* Send read CFI query command */ - __NOR_WRITE(__NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, 0x0055), 0x0098); + NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, NOR_CMD_ADDRESS_FIRST_CFI), NOR_CMD_DATA_CFI); /* read the NOR CFI information */ - pNOR_CFI->CFI_1 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, CFI1_ADDRESS); - pNOR_CFI->CFI_2 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, CFI2_ADDRESS); - pNOR_CFI->CFI_3 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, CFI3_ADDRESS); - pNOR_CFI->CFI_4 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(deviceAddress, NOR_MEMORY_8B, CFI4_ADDRESS); + pNOR_CFI->CFI_1 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, CFI1_ADDRESS); + pNOR_CFI->CFI_2 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, CFI2_ADDRESS); + pNOR_CFI->CFI_3 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, CFI3_ADDRESS); + pNOR_CFI->CFI_4 = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, NOR_MEMORY_8B, CFI4_ADDRESS); /* Check the NOR controller state */ hnor->State = HAL_NOR_STATE_READY; @@ -792,7 +829,7 @@ HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR * @} */ -/** @defgroup NOR_Group3 Control functions +/** @defgroup NOR_Exported_Functions_Group3 Control functions * @brief management functions * @verbatim @@ -858,7 +895,7 @@ HAL_StatusTypeDef HAL_NOR_WriteOperation_Disable(NOR_HandleTypeDef *hnor) * @} */ -/** @defgroup NOR_Group4 State functions +/** @defgroup NOR_Exported_Functions_Group4 State functions * @brief Peripheral State functions * @verbatim @@ -887,13 +924,13 @@ HAL_NOR_StateTypeDef HAL_NOR_GetState(NOR_HandleTypeDef *hnor) * @brief Returns the NOR operation status. * @param hnor: pointer to the NOR handle * @param Address: Device address - * @param Timeout: NOR progamming Timeout - * @retval NOR_Status: The returned value can be: NOR_SUCCESS, NOR_ERROR - * or NOR_TIMEOUT + * @param Timeout: NOR programming Timeout + * @retval NOR_Status: The returned value can be: HAL_NOR_STATUS_SUCCESS, HAL_NOR_STATUS_ERROR + * or HAL_NOR_STATUS_TIMEOUT */ -NOR_StatusTypedef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout) +HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout) { - NOR_StatusTypedef status = NOR_ONGOING; + HAL_NOR_StatusTypeDef status = HAL_NOR_STATUS_ONGOING; uint16_t tmpSR1 = 0, tmpSR2 = 0; uint32_t tickstart = 0; @@ -901,16 +938,17 @@ NOR_StatusTypedef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, u HAL_NOR_MspWait(hnor, Timeout); /* Get the NOR memory operation status -------------------------------------*/ - while(status != NOR_SUCCESS) + + /* Get tick */ + tickstart = HAL_GetTick(); + while((status != HAL_NOR_STATUS_SUCCESS ) && (status != HAL_NOR_STATUS_TIMEOUT)) { - /* Get tick */ - tickstart = HAL_GetTick(); /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) { if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) { - status = NOR_TIMEOUT; + status = HAL_NOR_STATUS_TIMEOUT; } } @@ -918,29 +956,28 @@ NOR_StatusTypedef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, u tmpSR1 = *(__IO uint16_t *)Address; tmpSR2 = *(__IO uint16_t *)Address; - /* If DQ6 did not toggle between the two reads then return NOR_Success */ - if((tmpSR1 & 0x0040) == (tmpSR2 & 0x0040)) + /* If DQ6 did not toggle between the two reads then return HAL_NOR_STATUS_SUCCESS */ + if((tmpSR1 & NOR_MASK_STATUS_DQ6) == (tmpSR2 & NOR_MASK_STATUS_DQ6)) { - return NOR_SUCCESS; + return HAL_NOR_STATUS_SUCCESS ; } - if((tmpSR1 & 0x0020) == 0x0020) + if((tmpSR1 & NOR_MASK_STATUS_DQ5) == NOR_MASK_STATUS_DQ5) { - return NOR_ONGOING; + status = HAL_NOR_STATUS_ONGOING; } tmpSR1 = *(__IO uint16_t *)Address; tmpSR2 = *(__IO uint16_t *)Address; - /* If DQ6 did not toggle between the two reads then return NOR_Success */ - if((tmpSR1 & 0x0040) == (tmpSR2 & 0x0040)) + /* If DQ6 did not toggle between the two reads then return HAL_NOR_STATUS_SUCCESS */ + if((tmpSR1 & NOR_MASK_STATUS_DQ6) == (tmpSR2 & NOR_MASK_STATUS_DQ6)) { - return NOR_SUCCESS; + return HAL_NOR_STATUS_SUCCESS; } - - if((tmpSR1 & 0x0020) == 0x0020) + if((tmpSR1 & NOR_MASK_STATUS_DQ5) == NOR_MASK_STATUS_DQ5) { - return NOR_ERROR; + return HAL_NOR_STATUS_ERROR; } } @@ -951,11 +988,13 @@ NOR_StatusTypedef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, u /** * @} */ + /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx ||\ + STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ #endif /* HAL_NOR_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.h index 9ae3e1120cb..fd883a91e1b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_nor.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_nor.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of NOR HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -44,13 +44,13 @@ #endif /* Includes ------------------------------------------------------------------*/ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) #include "stm32f4xx_ll_fsmc.h" #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) #include "stm32f4xx_ll_fmc.h" -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** @addtogroup STM32F4xx_HAL_Driver * @{ @@ -60,9 +60,15 @@ * @{ */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Exported typedef ----------------------------------------------------------*/ +/** @defgroup NOR_Exported_Types NOR Exported Types + * @{ + */ + /** * @brief HAL SRAM State structures definition */ @@ -80,11 +86,11 @@ typedef enum */ typedef enum { - NOR_SUCCESS = 0, - NOR_ONGOING, - NOR_ERROR, - NOR_TIMEOUT -}NOR_StatusTypedef; + HAL_NOR_STATUS_SUCCESS = 0, + HAL_NOR_STATUS_ONGOING, + HAL_NOR_STATUS_ERROR, + HAL_NOR_STATUS_TIMEOUT +}HAL_NOR_StatusTypeDef; /** * @brief FMC NOR ID typedef @@ -97,7 +103,7 @@ typedef struct uint16_t Device_Code2; - uint16_t Device_Code3; /*!< Defines the devices' codes used to identify the memory. + uint16_t Device_Code3; /*!< Defines the device's codes used to identify the memory. These codes can be accessed by performing read operations with specific control signals and addresses set.They can also be accessed by issuing an Auto Select command */ @@ -136,10 +142,90 @@ typedef struct __IO HAL_NOR_StateTypeDef State; /*!< NOR device access state */ -}NOR_HandleTypeDef; - +}NOR_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup NOR_Exported_Constants +/* Exported macros ------------------------------------------------------------*/ +/** @defgroup NOR_Exported_Macros NOR Exported Macros + * @{ + */ +/** @brief Reset NOR handle state + * @param __HANDLE__: specifies the NOR handle. + * @retval None + */ +#define __HAL_NOR_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_NOR_STATE_RESET) +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup NOR_Exported_Functions + * @{ + */ + +/** @addtogroup NOR_Exported_Functions_Group1 + * @{ + */ +/* Initialization/de-initialization functions ********************************/ +HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming); +HAL_StatusTypeDef HAL_NOR_DeInit(NOR_HandleTypeDef *hnor); +void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor); +void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor); +void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout); +/** + * @} + */ + +/** @addtogroup NOR_Exported_Functions_Group2 + * @{ + */ +/* I/O operation functions ***************************************************/ +HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_ID); +HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor); +HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData); +HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData); + +HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize); +HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize); + +HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAddress, uint32_t Address); +HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address); +HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR_CFI); +/** + * @} + */ + +/** @addtogroup NOR_Exported_Functions_Group3 + * @{ + */ +/* NOR Control functions *****************************************************/ +HAL_StatusTypeDef HAL_NOR_WriteOperation_Enable(NOR_HandleTypeDef *hnor); +HAL_StatusTypeDef HAL_NOR_WriteOperation_Disable(NOR_HandleTypeDef *hnor); +/** + * @} + */ + +/** @addtogroup NOR_Exported_Functions_Group4 + * @{ + */ +/* NOR State functions ********************************************************/ +HAL_NOR_StateTypeDef HAL_NOR_GetState(NOR_HandleTypeDef *hnor); +HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup NOR_Private_Constants NOR Private Constants * @{ */ /* NOR device IDs addresses */ @@ -166,66 +252,38 @@ typedef struct #define NOR_MEMORY_ADRESS2 ((uint32_t)0x64000000) #define NOR_MEMORY_ADRESS3 ((uint32_t)0x68000000) #define NOR_MEMORY_ADRESS4 ((uint32_t)0x6C000000) - /** * @} */ -/* Exported macro ------------------------------------------------------------*/ - -/** @brief Reset NOR handle state - * @param __HANDLE__: specifies the NOR handle. - * @retval None +/* Private macros ------------------------------------------------------------*/ +/** @defgroup NOR_Private_Macros NOR Private Macros + * @{ */ -#define __HAL_NOR_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_NOR_STATE_RESET) - /** * @brief NOR memory address shifting. - * @param __ADDRESS__: NOR memory address + * @param __NOR_ADDRESS__: NOR base address + * @param NOR_MEMORY_WIDTH: NOR memory width + * @param ADDRESS: NOR memory address * @retval NOR shifted address value */ -#define __NOR_ADDR_SHIFT(__NOR_ADDRESS, __NOR_MEMORY_WIDTH_, __ADDRESS__) (((__NOR_MEMORY_WIDTH_) == NOR_MEMORY_8B)? ((uint32_t)((__NOR_ADDRESS) + (2 * (__ADDRESS__)))):\ - ((uint32_t)((__NOR_ADDRESS) + (__ADDRESS__)))) +#define NOR_ADDR_SHIFT(__NOR_ADDRESS__, NOR_MEMORY_WIDTH, ADDRESS) (uint32_t)(((NOR_MEMORY_WIDTH) == NOR_MEMORY_8B)? ((uint32_t)((__NOR_ADDRESS__) + (2 * (ADDRESS)))):\ + ((uint32_t)((__NOR_ADDRESS__) + (ADDRESS)))) /** * @brief NOR memory write data to specified address. - * @param __ADDRESS__: NOR memory address - * @param __DATA__: Data to write + * @param ADDRESS: NOR memory address + * @param DATA: Data to write * @retval None */ -#define __NOR_WRITE(__ADDRESS__, __DATA__) (*(__IO uint16_t *)((uint32_t)(__ADDRESS__)) = (__DATA__)) - -/* Exported functions --------------------------------------------------------*/ - -/* Initialization/de-initialization functions ********************************/ -HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming); -HAL_StatusTypeDef HAL_NOR_DeInit(NOR_HandleTypeDef *hnor); -void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor); -void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor); -void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout); - -/* I/O operation functions ***************************************************/ -HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_ID); -HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor); -HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData); -HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData); - -HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize); -HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize); - -HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAddress, uint32_t Address); -HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address); -HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR_CFI); - -/* NOR Control functions *****************************************************/ -HAL_StatusTypeDef HAL_NOR_WriteOperation_Enable(NOR_HandleTypeDef *hnor); -HAL_StatusTypeDef HAL_NOR_WriteOperation_Disable(NOR_HandleTypeDef *hnor); - -/* NOR State functions ********************************************************/ -HAL_NOR_StateTypeDef HAL_NOR_GetState(NOR_HandleTypeDef *hnor); -NOR_StatusTypedef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout); +#define NOR_WRITE(ADDRESS, DATA) (*(__IO uint16_t *)((uint32_t)(ADDRESS)) = (DATA)) -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/** + * @} + */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ + STM32F446xx */ /** * @} */ From dbb04307e3a34f95310b56dda9f7a0f2f3555460 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Sun, 26 Apr 2015 01:47:43 +0200 Subject: [PATCH 09/24] [STM32F4xx] update of STM32CubeF4 to version 1.5 - part 2 --- .../TARGET_STM32F4/stm32_hal_legacy.h | 2307 ++++++++++++++ .../TARGET_STM32F4/stm32f4xx_hal_pccard.c | 271 +- .../TARGET_STM32F4/stm32f4xx_hal_pccard.h | 212 +- .../TARGET_STM32F4/stm32f4xx_hal_pcd.c | 172 +- .../TARGET_STM32F4/stm32f4xx_hal_pcd.h | 241 +- .../TARGET_STM32F4/stm32f4xx_hal_pcd_ex.c | 81 +- .../TARGET_STM32F4/stm32f4xx_hal_pcd_ex.h | 37 +- .../TARGET_STM32F4/stm32f4xx_hal_pwr.c | 224 +- .../TARGET_STM32F4/stm32f4xx_hal_pwr.h | 337 ++- .../TARGET_STM32F4/stm32f4xx_hal_pwr_ex.c | 208 +- .../TARGET_STM32F4/stm32f4xx_hal_pwr_ex.h | 184 +- .../TARGET_STM32F4/stm32f4xx_hal_qspi.c | 1942 ++++++++++++ .../TARGET_STM32F4/stm32f4xx_hal_qspi.h | 788 +++++ .../TARGET_STM32F4/stm32f4xx_hal_rcc.c | 175 +- .../TARGET_STM32F4/stm32f4xx_hal_rcc.h | 1404 +++++---- .../TARGET_STM32F4/stm32f4xx_hal_rcc_ex.c | 1232 +++++++- .../TARGET_STM32F4/stm32f4xx_hal_rcc_ex.h | 2640 +++++++++++++---- .../TARGET_STM32F4/stm32f4xx_hal_rng.c | 330 ++- .../TARGET_STM32F4/stm32f4xx_hal_rng.h | 242 +- .../TARGET_STM32F4/stm32f4xx_hal_rtc.c | 114 +- .../TARGET_STM32F4/stm32f4xx_hal_rtc.h | 465 +-- .../TARGET_STM32F4/stm32f4xx_hal_rtc_ex.c | 121 +- .../TARGET_STM32F4/stm32f4xx_hal_rtc_ex.h | 758 +++-- .../TARGET_STM32F4/stm32f4xx_hal_sai.c | 1278 +++++--- .../TARGET_STM32F4/stm32f4xx_hal_sai.h | 685 +++-- .../TARGET_STM32F4/stm32f4xx_hal_sai_ex.c | 269 ++ .../TARGET_STM32F4/stm32f4xx_hal_sai_ex.h | 101 + .../TARGET_STM32F4/stm32f4xx_hal_sd.c | 202 +- .../TARGET_STM32F4/stm32f4xx_hal_sd.h | 186 +- .../TARGET_STM32F4/stm32f4xx_hal_sdram.c | 38 +- .../TARGET_STM32F4/stm32f4xx_hal_sdram.h | 67 +- .../TARGET_STM32F4/stm32f4xx_hal_smartcard.c | 407 ++- .../TARGET_STM32F4/stm32f4xx_hal_smartcard.h | 315 +- .../TARGET_STM32F4/stm32f4xx_hal_spdifrx.c | 1210 ++++++++ .../TARGET_STM32F4/stm32f4xx_hal_spdifrx.h | 559 ++++ .../TARGET_STM32F4/stm32f4xx_hal_spi.c | 398 +-- .../TARGET_STM32F4/stm32f4xx_hal_spi.h | 289 +- .../TARGET_STM32F4/stm32f4xx_hal_sram.c | 35 +- .../TARGET_STM32F4/stm32f4xx_hal_sram.h | 78 +- .../TARGET_STM32F4/stm32f4xx_hal_tim.c | 1211 ++++---- .../TARGET_STM32F4/stm32f4xx_hal_tim.h | 969 +++--- .../TARGET_STM32F4/stm32f4xx_hal_tim_ex.c | 307 +- .../TARGET_STM32F4/stm32f4xx_hal_tim_ex.h | 162 +- .../TARGET_STM32F4/stm32f4xx_hal_uart.c | 223 +- .../TARGET_STM32F4/stm32f4xx_hal_uart.h | 351 ++- .../TARGET_STM32F4/stm32f4xx_hal_usart.c | 227 +- .../TARGET_STM32F4/stm32f4xx_hal_usart.h | 284 +- .../TARGET_STM32F4/stm32f4xx_hal_wwdg.c | 57 +- .../TARGET_STM32F4/stm32f4xx_hal_wwdg.h | 229 +- .../TARGET_STM32F4/stm32f4xx_ll_fmc.c | 758 ++++- .../TARGET_STM32F4/stm32f4xx_ll_fmc.h | 1012 ++++--- .../TARGET_STM32F4/stm32f4xx_ll_fsmc.c | 318 +- .../TARGET_STM32F4/stm32f4xx_ll_fsmc.h | 708 ++--- .../TARGET_STM32F4/stm32f4xx_ll_sdmmc.c | 35 +- .../TARGET_STM32F4/stm32f4xx_ll_sdmmc.h | 221 +- .../TARGET_STM32F4/stm32f4xx_ll_usb.c | 42 +- .../TARGET_STM32F4/stm32f4xx_ll_usb.h | 40 +- 57 files changed, 20860 insertions(+), 6896 deletions(-) create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32_hal_legacy.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.c create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.h diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32_hal_legacy.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32_hal_legacy.h new file mode 100644 index 00000000000..206e56f6a90 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32_hal_legacy.h @@ -0,0 +1,2307 @@ +/** + ****************************************************************************** + * @file stm32_hal_legacy.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief This file contains aliases definition for the STM32Cube HAL constants + * macros and functions maintained for legacy purpose. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + UART * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_HAL_LEGACY +#define __STM32_HAL_LEGACY + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup HAL_AES_Aliased_Defines HAL CRYP Aliased Defines maintained for legacy purpose + * @{ + */ +#define AES_FLAG_RDERR CRYP_FLAG_RDERR +#define AES_FLAG_WRERR CRYP_FLAG_WRERR +#define AES_CLEARFLAG_CCF CRYP_CLEARFLAG_CCF +#define AES_CLEARFLAG_RDERR CRYP_CLEARFLAG_RDERR +#define AES_CLEARFLAG_WRERR CRYP_CLEARFLAG_WRERR + +/** + * @} + */ + +/** @defgroup HAL_ADC_Aliased_Defines HAL ADC Aliased Defines maintained for legacy purpose + * @{ + */ +#define ADC_RESOLUTION12b ADC_RESOLUTION_12B +#define ADC_RESOLUTION10b ADC_RESOLUTION_10B +#define ADC_RESOLUTION8b ADC_RESOLUTION_8B +#define ADC_RESOLUTION6b ADC_RESOLUTION_6B +#define OVR_DATA_OVERWRITTEN ADC_OVR_DATA_OVERWRITTEN +#define OVR_DATA_PRESERVED ADC_OVR_DATA_PRESERVED +#define EOC_SINGLE_CONV ADC_EOC_SINGLE_CONV +#define EOC_SEQ_CONV ADC_EOC_SEQ_CONV +#define EOC_SINGLE_SEQ_CONV ADC_EOC_SINGLE_SEQ_CONV +#define REGULAR_GROUP ADC_REGULAR_GROUP +#define INJECTED_GROUP ADC_INJECTED_GROUP +#define REGULAR_INJECTED_GROUP ADC_REGULAR_INJECTED_GROUP +#define AWD_EVENT ADC_AWD_EVENT +#define AWD1_EVENT ADC_AWD1_EVENT +#define AWD2_EVENT ADC_AWD2_EVENT +#define AWD3_EVENT ADC_AWD3_EVENT +#define OVR_EVENT ADC_OVR_EVENT +#define JQOVF_EVENT ADC_JQOVF_EVENT +#define ALL_CHANNELS ADC_ALL_CHANNELS +#define REGULAR_CHANNELS ADC_REGULAR_CHANNELS +#define INJECTED_CHANNELS ADC_INJECTED_CHANNELS +#define SYSCFG_FLAG_SENSOR_ADC ADC_FLAG_SENSOR +#define SYSCFG_FLAG_VREF_ADC ADC_FLAG_VREFINT +#define ADC_EXTERNALTRIG0_T6_TRGO ADC_EXTERNALTRIGCONV_T6_TRGO +#define ADC_EXTERNALTRIG1_T21_CC2 ADC_EXTERNALTRIGCONV_T21_CC2 +#define ADC_EXTERNALTRIG2_T2_TRGO ADC_EXTERNALTRIGCONV_T2_TRGO +#define ADC_EXTERNALTRIG3_T2_CC4 ADC_EXTERNALTRIGCONV_T2_CC4 +#define ADC_EXTERNALTRIG4_T22_TRGO ADC_EXTERNALTRIGCONV_T22_TRGO +#define ADC_EXTERNALTRIG7_EXT_IT11 ADC_EXTERNALTRIGCONV_EXT_IT11 +#define ADC_CLOCK_ASYNC ADC_CLOCK_ASYNC_DIV1 +#define ADC_EXTERNALTRIG_EDGE_NONE ADC_EXTERNALTRIGCONVEDGE_NONE +#define ADC_EXTERNALTRIG_EDGE_RISING ADC_EXTERNALTRIGCONVEDGE_RISING +#define ADC_EXTERNALTRIG_EDGE_FALLING ADC_EXTERNALTRIGCONVEDGE_FALLING +#define ADC_EXTERNALTRIG_EDGE_RISINGFALLING ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING +/** + * @} + */ + +/** @defgroup HAL_CEC_Aliased_Defines HAL CEC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define __HAL_CEC_GET_IT __HAL_CEC_GET_FLAG + +/** + * @} + */ + +/** @defgroup HAL_COMP_Aliased_Defines HAL COMP Aliased Defines maintained for legacy purpose + * @{ + */ + +#define COMP_WINDOWMODE_DISABLED COMP_WINDOWMODE_DISABLE +#define COMP_WINDOWMODE_ENABLED COMP_WINDOWMODE_ENABLE +#define COMP_EXTI_LINE_COMP1_EVENT COMP_EXTI_LINE_COMP1 +#define COMP_EXTI_LINE_COMP2_EVENT COMP_EXTI_LINE_COMP2 + +/** + * @} + */ + +/** @defgroup HAL_CRC_Aliased_Defines HAL CRC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define CRC_OUTPUTDATA_INVERSION_DISABLED CRC_OUTPUTDATA_INVERSION_DISABLE +#define CRC_OUTPUTDATA_INVERSION_ENABLED CRC_OUTPUTDATA_INVERSION_ENABLE + +/** + * @} + */ + +/** @defgroup HAL_DAC_Aliased_Defines HAL DAC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define DAC1_CHANNEL_1 DAC_CHANNEL_1 +#define DAC1_CHANNEL_2 DAC_CHANNEL_2 +#define DAC2_CHANNEL_1 DAC_CHANNEL_1 +#define DAC_WAVE_NONE ((uint32_t)0x00000000) +#define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0) +#define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) +#define DAC_WAVEGENERATION_NONE DAC_WAVE_NONE +#define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE +#define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE + +/** + * @} + */ + + +/** @defgroup HAL_FLASH_Aliased_Defines HAL FLASH Aliased Defines maintained for legacy purpose + * @{ + */ + +#define TYPEPROGRAM_BYTE FLASH_TYPEPROGRAM_BYTE +#define TYPEPROGRAM_HALFWORD FLASH_TYPEPROGRAM_HALFWORD +#define TYPEPROGRAM_WORD FLASH_TYPEPROGRAM_WORD +#define TYPEPROGRAM_DOUBLEWORD FLASH_TYPEPROGRAM_DOUBLEWORD +#define TYPEERASE_SECTORS FLASH_TYPEERASE_SECTORS +#define TYPEERASE_PAGES FLASH_TYPEERASE_PAGES +#define TYPEERASE_PAGEERASE FLASH_TYPEERASE_PAGES +#define TYPEERASE_MASSERASE FLASH_TYPEERASE_MASSERASE +#define WRPSTATE_DISABLE OB_WRPSTATE_DISABLE +#define WRPSTATE_ENABLE OB_WRPSTATE_ENABLE +#define HAL_FLASH_TIMEOUT_VALUE FLASH_TIMEOUT_VALUE +#define OBEX_PCROP OPTIONBYTE_PCROP +#define OBEX_BOOTCONFIG OPTIONBYTE_BOOTCONFIG +#define PCROPSTATE_DISABLE OB_PCROP_STATE_DISABLE +#define PCROPSTATE_ENABLE OB_PCROP_STATE_ENABLE +#define TYPEERASEDATA_BYTE FLASH_TYPEERASEDATA_BYTE +#define TYPEERASEDATA_HALFWORD FLASH_TYPEERASEDATA_HALFWORD +#define TYPEERASEDATA_WORD FLASH_TYPEERASEDATA_WORD +#define TYPEPROGRAMDATA_BYTE FLASH_TYPEPROGRAMDATA_BYTE +#define TYPEPROGRAMDATA_HALFWORD FLASH_TYPEPROGRAMDATA_HALFWORD +#define TYPEPROGRAMDATA_WORD FLASH_TYPEPROGRAMDATA_WORD +#define TYPEPROGRAMDATA_FASTBYTE FLASH_TYPEPROGRAMDATA_FASTBYTE +#define TYPEPROGRAMDATA_FASTHALFWORD FLASH_TYPEPROGRAMDATA_FASTHALFWORD +#define TYPEPROGRAMDATA_FASTWORD FLASH_TYPEPROGRAMDATA_FASTWORD +#define PAGESIZE FLASH_PAGE_SIZE +#define TYPEPROGRAM_FASTBYTE FLASH_TYPEPROGRAM_BYTE +#define TYPEPROGRAM_FASTHALFWORD FLASH_TYPEPROGRAM_HALFWORD +#define TYPEPROGRAM_FASTWORD FLASH_TYPEPROGRAM_WORD +#define VOLTAGE_RANGE_1 FLASH_VOLTAGE_RANGE_1 +#define VOLTAGE_RANGE_2 FLASH_VOLTAGE_RANGE_2 +#define VOLTAGE_RANGE_3 FLASH_VOLTAGE_RANGE_3 +#define VOLTAGE_RANGE_4 FLASH_VOLTAGE_RANGE_4 +#define TYPEPROGRAM_FAST FLASH_TYPEPROGRAM_FAST +#define TYPEPROGRAM_FAST_AND_LAST FLASH_TYPEPROGRAM_FAST_AND_LAST +#define WRPAREA_BANK1_AREAA OB_WRPAREA_BANK1_AREAA +#define WRPAREA_BANK1_AREAB OB_WRPAREA_BANK1_AREAB +#define WRPAREA_BANK2_AREAA OB_WRPAREA_BANK2_AREAA +#define WRPAREA_BANK2_AREAB OB_WRPAREA_BANK2_AREAB +#define IWDG_STDBY_FREEZE OB_IWDG_STDBY_FREEZE +#define IWDG_STDBY_ACTIVE OB_IWDG_STDBY_RUN +#define IWDG_STOP_FREEZE OB_IWDG_STOP_FREEZE +#define IWDG_STOP_ACTIVE OB_IWDG_STOP_RUN +#define IS_NBSECTORS IS_FLASH_NBSECTORS +#define FLASH_ERROR_NONE HAL_FLASH_ERROR_NONE +#define FLASH_ERROR_RD HAL_FLASH_ERROR_RD +#define FLASH_ERROR_PG HAL_FLASH_ERROR_PROG +#define FLASH_ERROR_PGP HAL_FLASH_ERROR_PGS +#define FLASH_ERROR_WRP HAL_FLASH_ERROR_WRP +#define FLASH_ERROR_OPTV HAL_FLASH_ERROR_OPTV +#define FLASH_ERROR_OPTVUSR HAL_FLASH_ERROR_OPTVUSR +#define FLASH_ERROR_PROG HAL_FLASH_ERROR_PROG +#define FLASH_ERROR_OP HAL_FLASH_ERROR_OPERATION +#define FLASH_ERROR_PGA HAL_FLASH_ERROR_PGA +#define FLASH_ERROR_SIZE HAL_FLASH_ERROR_SIZE +#define FLASH_ERROR_SIZ HAL_FLASH_ERROR_SIZE +#define FLASH_ERROR_PGS HAL_FLASH_ERROR_PGS +#define FLASH_ERROR_MIS HAL_FLASH_ERROR_MIS +#define FLASH_ERROR_FAST HAL_FLASH_ERROR_FAST +#define FLASH_ERROR_FWWERR HAL_FLASH_ERROR_FWWERR +#define FLASH_ERROR_NOTZERO HAL_FLASH_ERROR_NOTZERO +#define FLASH_ERROR_OPERATION HAL_FLASH_ERROR_OPERATION +#define FLASH_ERROR_ERS HAL_FLASH_ERROR_ERS + +/** + * @} + */ + +/** @defgroup HAL_SYSCFG_Aliased_Defines HAL SYSCFG Aliased Defines maintained for legacy purpose + * @{ + */ + +#define SYSCFG_FASTMODEPLUS_I2C_PB6 I2C_FASTMODEPLUS_PB6 +#define SYSCFG_FASTMODEPLUS_I2C_PB7 I2C_FASTMODEPLUS_PB7 +#define SYSCFG_FASTMODEPLUS_I2C_PB8 I2C_FASTMODEPLUS_PB8 +#define SYSCFG_FASTMODEPLUS_I2C_PB9 I2C_FASTMODEPLUS_PB9 +#define SYSCFG_FASTMODEPLUS_I2C1 I2C_FASTMODEPLUS_I2C1 +#define SYSCFG_FASTMODEPLUS_I2C2 I2C_FASTMODEPLUS_I2C2 +#define SYSCFG_FASTMODEPLUS_I2C3 I2C_FASTMODEPLUS_I2C3 + +/** + * @} + */ + + +/** @defgroup LL_FSMC_Aliased_Defines LL FSMC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define FSMC_NORSRAM_TYPEDEF FSMC_NORSRAM_TypeDef +#define FSMC_NORSRAM_EXTENDED_TYPEDEF FSMC_NORSRAM_EXTENDED_TypeDef +/** + * @} + */ + +/** @defgroup HAL_GPIO_Aliased_Macros HAL GPIO Aliased Macros maintained for legacy purpose + * @{ + */ +#define GET_GPIO_SOURCE GPIO_GET_INDEX +#define GET_GPIO_INDEX GPIO_GET_INDEX +/** + * @} + */ + + +/** @defgroup HAL_I2C_Aliased_Defines HAL I2C Aliased Defines maintained for legacy purpose + * @{ + */ +#define I2C_DUALADDRESS_DISABLED I2C_DUALADDRESS_DISABLE +#define I2C_DUALADDRESS_ENABLED I2C_DUALADDRESS_ENABLE +#define I2C_GENERALCALL_DISABLED I2C_GENERALCALL_DISABLE +#define I2C_GENERALCALL_ENABLED I2C_GENERALCALL_ENABLE +#define I2C_NOSTRETCH_DISABLED I2C_NOSTRETCH_DISABLE +#define I2C_NOSTRETCH_ENABLED I2C_NOSTRETCH_ENABLE +#define I2C_ANALOGFILTER_ENABLED I2C_ANALOGFILTER_ENABLE +#define I2C_ANALOGFILTER_DISABLED I2C_ANALOGFILTER_DISABLE +/** + * @} + */ + +/** @defgroup HAL_IRDA_Aliased_Defines HAL IRDA Aliased Defines maintained for legacy purpose + * @{ + */ +#define IRDA_ONE_BIT_SAMPLE_DISABLED IRDA_ONE_BIT_SAMPLE_DISABLE +#define IRDA_ONE_BIT_SAMPLE_ENABLED IRDA_ONE_BIT_SAMPLE_ENABLE + +/** + * @} + */ + +/** @defgroup HAL_IWDG_Aliased_Defines HAL IWDG Aliased Defines maintained for legacy purpose + * @{ + */ +#define KR_KEY_RELOAD IWDG_KEY_RELOAD +#define KR_KEY_ENABLE IWDG_KEY_ENABLE +#define KR_KEY_EWA IWDG_KEY_WRITE_ACCESS_ENABLE +#define KR_KEY_DWA IWDG_KEY_WRITE_ACCESS_DISABLE +/** + * @} + */ + +/** @defgroup HAL_LPTIM_Aliased_Defines HAL LPTIM Aliased Defines maintained for legacy purpose + * @{ + */ + +#define LPTIM_CLOCKSAMPLETIME_DIRECTTRANSISTION LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION +#define LPTIM_CLOCKSAMPLETIME_2TRANSISTIONS LPTIM_CLOCKSAMPLETIME_2TRANSITIONS +#define LPTIM_CLOCKSAMPLETIME_4TRANSISTIONS LPTIM_CLOCKSAMPLETIME_4TRANSITIONS +#define LPTIM_CLOCKSAMPLETIME_8TRANSISTIONS LPTIM_CLOCKSAMPLETIME_8TRANSITIONS + +#define LPTIM_CLOCKPOLARITY_RISINGEDGE LPTIM_CLOCKPOLARITY_RISING +#define LPTIM_CLOCKPOLARITY_FALLINGEDGE LPTIM_CLOCKPOLARITY_FALLING +#define LPTIM_CLOCKPOLARITY_BOTHEDGES LPTIM_CLOCKPOLARITY_RISING_FALLING +/** + * @} + */ + +/** @defgroup HAL_NAND_Aliased_Defines HAL NAND Aliased Defines maintained for legacy purpose + * @{ + */ +#define NAND_AddressTypedef NAND_AddressTypeDef + +#define __ARRAY_ADDRESS ARRAY_ADDRESS +#define __ADDR_1st_CYCLE ADDR_1ST_CYCLE +#define __ADDR_2nd_CYCLE ADDR_2ND_CYCLE +#define __ADDR_3rd_CYCLE ADDR_3RD_CYCLE +#define __ADDR_4th_CYCLE ADDR_4TH_CYCLE +/** + * @} + */ + +/** @defgroup HAL_NOR_Aliased_Defines HAL NOR Aliased Defines maintained for legacy purpose + * @{ + */ +#define NOR_StatusTypedef HAL_NOR_StatusTypeDef +#define NOR_SUCCESS HAL_NOR_STATUS_SUCCESS +#define NOR_ONGOING HAL_NOR_STATUS_ONGOING +#define NOR_ERROR HAL_NOR_STATUS_ERROR +#define NOR_TIMEOUT HAL_NOR_STATUS_TIMEOUT + +#define __NOR_WRITE NOR_WRITE +#define __NOR_ADDR_SHIFT NOR_ADDR_SHIFT +/** + * @} + */ + +/** @defgroup HAL_OPAMP_Aliased_Defines HAL OPAMP Aliased Defines maintained for legacy purpose + * @{ + */ + +#define OPAMP_NONINVERTINGINPUT_VP0 OPAMP_NONINVERTINGINPUT_IO0 +#define OPAMP_NONINVERTINGINPUT_VP1 OPAMP_NONINVERTINGINPUT_IO1 +#define OPAMP_NONINVERTINGINPUT_VP2 OPAMP_NONINVERTINGINPUT_IO2 +#define OPAMP_NONINVERTINGINPUT_VP3 OPAMP_NONINVERTINGINPUT_IO3 + +#define OPAMP_SEC_NONINVERTINGINPUT_VP0 OPAMP_SEC_NONINVERTINGINPUT_IO0 +#define OPAMP_SEC_NONINVERTINGINPUT_VP1 OPAMP_SEC_NONINVERTINGINPUT_IO1 +#define OPAMP_SEC_NONINVERTINGINPUT_VP2 OPAMP_SEC_NONINVERTINGINPUT_IO2 +#define OPAMP_SEC_NONINVERTINGINPUT_VP3 OPAMP_SEC_NONINVERTINGINPUT_IO3 + +#define OPAMP_INVERTINGINPUT_VM0 OPAMP_INVERTINGINPUT_IO0 +#define OPAMP_INVERTINGINPUT_VM1 OPAMP_INVERTINGINPUT_IO1 + +#define IOPAMP_INVERTINGINPUT_VM0 OPAMP_INVERTINGINPUT_IO0 +#define IOPAMP_INVERTINGINPUT_VM1 OPAMP_INVERTINGINPUT_IO1 + +#define OPAMP_SEC_INVERTINGINPUT_VM0 OPAMP_SEC_INVERTINGINPUT_IO0 +#define OPAMP_SEC_INVERTINGINPUT_VM1 OPAMP_SEC_INVERTINGINPUT_IO1 + +#define OPAMP_INVERTINGINPUT_VINM OPAMP_SEC_INVERTINGINPUT_IO1 + +#define OPAMP_PGACONNECT_NO OPAMP_PGA_CONNECT_INVERTINGINPUT_NO +#define OPAMP_PGACONNECT_VM0 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 +#define OPAMP_PGACONNECT_VM1 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 + +/** + * @} + */ + +/** @defgroup HAL_I2S_Aliased_Defines HAL I2S Aliased Defines maintained for legacy purpose + * @{ + */ +#define I2S_STANDARD_PHILLIPS I2S_STANDARD_PHILIPS +/** + * @} + */ + +/** @defgroup HAL_PCCARD_Aliased_Defines HAL PCCARD Aliased Defines maintained for legacy purpose + * @{ + */ + +/* Compact Flash-ATA registers description */ +#define CF_DATA ATA_DATA +#define CF_SECTOR_COUNT ATA_SECTOR_COUNT +#define CF_SECTOR_NUMBER ATA_SECTOR_NUMBER +#define CF_CYLINDER_LOW ATA_CYLINDER_LOW +#define CF_CYLINDER_HIGH ATA_CYLINDER_HIGH +#define CF_CARD_HEAD ATA_CARD_HEAD +#define CF_STATUS_CMD ATA_STATUS_CMD +#define CF_STATUS_CMD_ALTERNATE ATA_STATUS_CMD_ALTERNATE +#define CF_COMMON_DATA_AREA ATA_COMMON_DATA_AREA + +/* Compact Flash-ATA commands */ +#define CF_READ_SECTOR_CMD ATA_READ_SECTOR_CMD +#define CF_WRITE_SECTOR_CMD ATA_WRITE_SECTOR_CMD +#define CF_ERASE_SECTOR_CMD ATA_ERASE_SECTOR_CMD +#define CF_IDENTIFY_CMD ATA_IDENTIFY_CMD + +#define PCCARD_StatusTypedef HAL_PCCARD_StatusTypeDef +#define PCCARD_SUCCESS HAL_PCCARD_STATUS_SUCCESS +#define PCCARD_ONGOING HAL_PCCARD_STATUS_ONGOING +#define PCCARD_ERROR HAL_PCCARD_STATUS_ERROR +#define PCCARD_TIMEOUT HAL_PCCARD_STATUS_TIMEOUT +/** + * @} + */ + +/** @defgroup HAL_RTC_Aliased_Defines HAL RTC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define FORMAT_BIN RTC_FORMAT_BIN +#define FORMAT_BCD RTC_FORMAT_BCD + +#define RTC_ALARMSUBSECONDMASK_None RTC_ALARMSUBSECONDMASK_NONE +#define RTC_TAMPERERASEBACKUP_ENABLED RTC_TAMPER_ERASE_BACKUP_ENABLE +#define RTC_TAMPERERASEBACKUP_DISABLED RTC_TAMPER_ERASE_BACKUP_DISABLE +#define RTC_TAMPERMASK_FLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE +#define RTC_TAMPERMASK_FLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE + +#define RTC_MASKTAMPERFLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE +#define RTC_MASKTAMPERFLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE +#define RTC_TAMPERERASEBACKUP_ENABLED RTC_TAMPER_ERASE_BACKUP_ENABLE +#define RTC_TAMPERERASEBACKUP_DISABLED RTC_TAMPER_ERASE_BACKUP_DISABLE +#define RTC_MASKTAMPERFLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE +#define RTC_MASKTAMPERFLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE +#define RTC_TAMPER1_2_INTERRUPT RTC_ALL_TAMPER_INTERRUPT +#define RTC_TAMPER1_2_3_INTERRUPT RTC_ALL_TAMPER_INTERRUPT + +/** + * @} + */ + + +/** @defgroup HAL_SMARTCARD_Aliased_Defines HAL SMARTCARD Aliased Defines maintained for legacy purpose + * @{ + */ +#define SMARTCARD_NACK_ENABLED SMARTCARD_NACK_ENABLE +#define SMARTCARD_NACK_DISABLED SMARTCARD_NACK_DISABLE + +#define SMARTCARD_ONEBIT_SAMPLING_DISABLED SMARTCARD_ONE_BIT_SAMPLE_DISABLE +#define SMARTCARD_ONEBIT_SAMPLING_ENABLED SMARTCARD_ONE_BIT_SAMPLE_ENABLE +#define SMARTCARD_ONEBIT_SAMPLING_DISABLE SMARTCARD_ONE_BIT_SAMPLE_DISABLE +#define SMARTCARD_ONEBIT_SAMPLING_ENABLE SMARTCARD_ONE_BIT_SAMPLE_ENABLE + +#define SMARTCARD_TIMEOUT_DISABLED SMARTCARD_TIMEOUT_DISABLE +#define SMARTCARD_TIMEOUT_ENABLED SMARTCARD_TIMEOUT_ENABLE + +#define SMARTCARD_LASTBIT_DISABLED SMARTCARD_LASTBIT_DISABLE +#define SMARTCARD_LASTBIT_ENABLED SMARTCARD_LASTBIT_ENABLE +/** + * @} + */ + + + /** @defgroup HAL_SMBUS_Aliased_Defines HAL SMBUS Aliased Defines maintained for legacy purpose + * @{ + */ +#define SMBUS_DUALADDRESS_DISABLED SMBUS_DUALADDRESS_DISABLE +#define SMBUS_DUALADDRESS_ENABLED SMBUS_DUALADDRESS_ENABLE +#define SMBUS_GENERALCALL_DISABLED SMBUS_GENERALCALL_DISABLE +#define SMBUS_GENERALCALL_ENABLED SMBUS_GENERALCALL_ENABLE +#define SMBUS_NOSTRETCH_DISABLED SMBUS_NOSTRETCH_DISABLE +#define SMBUS_NOSTRETCH_ENABLED SMBUS_NOSTRETCH_ENABLE +#define SMBUS_ANALOGFILTER_ENABLED SMBUS_ANALOGFILTER_ENABLE +#define SMBUS_ANALOGFILTER_DISABLED SMBUS_ANALOGFILTER_DISABLE +#define HAL_SMBUS_STATE_SLAVE_LISTEN HAL_SMBUS_STATE_LISTEN +/** + * @} + */ + + /** @defgroup HAL_SPI_Aliased_Defines HAL SPI Aliased Defines maintained for legacy purpose + * @{ + */ +#define SPI_TIMODE_DISABLED SPI_TIMODE_DISABLE +#define SPI_TIMODE_ENABLED SPI_TIMODE_ENABLE + +#define SPI_CRCCALCULATION_DISABLED SPI_CRCCALCULATION_DISABLE +#define SPI_CRCCALCULATION_ENABLED SPI_CRCCALCULATION_ENABLE + +#define SPI_NSS_PULSE_DISABLED SPI_NSS_PULSE_DISABLE +#define SPI_NSS_PULSE_ENABLED SPI_NSS_PULSE_ENABLE + +/** + * @} + */ + +/** @defgroup HAL_TIM_Aliased_Defines HAL TIM Aliased Defines maintained for legacy purpose + * @{ + */ +#define CCER_CCxE_MASK TIM_CCER_CCxE_MASK +#define CCER_CCxNE_MASK TIM_CCER_CCxNE_MASK + +#define TIM_DMABase_CR1 TIM_DMABASE_CR1 +#define TIM_DMABase_CR2 TIM_DMABASE_CR2 +#define TIM_DMABase_SMCR TIM_DMABASE_SMCR +#define TIM_DMABase_DIER TIM_DMABASE_DIER +#define TIM_DMABase_SR TIM_DMABASE_SR +#define TIM_DMABase_EGR TIM_DMABASE_EGR +#define TIM_DMABase_CCMR1 TIM_DMABASE_CCMR1 +#define TIM_DMABase_CCMR2 TIM_DMABASE_CCMR2 +#define TIM_DMABase_CCER TIM_DMABASE_CCER +#define TIM_DMABase_CNT TIM_DMABASE_CNT +#define TIM_DMABase_PSC TIM_DMABASE_PSC +#define TIM_DMABase_ARR TIM_DMABASE_ARR +#define TIM_DMABase_RCR TIM_DMABASE_RCR +#define TIM_DMABase_CCR1 TIM_DMABASE_CCR1 +#define TIM_DMABase_CCR2 TIM_DMABASE_CCR2 +#define TIM_DMABase_CCR3 TIM_DMABASE_CCR3 +#define TIM_DMABase_CCR4 TIM_DMABASE_CCR4 +#define TIM_DMABase_BDTR TIM_DMABASE_BDTR +#define TIM_DMABase_DCR TIM_DMABASE_DCR +#define TIM_DMABase_DMAR TIM_DMABASE_DMAR +#define TIM_DMABase_OR1 TIM_DMABASE_OR1 +#define TIM_DMABase_CCMR3 TIM_DMABASE_CCMR3 +#define TIM_DMABase_CCR5 TIM_DMABASE_CCR5 +#define TIM_DMABase_CCR6 TIM_DMABASE_CCR6 +#define TIM_DMABase_OR2 TIM_DMABASE_OR2 +#define TIM_DMABase_OR3 TIM_DMABASE_OR3 +#define TIM_DMABase_OR TIM_DMABASE_OR + +#define TIM_EventSource_Update TIM_EVENTSOURCE_UPDATE +#define TIM_EventSource_CC1 TIM_EVENTSOURCE_CC1 +#define TIM_EventSource_CC2 TIM_EVENTSOURCE_CC2 +#define TIM_EventSource_CC3 TIM_EVENTSOURCE_CC3 +#define TIM_EventSource_CC4 TIM_EVENTSOURCE_CC4 +#define TIM_EventSource_COM TIM_EVENTSOURCE_COM +#define TIM_EventSource_Trigger TIM_EVENTSOURCE_TRIGGER +#define TIM_EventSource_Break TIM_EVENTSOURCE_BREAK +#define TIM_EventSource_Break2 TIM_EVENTSOURCE_BREAK2 + +#define TIM_DMABurstLength_1Transfer TIM_DMABURSTLENGTH_1TRANSFER +#define TIM_DMABurstLength_2Transfers TIM_DMABURSTLENGTH_2TRANSFERS +#define TIM_DMABurstLength_3Transfers TIM_DMABURSTLENGTH_3TRANSFERS +#define TIM_DMABurstLength_4Transfers TIM_DMABURSTLENGTH_4TRANSFERS +#define TIM_DMABurstLength_5Transfers TIM_DMABURSTLENGTH_5TRANSFERS +#define TIM_DMABurstLength_6Transfers TIM_DMABURSTLENGTH_6TRANSFERS +#define TIM_DMABurstLength_7Transfers TIM_DMABURSTLENGTH_7TRANSFERS +#define TIM_DMABurstLength_8Transfers TIM_DMABURSTLENGTH_8TRANSFERS +#define TIM_DMABurstLength_9Transfers TIM_DMABURSTLENGTH_9TRANSFERS +#define TIM_DMABurstLength_10Transfers TIM_DMABURSTLENGTH_10TRANSFERS +#define TIM_DMABurstLength_11Transfers TIM_DMABURSTLENGTH_11TRANSFERS +#define TIM_DMABurstLength_12Transfers TIM_DMABURSTLENGTH_12TRANSFERS +#define TIM_DMABurstLength_13Transfers TIM_DMABURSTLENGTH_13TRANSFERS +#define TIM_DMABurstLength_14Transfers TIM_DMABURSTLENGTH_14TRANSFERS +#define TIM_DMABurstLength_15Transfers TIM_DMABURSTLENGTH_15TRANSFERS +#define TIM_DMABurstLength_16Transfers TIM_DMABURSTLENGTH_16TRANSFERS +#define TIM_DMABurstLength_17Transfers TIM_DMABURSTLENGTH_17TRANSFERS +#define TIM_DMABurstLength_18Transfers TIM_DMABURSTLENGTH_18TRANSFERS + +/** + * @} + */ + +/** @defgroup HAL_TSC_Aliased_Defines HAL TSC Aliased Defines maintained for legacy purpose + * @{ + */ +#define TSC_SYNC_POL_FALL TSC_SYNC_POLARITY_FALLING +#define TSC_SYNC_POL_RISE_HIGH TSC_SYNC_POLARITY_RISING +/** + * @} + */ + +/** @defgroup HAL_UART_Aliased_Defines HAL UART Aliased Defines maintained for legacy purpose + * @{ + */ +#define UART_ONEBIT_SAMPLING_DISABLED UART_ONE_BIT_SAMPLE_DISABLE +#define UART_ONEBIT_SAMPLING_ENABLED UART_ONE_BIT_SAMPLE_ENABLE +#define UART_ONE_BIT_SAMPLE_DISABLED UART_ONE_BIT_SAMPLE_DISABLE +#define UART_ONE_BIT_SAMPLE_ENABLED UART_ONE_BIT_SAMPLE_ENABLE + +#define __HAL_UART_ONEBIT_ENABLE __HAL_UART_ONE_BIT_SAMPLE_ENABLE +#define __HAL_UART_ONEBIT_DISABLE __HAL_UART_ONE_BIT_SAMPLE_DISABLE + +#define __DIV_SAMPLING16 UART_DIV_SAMPLING16 +#define __DIVMANT_SAMPLING16 UART_DIVMANT_SAMPLING16 +#define __DIVFRAQ_SAMPLING16 UART_DIVFRAQ_SAMPLING16 +#define __UART_BRR_SAMPLING16 UART_BRR_SAMPLING16 + +#define __DIV_SAMPLING8 UART_DIV_SAMPLING8 +#define __DIVMANT_SAMPLING8 UART_DIVMANT_SAMPLING8 +#define __DIVFRAQ_SAMPLING8 UART_DIVFRAQ_SAMPLING8 +#define __UART_BRR_SAMPLING8 UART_BRR_SAMPLING8 + +#define UART_WAKEUPMETHODE_IDLELINE UART_WAKEUPMETHOD_IDLELINE +#define UART_WAKEUPMETHODE_ADDRESSMARK UART_WAKEUPMETHOD_ADDRESSMARK + +/** + * @} + */ + + +/** @defgroup HAL_USART_Aliased_Defines HAL USART Aliased Defines maintained for legacy purpose + * @{ + */ + +#define USART_CLOCK_DISABLED USART_CLOCK_DISABLE +#define USART_CLOCK_ENABLED USART_CLOCK_ENABLE + +#define USARTNACK_ENABLED USART_NACK_ENABLE +#define USARTNACK_DISABLED USART_NACK_DISABLE +/** + * @} + */ + +/** @defgroup HAL_WWDG_Aliased_Defines HAL WWDG Aliased Defines maintained for legacy purpose + * @{ + */ +#define CFR_BASE WWDG_CFR_BASE + +/** + * @} + */ + +/** @defgroup HAL_CAN_Aliased_Defines HAL CAN Aliased Defines maintained for legacy purpose + * @{ + */ +#define CAN_FilterFIFO0 CAN_FILTER_FIFO0 +#define CAN_FilterFIFO1 CAN_FILTER_FIFO1 +#define CAN_IT_RQCP0 CAN_IT_TME +#define CAN_IT_RQCP1 CAN_IT_TME +#define CAN_IT_RQCP2 CAN_IT_TME +#define INAK_TIMEOUT CAN_TIMEOUT_VALUE +#define SLAK_TIMEOUT CAN_TIMEOUT_VALUE +#define CAN_TXSTATUS_FAILED ((uint8_t)0x00) +#define CAN_TXSTATUS_OK ((uint8_t)0x01) +#define CAN_TXSTATUS_PENDING ((uint8_t)0x02) + +/** + * @} + */ + +/** @defgroup HAL_ETH_Aliased_Defines HAL ETH Aliased Defines maintained for legacy purpose + * @{ + */ + +#define VLAN_TAG ETH_VLAN_TAG +#define MIN_ETH_PAYLOAD ETH_MIN_ETH_PAYLOAD +#define MAX_ETH_PAYLOAD ETH_MAX_ETH_PAYLOAD +#define JUMBO_FRAME_PAYLOAD ETH_JUMBO_FRAME_PAYLOAD +#define MACMIIAR_CR_MASK ETH_MACMIIAR_CR_MASK +#define MACCR_CLEAR_MASK ETH_MACCR_CLEAR_MASK +#define MACFCR_CLEAR_MASK ETH_MACFCR_CLEAR_MASK +#define DMAOMR_CLEAR_MASK ETH_DMAOMR_CLEAR_MASK + +#define ETH_MMCCR ((uint32_t)0x00000100) +#define ETH_MMCRIR ((uint32_t)0x00000104) +#define ETH_MMCTIR ((uint32_t)0x00000108) +#define ETH_MMCRIMR ((uint32_t)0x0000010C) +#define ETH_MMCTIMR ((uint32_t)0x00000110) +#define ETH_MMCTGFSCCR ((uint32_t)0x0000014C) +#define ETH_MMCTGFMSCCR ((uint32_t)0x00000150) +#define ETH_MMCTGFCR ((uint32_t)0x00000168) +#define ETH_MMCRFCECR ((uint32_t)0x00000194) +#define ETH_MMCRFAECR ((uint32_t)0x00000198) +#define ETH_MMCRGUFCR ((uint32_t)0x000001C4) + +/** + * @} + */ + +/** @defgroup HAL_PPP_Aliased_Defines HAL PPP Aliased Defines maintained for legacy purpose + * @{ + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup HAL_CRYP_Aliased_Functions HAL CRYP Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_CRYP_ComputationCpltCallback HAL_CRYPEx_ComputationCpltCallback +/** + * @} + */ + +/** @defgroup HAL_HASH_Aliased_Functions HAL HASH Aliased Functions maintained for legacy purpose + * @{ + */ + +#define HAL_HMAC_MD5_Finish HAL_HASH_MD5_Finish +#define HAL_HMAC_SHA1_Finish HAL_HASH_SHA1_Finish +#define HAL_HMAC_SHA224_Finish HAL_HASH_SHA224_Finish +#define HAL_HMAC_SHA256_Finish HAL_HASH_SHA256_Finish + +/*HASH Algorithm Selection*/ + +#define HASH_AlgoSelection_SHA1 HASH_ALGOSELECTION_SHA1 +#define HASH_AlgoSelection_SHA224 HASH_ALGOSELECTION_SHA224 +#define HASH_AlgoSelection_SHA256 HASH_ALGOSELECTION_SHA256 +#define HASH_AlgoSelection_MD5 HASH_ALGOSELECTION_MD5 + +#define HASH_AlgoMode_HASH HASH_ALGOMODE_HASH +#define HASH_AlgoMode_HMAC HASH_ALGOMODE_HMAC + +#define HASH_HMACKeyType_ShortKey HASH_HMAC_KEYTYPE_SHORTKEY +#define HASH_HMACKeyType_LongKey HASH_HMAC_KEYTYPE_LONGKEY +/** + * @} + */ + +/** @defgroup HAL_Aliased_Functions HAL Generic Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_EnableDBGSleepMode HAL_DBGMCU_EnableDBGSleepMode +#define HAL_DisableDBGSleepMode HAL_DBGMCU_DisableDBGSleepMode +#define HAL_EnableDBGStopMode HAL_DBGMCU_EnableDBGStopMode +#define HAL_DisableDBGStopMode HAL_DBGMCU_DisableDBGStopMode +#define HAL_EnableDBGStandbyMode HAL_DBGMCU_EnableDBGStandbyMode +#define HAL_DisableDBGStandbyMode HAL_DBGMCU_DisableDBGStandbyMode +#define HAL_DBG_LowPowerConfig(Periph, cmd) (((cmd)==ENABLE)? HAL_DBGMCU_DBG_EnableLowPowerConfig(Periph) : HAL_DBGMCU_DBG_DisableLowPowerConfig(Periph)) +#define HAL_VREFINT_OutputSelect HAL_SYSCFG_VREFINT_OutputSelect +#define HAL_Lock_Cmd(cmd) (((cmd)==ENABLE) ? HAL_SYSCFG_Enable_Lock_VREFINT() : HAL_SYSCFG_Disable_Lock_VREFINT()) +#define HAL_VREFINT_Cmd(cmd) (((cmd)==ENABLE)? HAL_SYSCFG_EnableVREFINT() : HAL_SYSCFG_DisableVREFINT()) +#define HAL_ADC_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINT() : HAL_ADCEx_DisableVREFINT()) +#define HAL_ADC_EnableBufferSensor_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINTTempSensor() : HAL_ADCEx_DisableVREFINTTempSensor()) +/** + * @} + */ + +/** @defgroup HAL_FLASH_Aliased_Functions HAL FLASH Aliased Functions maintained for legacy purpose + * @{ + */ +#define FLASH_HalfPageProgram HAL_FLASHEx_HalfPageProgram +#define FLASH_EnableRunPowerDown HAL_FLASHEx_EnableRunPowerDown +#define FLASH_DisableRunPowerDown HAL_FLASHEx_DisableRunPowerDown +#define HAL_DATA_EEPROMEx_Unlock HAL_FLASHEx_DATAEEPROM_Unlock +#define HAL_DATA_EEPROMEx_Lock HAL_FLASHEx_DATAEEPROM_Lock +#define HAL_DATA_EEPROMEx_Erase HAL_FLASHEx_DATAEEPROM_Erase +#define HAL_DATA_EEPROMEx_Program HAL_FLASHEx_DATAEEPROM_Program + + /** + * @} + */ + +/** @defgroup HAL_I2C_Aliased_Functions HAL I2C Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_I2CEx_AnalogFilter_Config HAL_I2CEx_ConfigAnalogFilter +#define HAL_I2CEx_DigitalFilter_Config HAL_I2CEx_ConfigDigitalFilter + +#define HAL_I2CFastModePlusConfig(SYSCFG_I2CFastModePlus, cmd) (((cmd)==ENABLE)? HAL_I2CEx_EnableFastModePlus(SYSCFG_I2CFastModePlus): HAL_I2CEx_DisableFastModePlus(SYSCFG_I2CFastModePlus)) + /** + * @} + */ + +/** @defgroup HAL_PWR_Aliased HAL PWR Aliased maintained for legacy purpose + * @{ + */ +#define HAL_PWR_PVDConfig HAL_PWR_ConfigPVD +#define HAL_PWR_DisableBkUpReg HAL_PWREx_DisableBkUpReg +#define HAL_PWR_DisableFlashPowerDown HAL_PWREx_DisableFlashPowerDown +#define HAL_PWR_DisableVddio2Monitor HAL_PWREx_DisableVddio2Monitor +#define HAL_PWR_EnableBkUpReg HAL_PWREx_EnableBkUpReg +#define HAL_PWR_EnableFlashPowerDown HAL_PWREx_EnableFlashPowerDown +#define HAL_PWR_EnableVddio2Monitor HAL_PWREx_EnableVddio2Monitor +#define HAL_PWR_PVD_PVM_IRQHandler HAL_PWREx_PVD_PVM_IRQHandler +#define HAL_PWR_PVDLevelConfig HAL_PWR_ConfigPVD +#define HAL_PWR_Vddio2Monitor_IRQHandler HAL_PWREx_Vddio2Monitor_IRQHandler +#define HAL_PWR_Vddio2MonitorCallback HAL_PWREx_Vddio2MonitorCallback +#define HAL_PWREx_ActivateOverDrive HAL_PWREx_EnableOverDrive +#define HAL_PWREx_DeactivateOverDrive HAL_PWREx_DisableOverDrive +#define HAL_PWREx_DisableSDADCAnalog HAL_PWREx_DisableSDADC +#define HAL_PWREx_EnableSDADCAnalog HAL_PWREx_EnableSDADC +#define HAL_PWREx_PVMConfig HAL_PWREx_ConfigPVM + +#define PWR_MODE_NORMAL PWR_PVD_MODE_NORMAL +#define PWR_MODE_IT_RISING PWR_PVD_MODE_IT_RISING +#define PWR_MODE_IT_FALLING PWR_PVD_MODE_IT_FALLING +#define PWR_MODE_IT_RISING_FALLING PWR_PVD_MODE_IT_RISING_FALLING +#define PWR_MODE_EVENT_RISING PWR_PVD_MODE_EVENT_RISING +#define PWR_MODE_EVENT_FALLING PWR_PVD_MODE_EVENT_FALLING +#define PWR_MODE_EVENT_RISING_FALLING PWR_PVD_MODE_EVENT_RISING_FALLING + +#define CR_OFFSET_BB PWR_CR_OFFSET_BB +#define CSR_OFFSET_BB PWR_CSR_OFFSET_BB + +#define DBP_BitNumber DBP_BIT_NUMBER +#define PVDE_BitNumber PVDE_BIT_NUMBER +#define PMODE_BitNumber PMODE_BIT_NUMBER +#define EWUP_BitNumber EWUP_BIT_NUMBER +#define FPDS_BitNumber FPDS_BIT_NUMBER +#define ODEN_BitNumber ODEN_BIT_NUMBER +#define ODSWEN_BitNumber ODSWEN_BIT_NUMBER +#define MRLVDS_BitNumber MRLVDS_BIT_NUMBER +#define LPLVDS_BitNumber LPLVDS_BIT_NUMBER +#define BRE_BitNumber BRE_BIT_NUMBER + +#define PWR_MODE_EVT PWR_PVD_MODE_NORMAL + +#define IS_PWR_REGULATOR_VOLTAGE IS_PWR_VOLTAGE_SCALING_RANGE + /** + * @} + */ + +/** @defgroup HAL_SMBUS_Aliased_Functions HAL SMBUS Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_SMBUS_Slave_Listen_IT HAL_SMBUS_EnableListen_IT +#define HAL_SMBUS_SlaveAddrCallback HAL_SMBUS_AddrCallback +#define HAL_SMBUS_SlaveListenCpltCallback HAL_SMBUS_ListenCpltCallback +/** + * @} + */ + +/** @defgroup HAL_SPI_Aliased_Functions HAL SPI Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_SPI_FlushRxFifo HAL_SPIEx_FlushRxFifo +/** + * @} + */ + +/** @defgroup HAL_TIM_Aliased_Functions HAL TIM Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_TIM_DMADelayPulseCplt TIM_DMADelayPulseCplt +#define HAL_TIM_DMAError TIM_DMAError +#define HAL_TIM_DMACaptureCplt TIM_DMACaptureCplt +#define HAL_TIMEx_DMACommutationCplt TIMEx_DMACommutationCplt +/** + * @} + */ + +/** @defgroup HAL_UART_Aliased_Functions HAL UART Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_UART_WakeupCallback HAL_UARTEx_WakeupCallback +/** + * @} + */ + + + /** @defgroup HAL_PPP_Aliased_Functions HAL PPP Aliased Functions maintained for legacy purpose + * @{ + */ + +/** + * @} + */ + +/* Exported macros ------------------------------------------------------------*/ + +/** @defgroup HAL_AES_Aliased_Macros HAL CRYP Aliased Macros maintained for legacy purpose + * @{ + */ +#define AES_IT_CC CRYP_IT_CC +#define AES_IT_ERR CRYP_IT_ERR +#define AES_FLAG_CCF CRYP_FLAG_CCF +/** + * @} + */ + +/** @defgroup HAL_Aliased_Macros HAL Generic Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_GET_BOOT_MODE __HAL_SYSCFG_GET_BOOT_MODE +#define __HAL_REMAPMEMORY_FLASH __HAL_SYSCFG_REMAPMEMORY_FLASH +#define __HAL_REMAPMEMORY_SYSTEMFLASH __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH +#define __HAL_REMAPMEMORY_SRAM __HAL_SYSCFG_REMAPMEMORY_SRAM +#define __HAL_REMAPMEMORY_FMC __HAL_SYSCFG_REMAPMEMORY_FMC +#define __HAL_REMAPMEMORY_FMC_SDRAM __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM +#define __HAL_REMAPMEMORY_FSMC __HAL_SYSCFG_REMAPMEMORY_FSMC +#define __HAL_REMAPMEMORY_QUADSPI __HAL_SYSCFG_REMAPMEMORY_QUADSPI +#define __HAL_FMC_BANK __HAL_SYSCFG_FMC_BANK +#define __HAL_GET_FLAG __HAL_SYSCFG_GET_FLAG +#define __HAL_CLEAR_FLAG __HAL_SYSCFG_CLEAR_FLAG +#define __HAL_VREFINT_OUT_ENABLE __HAL_SYSCFG_VREFINT_OUT_ENABLE +#define __HAL_VREFINT_OUT_DISABLE __HAL_SYSCFG_VREFINT_OUT_DISABLE + +#define SYSCFG_FLAG_VREF_READY SYSCFG_FLAG_VREFINT_READY +#define SYSCFG_FLAG_RC48 RCC_FLAG_HSI48 +#define IS_SYSCFG_FASTMODEPLUS_CONFIG IS_I2C_FASTMODEPLUS +#define UFB_MODE_BitNumber UFB_MODE_BIT_NUMBER +#define CMP_PD_BitNumber CMP_PD_BIT_NUMBER + +/** + * @} + */ + + +/** @defgroup HAL_ADC_Aliased_Macros HAL ADC Aliased Macros maintained for legacy purpose + * @{ + */ +#define __ADC_ENABLE __HAL_ADC_ENABLE +#define __ADC_DISABLE __HAL_ADC_DISABLE +#define __HAL_ADC_ENABLING_CONDITIONS ADC_ENABLING_CONDITIONS +#define __HAL_ADC_DISABLING_CONDITIONS ADC_DISABLING_CONDITIONS +#define __HAL_ADC_IS_ENABLED ADC_IS_ENABLE +#define __ADC_IS_ENABLED ADC_IS_ENABLE +#define __HAL_ADC_IS_SOFTWARE_START_REGULAR ADC_IS_SOFTWARE_START_REGULAR +#define __HAL_ADC_IS_SOFTWARE_START_INJECTED ADC_IS_SOFTWARE_START_INJECTED +#define __HAL_ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED +#define __HAL_ADC_IS_CONVERSION_ONGOING_REGULAR ADC_IS_CONVERSION_ONGOING_REGULAR +#define __HAL_ADC_IS_CONVERSION_ONGOING_INJECTED ADC_IS_CONVERSION_ONGOING_INJECTED +#define __HAL_ADC_IS_CONVERSION_ONGOING ADC_IS_CONVERSION_ONGOING +#define __HAL_ADC_CLEAR_ERRORCODE ADC_CLEAR_ERRORCODE + +#define __HAL_ADC_GET_RESOLUTION ADC_GET_RESOLUTION +#define __HAL_ADC_JSQR_RK ADC_JSQR_RK +#define __HAL_ADC_CFGR_AWD1CH ADC_CFGR_AWD1CH_SHIFT +#define __HAL_ADC_CFGR_AWD23CR ADC_CFGR_AWD23CR +#define __HAL_ADC_CFGR_INJECT_AUTO_CONVERSION ADC_CFGR_INJECT_AUTO_CONVERSION +#define __HAL_ADC_CFGR_INJECT_CONTEXT_QUEUE ADC_CFGR_INJECT_CONTEXT_QUEUE +#define __HAL_ADC_CFGR_INJECT_DISCCONTINUOUS ADC_CFGR_INJECT_DISCCONTINUOUS +#define __HAL_ADC_CFGR_REG_DISCCONTINUOUS ADC_CFGR_REG_DISCCONTINUOUS +#define __HAL_ADC_CFGR_DISCONTINUOUS_NUM ADC_CFGR_DISCONTINUOUS_NUM +#define __HAL_ADC_CFGR_AUTOWAIT ADC_CFGR_AUTOWAIT +#define __HAL_ADC_CFGR_CONTINUOUS ADC_CFGR_CONTINUOUS +#define __HAL_ADC_CFGR_OVERRUN ADC_CFGR_OVERRUN +#define __HAL_ADC_CFGR_DMACONTREQ ADC_CFGR_DMACONTREQ +#define __HAL_ADC_CFGR_EXTSEL ADC_CFGR_EXTSEL_SET +#define __HAL_ADC_JSQR_JEXTSEL ADC_JSQR_JEXTSEL_SET +#define __HAL_ADC_OFR_CHANNEL ADC_OFR_CHANNEL +#define __HAL_ADC_DIFSEL_CHANNEL ADC_DIFSEL_CHANNEL +#define __HAL_ADC_CALFACT_DIFF_SET ADC_CALFACT_DIFF_SET +#define __HAL_ADC_CALFACT_DIFF_GET ADC_CALFACT_DIFF_GET +#define __HAL_ADC_TRX_HIGHTHRESHOLD ADC_TRX_HIGHTHRESHOLD + +#define __HAL_ADC_OFFSET_SHIFT_RESOLUTION ADC_OFFSET_SHIFT_RESOLUTION +#define __HAL_ADC_AWD1THRESHOLD_SHIFT_RESOLUTION ADC_AWD1THRESHOLD_SHIFT_RESOLUTION +#define __HAL_ADC_AWD23THRESHOLD_SHIFT_RESOLUTION ADC_AWD23THRESHOLD_SHIFT_RESOLUTION +#define __HAL_ADC_COMMON_REGISTER ADC_COMMON_REGISTER +#define __HAL_ADC_COMMON_CCR_MULTI ADC_COMMON_CCR_MULTI +#define __HAL_ADC_MULTIMODE_IS_ENABLED ADC_MULTIMODE_IS_ENABLE +#define __ADC_MULTIMODE_IS_ENABLED ADC_MULTIMODE_IS_ENABLE +#define __HAL_ADC_NONMULTIMODE_OR_MULTIMODEMASTER ADC_NONMULTIMODE_OR_MULTIMODEMASTER +#define __HAL_ADC_COMMON_ADC_OTHER ADC_COMMON_ADC_OTHER +#define __HAL_ADC_MULTI_SLAVE ADC_MULTI_SLAVE + +#define __HAL_ADC_SQR1_L ADC_SQR1_L_SHIFT +#define __HAL_ADC_JSQR_JL ADC_JSQR_JL_SHIFT +#define __HAL_ADC_JSQR_RK_JL ADC_JSQR_RK_JL +#define __HAL_ADC_CR1_DISCONTINUOUS_NUM ADC_CR1_DISCONTINUOUS_NUM +#define __HAL_ADC_CR1_SCAN ADC_CR1_SCAN_SET +#define __HAL_ADC_CONVCYCLES_MAX_RANGE ADC_CONVCYCLES_MAX_RANGE +#define __HAL_ADC_CLOCK_PRESCALER_RANGE ADC_CLOCK_PRESCALER_RANGE +#define __HAL_ADC_GET_CLOCK_PRESCALER ADC_GET_CLOCK_PRESCALER + +#define __HAL_ADC_SQR1 ADC_SQR1 +#define __HAL_ADC_SMPR1 ADC_SMPR1 +#define __HAL_ADC_SMPR2 ADC_SMPR2 +#define __HAL_ADC_SQR3_RK ADC_SQR3_RK +#define __HAL_ADC_SQR2_RK ADC_SQR2_RK +#define __HAL_ADC_SQR1_RK ADC_SQR1_RK +#define __HAL_ADC_CR2_CONTINUOUS ADC_CR2_CONTINUOUS +#define __HAL_ADC_CR1_DISCONTINUOUS ADC_CR1_DISCONTINUOUS +#define __HAL_ADC_CR1_SCANCONV ADC_CR1_SCANCONV +#define __HAL_ADC_CR2_EOCSelection ADC_CR2_EOCSelection +#define __HAL_ADC_CR2_DMAContReq ADC_CR2_DMAContReq +#define __HAL_ADC_GET_RESOLUTION ADC_GET_RESOLUTION +#define __HAL_ADC_JSQR ADC_JSQR + +#define __HAL_ADC_CHSELR_CHANNEL ADC_CHSELR_CHANNEL +#define __HAL_ADC_CFGR1_REG_DISCCONTINUOUS ADC_CFGR1_REG_DISCCONTINUOUS +#define __HAL_ADC_CFGR1_AUTOOFF ADC_CFGR1_AUTOOFF +#define __HAL_ADC_CFGR1_AUTOWAIT ADC_CFGR1_AUTOWAIT +#define __HAL_ADC_CFGR1_CONTINUOUS ADC_CFGR1_CONTINUOUS +#define __HAL_ADC_CFGR1_OVERRUN ADC_CFGR1_OVERRUN +#define __HAL_ADC_CFGR1_SCANDIR ADC_CFGR1_SCANDIR +#define __HAL_ADC_CFGR1_DMACONTREQ ADC_CFGR1_DMACONTREQ + +/** + * @} + */ + +/** @defgroup HAL_DAC_Aliased_Macros HAL DAC Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_DHR12R1_ALIGNEMENT DAC_DHR12R1_ALIGNMENT +#define __HAL_DHR12R2_ALIGNEMENT DAC_DHR12R2_ALIGNMENT +#define __HAL_DHR12RD_ALIGNEMENT DAC_DHR12RD_ALIGNMENT +#define IS_DAC_GENERATE_WAVE IS_DAC_WAVE + +/** + * @} + */ + +/** @defgroup HAL_DBGMCU_Aliased_Macros HAL DBGMCU Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_FREEZE_TIM1_DBGMCU __HAL_DBGMCU_FREEZE_TIM1 +#define __HAL_UNFREEZE_TIM1_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM1 +#define __HAL_FREEZE_TIM2_DBGMCU __HAL_DBGMCU_FREEZE_TIM2 +#define __HAL_UNFREEZE_TIM2_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM2 +#define __HAL_FREEZE_TIM3_DBGMCU __HAL_DBGMCU_FREEZE_TIM3 +#define __HAL_UNFREEZE_TIM3_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM3 +#define __HAL_FREEZE_TIM4_DBGMCU __HAL_DBGMCU_FREEZE_TIM4 +#define __HAL_UNFREEZE_TIM4_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM4 +#define __HAL_FREEZE_TIM5_DBGMCU __HAL_DBGMCU_FREEZE_TIM5 +#define __HAL_UNFREEZE_TIM5_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM5 +#define __HAL_FREEZE_TIM6_DBGMCU __HAL_DBGMCU_FREEZE_TIM6 +#define __HAL_UNFREEZE_TIM6_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM6 +#define __HAL_FREEZE_TIM7_DBGMCU __HAL_DBGMCU_FREEZE_TIM7 +#define __HAL_UNFREEZE_TIM7_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM7 +#define __HAL_FREEZE_TIM8_DBGMCU __HAL_DBGMCU_FREEZE_TIM8 +#define __HAL_UNFREEZE_TIM8_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM8 + +#define __HAL_FREEZE_TIM9_DBGMCU __HAL_DBGMCU_FREEZE_TIM9 +#define __HAL_UNFREEZE_TIM9_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM9 +#define __HAL_FREEZE_TIM10_DBGMCU __HAL_DBGMCU_FREEZE_TIM10 +#define __HAL_UNFREEZE_TIM10_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM10 +#define __HAL_FREEZE_TIM11_DBGMCU __HAL_DBGMCU_FREEZE_TIM11 +#define __HAL_UNFREEZE_TIM11_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM11 +#define __HAL_FREEZE_TIM12_DBGMCU __HAL_DBGMCU_FREEZE_TIM12 +#define __HAL_UNFREEZE_TIM12_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM12 +#define __HAL_FREEZE_TIM13_DBGMCU __HAL_DBGMCU_FREEZE_TIM13 +#define __HAL_UNFREEZE_TIM13_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM13 +#define __HAL_FREEZE_TIM14_DBGMCU __HAL_DBGMCU_FREEZE_TIM14 +#define __HAL_UNFREEZE_TIM14_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM14 +#define __HAL_FREEZE_CAN2_DBGMCU __HAL_DBGMCU_FREEZE_CAN2 +#define __HAL_UNFREEZE_CAN2_DBGMCU __HAL_DBGMCU_UNFREEZE_CAN2 + + +#define __HAL_FREEZE_TIM15_DBGMCU __HAL_DBGMCU_FREEZE_TIM15 +#define __HAL_UNFREEZE_TIM15_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM15 +#define __HAL_FREEZE_TIM16_DBGMCU __HAL_DBGMCU_FREEZE_TIM16 +#define __HAL_UNFREEZE_TIM16_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM16 +#define __HAL_FREEZE_TIM17_DBGMCU __HAL_DBGMCU_FREEZE_TIM17 +#define __HAL_UNFREEZE_TIM17_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM17 +#define __HAL_FREEZE_RTC_DBGMCU __HAL_DBGMCU_FREEZE_RTC +#define __HAL_UNFREEZE_RTC_DBGMCU __HAL_DBGMCU_UNFREEZE_RTC +#define __HAL_FREEZE_WWDG_DBGMCU __HAL_DBGMCU_FREEZE_WWDG +#define __HAL_UNFREEZE_WWDG_DBGMCU __HAL_DBGMCU_UNFREEZE_WWDG +#define __HAL_FREEZE_IWDG_DBGMCU __HAL_DBGMCU_FREEZE_IWDG +#define __HAL_UNFREEZE_IWDG_DBGMCU __HAL_DBGMCU_UNFREEZE_IWDG +#define __HAL_FREEZE_I2C1_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT +#define __HAL_UNFREEZE_I2C1_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT +#define __HAL_FREEZE_I2C2_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT +#define __HAL_UNFREEZE_I2C2_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT +#define __HAL_FREEZE_I2C3_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT +#define __HAL_UNFREEZE_I2C3_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT +#define __HAL_FREEZE_CAN1_DBGMCU __HAL_DBGMCU_FREEZE_CAN1 +#define __HAL_UNFREEZE_CAN1_DBGMCU __HAL_DBGMCU_UNFREEZE_CAN1 +#define __HAL_FREEZE_LPTIM1_DBGMCU __HAL_DBGMCU_FREEZE_LPTIM1 +#define __HAL_UNFREEZE_LPTIM1_DBGMCU __HAL_DBGMCU_UNFREEZE_LPTIM1 +#define __HAL_FREEZE_LPTIM2_DBGMCU __HAL_DBGMCU_FREEZE_LPTIM2 +#define __HAL_UNFREEZE_LPTIM2_DBGMCU __HAL_DBGMCU_UNFREEZE_LPTIM2 + +/** + * @} + */ + +/** @defgroup HAL_COMP_Aliased_Macros HAL COMP Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_IT()) +#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_IT()) +#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \ + __HAL_COMP_COMP2_EXTI_GET_FLAG()) +#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \ + __HAL_COMP_COMP2_EXTI_CLEAR_FLAG()) +#define __HAL_COMP_GET_EXTI_LINE COMP_GET_EXTI_LINE + +/** + * @} + */ + +/** @defgroup HAL_DAC_Aliased_Macros HAL DAC Aliased Macros maintained for legacy purpose + * @{ + */ + +#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NONE) || \ + ((WAVE) == DAC_WAVE_NOISE)|| \ + ((WAVE) == DAC_WAVE_TRIANGLE)) + +/** + * @} + */ + +/** @defgroup HAL_FLASH_Aliased_Macros HAL FLASH Aliased Macros maintained for legacy purpose + * @{ + */ + +#define IS_WRPAREA IS_OB_WRPAREA +#define IS_TYPEPROGRAM IS_FLASH_TYPEPROGRAM +#define IS_TYPEPROGRAMFLASH IS_FLASH_TYPEPROGRAM +#define IS_TYPEERASE IS_FLASH_TYPEERASE + +/** + * @} + */ + +/** @defgroup HAL_I2C_Aliased_Macros HAL I2C Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_I2C_RESET_CR2 I2C_RESET_CR2 +#define __HAL_I2C_GENERATE_START I2C_GENERATE_START +#define __HAL_I2C_FREQ_RANGE I2C_FREQ_RANGE +#define __HAL_I2C_RISE_TIME I2C_RISE_TIME +#define __HAL_I2C_SPEED_STANDARD I2C_SPEED_STANDARD +#define __HAL_I2C_SPEED_FAST I2C_SPEED_FAST +#define __HAL_I2C_SPEED I2C_SPEED +#define __HAL_I2C_7BIT_ADD_WRITE I2C_7BIT_ADD_WRITE +#define __HAL_I2C_7BIT_ADD_READ I2C_7BIT_ADD_READ +#define __HAL_I2C_10BIT_ADDRESS I2C_10BIT_ADDRESS +#define __HAL_I2C_10BIT_HEADER_WRITE I2C_10BIT_HEADER_WRITE +#define __HAL_I2C_10BIT_HEADER_READ I2C_10BIT_HEADER_READ +#define __HAL_I2C_MEM_ADD_MSB I2C_MEM_ADD_MSB +#define __HAL_I2C_MEM_ADD_LSB I2C_MEM_ADD_LSB +#define __HAL_I2C_FREQRANGE I2C_FREQRANGE +/** + * @} + */ + +/** @defgroup HAL_I2S_Aliased_Macros HAL I2S Aliased Macros maintained for legacy purpose + * @{ + */ + +#define IS_I2S_INSTANCE IS_I2S_ALL_INSTANCE +#define IS_I2S_INSTANCE_EXT IS_I2S_ALL_INSTANCE_EXT + +/** + * @} + */ + +/** @defgroup HAL_IRDA_Aliased_Macros HAL IRDA Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __IRDA_DISABLE __HAL_IRDA_DISABLE +#define __IRDA_ENABLE __HAL_IRDA_ENABLE + +#define __HAL_IRDA_GETCLOCKSOURCE IRDA_GETCLOCKSOURCE +#define __HAL_IRDA_MASK_COMPUTATION IRDA_MASK_COMPUTATION +#define __IRDA_GETCLOCKSOURCE IRDA_GETCLOCKSOURCE +#define __IRDA_MASK_COMPUTATION IRDA_MASK_COMPUTATION + +#define IS_IRDA_ONEBIT_SAMPLE IS_IRDA_ONE_BIT_SAMPLE + + +/** + * @} + */ + + +/** @defgroup HAL_IWDG_Aliased_Macros HAL IWDG Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_IWDG_ENABLE_WRITE_ACCESS IWDG_ENABLE_WRITE_ACCESS +#define __HAL_IWDG_DISABLE_WRITE_ACCESS IWDG_DISABLE_WRITE_ACCESS +/** + * @} + */ + + +/** @defgroup HAL_LPTIM_Aliased_Macros HAL LPTIM Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_LPTIM_ENABLE_INTERRUPT __HAL_LPTIM_ENABLE_IT +#define __HAL_LPTIM_DISABLE_INTERRUPT __HAL_LPTIM_DISABLE_IT +#define __HAL_LPTIM_GET_ITSTATUS __HAL_LPTIM_GET_IT_SOURCE + +/** + * @} + */ + + +/** @defgroup HAL_OPAMP_Aliased_Macros HAL OPAMP Aliased Macros maintained for legacy purpose + * @{ + */ +#define __OPAMP_CSR_OPAXPD OPAMP_CSR_OPAXPD +#define __OPAMP_CSR_S3SELX OPAMP_CSR_S3SELX +#define __OPAMP_CSR_S4SELX OPAMP_CSR_S4SELX +#define __OPAMP_CSR_S5SELX OPAMP_CSR_S5SELX +#define __OPAMP_CSR_S6SELX OPAMP_CSR_S6SELX +#define __OPAMP_CSR_OPAXCAL_L OPAMP_CSR_OPAXCAL_L +#define __OPAMP_CSR_OPAXCAL_H OPAMP_CSR_OPAXCAL_H +#define __OPAMP_CSR_OPAXLPM OPAMP_CSR_OPAXLPM +#define __OPAMP_CSR_ALL_SWITCHES OPAMP_CSR_ALL_SWITCHES +#define __OPAMP_CSR_ANAWSELX OPAMP_CSR_ANAWSELX +#define __OPAMP_CSR_OPAXCALOUT OPAMP_CSR_OPAXCALOUT +#define __OPAMP_OFFSET_TRIM_BITSPOSITION OPAMP_OFFSET_TRIM_BITSPOSITION +#define __OPAMP_OFFSET_TRIM_SET OPAMP_OFFSET_TRIM_SET + +/** + * @} + */ + + +/** @defgroup HAL_PWR_Aliased_Macros HAL PWR Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_PVD_EVENT_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_EVENT +#define __HAL_PVD_EVENT_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_EVENT +#define __HAL_PVD_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE +#define __HAL_PVD_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PVD_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE +#define __HAL_PVD_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE +#define __HAL_PVM_EVENT_DISABLE __HAL_PWR_PVM_EVENT_DISABLE +#define __HAL_PVM_EVENT_ENABLE __HAL_PWR_PVM_EVENT_ENABLE +#define __HAL_PVM_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVM_EXTI_FALLINGTRIGGER_DISABLE +#define __HAL_PVM_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVM_EXTI_FALLINGTRIGGER_ENABLE +#define __HAL_PVM_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVM_EXTI_RISINGTRIGGER_DISABLE +#define __HAL_PVM_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVM_EXTI_RISINGTRIGGER_ENABLE +#define __HAL_PWR_INTERNALWAKEUP_DISABLE HAL_PWREx_DisableInternalWakeUpLine +#define __HAL_PWR_INTERNALWAKEUP_ENABLE HAL_PWREx_EnableInternalWakeUpLine +#define __HAL_PWR_PULL_UP_DOWN_CONFIG_DISABLE HAL_PWREx_DisablePullUpPullDownConfig +#define __HAL_PWR_PULL_UP_DOWN_CONFIG_ENABLE HAL_PWREx_EnablePullUpPullDownConfig +#define __HAL_PWR_PVD_EXTI_CLEAR_EGDE_TRIGGER() __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() +#define __HAL_PWR_PVD_EXTI_EVENT_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_EVENT +#define __HAL_PWR_PVD_EXTI_EVENT_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_EVENT +#define __HAL_PWR_PVD_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE +#define __HAL_PWR_PVD_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PWR_PVD_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE +#define __HAL_PWR_PVD_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE +#define __HAL_PWR_PVD_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PWR_PVD_EXTI_SET_RISING_EDGE_TRIGGER __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE +#define __HAL_PWR_PVM_DISABLE() HAL_PWREx_DisablePVM1();HAL_PWREx_DisablePVM2();HAL_PWREx_DisablePVM3();HAL_PWREx_DisablePVM4() +#define __HAL_PWR_PVM_ENABLE() HAL_PWREx_EnablePVM1();HAL_PWREx_EnablePVM2();HAL_PWREx_EnablePVM3();HAL_PWREx_EnablePVM4() +#define __HAL_PWR_SRAM2CONTENT_PRESERVE_DISABLE HAL_PWREx_DisableSRAM2ContentRetention +#define __HAL_PWR_SRAM2CONTENT_PRESERVE_ENABLE HAL_PWREx_EnableSRAM2ContentRetention +#define __HAL_PWR_VDDIO2_DISABLE HAL_PWREx_DisableVddIO2 +#define __HAL_PWR_VDDIO2_ENABLE HAL_PWREx_EnableVddIO2 +#define __HAL_PWR_VDDIO2_EXTI_CLEAR_EGDE_TRIGGER __HAL_PWR_VDDIO2_EXTI_DISABLE_FALLING_EDGE +#define __HAL_PWR_VDDIO2_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_PWR_VDDIO2_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PWR_VDDUSB_DISABLE HAL_PWREx_DisableVddUSB +#define __HAL_PWR_VDDUSB_ENABLE HAL_PWREx_EnableVddUSB + +#if defined (STM32F4) +#define __HAL_PVD_EXTI_ENABLE_IT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_ENABLE_IT() +#define __HAL_PVD_EXTI_DISABLE_IT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_DISABLE_IT() +#define __HAL_PVD_EXTI_GET_FLAG(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_GET_FLAG() +#define __HAL_PVD_EXTI_CLEAR_FLAG(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_CLEAR_FLAG() +#define __HAL_PVD_EXTI_GENERATE_SWIT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_GENERATE_SWIT() +#else +#define __HAL_PVD_EXTI_CLEAR_FLAG __HAL_PWR_PVD_EXTI_CLEAR_FLAG +#define __HAL_PVD_EXTI_DISABLE_IT __HAL_PWR_PVD_EXTI_DISABLE_IT +#define __HAL_PVD_EXTI_ENABLE_IT __HAL_PWR_PVD_EXTI_ENABLE_IT +#define __HAL_PVD_EXTI_GENERATE_SWIT __HAL_PWR_PVD_EXTI_GENERATE_SWIT +#define __HAL_PVD_EXTI_GET_FLAG __HAL_PWR_PVD_EXTI_GET_FLAG +#endif /* STM32F4 */ +/** + * @} + */ + + +/** @defgroup HAL_RCC_Aliased HAL RCC Aliased maintained for legacy purpose + * @{ + */ + +#define RCC_StopWakeUpClock_MSI RCC_STOP_WAKEUPCLOCK_MSI +#define RCC_StopWakeUpClock_HSI RCC_STOP_WAKEUPCLOCK_HSI + +#define HAL_RCC_CCSCallback HAL_RCC_CSSCallback +#define HAL_RC48_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_RCCEx_EnableHSI48_VREFINT() : HAL_RCCEx_DisableHSI48_VREFINT()) + +#define __ADC_CLK_DISABLE __HAL_RCC_ADC_CLK_DISABLE +#define __ADC_CLK_ENABLE __HAL_RCC_ADC_CLK_ENABLE +#define __ADC_CLK_SLEEP_DISABLE __HAL_RCC_ADC_CLK_SLEEP_DISABLE +#define __ADC_CLK_SLEEP_ENABLE __HAL_RCC_ADC_CLK_SLEEP_ENABLE +#define __ADC_FORCE_RESET __HAL_RCC_ADC_FORCE_RESET +#define __ADC_RELEASE_RESET __HAL_RCC_ADC_RELEASE_RESET +#define __ADC1_CLK_DISABLE __HAL_RCC_ADC1_CLK_DISABLE +#define __ADC1_CLK_ENABLE __HAL_RCC_ADC1_CLK_ENABLE +#define __ADC1_FORCE_RESET __HAL_RCC_ADC1_FORCE_RESET +#define __ADC1_RELEASE_RESET __HAL_RCC_ADC1_RELEASE_RESET +#define __ADC1_CLK_SLEEP_ENABLE __HAL_RCC_ADC1_CLK_SLEEP_ENABLE +#define __ADC1_CLK_SLEEP_DISABLE __HAL_RCC_ADC1_CLK_SLEEP_DISABLE +#define __ADC2_CLK_DISABLE __HAL_RCC_ADC2_CLK_DISABLE +#define __ADC2_CLK_ENABLE __HAL_RCC_ADC2_CLK_ENABLE +#define __ADC2_FORCE_RESET __HAL_RCC_ADC2_FORCE_RESET +#define __ADC2_RELEASE_RESET __HAL_RCC_ADC2_RELEASE_RESET +#define __ADC3_CLK_DISABLE __HAL_RCC_ADC3_CLK_DISABLE +#define __ADC3_CLK_ENABLE __HAL_RCC_ADC3_CLK_ENABLE +#define __ADC3_FORCE_RESET __HAL_RCC_ADC3_FORCE_RESET +#define __ADC3_RELEASE_RESET __HAL_RCC_ADC3_RELEASE_RESET +#define __AES_CLK_DISABLE __HAL_RCC_AES_CLK_DISABLE +#define __AES_CLK_ENABLE __HAL_RCC_AES_CLK_ENABLE +#define __AES_CLK_SLEEP_DISABLE __HAL_RCC_AES_CLK_SLEEP_DISABLE +#define __AES_CLK_SLEEP_ENABLE __HAL_RCC_AES_CLK_SLEEP_ENABLE +#define __AES_FORCE_RESET __HAL_RCC_AES_FORCE_RESET +#define __AES_RELEASE_RESET __HAL_RCC_AES_RELEASE_RESET +#define __CRYP_CLK_SLEEP_ENABLE __HAL_RCC_CRYP_CLK_SLEEP_ENABLE +#define __CRYP_CLK_SLEEP_DISABLE __HAL_RCC_CRYP_CLK_SLEEP_DISABLE +#define __CRYP_CLK_ENABLE __HAL_RCC_CRYP_CLK_ENABLE +#define __CRYP_CLK_DISABLE __HAL_RCC_CRYP_CLK_DISABLE +#define __CRYP_FORCE_RESET __HAL_RCC_CRYP_FORCE_RESET +#define __CRYP_RELEASE_RESET __HAL_RCC_CRYP_RELEASE_RESET +#define __AFIO_CLK_DISABLE __HAL_RCC_AFIO_CLK_DISABLE +#define __AFIO_CLK_ENABLE __HAL_RCC_AFIO_CLK_ENABLE +#define __AFIO_FORCE_RESET __HAL_RCC_AFIO_FORCE_RESET +#define __AFIO_RELEASE_RESET __HAL_RCC_AFIO_RELEASE_RESET +#define __AHB_FORCE_RESET __HAL_RCC_AHB_FORCE_RESET +#define __AHB_RELEASE_RESET __HAL_RCC_AHB_RELEASE_RESET +#define __AHB1_FORCE_RESET __HAL_RCC_AHB1_FORCE_RESET +#define __AHB1_RELEASE_RESET __HAL_RCC_AHB1_RELEASE_RESET +#define __AHB2_FORCE_RESET __HAL_RCC_AHB2_FORCE_RESET +#define __AHB2_RELEASE_RESET __HAL_RCC_AHB2_RELEASE_RESET +#define __AHB3_FORCE_RESET __HAL_RCC_AHB3_FORCE_RESET +#define __AHB3_RELEASE_RESET __HAL_RCC_AHB3_RELEASE_RESET +#define __APB1_FORCE_RESET __HAL_RCC_APB1_FORCE_RESET +#define __APB1_RELEASE_RESET __HAL_RCC_APB1_RELEASE_RESET +#define __APB2_FORCE_RESET __HAL_RCC_APB2_FORCE_RESET +#define __APB2_RELEASE_RESET __HAL_RCC_APB2_RELEASE_RESET +#define __BKP_CLK_DISABLE __HAL_RCC_BKP_CLK_DISABLE +#define __BKP_CLK_ENABLE __HAL_RCC_BKP_CLK_ENABLE +#define __BKP_FORCE_RESET __HAL_RCC_BKP_FORCE_RESET +#define __BKP_RELEASE_RESET __HAL_RCC_BKP_RELEASE_RESET +#define __CAN1_CLK_DISABLE __HAL_RCC_CAN1_CLK_DISABLE +#define __CAN1_CLK_ENABLE __HAL_RCC_CAN1_CLK_ENABLE +#define __CAN1_CLK_SLEEP_DISABLE __HAL_RCC_CAN1_CLK_SLEEP_DISABLE +#define __CAN1_CLK_SLEEP_ENABLE __HAL_RCC_CAN1_CLK_SLEEP_ENABLE +#define __CAN1_FORCE_RESET __HAL_RCC_CAN1_FORCE_RESET +#define __CAN1_RELEASE_RESET __HAL_RCC_CAN1_RELEASE_RESET +#define __CAN_CLK_DISABLE __HAL_RCC_CAN1_CLK_DISABLE +#define __CAN_CLK_ENABLE __HAL_RCC_CAN1_CLK_ENABLE +#define __CAN_FORCE_RESET __HAL_RCC_CAN1_FORCE_RESET +#define __CAN_RELEASE_RESET __HAL_RCC_CAN1_RELEASE_RESET +#define __CAN2_CLK_DISABLE __HAL_RCC_CAN2_CLK_DISABLE +#define __CAN2_CLK_ENABLE __HAL_RCC_CAN2_CLK_ENABLE +#define __CAN2_FORCE_RESET __HAL_RCC_CAN2_FORCE_RESET +#define __CAN2_RELEASE_RESET __HAL_RCC_CAN2_RELEASE_RESET +#define __CEC_CLK_DISABLE __HAL_RCC_CEC_CLK_DISABLE +#define __CEC_CLK_ENABLE __HAL_RCC_CEC_CLK_ENABLE +#define __COMP_CLK_DISABLE __HAL_RCC_COMP_CLK_DISABLE +#define __COMP_CLK_ENABLE __HAL_RCC_COMP_CLK_ENABLE +#define __COMP_FORCE_RESET __HAL_RCC_COMP_FORCE_RESET +#define __COMP_RELEASE_RESET __HAL_RCC_COMP_RELEASE_RESET +#define __COMP_CLK_SLEEP_ENABLE __HAL_RCC_COMP_CLK_SLEEP_ENABLE +#define __COMP_CLK_SLEEP_DISABLE __HAL_RCC_COMP_CLK_SLEEP_DISABLE +#define __CEC_FORCE_RESET __HAL_RCC_CEC_FORCE_RESET +#define __CEC_RELEASE_RESET __HAL_RCC_CEC_RELEASE_RESET +#define __CRC_CLK_DISABLE __HAL_RCC_CRC_CLK_DISABLE +#define __CRC_CLK_ENABLE __HAL_RCC_CRC_CLK_ENABLE +#define __CRC_CLK_SLEEP_DISABLE __HAL_RCC_CRC_CLK_SLEEP_DISABLE +#define __CRC_CLK_SLEEP_ENABLE __HAL_RCC_CRC_CLK_SLEEP_ENABLE +#define __CRC_FORCE_RESET __HAL_RCC_CRC_FORCE_RESET +#define __CRC_RELEASE_RESET __HAL_RCC_CRC_RELEASE_RESET +#define __DAC_CLK_DISABLE __HAL_RCC_DAC_CLK_DISABLE +#define __DAC_CLK_ENABLE __HAL_RCC_DAC_CLK_ENABLE +#define __DAC_FORCE_RESET __HAL_RCC_DAC_FORCE_RESET +#define __DAC_RELEASE_RESET __HAL_RCC_DAC_RELEASE_RESET +#define __DAC1_CLK_DISABLE __HAL_RCC_DAC1_CLK_DISABLE +#define __DAC1_CLK_ENABLE __HAL_RCC_DAC1_CLK_ENABLE +#define __DAC1_CLK_SLEEP_DISABLE __HAL_RCC_DAC1_CLK_SLEEP_DISABLE +#define __DAC1_CLK_SLEEP_ENABLE __HAL_RCC_DAC1_CLK_SLEEP_ENABLE +#define __DAC1_FORCE_RESET __HAL_RCC_DAC1_FORCE_RESET +#define __DAC1_RELEASE_RESET __HAL_RCC_DAC1_RELEASE_RESET +#define __DBGMCU_CLK_ENABLE __HAL_RCC_DBGMCU_CLK_ENABLE +#define __DBGMCU_CLK_DISABLE __HAL_RCC_DBGMCU_CLK_DISABLE +#define __DBGMCU_FORCE_RESET __HAL_RCC_DBGMCU_FORCE_RESET +#define __DBGMCU_RELEASE_RESET __HAL_RCC_DBGMCU_RELEASE_RESET +#define __DFSDM_CLK_DISABLE __HAL_RCC_DFSDM_CLK_DISABLE +#define __DFSDM_CLK_ENABLE __HAL_RCC_DFSDM_CLK_ENABLE +#define __DFSDM_CLK_SLEEP_DISABLE __HAL_RCC_DFSDM_CLK_SLEEP_DISABLE +#define __DFSDM_CLK_SLEEP_ENABLE __HAL_RCC_DFSDM_CLK_SLEEP_ENABLE +#define __DFSDM_FORCE_RESET __HAL_RCC_DFSDM_FORCE_RESET +#define __DFSDM_RELEASE_RESET __HAL_RCC_DFSDM_RELEASE_RESET +#define __DMA1_CLK_DISABLE __HAL_RCC_DMA1_CLK_DISABLE +#define __DMA1_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE +#define __DMA1_CLK_SLEEP_DISABLE __HAL_RCC_DMA1_CLK_SLEEP_DISABLE +#define __DMA1_CLK_SLEEP_ENABLE __HAL_RCC_DMA1_CLK_SLEEP_ENABLE +#define __DMA1_FORCE_RESET __HAL_RCC_DMA1_FORCE_RESET +#define __DMA1_RELEASE_RESET __HAL_RCC_DMA1_RELEASE_RESET +#define __DMA2_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE +#define __DMA2_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE +#define __DMA2_CLK_SLEEP_DISABLE __HAL_RCC_DMA2_CLK_SLEEP_DISABLE +#define __DMA2_CLK_SLEEP_ENABLE __HAL_RCC_DMA2_CLK_SLEEP_ENABLE +#define __DMA2_FORCE_RESET __HAL_RCC_DMA2_FORCE_RESET +#define __DMA2_RELEASE_RESET __HAL_RCC_DMA2_RELEASE_RESET +#define __ETHMAC_CLK_DISABLE __HAL_RCC_ETHMAC_CLK_DISABLE +#define __ETHMAC_CLK_ENABLE __HAL_RCC_ETHMAC_CLK_ENABLE +#define __ETHMAC_FORCE_RESET __HAL_RCC_ETHMAC_FORCE_RESET +#define __ETHMAC_RELEASE_RESET __HAL_RCC_ETHMAC_RELEASE_RESET +#define __ETHMACRX_CLK_DISABLE __HAL_RCC_ETHMACRX_CLK_DISABLE +#define __ETHMACRX_CLK_ENABLE __HAL_RCC_ETHMACRX_CLK_ENABLE +#define __ETHMACTX_CLK_DISABLE __HAL_RCC_ETHMACTX_CLK_DISABLE +#define __ETHMACTX_CLK_ENABLE __HAL_RCC_ETHMACTX_CLK_ENABLE +#define __FIREWALL_CLK_DISABLE __HAL_RCC_FIREWALL_CLK_DISABLE +#define __FIREWALL_CLK_ENABLE __HAL_RCC_FIREWALL_CLK_ENABLE +#define __FLASH_CLK_DISABLE __HAL_RCC_FLASH_CLK_DISABLE +#define __FLASH_CLK_ENABLE __HAL_RCC_FLASH_CLK_ENABLE +#define __FLASH_CLK_SLEEP_DISABLE __HAL_RCC_FLASH_CLK_SLEEP_DISABLE +#define __FLASH_CLK_SLEEP_ENABLE __HAL_RCC_FLASH_CLK_SLEEP_ENABLE +#define __FLASH_FORCE_RESET __HAL_RCC_FLASH_FORCE_RESET +#define __FLASH_RELEASE_RESET __HAL_RCC_FLASH_RELEASE_RESET +#define __FLITF_CLK_DISABLE __HAL_RCC_FLITF_CLK_DISABLE +#define __FLITF_CLK_ENABLE __HAL_RCC_FLITF_CLK_ENABLE +#define __FLITF_FORCE_RESET __HAL_RCC_FLITF_FORCE_RESET +#define __FLITF_RELEASE_RESET __HAL_RCC_FLITF_RELEASE_RESET +#define __FLITF_CLK_SLEEP_ENABLE __HAL_RCC_FLITF_CLK_SLEEP_ENABLE +#define __FLITF_CLK_SLEEP_DISABLE __HAL_RCC_FLITF_CLK_SLEEP_DISABLE +#define __FMC_CLK_DISABLE __HAL_RCC_FMC_CLK_DISABLE +#define __FMC_CLK_ENABLE __HAL_RCC_FMC_CLK_ENABLE +#define __FMC_CLK_SLEEP_DISABLE __HAL_RCC_FMC_CLK_SLEEP_DISABLE +#define __FMC_CLK_SLEEP_ENABLE __HAL_RCC_FMC_CLK_SLEEP_ENABLE +#define __FMC_FORCE_RESET __HAL_RCC_FMC_FORCE_RESET +#define __FMC_RELEASE_RESET __HAL_RCC_FMC_RELEASE_RESET +#define __FSMC_CLK_DISABLE __HAL_RCC_FSMC_CLK_DISABLE +#define __FSMC_CLK_ENABLE __HAL_RCC_FSMC_CLK_ENABLE +#define __GPIOA_CLK_DISABLE __HAL_RCC_GPIOA_CLK_DISABLE +#define __GPIOA_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define __GPIOA_CLK_SLEEP_DISABLE __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE +#define __GPIOA_CLK_SLEEP_ENABLE __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE +#define __GPIOA_FORCE_RESET __HAL_RCC_GPIOA_FORCE_RESET +#define __GPIOA_RELEASE_RESET __HAL_RCC_GPIOA_RELEASE_RESET +#define __GPIOB_CLK_DISABLE __HAL_RCC_GPIOB_CLK_DISABLE +#define __GPIOB_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#define __GPIOB_CLK_SLEEP_DISABLE __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE +#define __GPIOB_CLK_SLEEP_ENABLE __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE +#define __GPIOB_FORCE_RESET __HAL_RCC_GPIOB_FORCE_RESET +#define __GPIOB_RELEASE_RESET __HAL_RCC_GPIOB_RELEASE_RESET +#define __GPIOC_CLK_DISABLE __HAL_RCC_GPIOC_CLK_DISABLE +#define __GPIOC_CLK_ENABLE __HAL_RCC_GPIOC_CLK_ENABLE +#define __GPIOC_CLK_SLEEP_DISABLE __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE +#define __GPIOC_CLK_SLEEP_ENABLE __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE +#define __GPIOC_FORCE_RESET __HAL_RCC_GPIOC_FORCE_RESET +#define __GPIOC_RELEASE_RESET __HAL_RCC_GPIOC_RELEASE_RESET +#define __GPIOD_CLK_DISABLE __HAL_RCC_GPIOD_CLK_DISABLE +#define __GPIOD_CLK_ENABLE __HAL_RCC_GPIOD_CLK_ENABLE +#define __GPIOD_CLK_SLEEP_DISABLE __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE +#define __GPIOD_CLK_SLEEP_ENABLE __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE +#define __GPIOD_FORCE_RESET __HAL_RCC_GPIOD_FORCE_RESET +#define __GPIOD_RELEASE_RESET __HAL_RCC_GPIOD_RELEASE_RESET +#define __GPIOE_CLK_DISABLE __HAL_RCC_GPIOE_CLK_DISABLE +#define __GPIOE_CLK_ENABLE __HAL_RCC_GPIOE_CLK_ENABLE +#define __GPIOE_CLK_SLEEP_DISABLE __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE +#define __GPIOE_CLK_SLEEP_ENABLE __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE +#define __GPIOE_FORCE_RESET __HAL_RCC_GPIOE_FORCE_RESET +#define __GPIOE_RELEASE_RESET __HAL_RCC_GPIOE_RELEASE_RESET +#define __GPIOF_CLK_DISABLE __HAL_RCC_GPIOF_CLK_DISABLE +#define __GPIOF_CLK_ENABLE __HAL_RCC_GPIOF_CLK_ENABLE +#define __GPIOF_CLK_SLEEP_DISABLE __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE +#define __GPIOF_CLK_SLEEP_ENABLE __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE +#define __GPIOF_FORCE_RESET __HAL_RCC_GPIOF_FORCE_RESET +#define __GPIOF_RELEASE_RESET __HAL_RCC_GPIOF_RELEASE_RESET +#define __GPIOG_CLK_DISABLE __HAL_RCC_GPIOG_CLK_DISABLE +#define __GPIOG_CLK_ENABLE __HAL_RCC_GPIOG_CLK_ENABLE +#define __GPIOG_CLK_SLEEP_DISABLE __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE +#define __GPIOG_CLK_SLEEP_ENABLE __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE +#define __GPIOG_FORCE_RESET __HAL_RCC_GPIOG_FORCE_RESET +#define __GPIOG_RELEASE_RESET __HAL_RCC_GPIOG_RELEASE_RESET +#define __GPIOH_CLK_DISABLE __HAL_RCC_GPIOH_CLK_DISABLE +#define __GPIOH_CLK_ENABLE __HAL_RCC_GPIOH_CLK_ENABLE +#define __GPIOH_CLK_SLEEP_DISABLE __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE +#define __GPIOH_CLK_SLEEP_ENABLE __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE +#define __GPIOH_FORCE_RESET __HAL_RCC_GPIOH_FORCE_RESET +#define __GPIOH_RELEASE_RESET __HAL_RCC_GPIOH_RELEASE_RESET +#define __I2C1_CLK_DISABLE __HAL_RCC_I2C1_CLK_DISABLE +#define __I2C1_CLK_ENABLE __HAL_RCC_I2C1_CLK_ENABLE +#define __I2C1_CLK_SLEEP_DISABLE __HAL_RCC_I2C1_CLK_SLEEP_DISABLE +#define __I2C1_CLK_SLEEP_ENABLE __HAL_RCC_I2C1_CLK_SLEEP_ENABLE +#define __I2C1_FORCE_RESET __HAL_RCC_I2C1_FORCE_RESET +#define __I2C1_RELEASE_RESET __HAL_RCC_I2C1_RELEASE_RESET +#define __I2C2_CLK_DISABLE __HAL_RCC_I2C2_CLK_DISABLE +#define __I2C2_CLK_ENABLE __HAL_RCC_I2C2_CLK_ENABLE +#define __I2C2_CLK_SLEEP_DISABLE __HAL_RCC_I2C2_CLK_SLEEP_DISABLE +#define __I2C2_CLK_SLEEP_ENABLE __HAL_RCC_I2C2_CLK_SLEEP_ENABLE +#define __I2C2_FORCE_RESET __HAL_RCC_I2C2_FORCE_RESET +#define __I2C2_RELEASE_RESET __HAL_RCC_I2C2_RELEASE_RESET +#define __I2C3_CLK_DISABLE __HAL_RCC_I2C3_CLK_DISABLE +#define __I2C3_CLK_ENABLE __HAL_RCC_I2C3_CLK_ENABLE +#define __I2C3_CLK_SLEEP_DISABLE __HAL_RCC_I2C3_CLK_SLEEP_DISABLE +#define __I2C3_CLK_SLEEP_ENABLE __HAL_RCC_I2C3_CLK_SLEEP_ENABLE +#define __I2C3_FORCE_RESET __HAL_RCC_I2C3_FORCE_RESET +#define __I2C3_RELEASE_RESET __HAL_RCC_I2C3_RELEASE_RESET +#define __LCD_CLK_DISABLE __HAL_RCC_LCD_CLK_DISABLE +#define __LCD_CLK_ENABLE __HAL_RCC_LCD_CLK_ENABLE +#define __LCD_CLK_SLEEP_DISABLE __HAL_RCC_LCD_CLK_SLEEP_DISABLE +#define __LCD_CLK_SLEEP_ENABLE __HAL_RCC_LCD_CLK_SLEEP_ENABLE +#define __LCD_FORCE_RESET __HAL_RCC_LCD_FORCE_RESET +#define __LCD_RELEASE_RESET __HAL_RCC_LCD_RELEASE_RESET +#define __LPTIM1_CLK_DISABLE __HAL_RCC_LPTIM1_CLK_DISABLE +#define __LPTIM1_CLK_ENABLE __HAL_RCC_LPTIM1_CLK_ENABLE +#define __LPTIM1_CLK_SLEEP_DISABLE __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE +#define __LPTIM1_CLK_SLEEP_ENABLE __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE +#define __LPTIM1_FORCE_RESET __HAL_RCC_LPTIM1_FORCE_RESET +#define __LPTIM1_RELEASE_RESET __HAL_RCC_LPTIM1_RELEASE_RESET +#define __LPTIM2_CLK_DISABLE __HAL_RCC_LPTIM2_CLK_DISABLE +#define __LPTIM2_CLK_ENABLE __HAL_RCC_LPTIM2_CLK_ENABLE +#define __LPTIM2_CLK_SLEEP_DISABLE __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE +#define __LPTIM2_CLK_SLEEP_ENABLE __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE +#define __LPTIM2_FORCE_RESET __HAL_RCC_LPTIM2_FORCE_RESET +#define __LPTIM2_RELEASE_RESET __HAL_RCC_LPTIM2_RELEASE_RESET +#define __LPUART1_CLK_DISABLE __HAL_RCC_LPUART1_CLK_DISABLE +#define __LPUART1_CLK_ENABLE __HAL_RCC_LPUART1_CLK_ENABLE +#define __LPUART1_CLK_SLEEP_DISABLE __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE +#define __LPUART1_CLK_SLEEP_ENABLE __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE +#define __LPUART1_FORCE_RESET __HAL_RCC_LPUART1_FORCE_RESET +#define __LPUART1_RELEASE_RESET __HAL_RCC_LPUART1_RELEASE_RESET +#define __OPAMP_CLK_DISABLE __HAL_RCC_OPAMP_CLK_DISABLE +#define __OPAMP_CLK_ENABLE __HAL_RCC_OPAMP_CLK_ENABLE +#define __OPAMP_CLK_SLEEP_DISABLE __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE +#define __OPAMP_CLK_SLEEP_ENABLE __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE +#define __OPAMP_FORCE_RESET __HAL_RCC_OPAMP_FORCE_RESET +#define __OPAMP_RELEASE_RESET __HAL_RCC_OPAMP_RELEASE_RESET +#define __OTGFS_CLK_DISABLE __HAL_RCC_OTGFS_CLK_DISABLE +#define __OTGFS_CLK_ENABLE __HAL_RCC_OTGFS_CLK_ENABLE +#define __OTGFS_CLK_SLEEP_DISABLE __HAL_RCC_OTGFS_CLK_SLEEP_DISABLE +#define __OTGFS_CLK_SLEEP_ENABLE __HAL_RCC_OTGFS_CLK_SLEEP_ENABLE +#define __OTGFS_FORCE_RESET __HAL_RCC_OTGFS_FORCE_RESET +#define __OTGFS_RELEASE_RESET __HAL_RCC_OTGFS_RELEASE_RESET +#define __PWR_CLK_DISABLE __HAL_RCC_PWR_CLK_DISABLE +#define __PWR_CLK_ENABLE __HAL_RCC_PWR_CLK_ENABLE +#define __PWR_CLK_SLEEP_DISABLE __HAL_RCC_PWR_CLK_SLEEP_DISABLE +#define __PWR_CLK_SLEEP_ENABLE __HAL_RCC_PWR_CLK_SLEEP_ENABLE +#define __PWR_FORCE_RESET __HAL_RCC_PWR_FORCE_RESET +#define __PWR_RELEASE_RESET __HAL_RCC_PWR_RELEASE_RESET +#define __QSPI_CLK_DISABLE __HAL_RCC_QSPI_CLK_DISABLE +#define __QSPI_CLK_ENABLE __HAL_RCC_QSPI_CLK_ENABLE +#define __QSPI_CLK_SLEEP_DISABLE __HAL_RCC_QSPI_CLK_SLEEP_DISABLE +#define __QSPI_CLK_SLEEP_ENABLE __HAL_RCC_QSPI_CLK_SLEEP_ENABLE +#define __QSPI_FORCE_RESET __HAL_RCC_QSPI_FORCE_RESET +#define __QSPI_RELEASE_RESET __HAL_RCC_QSPI_RELEASE_RESET +#define __RNG_CLK_DISABLE __HAL_RCC_RNG_CLK_DISABLE +#define __RNG_CLK_ENABLE __HAL_RCC_RNG_CLK_ENABLE +#define __RNG_CLK_SLEEP_DISABLE __HAL_RCC_RNG_CLK_SLEEP_DISABLE +#define __RNG_CLK_SLEEP_ENABLE __HAL_RCC_RNG_CLK_SLEEP_ENABLE +#define __RNG_FORCE_RESET __HAL_RCC_RNG_FORCE_RESET +#define __RNG_RELEASE_RESET __HAL_RCC_RNG_RELEASE_RESET +#define __SAI1_CLK_DISABLE __HAL_RCC_SAI1_CLK_DISABLE +#define __SAI1_CLK_ENABLE __HAL_RCC_SAI1_CLK_ENABLE +#define __SAI1_CLK_SLEEP_DISABLE __HAL_RCC_SAI1_CLK_SLEEP_DISABLE +#define __SAI1_CLK_SLEEP_ENABLE __HAL_RCC_SAI1_CLK_SLEEP_ENABLE +#define __SAI1_FORCE_RESET __HAL_RCC_SAI1_FORCE_RESET +#define __SAI1_RELEASE_RESET __HAL_RCC_SAI1_RELEASE_RESET +#define __SAI2_CLK_DISABLE __HAL_RCC_SAI2_CLK_DISABLE +#define __SAI2_CLK_ENABLE __HAL_RCC_SAI2_CLK_ENABLE +#define __SAI2_CLK_SLEEP_DISABLE __HAL_RCC_SAI2_CLK_SLEEP_DISABLE +#define __SAI2_CLK_SLEEP_ENABLE __HAL_RCC_SAI2_CLK_SLEEP_ENABLE +#define __SAI2_FORCE_RESET __HAL_RCC_SAI2_FORCE_RESET +#define __SAI2_RELEASE_RESET __HAL_RCC_SAI2_RELEASE_RESET +#define __SDIO_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE +#define __SDIO_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE +#define __SDMMC_CLK_DISABLE __HAL_RCC_SDMMC_CLK_DISABLE +#define __SDMMC_CLK_ENABLE __HAL_RCC_SDMMC_CLK_ENABLE +#define __SDMMC_CLK_SLEEP_DISABLE __HAL_RCC_SDMMC_CLK_SLEEP_DISABLE +#define __SDMMC_CLK_SLEEP_ENABLE __HAL_RCC_SDMMC_CLK_SLEEP_ENABLE +#define __SDMMC_FORCE_RESET __HAL_RCC_SDMMC_FORCE_RESET +#define __SDMMC_RELEASE_RESET __HAL_RCC_SDMMC_RELEASE_RESET +#define __SPI1_CLK_DISABLE __HAL_RCC_SPI1_CLK_DISABLE +#define __SPI1_CLK_ENABLE __HAL_RCC_SPI1_CLK_ENABLE +#define __SPI1_CLK_SLEEP_DISABLE __HAL_RCC_SPI1_CLK_SLEEP_DISABLE +#define __SPI1_CLK_SLEEP_ENABLE __HAL_RCC_SPI1_CLK_SLEEP_ENABLE +#define __SPI1_FORCE_RESET __HAL_RCC_SPI1_FORCE_RESET +#define __SPI1_RELEASE_RESET __HAL_RCC_SPI1_RELEASE_RESET +#define __SPI2_CLK_DISABLE __HAL_RCC_SPI2_CLK_DISABLE +#define __SPI2_CLK_ENABLE __HAL_RCC_SPI2_CLK_ENABLE +#define __SPI2_CLK_SLEEP_DISABLE __HAL_RCC_SPI2_CLK_SLEEP_DISABLE +#define __SPI2_CLK_SLEEP_ENABLE __HAL_RCC_SPI2_CLK_SLEEP_ENABLE +#define __SPI2_FORCE_RESET __HAL_RCC_SPI2_FORCE_RESET +#define __SPI2_RELEASE_RESET __HAL_RCC_SPI2_RELEASE_RESET +#define __SPI3_CLK_DISABLE __HAL_RCC_SPI3_CLK_DISABLE +#define __SPI3_CLK_ENABLE __HAL_RCC_SPI3_CLK_ENABLE +#define __SPI3_CLK_SLEEP_DISABLE __HAL_RCC_SPI3_CLK_SLEEP_DISABLE +#define __SPI3_CLK_SLEEP_ENABLE __HAL_RCC_SPI3_CLK_SLEEP_ENABLE +#define __SPI3_FORCE_RESET __HAL_RCC_SPI3_FORCE_RESET +#define __SPI3_RELEASE_RESET __HAL_RCC_SPI3_RELEASE_RESET +#define __SRAM_CLK_DISABLE __HAL_RCC_SRAM_CLK_DISABLE +#define __SRAM_CLK_ENABLE __HAL_RCC_SRAM_CLK_ENABLE +#define __SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE +#define __SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE +#define __SRAM2_CLK_SLEEP_DISABLE __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE +#define __SRAM2_CLK_SLEEP_ENABLE __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE +#define __SWPMI1_CLK_DISABLE __HAL_RCC_SWPMI1_CLK_DISABLE +#define __SWPMI1_CLK_ENABLE __HAL_RCC_SWPMI1_CLK_ENABLE +#define __SWPMI1_CLK_SLEEP_DISABLE __HAL_RCC_SWPMI1_CLK_SLEEP_DISABLE +#define __SWPMI1_CLK_SLEEP_ENABLE __HAL_RCC_SWPMI1_CLK_SLEEP_ENABLE +#define __SWPMI1_FORCE_RESET __HAL_RCC_SWPMI1_FORCE_RESET +#define __SWPMI1_RELEASE_RESET __HAL_RCC_SWPMI1_RELEASE_RESET +#define __SYSCFG_CLK_DISABLE __HAL_RCC_SYSCFG_CLK_DISABLE +#define __SYSCFG_CLK_ENABLE __HAL_RCC_SYSCFG_CLK_ENABLE +#define __SYSCFG_CLK_SLEEP_DISABLE __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE +#define __SYSCFG_CLK_SLEEP_ENABLE __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE +#define __SYSCFG_FORCE_RESET __HAL_RCC_SYSCFG_FORCE_RESET +#define __SYSCFG_RELEASE_RESET __HAL_RCC_SYSCFG_RELEASE_RESET +#define __TIM1_CLK_DISABLE __HAL_RCC_TIM1_CLK_DISABLE +#define __TIM1_CLK_ENABLE __HAL_RCC_TIM1_CLK_ENABLE +#define __TIM1_CLK_SLEEP_DISABLE __HAL_RCC_TIM1_CLK_SLEEP_DISABLE +#define __TIM1_CLK_SLEEP_ENABLE __HAL_RCC_TIM1_CLK_SLEEP_ENABLE +#define __TIM1_FORCE_RESET __HAL_RCC_TIM1_FORCE_RESET +#define __TIM1_RELEASE_RESET __HAL_RCC_TIM1_RELEASE_RESET +#define __TIM10_CLK_DISABLE __HAL_RCC_TIM10_CLK_DISABLE +#define __TIM10_CLK_ENABLE __HAL_RCC_TIM10_CLK_ENABLE +#define __TIM10_FORCE_RESET __HAL_RCC_TIM10_FORCE_RESET +#define __TIM10_RELEASE_RESET __HAL_RCC_TIM10_RELEASE_RESET +#define __TIM11_CLK_DISABLE __HAL_RCC_TIM11_CLK_DISABLE +#define __TIM11_CLK_ENABLE __HAL_RCC_TIM11_CLK_ENABLE +#define __TIM11_FORCE_RESET __HAL_RCC_TIM11_FORCE_RESET +#define __TIM11_RELEASE_RESET __HAL_RCC_TIM11_RELEASE_RESET +#define __TIM12_CLK_DISABLE __HAL_RCC_TIM12_CLK_DISABLE +#define __TIM12_CLK_ENABLE __HAL_RCC_TIM12_CLK_ENABLE +#define __TIM12_FORCE_RESET __HAL_RCC_TIM12_FORCE_RESET +#define __TIM12_RELEASE_RESET __HAL_RCC_TIM12_RELEASE_RESET +#define __TIM13_CLK_DISABLE __HAL_RCC_TIM13_CLK_DISABLE +#define __TIM13_CLK_ENABLE __HAL_RCC_TIM13_CLK_ENABLE +#define __TIM13_FORCE_RESET __HAL_RCC_TIM13_FORCE_RESET +#define __TIM13_RELEASE_RESET __HAL_RCC_TIM13_RELEASE_RESET +#define __TIM14_CLK_DISABLE __HAL_RCC_TIM14_CLK_DISABLE +#define __TIM14_CLK_ENABLE __HAL_RCC_TIM14_CLK_ENABLE +#define __TIM14_FORCE_RESET __HAL_RCC_TIM14_FORCE_RESET +#define __TIM14_RELEASE_RESET __HAL_RCC_TIM14_RELEASE_RESET +#define __TIM15_CLK_DISABLE __HAL_RCC_TIM15_CLK_DISABLE +#define __TIM15_CLK_ENABLE __HAL_RCC_TIM15_CLK_ENABLE +#define __TIM15_CLK_SLEEP_DISABLE __HAL_RCC_TIM15_CLK_SLEEP_DISABLE +#define __TIM15_CLK_SLEEP_ENABLE __HAL_RCC_TIM15_CLK_SLEEP_ENABLE +#define __TIM15_FORCE_RESET __HAL_RCC_TIM15_FORCE_RESET +#define __TIM15_RELEASE_RESET __HAL_RCC_TIM15_RELEASE_RESET +#define __TIM16_CLK_DISABLE __HAL_RCC_TIM16_CLK_DISABLE +#define __TIM16_CLK_ENABLE __HAL_RCC_TIM16_CLK_ENABLE +#define __TIM16_CLK_SLEEP_DISABLE __HAL_RCC_TIM16_CLK_SLEEP_DISABLE +#define __TIM16_CLK_SLEEP_ENABLE __HAL_RCC_TIM16_CLK_SLEEP_ENABLE +#define __TIM16_FORCE_RESET __HAL_RCC_TIM16_FORCE_RESET +#define __TIM16_RELEASE_RESET __HAL_RCC_TIM16_RELEASE_RESET +#define __TIM17_CLK_DISABLE __HAL_RCC_TIM17_CLK_DISABLE +#define __TIM17_CLK_ENABLE __HAL_RCC_TIM17_CLK_ENABLE +#define __TIM17_CLK_SLEEP_DISABLE __HAL_RCC_TIM17_CLK_SLEEP_DISABLE +#define __TIM17_CLK_SLEEP_ENABLE __HAL_RCC_TIM17_CLK_SLEEP_ENABLE +#define __TIM17_FORCE_RESET __HAL_RCC_TIM17_FORCE_RESET +#define __TIM17_RELEASE_RESET __HAL_RCC_TIM17_RELEASE_RESET +#define __TIM2_CLK_DISABLE __HAL_RCC_TIM2_CLK_DISABLE +#define __TIM2_CLK_ENABLE __HAL_RCC_TIM2_CLK_ENABLE +#define __TIM2_CLK_SLEEP_DISABLE __HAL_RCC_TIM2_CLK_SLEEP_DISABLE +#define __TIM2_CLK_SLEEP_ENABLE __HAL_RCC_TIM2_CLK_SLEEP_ENABLE +#define __TIM2_FORCE_RESET __HAL_RCC_TIM2_FORCE_RESET +#define __TIM2_RELEASE_RESET __HAL_RCC_TIM2_RELEASE_RESET +#define __TIM3_CLK_DISABLE __HAL_RCC_TIM3_CLK_DISABLE +#define __TIM3_CLK_ENABLE __HAL_RCC_TIM3_CLK_ENABLE +#define __TIM3_CLK_SLEEP_DISABLE __HAL_RCC_TIM3_CLK_SLEEP_DISABLE +#define __TIM3_CLK_SLEEP_ENABLE __HAL_RCC_TIM3_CLK_SLEEP_ENABLE +#define __TIM3_FORCE_RESET __HAL_RCC_TIM3_FORCE_RESET +#define __TIM3_RELEASE_RESET __HAL_RCC_TIM3_RELEASE_RESET +#define __TIM4_CLK_DISABLE __HAL_RCC_TIM4_CLK_DISABLE +#define __TIM4_CLK_ENABLE __HAL_RCC_TIM4_CLK_ENABLE +#define __TIM4_CLK_SLEEP_DISABLE __HAL_RCC_TIM4_CLK_SLEEP_DISABLE +#define __TIM4_CLK_SLEEP_ENABLE __HAL_RCC_TIM4_CLK_SLEEP_ENABLE +#define __TIM4_FORCE_RESET __HAL_RCC_TIM4_FORCE_RESET +#define __TIM4_RELEASE_RESET __HAL_RCC_TIM4_RELEASE_RESET +#define __TIM5_CLK_DISABLE __HAL_RCC_TIM5_CLK_DISABLE +#define __TIM5_CLK_ENABLE __HAL_RCC_TIM5_CLK_ENABLE +#define __TIM5_CLK_SLEEP_DISABLE __HAL_RCC_TIM5_CLK_SLEEP_DISABLE +#define __TIM5_CLK_SLEEP_ENABLE __HAL_RCC_TIM5_CLK_SLEEP_ENABLE +#define __TIM5_FORCE_RESET __HAL_RCC_TIM5_FORCE_RESET +#define __TIM5_RELEASE_RESET __HAL_RCC_TIM5_RELEASE_RESET +#define __TIM6_CLK_DISABLE __HAL_RCC_TIM6_CLK_DISABLE +#define __TIM6_CLK_ENABLE __HAL_RCC_TIM6_CLK_ENABLE +#define __TIM6_CLK_SLEEP_DISABLE __HAL_RCC_TIM6_CLK_SLEEP_DISABLE +#define __TIM6_CLK_SLEEP_ENABLE __HAL_RCC_TIM6_CLK_SLEEP_ENABLE +#define __TIM6_FORCE_RESET __HAL_RCC_TIM6_FORCE_RESET +#define __TIM6_RELEASE_RESET __HAL_RCC_TIM6_RELEASE_RESET +#define __TIM7_CLK_DISABLE __HAL_RCC_TIM7_CLK_DISABLE +#define __TIM7_CLK_ENABLE __HAL_RCC_TIM7_CLK_ENABLE +#define __TIM7_CLK_SLEEP_DISABLE __HAL_RCC_TIM7_CLK_SLEEP_DISABLE +#define __TIM7_CLK_SLEEP_ENABLE __HAL_RCC_TIM7_CLK_SLEEP_ENABLE +#define __TIM7_FORCE_RESET __HAL_RCC_TIM7_FORCE_RESET +#define __TIM7_RELEASE_RESET __HAL_RCC_TIM7_RELEASE_RESET +#define __TIM8_CLK_DISABLE __HAL_RCC_TIM8_CLK_DISABLE +#define __TIM8_CLK_ENABLE __HAL_RCC_TIM8_CLK_ENABLE +#define __TIM8_CLK_SLEEP_DISABLE __HAL_RCC_TIM8_CLK_SLEEP_DISABLE +#define __TIM8_CLK_SLEEP_ENABLE __HAL_RCC_TIM8_CLK_SLEEP_ENABLE +#define __TIM8_FORCE_RESET __HAL_RCC_TIM8_FORCE_RESET +#define __TIM8_RELEASE_RESET __HAL_RCC_TIM8_RELEASE_RESET +#define __TIM9_CLK_DISABLE __HAL_RCC_TIM9_CLK_DISABLE +#define __TIM9_CLK_ENABLE __HAL_RCC_TIM9_CLK_ENABLE +#define __TIM9_FORCE_RESET __HAL_RCC_TIM9_FORCE_RESET +#define __TIM9_RELEASE_RESET __HAL_RCC_TIM9_RELEASE_RESET +#define __TSC_CLK_DISABLE __HAL_RCC_TSC_CLK_DISABLE +#define __TSC_CLK_ENABLE __HAL_RCC_TSC_CLK_ENABLE +#define __TSC_CLK_SLEEP_DISABLE __HAL_RCC_TSC_CLK_SLEEP_DISABLE +#define __TSC_CLK_SLEEP_ENABLE __HAL_RCC_TSC_CLK_SLEEP_ENABLE +#define __TSC_FORCE_RESET __HAL_RCC_TSC_FORCE_RESET +#define __TSC_RELEASE_RESET __HAL_RCC_TSC_RELEASE_RESET +#define __UART4_CLK_DISABLE __HAL_RCC_UART4_CLK_DISABLE +#define __UART4_CLK_ENABLE __HAL_RCC_UART4_CLK_ENABLE +#define __UART4_CLK_SLEEP_DISABLE __HAL_RCC_UART4_CLK_SLEEP_DISABLE +#define __UART4_CLK_SLEEP_ENABLE __HAL_RCC_UART4_CLK_SLEEP_ENABLE +#define __UART4_FORCE_RESET __HAL_RCC_UART4_FORCE_RESET +#define __UART4_RELEASE_RESET __HAL_RCC_UART4_RELEASE_RESET +#define __UART5_CLK_DISABLE __HAL_RCC_UART5_CLK_DISABLE +#define __UART5_CLK_ENABLE __HAL_RCC_UART5_CLK_ENABLE +#define __UART5_CLK_SLEEP_DISABLE __HAL_RCC_UART5_CLK_SLEEP_DISABLE +#define __UART5_CLK_SLEEP_ENABLE __HAL_RCC_UART5_CLK_SLEEP_ENABLE +#define __UART5_FORCE_RESET __HAL_RCC_UART5_FORCE_RESET +#define __UART5_RELEASE_RESET __HAL_RCC_UART5_RELEASE_RESET +#define __USART1_CLK_DISABLE __HAL_RCC_USART1_CLK_DISABLE +#define __USART1_CLK_ENABLE __HAL_RCC_USART1_CLK_ENABLE +#define __USART1_CLK_SLEEP_DISABLE __HAL_RCC_USART1_CLK_SLEEP_DISABLE +#define __USART1_CLK_SLEEP_ENABLE __HAL_RCC_USART1_CLK_SLEEP_ENABLE +#define __USART1_FORCE_RESET __HAL_RCC_USART1_FORCE_RESET +#define __USART1_RELEASE_RESET __HAL_RCC_USART1_RELEASE_RESET +#define __USART2_CLK_DISABLE __HAL_RCC_USART2_CLK_DISABLE +#define __USART2_CLK_ENABLE __HAL_RCC_USART2_CLK_ENABLE +#define __USART2_CLK_SLEEP_DISABLE __HAL_RCC_USART2_CLK_SLEEP_DISABLE +#define __USART2_CLK_SLEEP_ENABLE __HAL_RCC_USART2_CLK_SLEEP_ENABLE +#define __USART2_FORCE_RESET __HAL_RCC_USART2_FORCE_RESET +#define __USART2_RELEASE_RESET __HAL_RCC_USART2_RELEASE_RESET +#define __USART3_CLK_DISABLE __HAL_RCC_USART3_CLK_DISABLE +#define __USART3_CLK_ENABLE __HAL_RCC_USART3_CLK_ENABLE +#define __USART3_CLK_SLEEP_DISABLE __HAL_RCC_USART3_CLK_SLEEP_DISABLE +#define __USART3_CLK_SLEEP_ENABLE __HAL_RCC_USART3_CLK_SLEEP_ENABLE +#define __USART3_FORCE_RESET __HAL_RCC_USART3_FORCE_RESET +#define __USART3_RELEASE_RESET __HAL_RCC_USART3_RELEASE_RESET +#define __USART4_CLK_DISABLE __HAL_RCC_USART4_CLK_DISABLE +#define __USART4_CLK_ENABLE __HAL_RCC_USART4_CLK_ENABLE +#define __USART4_CLK_SLEEP_ENABLE __HAL_RCC_USART4_CLK_SLEEP_ENABLE +#define __USART4_CLK_SLEEP_DISABLE __HAL_RCC_USART4_CLK_SLEEP_DISABLE +#define __USART4_FORCE_RESET __HAL_RCC_USART4_FORCE_RESET +#define __USART4_RELEASE_RESET __HAL_RCC_USART4_RELEASE_RESET +#define __USART5_CLK_DISABLE __HAL_RCC_USART5_CLK_DISABLE +#define __USART5_CLK_ENABLE __HAL_RCC_USART5_CLK_ENABLE +#define __USART5_CLK_SLEEP_ENABLE __HAL_RCC_USART5_CLK_SLEEP_ENABLE +#define __USART5_CLK_SLEEP_DISABLE __HAL_RCC_USART5_CLK_SLEEP_DISABLE +#define __USART5_FORCE_RESET __HAL_RCC_USART5_FORCE_RESET +#define __USART5_RELEASE_RESET __HAL_RCC_USART5_RELEASE_RESET +#define __USART7_CLK_DISABLE __HAL_RCC_USART7_CLK_DISABLE +#define __USART7_CLK_ENABLE __HAL_RCC_USART7_CLK_ENABLE +#define __USART7_FORCE_RESET __HAL_RCC_USART7_FORCE_RESET +#define __USART7_RELEASE_RESET __HAL_RCC_USART7_RELEASE_RESET +#define __USART8_CLK_DISABLE __HAL_RCC_USART8_CLK_DISABLE +#define __USART8_CLK_ENABLE __HAL_RCC_USART8_CLK_ENABLE +#define __USART8_FORCE_RESET __HAL_RCC_USART8_FORCE_RESET +#define __USART8_RELEASE_RESET __HAL_RCC_USART8_RELEASE_RESET +#define __USB_CLK_DISABLE __HAL_RCC_USB_CLK_DISABLE +#define __USB_CLK_ENABLE __HAL_RCC_USB_CLK_ENABLE +#define __USB_FORCE_RESET __HAL_RCC_USB_FORCE_RESET +#define __USB_CLK_SLEEP_ENABLE __HAL_RCC_USB_CLK_SLEEP_ENABLE +#define __USB_CLK_SLEEP_DISABLE __HAL_RCC_USB_CLK_SLEEP_DISABLE +#define __USB_OTG_FS_CLK_DISABLE __HAL_RCC_USB_OTG_FS_CLK_DISABLE +#define __USB_OTG_FS_CLK_ENABLE __HAL_RCC_USB_OTG_FS_CLK_ENABLE +#define __USB_RELEASE_RESET __HAL_RCC_USB_RELEASE_RESET +#define __WWDG_CLK_DISABLE __HAL_RCC_WWDG_CLK_DISABLE +#define __WWDG_CLK_ENABLE __HAL_RCC_WWDG_CLK_ENABLE +#define __WWDG_CLK_SLEEP_DISABLE __HAL_RCC_WWDG_CLK_SLEEP_DISABLE +#define __WWDG_CLK_SLEEP_ENABLE __HAL_RCC_WWDG_CLK_SLEEP_ENABLE +#define __WWDG_FORCE_RESET __HAL_RCC_WWDG_FORCE_RESET +#define __WWDG_RELEASE_RESET __HAL_RCC_WWDG_RELEASE_RESET +#define __TIM21_CLK_ENABLE __HAL_RCC_TIM21_CLK_ENABLE +#define __TIM21_CLK_DISABLE __HAL_RCC_TIM21_CLK_DISABLE +#define __TIM21_FORCE_RESET __HAL_RCC_TIM21_FORCE_RESET +#define __TIM21_RELEASE_RESET __HAL_RCC_TIM21_RELEASE_RESET +#define __TIM21_CLK_SLEEP_ENABLE __HAL_RCC_TIM21_CLK_SLEEP_ENABLE +#define __TIM21_CLK_SLEEP_DISABLE __HAL_RCC_TIM21_CLK_SLEEP_DISABLE +#define __TIM22_CLK_ENABLE __HAL_RCC_TIM22_CLK_ENABLE +#define __TIM22_CLK_DISABLE __HAL_RCC_TIM22_CLK_DISABLE +#define __TIM22_FORCE_RESET __HAL_RCC_TIM22_FORCE_RESET +#define __TIM22_RELEASE_RESET __HAL_RCC_TIM22_RELEASE_RESET +#define __TIM22_CLK_SLEEP_ENABLE __HAL_RCC_TIM22_CLK_SLEEP_ENABLE +#define __TIM22_CLK_SLEEP_DISABLE __HAL_RCC_TIM22_CLK_SLEEP_DISABLE +#define __CRS_CLK_DISABLE __HAL_RCC_CRS_CLK_DISABLE +#define __CRS_CLK_ENABLE __HAL_RCC_CRS_CLK_ENABLE +#define __CRS_CLK_SLEEP_DISABLE __HAL_RCC_CRS_CLK_SLEEP_DISABLE +#define __CRS_CLK_SLEEP_ENABLE __HAL_RCC_CRS_CLK_SLEEP_ENABLE +#define __CRS_FORCE_RESET __HAL_RCC_CRS_FORCE_RESET +#define __CRS_RELEASE_RESET __HAL_RCC_CRS_RELEASE_RESET +#define __RCC_BACKUPRESET_FORCE __HAL_RCC_BACKUPRESET_FORCE +#define __RCC_BACKUPRESET_RELEASE __HAL_RCC_BACKUPRESET_RELEASE + +#define __USB_OTG_FS_FORCE_RESET __HAL_RCC_USB_OTG_FS_FORCE_RESET +#define __USB_OTG_FS_RELEASE_RESET __HAL_RCC_USB_OTG_FS_RELEASE_RESET +#define __USB_OTG_FS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE +#define __USB_OTG_FS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE +#define __USB_OTG_HS_CLK_DISABLE __HAL_RCC_USB_OTG_HS_CLK_DISABLE +#define __USB_OTG_HS_CLK_ENABLE __HAL_RCC_USB_OTG_HS_CLK_ENABLE +#define __USB_OTG_HS_ULPI_CLK_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE +#define __USB_OTG_HS_ULPI_CLK_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE +#define __TIM9_CLK_SLEEP_ENABLE __HAL_RCC_TIM9_CLK_SLEEP_ENABLE +#define __TIM9_CLK_SLEEP_DISABLE __HAL_RCC_TIM9_CLK_SLEEP_DISABLE +#define __TIM10_CLK_SLEEP_ENABLE __HAL_RCC_TIM10_CLK_SLEEP_ENABLE +#define __TIM10_CLK_SLEEP_DISABLE __HAL_RCC_TIM10_CLK_SLEEP_DISABLE +#define __TIM11_CLK_SLEEP_ENABLE __HAL_RCC_TIM11_CLK_SLEEP_ENABLE +#define __TIM11_CLK_SLEEP_DISABLE __HAL_RCC_TIM11_CLK_SLEEP_DISABLE +#define __ETHMACPTP_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACPTP_CLK_SLEEP_ENABLE +#define __ETHMACPTP_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACPTP_CLK_SLEEP_DISABLE +#define __ETHMACPTP_CLK_ENABLE __HAL_RCC_ETHMACPTP_CLK_ENABLE +#define __ETHMACPTP_CLK_DISABLE __HAL_RCC_ETHMACPTP_CLK_DISABLE +#define __HASH_CLK_ENABLE __HAL_RCC_HASH_CLK_ENABLE +#define __HASH_FORCE_RESET __HAL_RCC_HASH_FORCE_RESET +#define __HASH_RELEASE_RESET __HAL_RCC_HASH_RELEASE_RESET +#define __HASH_CLK_SLEEP_ENABLE __HAL_RCC_HASH_CLK_SLEEP_ENABLE +#define __HASH_CLK_SLEEP_DISABLE __HAL_RCC_HASH_CLK_SLEEP_DISABLE +#define __HASH_CLK_DISABLE __HAL_RCC_HASH_CLK_DISABLE +#define __SPI5_CLK_ENABLE __HAL_RCC_SPI5_CLK_ENABLE +#define __SPI5_CLK_DISABLE __HAL_RCC_SPI5_CLK_DISABLE +#define __SPI5_FORCE_RESET __HAL_RCC_SPI5_FORCE_RESET +#define __SPI5_RELEASE_RESET __HAL_RCC_SPI5_RELEASE_RESET +#define __SPI5_CLK_SLEEP_ENABLE __HAL_RCC_SPI5_CLK_SLEEP_ENABLE +#define __SPI5_CLK_SLEEP_DISABLE __HAL_RCC_SPI5_CLK_SLEEP_DISABLE +#define __SPI6_CLK_ENABLE __HAL_RCC_SPI6_CLK_ENABLE +#define __SPI6_CLK_DISABLE __HAL_RCC_SPI6_CLK_DISABLE +#define __SPI6_FORCE_RESET __HAL_RCC_SPI6_FORCE_RESET +#define __SPI6_RELEASE_RESET __HAL_RCC_SPI6_RELEASE_RESET +#define __SPI6_CLK_SLEEP_ENABLE __HAL_RCC_SPI6_CLK_SLEEP_ENABLE +#define __SPI6_CLK_SLEEP_DISABLE __HAL_RCC_SPI6_CLK_SLEEP_DISABLE +#define __LTDC_CLK_ENABLE __HAL_RCC_LTDC_CLK_ENABLE +#define __LTDC_CLK_DISABLE __HAL_RCC_LTDC_CLK_DISABLE +#define __LTDC_FORCE_RESET __HAL_RCC_LTDC_FORCE_RESET +#define __LTDC_RELEASE_RESET __HAL_RCC_LTDC_RELEASE_RESET +#define __LTDC_CLK_SLEEP_ENABLE __HAL_RCC_LTDC_CLK_SLEEP_ENABLE +#define __ETHMAC_CLK_SLEEP_ENABLE __HAL_RCC_ETHMAC_CLK_SLEEP_ENABLE +#define __ETHMAC_CLK_SLEEP_DISABLE __HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE +#define __ETHMACTX_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACTX_CLK_SLEEP_ENABLE +#define __ETHMACTX_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE +#define __ETHMACRX_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACRX_CLK_SLEEP_ENABLE +#define __ETHMACRX_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE +#define __TIM12_CLK_SLEEP_ENABLE __HAL_RCC_TIM12_CLK_SLEEP_ENABLE +#define __TIM12_CLK_SLEEP_DISABLE __HAL_RCC_TIM12_CLK_SLEEP_DISABLE +#define __TIM13_CLK_SLEEP_ENABLE __HAL_RCC_TIM13_CLK_SLEEP_ENABLE +#define __TIM13_CLK_SLEEP_DISABLE __HAL_RCC_TIM13_CLK_SLEEP_DISABLE +#define __TIM14_CLK_SLEEP_ENABLE __HAL_RCC_TIM14_CLK_SLEEP_ENABLE +#define __TIM14_CLK_SLEEP_DISABLE __HAL_RCC_TIM14_CLK_SLEEP_DISABLE +#define __BKPSRAM_CLK_ENABLE __HAL_RCC_BKPSRAM_CLK_ENABLE +#define __BKPSRAM_CLK_DISABLE __HAL_RCC_BKPSRAM_CLK_DISABLE +#define __BKPSRAM_CLK_SLEEP_ENABLE __HAL_RCC_BKPSRAM_CLK_SLEEP_ENABLE +#define __BKPSRAM_CLK_SLEEP_DISABLE __HAL_RCC_BKPSRAM_CLK_SLEEP_DISABLE +#define __CCMDATARAMEN_CLK_ENABLE __HAL_RCC_CCMDATARAMEN_CLK_ENABLE +#define __CCMDATARAMEN_CLK_DISABLE __HAL_RCC_CCMDATARAMEN_CLK_DISABLE +#define __USART6_CLK_ENABLE __HAL_RCC_USART6_CLK_ENABLE +#define __USART6_CLK_DISABLE __HAL_RCC_USART6_CLK_DISABLE +#define __USART6_FORCE_RESET __HAL_RCC_USART6_FORCE_RESET +#define __USART6_RELEASE_RESET __HAL_RCC_USART6_RELEASE_RESET +#define __USART6_CLK_SLEEP_ENABLE __HAL_RCC_USART6_CLK_SLEEP_ENABLE +#define __USART6_CLK_SLEEP_DISABLE __HAL_RCC_USART6_CLK_SLEEP_DISABLE +#define __SPI4_CLK_ENABLE __HAL_RCC_SPI4_CLK_ENABLE +#define __SPI4_CLK_DISABLE __HAL_RCC_SPI4_CLK_DISABLE +#define __SPI4_FORCE_RESET __HAL_RCC_SPI4_FORCE_RESET +#define __SPI4_RELEASE_RESET __HAL_RCC_SPI4_RELEASE_RESET +#define __SPI4_CLK_SLEEP_ENABLE __HAL_RCC_SPI4_CLK_SLEEP_ENABLE +#define __SPI4_CLK_SLEEP_DISABLE __HAL_RCC_SPI4_CLK_SLEEP_DISABLE +#define __GPIOI_CLK_ENABLE __HAL_RCC_GPIOI_CLK_ENABLE +#define __GPIOI_CLK_DISABLE __HAL_RCC_GPIOI_CLK_DISABLE +#define __GPIOI_FORCE_RESET __HAL_RCC_GPIOI_FORCE_RESET +#define __GPIOI_RELEASE_RESET __HAL_RCC_GPIOI_RELEASE_RESET +#define __GPIOI_CLK_SLEEP_ENABLE __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE +#define __GPIOI_CLK_SLEEP_DISABLE __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE +#define __GPIOJ_CLK_ENABLE __HAL_RCC_GPIOJ_CLK_ENABLE +#define __GPIOJ_CLK_DISABLE __HAL_RCC_GPIOJ_CLK_DISABLE +#define __GPIOJ_FORCE_RESET __HAL_RCC_GPIOJ_FORCE_RESET +#define __GPIOJ_RELEASE_RESET __HAL_RCC_GPIOJ_RELEASE_RESET +#define __GPIOJ_CLK_SLEEP_ENABLE __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE +#define __GPIOJ_CLK_SLEEP_DISABLE __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE +#define __GPIOK_CLK_ENABLE __HAL_RCC_GPIOK_CLK_ENABLE +#define __GPIOK_CLK_DISABLE __HAL_RCC_GPIOK_CLK_DISABLE +#define __GPIOK_RELEASE_RESET __HAL_RCC_GPIOK_RELEASE_RESET +#define __GPIOK_CLK_SLEEP_ENABLE __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE +#define __GPIOK_CLK_SLEEP_DISABLE __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE +#define __ETH_CLK_ENABLE __HAL_RCC_ETH_CLK_ENABLE +#define __ETH_CLK_DISABLE __HAL_RCC_ETH_CLK_DISABLE +#define __DCMI_CLK_ENABLE __HAL_RCC_DCMI_CLK_ENABLE +#define __DCMI_CLK_DISABLE __HAL_RCC_DCMI_CLK_DISABLE +#define __DCMI_FORCE_RESET __HAL_RCC_DCMI_FORCE_RESET +#define __DCMI_RELEASE_RESET __HAL_RCC_DCMI_RELEASE_RESET +#define __DCMI_CLK_SLEEP_ENABLE __HAL_RCC_DCMI_CLK_SLEEP_ENABLE +#define __DCMI_CLK_SLEEP_DISABLE __HAL_RCC_DCMI_CLK_SLEEP_DISABLE +#define __UART7_CLK_ENABLE __HAL_RCC_UART7_CLK_ENABLE +#define __UART7_CLK_DISABLE __HAL_RCC_UART7_CLK_DISABLE +#define __UART7_RELEASE_RESET __HAL_RCC_UART7_RELEASE_RESET +#define __UART7_FORCE_RESET __HAL_RCC_UART7_FORCE_RESET +#define __UART7_CLK_SLEEP_ENABLE __HAL_RCC_UART7_CLK_SLEEP_ENABLE +#define __UART7_CLK_SLEEP_DISABLE __HAL_RCC_UART7_CLK_SLEEP_DISABLE +#define __UART8_CLK_ENABLE __HAL_RCC_UART8_CLK_ENABLE +#define __UART8_CLK_DISABLE __HAL_RCC_UART8_CLK_DISABLE +#define __UART8_FORCE_RESET __HAL_RCC_UART8_FORCE_RESET +#define __UART8_RELEASE_RESET __HAL_RCC_UART8_RELEASE_RESET +#define __UART8_CLK_SLEEP_ENABLE __HAL_RCC_UART8_CLK_SLEEP_ENABLE +#define __UART8_CLK_SLEEP_DISABLE __HAL_RCC_UART8_CLK_SLEEP_DISABLE +#define __OTGHS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE +#define __OTGHS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE +#define __OTGHS_FORCE_RESET __HAL_RCC_USB_OTG_HS_FORCE_RESET +#define __OTGHS_RELEASE_RESET __HAL_RCC_USB_OTG_HS_RELEASE_RESET +#define __OTGHSULPI_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE +#define __OTGHSULPI_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE +#define __HAL_RCC_OTGHS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE +#define __HAL_RCC_OTGHS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE +#define __HAL_RCC_OTGHS_FORCE_RESET __HAL_RCC_USB_OTG_HS_FORCE_RESET +#define __HAL_RCC_OTGHS_RELEASE_RESET __HAL_RCC_USB_OTG_HS_RELEASE_RESET +#define __HAL_RCC_OTGHSULPI_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE +#define __HAL_RCC_OTGHSULPI_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE +#define __CRYP_FORCE_RESET __HAL_RCC_CRYP_FORCE_RESET +#define __SRAM3_CLK_SLEEP_ENABLE __HAL_RCC_SRAM3_CLK_SLEEP_ENABLE +#define __CAN2_CLK_SLEEP_ENABLE __HAL_RCC_CAN2_CLK_SLEEP_ENABLE +#define __CAN2_CLK_SLEEP_DISABLE __HAL_RCC_CAN2_CLK_SLEEP_DISABLE +#define __DAC_CLK_SLEEP_ENABLE __HAL_RCC_DAC_CLK_SLEEP_ENABLE +#define __DAC_CLK_SLEEP_DISABLE __HAL_RCC_DAC_CLK_SLEEP_DISABLE +#define __ADC2_CLK_SLEEP_ENABLE __HAL_RCC_ADC2_CLK_SLEEP_ENABLE +#define __ADC2_CLK_SLEEP_DISABLE __HAL_RCC_ADC2_CLK_SLEEP_DISABLE +#define __ADC3_CLK_SLEEP_ENABLE __HAL_RCC_ADC3_CLK_SLEEP_ENABLE +#define __ADC3_CLK_SLEEP_DISABLE __HAL_RCC_ADC3_CLK_SLEEP_DISABLE +#define __FSMC_FORCE_RESET __HAL_RCC_FSMC_FORCE_RESET +#define __FSMC_RELEASE_RESET __HAL_RCC_FSMC_RELEASE_RESET +#define __FSMC_CLK_SLEEP_ENABLE __HAL_RCC_FSMC_CLK_SLEEP_ENABLE +#define __FSMC_CLK_SLEEP_DISABLE __HAL_RCC_FSMC_CLK_SLEEP_DISABLE +#define __SDIO_FORCE_RESET __HAL_RCC_SDIO_FORCE_RESET +#define __SDIO_RELEASE_RESET __HAL_RCC_SDIO_RELEASE_RESET +#define __SDIO_CLK_SLEEP_DISABLE __HAL_RCC_SDIO_CLK_SLEEP_DISABLE +#define __SDIO_CLK_SLEEP_ENABLE __HAL_RCC_SDIO_CLK_SLEEP_ENABLE +#define __DMA2D_CLK_ENABLE __HAL_RCC_DMA2D_CLK_ENABLE +#define __DMA2D_CLK_DISABLE __HAL_RCC_DMA2D_CLK_DISABLE +#define __DMA2D_FORCE_RESET __HAL_RCC_DMA2D_FORCE_RESET +#define __DMA2D_RELEASE_RESET __HAL_RCC_DMA2D_RELEASE_RESET +#define __DMA2D_CLK_SLEEP_ENABLE __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE +#define __DMA2D_CLK_SLEEP_DISABLE __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE + +/* alias define maintained for legacy */ +#define __HAL_RCC_OTGFS_FORCE_RESET __HAL_RCC_USB_OTG_FS_FORCE_RESET +#define __HAL_RCC_OTGFS_RELEASE_RESET __HAL_RCC_USB_OTG_FS_RELEASE_RESET + +#define __HAL_RCC_I2SCLK __HAL_RCC_I2S_CONFIG +#define __HAL_RCC_I2SCLK_CONFIG __HAL_RCC_I2S_CONFIG + +#define __RCC_PLLSRC RCC_GET_PLL_OSCSOURCE + +#define IS_RCC_MSIRANGE IS_RCC_MSI_CLOCK_RANGE +#define IS_RCC_RTCCLK_SOURCE IS_RCC_RTCCLKSOURCE +#define IS_RCC_SYSCLK_DIV IS_RCC_HCLK +#define IS_RCC_HCLK_DIV IS_RCC_PCLK + +#define IS_RCC_MCOSOURCE IS_RCC_MCO1SOURCE +#define RCC_MCO_NODIV RCC_MCODIV_1 +#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK + +#define HSION_BitNumber RCC_HSION_BIT_NUMBER +#define CSSON_BitNumber RCC_CSSON_BIT_NUMBER +#define PLLON_BitNumber RCC_PLLON_BIT_NUMBER +#define PLLI2SON_BitNumber RCC_PLLI2SON_BIT_NUMBER +#define I2SSRC_BitNumber RCC_I2SSRC_BIT_NUMBER +#define RTCEN_BitNumber RCC_RTCEN_BIT_NUMBER +#define BDRST_BitNumber RCC_BDRST_BIT_NUMBER +#define LSION_BitNumber RCC_LSION_BIT_NUMBER +#define PLLSAION_BitNumber RCC_PLLSAION_BIT_NUMBER +#define TIMPRE_BitNumber RCC_TIMPRE_BIT_NUMBER + +#define CR_BYTE2_ADDRESS RCC_CR_BYTE2_ADDRESS +#define CIR_BYTE1_ADDRESS RCC_CIR_BYTE1_ADDRESS +#define CIR_BYTE2_ADDRESS RCC_CIR_BYTE2_ADDRESS +#define BDCR_BYTE0_ADDRESS RCC_BDCR_BYTE0_ADDRESS +#define DBP_TIMEOUT_VALUE RCC_DBP_TIMEOUT_VALUE +#define LSE_TIMEOUT_VALUE RCC_LSE_TIMEOUT_VALUE + +#define CR_HSION_BB RCC_CR_HSION_BB +#define CR_CSSON_BB RCC_CR_CSSON_BB +#define CR_PLLON_BB RCC_CR_PLLON_BB +#define CR_PLLI2SON_BB RCC_CR_PLLI2SON_BB +#define CR_MSION_BB RCC_CR_MSION_BB +#define CSR_LSION_BB RCC_CSR_LSION_BB +#define CSR_LSEON_BB RCC_CSR_LSEON_BB +#define CSR_LSEBYP_BB RCC_CSR_LSEBYP_BB +#define CSR_RTCEN_BB RCC_CSR_RTCEN_BB +#define CSR_RTCRST_BB RCC_CSR_RTCRST_BB +#define CFGR_I2SSRC_BB RCC_CFGR_I2SSRC_BB +#define BDCR_RTCEN_BB RCC_BDCR_RTCEN_BB +#define BDCR_BDRST_BB RCC_BDCR_BDRST_BB +#define CR_PLLSAION_BB RCC_CR_PLLSAION_BB +#define DCKCFGR_TIMPRE_BB RCC_DCKCFGR_TIMPRE_BB + +/** + * @} + */ + +/** @defgroup HAL_RNG_Aliased_Macros HAL RNG Aliased Macros maintained for legacy purpose + * @{ + */ +#define HAL_RNG_ReadyCallback(__HANDLE__) HAL_RNG_ReadyDataCallback((__HANDLE__), uint32_t random32bit) + +/** + * @} + */ + +/** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG +#define __HAL_RTC_DISABLE_IT __HAL_RTC_EXTI_DISABLE_IT +#define __HAL_RTC_ENABLE_IT __HAL_RTC_EXTI_ENABLE_IT +#if defined (STM32F1) +#define __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() + +#define __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_ENABLE_IT() + +#define __HAL_RTC_EXTI_DISABLE_IT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_DISABLE_IT() + +#define __HAL_RTC_EXTI_GET_FLAG(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_GET_FLAG() + +#define __HAL_RTC_EXTI_GENERATE_SWIT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() +#else +#define __HAL_RTC_EXTI_CLEAR_FLAG(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG())) +#define __HAL_RTC_EXTI_ENABLE_IT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_ENABLE_IT() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT())) +#define __HAL_RTC_EXTI_DISABLE_IT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_DISABLE_IT() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT())) +#define __HAL_RTC_EXTI_GET_FLAG(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_GET_FLAG() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG())) +#define __HAL_RTC_EXTI_GENERATE_SWIT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT())) +#endif /* STM32F1 */ + +#define IS_ALARM IS_RTC_ALARM +#define IS_ALARM_MASK IS_RTC_ALARM_MASK +#define IS_TAMPER IS_RTC_TAMPER +#define IS_TAMPER_ERASE_MODE IS_RTC_TAMPER_ERASE_MODE +#define IS_TAMPER_FILTER IS_RTC_TAMPER_FILTER +#define IS_TAMPER_INTERRUPT IS_RTC_TAMPER_INTERRUPT +#define IS_TAMPER_MASKFLAG_STATE IS_RTC_TAMPER_MASKFLAG_STATE +#define IS_TAMPER_PRECHARGE_DURATION IS_RTC_TAMPER_PRECHARGE_DURATION +#define IS_TAMPER_PULLUP_STATE IS_RTC_TAMPER_PULLUP_STATE +#define IS_TAMPER_SAMPLING_FREQ IS_RTC_TAMPER_SAMPLING_FREQ +#define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION +#define IS_TAMPER_TRIGGER IS_RTC_TAMPER_TRIGGER +#define IS_WAKEUP_CLOCK IS_RTC_WAKEUP_CLOCK +#define IS_WAKEUP_COUNTER IS_RTC_WAKEUP_COUNTER + +#define __RTC_WRITEPROTECTION_ENABLE __HAL_RTC_WRITEPROTECTION_ENABLE +#define __RTC_WRITEPROTECTION_DISABLE __HAL_RTC_WRITEPROTECTION_DISABLE + +/** + * @} + */ + +/** @defgroup HAL_SD_Aliased_Macros HAL SD Aliased Macros maintained for legacy purpose + * @{ + */ + +#define SD_OCR_CID_CSD_OVERWRIETE SD_OCR_CID_CSD_OVERWRITE +#define SD_CMD_SD_APP_STAUS SD_CMD_SD_APP_STATUS + +/** + * @} + */ + +/** @defgroup HAL_SMARTCARD_Aliased_Macros HAL SMARTCARD Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __SMARTCARD_ENABLE_IT __HAL_SMARTCARD_ENABLE_IT +#define __SMARTCARD_DISABLE_IT __HAL_SMARTCARD_DISABLE_IT +#define __SMARTCARD_ENABLE __HAL_SMARTCARD_ENABLE +#define __SMARTCARD_DISABLE __HAL_SMARTCARD_DISABLE +#define __SMARTCARD_DMA_REQUEST_ENABLE __HAL_SMARTCARD_DMA_REQUEST_ENABLE +#define __SMARTCARD_DMA_REQUEST_DISABLE __HAL_SMARTCARD_DMA_REQUEST_DISABLE + +#define __HAL_SMARTCARD_GETCLOCKSOURCE SMARTCARD_GETCLOCKSOURCE +#define __SMARTCARD_GETCLOCKSOURCE SMARTCARD_GETCLOCKSOURCE + +#define IS_SMARTCARD_ONEBIT_SAMPLING IS_SMARTCARD_ONE_BIT_SAMPLE + +#define SMARTCARD_WORDLENGTH_8B ((uint32_t)0x00000000) +#define SMARTCARD_STOPBITS_1 ((uint32_t)0x00000000) +#define SMARTCARD_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) +#define SMARTCARD_PARITY_NONE ((uint32_t)0x00000000) + + +/** + * @} + */ + +/** @defgroup HAL_SMBUS_Aliased_Macros HAL SMBUS Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_SMBUS_RESET_CR1 SMBUS_RESET_CR1 +#define __HAL_SMBUS_RESET_CR2 SMBUS_RESET_CR2 +#define __HAL_SMBUS_GENERATE_START SMBUS_GENERATE_START +#define __HAL_SMBUS_GET_ADDR_MATCH SMBUS_GET_ADDR_MATCH +#define __HAL_SMBUS_GET_DIR SMBUS_GET_DIR +#define __HAL_SMBUS_GET_STOP_MODE SMBUS_GET_STOP_MODE +#define __HAL_SMBUS_GET_PEC_MODE SMBUS_GET_PEC_MODE +#define __HAL_SMBUS_GET_ALERT_ENABLED SMBUS_GET_ALERT_ENABLED +/** + * @} + */ + +/** @defgroup HAL_SPI_Aliased_Macros HAL SPI Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_SPI_1LINE_TX SPI_1LINE_TX +#define __HAL_SPI_1LINE_RX SPI_1LINE_RX +#define __HAL_SPI_RESET_CRC SPI_RESET_CRC + +/** + * @} + */ + +/** @defgroup HAL_UART_Aliased_Macros HAL UART Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_UART_GETCLOCKSOURCE UART_GETCLOCKSOURCE +#define __HAL_UART_MASK_COMPUTATION UART_MASK_COMPUTATION +#define __UART_GETCLOCKSOURCE UART_GETCLOCKSOURCE +#define __UART_MASK_COMPUTATION UART_MASK_COMPUTATION + +#define IS_UART_WAKEUPMETHODE IS_UART_WAKEUPMETHOD + +#define IS_UART_ONEBIT_SAMPLE IS_UART_ONE_BIT_SAMPLE +#define IS_UART_ONEBIT_SAMPLING IS_UART_ONE_BIT_SAMPLE + +/** + * @} + */ + + +/** @defgroup HAL_USART_Aliased_Macros HAL USART Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __USART_ENABLE_IT __HAL_USART_ENABLE_IT +#define __USART_DISABLE_IT __HAL_USART_DISABLE_IT +#define __USART_ENABLE __HAL_USART_ENABLE +#define __USART_DISABLE __HAL_USART_DISABLE + +#define __HAL_USART_GETCLOCKSOURCE USART_GETCLOCKSOURCE +#define __USART_GETCLOCKSOURCE USART_GETCLOCKSOURCE + +/** + * @} + */ + +/** @defgroup HAL_USB_Aliased_Macros HAL USB Aliased Macros maintained for legacy purpose + * @{ + */ +#define USB_EXTI_LINE_WAKEUP USB_WAKEUP_EXTI_LINE + +#define USB_FS_EXTI_TRIGGER_RISING_EDGE USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE +#define USB_FS_EXTI_TRIGGER_FALLING_EDGE USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE +#define USB_FS_EXTI_TRIGGER_BOTH_EDGE USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE +#define USB_FS_EXTI_LINE_WAKEUP USB_OTG_FS_WAKEUP_EXTI_LINE + +#define USB_HS_EXTI_TRIGGER_RISING_EDGE USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE +#define USB_HS_EXTI_TRIGGER_FALLING_EDGE USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE +#define USB_HS_EXTI_TRIGGER_BOTH_EDGE USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE +#define USB_HS_EXTI_LINE_WAKEUP USB_OTG_HS_WAKEUP_EXTI_LINE + +#define __HAL_USB_EXTI_ENABLE_IT __HAL_USB_WAKEUP_EXTI_ENABLE_IT +#define __HAL_USB_EXTI_DISABLE_IT __HAL_USB_WAKEUP_EXTI_DISABLE_IT +#define __HAL_USB_EXTI_GET_FLAG __HAL_USB_WAKEUP_EXTI_GET_FLAG +#define __HAL_USB_EXTI_CLEAR_FLAG __HAL_USB_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_USB_EXTI_SET_RISING_EDGE_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE +#define __HAL_USB_EXTI_SET_FALLING_EDGE_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_FALLING_EDGE +#define __HAL_USB_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE + +#define __HAL_USB_FS_EXTI_ENABLE_IT __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT +#define __HAL_USB_FS_EXTI_DISABLE_IT __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT +#define __HAL_USB_FS_EXTI_GET_FLAG __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG +#define __HAL_USB_FS_EXTI_CLEAR_FLAG __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_USB_FS_EXTI_SET_RISING_EGDE_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE +#define __HAL_USB_FS_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE +#define __HAL_USB_FS_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE +#define __HAL_USB_FS_EXTI_GENERATE_SWIT __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT + +#define __HAL_USB_HS_EXTI_ENABLE_IT __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT +#define __HAL_USB_HS_EXTI_DISABLE_IT __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT +#define __HAL_USB_HS_EXTI_GET_FLAG __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG +#define __HAL_USB_HS_EXTI_CLEAR_FLAG __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_USB_HS_EXTI_SET_RISING_EGDE_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE +#define __HAL_USB_HS_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE +#define __HAL_USB_HS_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE +#define __HAL_USB_HS_EXTI_GENERATE_SWIT __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT + +#define HAL_PCD_ActiveRemoteWakeup HAL_PCD_ActivateRemoteWakeup +#define HAL_PCD_DeActiveRemoteWakeup HAL_PCD_DeActivateRemoteWakeup + +#define HAL_PCD_SetTxFiFo HAL_PCDEx_SetTxFiFo +#define HAL_PCD_SetRxFiFo HAL_PCDEx_SetRxFiFo +/** + * @} + */ + +/** @defgroup HAL_TIM_Aliased_Macros HAL TIM Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_TIM_SetICPrescalerValue TIM_SET_ICPRESCALERVALUE +#define __HAL_TIM_ResetICPrescalerValue TIM_RESET_ICPRESCALERVALUE + +#define TIM_GET_ITSTATUS __HAL_TIM_GET_IT_SOURCE +#define TIM_GET_CLEAR_IT __HAL_TIM_CLEAR_IT + +#define __HAL_TIM_GET_ITSTATUS __HAL_TIM_GET_IT_SOURCE + +#define __HAL_TIM_DIRECTION_STATUS __HAL_TIM_IS_TIM_COUNTING_DOWN +#define __HAL_TIM_PRESCALER __HAL_TIM_SET_PRESCALER +#define __HAL_TIM_SetCounter __HAL_TIM_SET_COUNTER +#define __HAL_TIM_GetCounter __HAL_TIM_GET_COUNTER +#define __HAL_TIM_SetAutoreload __HAL_TIM_SET_AUTORELOAD +#define __HAL_TIM_GetAutoreload __HAL_TIM_GET_AUTORELOAD +#define __HAL_TIM_SetClockDivision __HAL_TIM_SET_CLOCKDIVISION +#define __HAL_TIM_GetClockDivision __HAL_TIM_GET_CLOCKDIVISION +#define __HAL_TIM_SetICPrescaler __HAL_TIM_SET_ICPRESCALER +#define __HAL_TIM_GetICPrescaler __HAL_TIM_GET_ICPRESCALER +#define __HAL_TIM_SetCompare __HAL_TIM_SET_COMPARE +#define __HAL_TIM_GetCompare __HAL_TIM_GET_COMPARE + +#define TIM_TS_ITR0 ((uint32_t)0x0000) +#define TIM_TS_ITR1 ((uint32_t)0x0010) +#define TIM_TS_ITR2 ((uint32_t)0x0020) +#define TIM_TS_ITR3 ((uint32_t)0x0030) +#define IS_TIM_INTERNAL_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ + ((SELECTION) == TIM_TS_ITR1) || \ + ((SELECTION) == TIM_TS_ITR2) || \ + ((SELECTION) == TIM_TS_ITR3)) + +#define TIM_CHANNEL_1 ((uint32_t)0x0000) +#define TIM_CHANNEL_2 ((uint32_t)0x0004) +#define IS_TIM_PWMI_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ + ((CHANNEL) == TIM_CHANNEL_2)) + +#define TIM_OUTPUTNSTATE_DISABLE ((uint32_t)0x0000) +#define TIM_OUTPUTNSTATE_ENABLE (TIM_CCER_CC1NE) + +#define IS_TIM_OUTPUTN_STATE(STATE) (((STATE) == TIM_OUTPUTNSTATE_DISABLE) || \ + ((STATE) == TIM_OUTPUTNSTATE_ENABLE)) + +#define TIM_OUTPUTSTATE_DISABLE ((uint32_t)0x0000) +#define TIM_OUTPUTSTATE_ENABLE (TIM_CCER_CC1E) + +#define IS_TIM_OUTPUT_STATE(STATE) (((STATE) == TIM_OUTPUTSTATE_DISABLE) || \ + ((STATE) == TIM_OUTPUTSTATE_ENABLE)) +/** + * @} + */ + +/** @defgroup HAL_ETH_Aliased_Macros HAL ETH Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_ETH_EXTI_ENABLE_IT __HAL_ETH_WAKEUP_EXTI_ENABLE_IT +#define __HAL_ETH_EXTI_DISABLE_IT __HAL_ETH_WAKEUP_EXTI_DISABLE_IT +#define __HAL_ETH_EXTI_GET_FLAG __HAL_ETH_WAKEUP_EXTI_GET_FLAG +#define __HAL_ETH_EXTI_CLEAR_FLAG __HAL_ETH_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_ETH_EXTI_SET_RISING_EGDE_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER +#define __HAL_ETH_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER +#define __HAL_ETH_EXTI_SET_FALLINGRISING_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER + +#define ETH_PROMISCIOUSMODE_ENABLE ETH_PROMISCUOUS_MODE_ENABLE +#define ETH_PROMISCIOUSMODE_DISABLE ETH_PROMISCUOUS_MODE_DISABLE +#define IS_ETH_PROMISCIOUS_MODE IS_ETH_PROMISCUOUS_MODE +/** + * @} + */ + +/** @defgroup HAL_LTDC_Aliased_Macros HAL LTDC Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_LTDC_LAYER LTDC_LAYER +/** + * @} + */ + +/** @defgroup HAL_SAI_Aliased_Macros HAL SAI Aliased Macros maintained for legacy purpose + * @{ + */ +#define SAI_OUTPUTDRIVE_DISABLED SAI_OUTPUTDRIVE_DISABLE +#define SAI_OUTPUTDRIVE_ENABLED SAI_OUTPUTDRIVE_ENABLE +#define SAI_MASTERDIVIDER_ENABLED SAI_MASTERDIVIDER_ENABLE +#define SAI_MASTERDIVIDER_DISABLED SAI_MASTERDIVIDER_DISABLE +#define SAI_STREOMODE SAI_STEREOMODE +#define SAI_FIFOStatus_Empty SAI_FIFOSTATUS_EMPTY +#define SAI_FIFOStatus_Less1QuarterFull SAI_FIFOSTATUS_LESS1QUARTERFULL +#define SAI_FIFOStatus_1QuarterFull SAI_FIFOSTATUS_1QUARTERFULL +#define SAI_FIFOStatus_HalfFull SAI_FIFOSTATUS_HALFFULL +#define SAI_FIFOStatus_3QuartersFull SAI_FIFOSTATUS_3QUARTERFULL +#define SAI_FIFOStatus_Full SAI_FIFOSTATUS_FULL +#define IS_SAI_BLOCK_MONO_STREO_MODE IS_SAI_BLOCK_MONO_STEREO_MODE + +/** + * @} + */ + + +/** @defgroup HAL_PPP_Aliased_Macros HAL PPP Aliased Macros maintained for legacy purpose + * @{ + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* ___STM32_HAL_LEGACY */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.c index 342d87114c1..2f51d3ec3f2 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_pccard.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief PCCARD HAL module driver. * This file provides a generic firmware to drive PCCARD memories mounted * as external device. @@ -17,37 +17,40 @@ control PCCARD/compact flash memories. It uses the FMC/FSMC layer functions to interface with PCCARD devices. This driver is used for: - (+) PCCARD/compact flash memory configuration sequence using the function - HAL_PCCARD_Init() with control and timing parameters for both common and - attribute spaces. + (+) PCCARD/Compact Flash memory configuration sequence using the function + HAL_PCCARD_Init()/HAL_CF_Init() with control and timing parameters for + both common and attribute spaces. - (+) Read PCCARD/compact flash memory maker and device IDs using the function - HAL_CF_Read_ID(). The read information is stored in the CompactFlash_ID - structure declared by the function caller. + (+) Read PCCARD/Compact Flash memory maker and device IDs using the function + HAL_PCCARD_Read_ID()/HAL_CF_Read_ID(). The read information is stored in + the CompactFlash_ID structure declared by the function caller. - (+) Access PCCARD/compact flash memory by read/write operations using the functions + (+) Access PCCARD/Compact Flash memory by read/write operations using the functions + HAL_PCCARD_Read_Sector()/ HAL_PCCARD_Write_Sector() - HAL_CF_Read_Sector()/HAL_CF_Write_Sector(), to read/write sector. - (+) Perform PCCARD/compact flash Reset chip operation using the function HAL_CF_Reset(). + (+) Perform PCCARD/Compact Flash Reset chip operation using the function + HAL_PCCARD_Reset()/HAL_CF_Reset. - (+) Perform PCCARD/compact flash erase sector operation using the function - HAL_CF_Erase_Sector(). + (+) Perform PCCARD/Compact Flash erase sector operation using the function + HAL_PCCARD_Erase_Sector()/HAL_CF_Erase_Sector. - (+) Read the PCCARD/compact flash status operation using the function HAL_CF_ReadStatus(). + (+) Read the PCCARD/Compact Flash status operation using the function + HAL_PCCARD_ReadStatus()/HAL_CF_ReadStatus(). - (+) You can monitor the PCCARD/compact flash device HAL state by calling the function - HAL_PCCARD_GetState() + (+) You can monitor the PCCARD/Compact Flash device HAL state by calling + the function HAL_PCCARD_GetState()/HAL_CF_GetState() [..] (@) This driver is a set of generic APIs which handle standard PCCARD/compact flash - operations. If a PCCARD/compact flash device contains different operations + operations. If a PCCARD/Compact Flash device contains different operations and/or implementations, it should be implemented separately. @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -81,25 +84,39 @@ * @{ */ -/** @defgroup PCCARD - * @brief PCCARD driver modules +#ifdef HAL_PCCARD_MODULE_ENABLED +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @defgroup PCCARD PCCARD + * @brief PCCARD HAL module driver * @{ */ -#ifdef HAL_PCCARD_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ + +/** @defgroup PCCARD_Private_Defines PCCARD Private Defines + * @{ + */ +#define PCCARD_TIMEOUT_READ_ID (uint32_t)0x0000FFFF +#define PCCARD_TIMEOUT_READ_WRITE_SECTOR (uint32_t)0x0000FFFF +#define PCCARD_TIMEOUT_ERASE_SECTOR (uint32_t)0x00000400 +#define PCCARD_TIMEOUT_STATUS (uint32_t)0x01000000 + +#define PCCARD_STATUS_OK (uint8_t)0x58 +#define PCCARD_STATUS_WRITE_OK (uint8_t)0x50 +/** + * @} + */ + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup PCCARD_Private_Functions +/* Private function ----------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/** @defgroup PCCARD_Exported_Functions PCCARD Exported Functions * @{ */ -/** @defgroup PCCARD_Group1 Initialization and de-initialization functions +/** @defgroup PCCARD_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -133,6 +150,8 @@ HAL_StatusTypeDef HAL_PCCARD_Init(PCCARD_HandleTypeDef *hpccard, FMC_NAND_PCC_Ti if(hpccard->State == HAL_PCCARD_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hpccard->Lock = HAL_UNLOCKED; /* Initialize the low level hardware (MSP) */ HAL_PCCARD_MspInit(hpccard); } @@ -215,7 +234,7 @@ __weak void HAL_PCCARD_MspDeInit(PCCARD_HandleTypeDef *hpccard) * @} */ -/** @defgroup PCCARD_Group2 Input and Output functions +/** @defgroup PCCARD_Exported_Functions_Group2 Input and Output functions * @brief Input Output and memory control functions * @verbatim @@ -238,10 +257,10 @@ __weak void HAL_PCCARD_MspDeInit(PCCARD_HandleTypeDef *hpccard) * @retval HAL status * */ -HAL_StatusTypeDef HAL_CF_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactFlash_ID[], uint8_t *pStatus) +HAL_StatusTypeDef HAL_PCCARD_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactFlash_ID[], uint8_t *pStatus) { - uint32_t timeout = 0xFFFF, index; - uint8_t status; + uint32_t timeout = PCCARD_TIMEOUT_READ_ID, index = 0; + uint8_t status = 0; /* Process Locked */ __HAL_LOCK(hpccard); @@ -255,31 +274,31 @@ HAL_StatusTypeDef HAL_CF_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactF /* Update the PCCARD controller state */ hpccard->State = HAL_PCCARD_STATE_BUSY; - /* Initialize the CF status */ - *pStatus = CF_READY; + /* Initialize the PCCARD status */ + *pStatus = PCCARD_READY; /* Send the Identify Command */ - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD) = 0xECEC; + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD) = 0xECEC; - /* Read CF IDs and timeout treatment */ + /* Read PCCARD IDs and timeout treatment */ do { - /* Read the CF status */ - status = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + /* Read the PCCARD status */ + status = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; - }while((status != 0x58) && timeout); + }while((status != PCCARD_STATUS_OK) && timeout); if(timeout == 0) { - *pStatus = CF_TIMEOUT_ERROR; + *pStatus = PCCARD_TIMEOUT_ERROR; } else { - /* Read CF ID bytes */ + /* Read PCCARD ID bytes */ for(index = 0; index < 16; index++) { - CompactFlash_ID[index] = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_DATA); + CompactFlash_ID[index] = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_DATA); } } @@ -298,13 +317,13 @@ HAL_StatusTypeDef HAL_CF_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactF * the configuration information for PCCARD module. * @param pBuffer: pointer to destination read buffer * @param SectorAddress: Sector address to read - * @param pStatus: pointer to CF status + * @param pStatus: pointer to PCCARD status * @retval HAL status */ -HAL_StatusTypeDef HAL_CF_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus) +HAL_StatusTypeDef HAL_PCCARD_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus) { - uint32_t timeout = 0xFFFF, index = 0; - uint8_t status; + uint32_t timeout = PCCARD_TIMEOUT_READ_WRITE_SECTOR, index = 0; + uint8_t status = 0; /* Process Locked */ __HAL_LOCK(hpccard); @@ -318,44 +337,44 @@ HAL_StatusTypeDef HAL_CF_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pB /* Update the PCCARD controller state */ hpccard->State = HAL_PCCARD_STATE_BUSY; - /* Initialize CF status */ - *pStatus = CF_READY; + /* Initialize PCCARD status */ + *pStatus = PCCARD_READY; /* Set the parameters to write a sector */ - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_CYLINDER_HIGH) = (uint16_t)0x00; - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_SECTOR_COUNT) = ((uint16_t)0x0100 ) | ((uint16_t)SectorAddress); - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD) = (uint16_t)0xE4A0; + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_CYLINDER_HIGH) = (uint16_t)0x00; + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_SECTOR_COUNT) = ((uint16_t)0x0100 ) | ((uint16_t)SectorAddress); + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD) = (uint16_t)0xE4A0; do { /* wait till the Status = 0x80 */ - status = *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + status = *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; }while((status == 0x80) && timeout); if(timeout == 0) { - *pStatus = CF_TIMEOUT_ERROR; + *pStatus = PCCARD_TIMEOUT_ERROR; } - timeout = 0xFFFF; + timeout = PCCARD_TIMEOUT_READ_WRITE_SECTOR; do { - /* wait till the Status = 0x58 */ - status = *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + /* wait till the Status = PCCARD_STATUS_OK */ + status = *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; - }while((status != 0x58) && timeout); + }while((status != PCCARD_STATUS_OK) && timeout); if(timeout == 0) { - *pStatus = CF_TIMEOUT_ERROR; + *pStatus = PCCARD_TIMEOUT_ERROR; } /* Read bytes */ - for(; index < CF_SECTOR_SIZE; index++) + for(; index < PCCARD_SECTOR_SIZE; index++) { - *(uint16_t *)pBuffer++ = *(uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR); + *(uint16_t *)pBuffer++ = *(uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR); } /* Update the PCCARD controller state */ @@ -374,13 +393,13 @@ HAL_StatusTypeDef HAL_CF_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pB * the configuration information for PCCARD module. * @param pBuffer: pointer to source write buffer * @param SectorAddress: Sector address to write - * @param pStatus: pointer to CF status + * @param pStatus: pointer to PCCARD status * @retval HAL status */ -HAL_StatusTypeDef HAL_CF_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus) +HAL_StatusTypeDef HAL_PCCARD_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus) { - uint32_t timeout = 0xFFFF, index = 0; - uint8_t status; + uint32_t timeout = PCCARD_TIMEOUT_READ_WRITE_SECTOR, index = 0; + uint8_t status = 0; /* Process Locked */ __HAL_LOCK(hpccard); @@ -394,42 +413,42 @@ HAL_StatusTypeDef HAL_CF_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *p /* Update the PCCARD controller state */ hpccard->State = HAL_PCCARD_STATE_BUSY; - /* Initialize CF status */ - *pStatus = CF_READY; + /* Initialize PCCARD status */ + *pStatus = PCCARD_READY; /* Set the parameters to write a sector */ - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_CYLINDER_HIGH) = (uint16_t)0x00; - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_SECTOR_COUNT) = ((uint16_t)0x0100 ) | ((uint16_t)SectorAddress); - *(__IO uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD) = (uint16_t)0x30A0; + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_CYLINDER_HIGH) = (uint16_t)0x00; + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_SECTOR_COUNT) = ((uint16_t)0x0100 ) | ((uint16_t)SectorAddress); + *(__IO uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD) = (uint16_t)0x30A0; do { - /* Wait till the Status = 0x58 */ - status = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + /* Wait till the Status = PCCARD_STATUS_OK */ + status = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; - }while((status != 0x58) && timeout); + }while((status != PCCARD_STATUS_OK) && timeout); if(timeout == 0) { - *pStatus = CF_TIMEOUT_ERROR; + *pStatus = PCCARD_TIMEOUT_ERROR; } /* Write bytes */ - for(; index < CF_SECTOR_SIZE; index++) + for(; index < PCCARD_SECTOR_SIZE; index++) { - *(uint16_t *)(CF_IO_SPACE_PRIMARY_ADDR) = *(uint16_t *)pBuffer++; + *(uint16_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR) = *(uint16_t *)pBuffer++; } do { - /* Wait till the Status = 0x50 */ - status = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + /* Wait till the Status = PCCARD_STATUS_WRITE_OK */ + status = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; - }while((status != 0x50) && timeout); + }while((status != PCCARD_STATUS_WRITE_OK) && timeout); if(timeout == 0) { - *pStatus = CF_TIMEOUT_ERROR; + *pStatus = PCCARD_TIMEOUT_ERROR; } /* Update the PCCARD controller state */ @@ -447,13 +466,13 @@ HAL_StatusTypeDef HAL_CF_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *p * @param hpccard: pointer to a PCCARD_HandleTypeDef structure that contains * the configuration information for PCCARD module. * @param SectorAddress: Sector address to erase - * @param pStatus: pointer to CF status + * @param pStatus: pointer to PCCARD status * @retval HAL status */ -HAL_StatusTypeDef HAL_CF_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t SectorAddress, uint8_t *pStatus) +HAL_StatusTypeDef HAL_PCCARD_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t SectorAddress, uint8_t *pStatus) { - uint32_t timeout = 0x400; - uint8_t status; + uint32_t timeout = PCCARD_TIMEOUT_ERASE_SECTOR; + uint8_t status = 0; /* Process Locked */ __HAL_LOCK(hpccard); @@ -467,29 +486,29 @@ HAL_StatusTypeDef HAL_CF_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t S /* Update the PCCARD controller state */ hpccard->State = HAL_PCCARD_STATE_BUSY; - /* Initialize CF status */ - *pStatus = CF_READY; + /* Initialize PCCARD status */ + *pStatus = PCCARD_READY; /* Set the parameters to write a sector */ - *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_CYLINDER_LOW) = 0x00; - *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_CYLINDER_HIGH) = 0x00; - *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_SECTOR_NUMBER) = SectorAddress; - *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_SECTOR_COUNT) = 0x01; - *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_CARD_HEAD) = 0xA0; - *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD) = CF_ERASE_SECTOR_CMD; + *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_CYLINDER_LOW) = 0x00; + *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_CYLINDER_HIGH) = 0x00; + *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_SECTOR_NUMBER) = SectorAddress; + *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_SECTOR_COUNT) = 0x01; + *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_CARD_HEAD) = 0xA0; + *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD) = ATA_ERASE_SECTOR_CMD; - /* wait till the CF is ready */ - status = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + /* wait till the PCCARD is ready */ + status = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); - while((status != 0x50) && timeout) + while((status != PCCARD_STATUS_WRITE_OK) && timeout) { - status = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + status = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; } if(timeout == 0) { - *pStatus = CF_TIMEOUT_ERROR; + *pStatus = PCCARD_TIMEOUT_ERROR; } /* Check the PCCARD controller state */ @@ -507,9 +526,8 @@ HAL_StatusTypeDef HAL_CF_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t S * the configuration information for PCCARD module. * @retval HAL status */ -HAL_StatusTypeDef HAL_CF_Reset(PCCARD_HandleTypeDef *hpccard) +HAL_StatusTypeDef HAL_PCCARD_Reset(PCCARD_HandleTypeDef *hpccard) { - /* Process Locked */ __HAL_LOCK(hpccard); @@ -519,17 +537,17 @@ HAL_StatusTypeDef HAL_CF_Reset(PCCARD_HandleTypeDef *hpccard) return HAL_BUSY; } - /* Provide an SW reset and Read and verify the: - - CF Configuration Option Register at address 0x98000200 --> 0x80 - - Card Configuration and Status Register at address 0x98000202 --> 0x00 - - Pin Replacement Register at address 0x98000204 --> 0x0C + /* Provide a SW reset and Read and verify the: + - PCCard Configuration Option Register at address 0x98000200 --> 0x80 + - Card Configuration and Status Register at address 0x98000202 --> 0x00 + - Pin Replacement Register at address 0x98000204 --> 0x0C - Socket and Copy Register at address 0x98000206 --> 0x00 */ /* Check the PCCARD controller state */ hpccard->State = HAL_PCCARD_STATE_BUSY; - *(__IO uint8_t *)(0x98000202) = 0x01; + *(__IO uint8_t *)(PCCARD_ATTRIBUTE_SPACE_ADDRESS | ATA_CARD_CONFIGURATION ) = 0x01; /* Check the PCCARD controller state */ hpccard->State = HAL_PCCARD_STATE_READY; @@ -587,7 +605,6 @@ void HAL_PCCARD_IRQHandler(PCCARD_HandleTypeDef *hpccard) /* Clear PCCARD interrupt FIFO empty pending bit */ __FMC_PCCARD_CLEAR_FLAG(hpccard->Instance, FMC_FLAG_FEMPT); } - } /** @@ -607,7 +624,7 @@ __weak void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard) * @} */ -/** @defgroup PCCARD_Group4 State functions +/** @defgroup PCCARD_Exported_Functions_Group3 State functions * @brief Peripheral State functions * @verbatim @@ -637,37 +654,36 @@ HAL_PCCARD_StateTypeDef HAL_PCCARD_GetState(PCCARD_HandleTypeDef *hpccard) * @brief Get the compact flash memory status * @param hpccard: pointer to a PCCARD_HandleTypeDef structure that contains * the configuration information for PCCARD module. - * @retval New status of the CF operation. This parameter can be: + * @retval New status of the PCCARD operation. This parameter can be: * - CompactFlash_TIMEOUT_ERROR: when the previous operation generate * a Timeout error - * - CompactFlash_READY: when memory is ready for the next operation - * + * - CompactFlash_READY: when memory is ready for the next operation */ -CF_StatusTypedef HAL_CF_GetStatus(PCCARD_HandleTypeDef *hpccard) +HAL_PCCARD_StatusTypeDef HAL_PCCARD_GetStatus(PCCARD_HandleTypeDef *hpccard) { - uint32_t timeout = 0x1000000, status_CF; + uint32_t timeout = PCCARD_TIMEOUT_STATUS, status_pccard = 0; /* Check the PCCARD controller state */ if(hpccard->State == HAL_PCCARD_STATE_BUSY) { - return CF_ONGOING; + return HAL_PCCARD_STATUS_ONGOING; } - status_CF = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + status_pccard = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); - while((status_CF == CF_BUSY) && timeout) + while((status_pccard == PCCARD_BUSY) && timeout) { - status_CF = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + status_pccard = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); timeout--; } if(timeout == 0) { - status_CF = CF_TIMEOUT_ERROR; + status_pccard = PCCARD_TIMEOUT_ERROR; } /* Return the operation status */ - return (CF_StatusTypedef) status_CF; + return (HAL_PCCARD_StatusTypeDef) status_pccard; } /** @@ -677,31 +693,31 @@ CF_StatusTypedef HAL_CF_GetStatus(PCCARD_HandleTypeDef *hpccard) * @retval The status of the Compact Flash memory. This parameter can be: * - CompactFlash_BUSY: when memory is busy * - CompactFlash_READY: when memory is ready for the next operation - * - CompactFlash_ERROR: when the previous operation gererates error + * - CompactFlash_ERROR: when the previous operation generates error */ -CF_StatusTypedef HAL_CF_ReadStatus(PCCARD_HandleTypeDef *hpccard) +HAL_PCCARD_StatusTypeDef HAL_PCCARD_ReadStatus(PCCARD_HandleTypeDef *hpccard) { - uint8_t data = 0, status_CF = CF_BUSY; + uint8_t data = 0, status_pccard = PCCARD_BUSY; /* Check the PCCARD controller state */ if(hpccard->State == HAL_PCCARD_STATE_BUSY) { - return CF_ONGOING; + return HAL_PCCARD_STATUS_ONGOING; } /* Read status operation */ - data = *(__IO uint8_t *)(CF_IO_SPACE_PRIMARY_ADDR | CF_STATUS_CMD_ALTERNATE); + data = *(__IO uint8_t *)(PCCARD_IO_SPACE_PRIMARY_ADDR | ATA_STATUS_CMD_ALTERNATE); - if((data & CF_TIMEOUT_ERROR) == CF_TIMEOUT_ERROR) + if((data & PCCARD_TIMEOUT_ERROR) == PCCARD_TIMEOUT_ERROR) { - status_CF = CF_TIMEOUT_ERROR; + status_pccard = PCCARD_TIMEOUT_ERROR; } - else if((data & CF_READY) == CF_READY) + else if((data & PCCARD_READY) == PCCARD_READY) { - status_CF = CF_READY; + status_pccard = PCCARD_READY; } - return (CF_StatusTypedef) status_CF; + return (HAL_PCCARD_StatusTypeDef) status_pccard; } /** @@ -711,8 +727,9 @@ CF_StatusTypedef HAL_CF_ReadStatus(PCCARD_HandleTypeDef *hpccard) /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#endif /* HAL_PCCARD_MODULE_ENABLED */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* HAL_PCCARD_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.h index 45a7ff3ebd5..d666adce206 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pccard.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_pccard.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of PCCARD HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -44,11 +44,11 @@ #endif /* Includes ------------------------------------------------------------------*/ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) #include "stm32f4xx_ll_fsmc.h" #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) #include "stm32f4xx_ll_fmc.h" #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ @@ -56,16 +56,20 @@ * @{ */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /** @addtogroup PCCARD * @{ */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Exported typedef ----------------------------------------------------------*/ +/** @defgroup PCCARD_Exported_Types PCCARD Exported Types + * @{ + */ /** - * @brief HAL SRAM State structures definition + * @brief HAL PCCARD State structures definition */ typedef enum { @@ -74,14 +78,14 @@ typedef enum HAL_PCCARD_STATE_BUSY = 0x02, /*!< PCCARD peripheral busy */ HAL_PCCARD_STATE_ERROR = 0x04 /*!< PCCARD peripheral error */ }HAL_PCCARD_StateTypeDef; - + typedef enum { - CF_SUCCESS = 0, - CF_ONGOING, - CF_ERROR, - CF_TIMEOUT -}CF_StatusTypedef; + HAL_PCCARD_STATUS_SUCCESS = 0, + HAL_PCCARD_STATUS_ONGOING, + HAL_PCCARD_STATUS_ERROR, + HAL_PCCARD_STATUS_TIMEOUT +}HAL_PCCARD_StatusTypeDef; /** * @brief FMC_PCCARD handle Structure definition @@ -97,80 +101,158 @@ typedef struct HAL_LockTypeDef Lock; /*!< PCCARD Lock */ }PCCARD_HandleTypeDef; - +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup PCCARD_Exported_Constants +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup PCCARD_Exported_Macros PCCARD Exported Macros * @{ */ - -#define CF_DEVICE_ADDRESS ((uint32_t)0x90000000) -#define CF_ATTRIBUTE_SPACE_ADDRESS ((uint32_t)0x98000000) /* Attribute space size to @0x9BFF FFFF */ -#define CF_COMMON_SPACE_ADDRESS CF_DEVICE_ADDRESS /* Common space size to @0x93FF FFFF */ -#define CF_IO_SPACE_ADDRESS ((uint32_t)0x9C000000) /* IO space size to @0x9FFF FFFF */ -#define CF_IO_SPACE_PRIMARY_ADDR ((uint32_t)0x9C0001F0) /* IO space size to @0x9FFF FFFF */ - -/* Compact Flash-ATA registers description */ -#define CF_DATA ((uint8_t)0x00) /* Data register */ -#define CF_SECTOR_COUNT ((uint8_t)0x02) /* Sector Count register */ -#define CF_SECTOR_NUMBER ((uint8_t)0x03) /* Sector Number register */ -#define CF_CYLINDER_LOW ((uint8_t)0x04) /* Cylinder low register */ -#define CF_CYLINDER_HIGH ((uint8_t)0x05) /* Cylinder high register */ -#define CF_CARD_HEAD ((uint8_t)0x06) /* Card/Head register */ -#define CF_STATUS_CMD ((uint8_t)0x07) /* Status(read)/Command(write) register */ -#define CF_STATUS_CMD_ALTERNATE ((uint8_t)0x0E) /* Alternate Status(read)/Command(write) register */ -#define CF_COMMON_DATA_AREA ((uint16_t)0x0400) /* Start of data area (for Common access only!) */ - -/* Compact Flash-ATA commands */ -#define CF_READ_SECTOR_CMD ((uint8_t)0x20) -#define CF_WRITE_SECTOR_CMD ((uint8_t)0x30) -#define CF_ERASE_SECTOR_CMD ((uint8_t)0xC0) -#define CF_IDENTIFY_CMD ((uint8_t)0xEC) - -/* Compact Flash status */ -#define CF_TIMEOUT_ERROR ((uint8_t)0x60) -#define CF_BUSY ((uint8_t)0x80) -#define CF_PROGR ((uint8_t)0x01) -#define CF_READY ((uint8_t)0x40) - -#define CF_SECTOR_SIZE ((uint32_t)255) /* In half words */ - -/** - * @} - */ -/* Exported macro ------------------------------------------------------------*/ - /** @brief Reset PCCARD handle state * @param __HANDLE__: specifies the PCCARD handle. * @retval None */ #define __HAL_PCCARD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_PCCARD_STATE_RESET) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup PCCARD_Exported_Functions + * @{ + */ + +/** @addtogroup PCCARD_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_PCCARD_Init(PCCARD_HandleTypeDef *hpccard, FMC_NAND_PCC_TimingTypeDef *ComSpaceTiming, FMC_NAND_PCC_TimingTypeDef *AttSpaceTiming, FMC_NAND_PCC_TimingTypeDef *IOSpaceTiming); -HAL_StatusTypeDef HAL_PCCARD_DeInit(PCCARD_HandleTypeDef *hpccard); +HAL_StatusTypeDef HAL_PCCARD_DeInit(PCCARD_HandleTypeDef *hpccard); void HAL_PCCARD_MspInit(PCCARD_HandleTypeDef *hpccard); void HAL_PCCARD_MspDeInit(PCCARD_HandleTypeDef *hpccard); +/** + * @} + */ +/** @addtogroup PCCARD_Exported_Functions_Group2 + * @{ + */ /* IO operation functions *****************************************************/ -HAL_StatusTypeDef HAL_CF_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactFlash_ID[], uint8_t *pStatus); -HAL_StatusTypeDef HAL_CF_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus); -HAL_StatusTypeDef HAL_CF_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus); -HAL_StatusTypeDef HAL_CF_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t SectorAddress, uint8_t *pStatus); -HAL_StatusTypeDef HAL_CF_Reset(PCCARD_HandleTypeDef *hpccard); +HAL_StatusTypeDef HAL_PCCARD_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactFlash_ID[], uint8_t *pStatus); +HAL_StatusTypeDef HAL_PCCARD_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus); +HAL_StatusTypeDef HAL_PCCARD_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus); +HAL_StatusTypeDef HAL_PCCARD_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t SectorAddress, uint8_t *pStatus); +HAL_StatusTypeDef HAL_PCCARD_Reset(PCCARD_HandleTypeDef *hpccard); void HAL_PCCARD_IRQHandler(PCCARD_HandleTypeDef *hpccard); -void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard); +void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard); +/** + * @} + */ + +/** @addtogroup PCCARD_Exported_Functions_Group3 + * @{ + */ /* PCCARD State functions *******************************************************/ -HAL_PCCARD_StateTypeDef HAL_PCCARD_GetState(PCCARD_HandleTypeDef *hpccard); -CF_StatusTypedef HAL_CF_GetStatus(PCCARD_HandleTypeDef *hpccard); -CF_StatusTypedef HAL_CF_ReadStatus(PCCARD_HandleTypeDef *hpccard); +HAL_PCCARD_StateTypeDef HAL_PCCARD_GetState(PCCARD_HandleTypeDef *hpccard); +HAL_PCCARD_StatusTypeDef HAL_PCCARD_GetStatus(PCCARD_HandleTypeDef *hpccard); +HAL_PCCARD_StatusTypeDef HAL_PCCARD_ReadStatus(PCCARD_HandleTypeDef *hpccard); +/** + * @} + */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ /** * @} - */ + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup PCCARD_Private_Constants PCCARD Private Constants + * @{ + */ +#define PCCARD_DEVICE_ADDRESS ((uint32_t)0x90000000) +#define PCCARD_ATTRIBUTE_SPACE_ADDRESS ((uint32_t)0x98000000) /* Attribute space size to @0x9BFF FFFF */ +#define PCCARD_COMMON_SPACE_ADDRESS PCCARD_DEVICE_ADDRESS /* Common space size to @0x93FF FFFF */ +#define PCCARD_IO_SPACE_ADDRESS ((uint32_t)0x9C000000) /* IO space size to @0x9FFF FFFF */ +#define PCCARD_IO_SPACE_PRIMARY_ADDR ((uint32_t)0x9C0001F0) /* IO space size to @0x9FFF FFFF */ + +/* Flash-ATA registers description */ +#define ATA_DATA ((uint8_t)0x00) /* Data register */ +#define ATA_SECTOR_COUNT ((uint8_t)0x02) /* Sector Count register */ +#define ATA_SECTOR_NUMBER ((uint8_t)0x03) /* Sector Number register */ +#define ATA_CYLINDER_LOW ((uint8_t)0x04) /* Cylinder low register */ +#define ATA_CYLINDER_HIGH ((uint8_t)0x05) /* Cylinder high register */ +#define ATA_CARD_HEAD ((uint8_t)0x06) /* Card/Head register */ +#define ATA_STATUS_CMD ((uint8_t)0x07) /* Status(read)/Command(write) register */ +#define ATA_STATUS_CMD_ALTERNATE ((uint8_t)0x0E) /* Alternate Status(read)/Command(write) register */ +#define ATA_COMMON_DATA_AREA ((uint16_t)0x0400) /* Start of data area (for Common access only!) */ +#define ATA_CARD_CONFIGURATION ((uint16_t)0x0202) /* Card Configuration and Status Register */ + +/* Flash-ATA commands */ +#define ATA_READ_SECTOR_CMD ((uint8_t)0x20) +#define ATA_WRITE_SECTOR_CMD ((uint8_t)0x30) +#define ATA_ERASE_SECTOR_CMD ((uint8_t)0xC0) +#define ATA_IDENTIFY_CMD ((uint8_t)0xEC) + +/* PC Card/Compact Flash status */ +#define PCCARD_TIMEOUT_ERROR ((uint8_t)0x60) +#define PCCARD_BUSY ((uint8_t)0x80) +#define PCCARD_PROGR ((uint8_t)0x01) +#define PCCARD_READY ((uint8_t)0x40) + +#define PCCARD_SECTOR_SIZE ((uint32_t)255) /* In half words */ + +/** + * @} + */ +/* Compact Flash redefinition */ +#define HAL_CF_Init HAL_PCCARD_Init +#define HAL_CF_DeInit HAL_PCCARD_DeInit +#define HAL_CF_MspInit HAL_PCCARD_MspInit +#define HAL_CF_MspDeInit HAL_PCCARD_MspDeInit + +#define HAL_CF_Read_ID HAL_PCCARD_Read_ID +#define HAL_CF_Write_Sector HAL_PCCARD_Write_Sector +#define HAL_CF_Read_Sector HAL_PCCARD_Read_Sector +#define HAL_CF_Erase_Sector HAL_PCCARD_Erase_Sector +#define HAL_CF_Reset HAL_PCCARD_Reset +#define HAL_CF_IRQHandler HAL_PCCARD_IRQHandler +#define HAL_CF_ITCallback HAL_PCCARD_ITCallback + +#define HAL_CF_GetState HAL_PCCARD_GetState +#define HAL_CF_GetStatus HAL_PCCARD_GetStatus +#define HAL_CF_ReadStatus HAL_PCCARD_ReadStatus + +#define HAL_CF_STATUS_SUCCESS HAL_PCCARD_STATUS_SUCCESS +#define HAL_CF_STATUS_ONGOING HAL_PCCARD_STATUS_ONGOING +#define HAL_CF_STATUS_ERROR HAL_PCCARD_STATUS_ERROR +#define HAL_CF_STATUS_TIMEOUT HAL_PCCARD_STATUS_TIMEOUT +#define HAL_CF_StatusTypeDef HAL_PCCARD_StatusTypeDef + + +#define CF_DEVICE_ADDRESS PCCARD_DEVICE_ADDRESS +#define CF_ATTRIBUTE_SPACE_ADDRESS PCCARD_ATTRIBUTE_SPACE_ADDRESS +#define CF_COMMON_SPACE_ADDRESS PCCARD_COMMON_SPACE_ADDRESS +#define CF_IO_SPACE_ADDRESS PCCARD_IO_SPACE_ADDRESS +#define CF_IO_SPACE_PRIMARY_ADDR PCCARD_IO_SPACE_PRIMARY_ADDR + +#define CF_TIMEOUT_ERROR PCCARD_TIMEOUT_ERROR +#define CF_BUSY PCCARD_BUSY +#define CF_PROGR PCCARD_PROGR +#define CF_READY PCCARD_READY + +#define CF_SECTOR_SIZE PCCARD_SECTOR_SIZE + +/* Private macros ------------------------------------------------------------*/ +/** + * @} + */ + +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.c index c0c9b3443f0..bd5be2e1704 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_pcd.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief PCD HAL module driver. * This file provides firmware functions to manage the following * functionalities of the USB Peripheral Controller: @@ -45,7 +45,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -79,31 +79,44 @@ * @{ */ -/** @defgroup PCD +/** @defgroup PCD PCD * @brief PCD HAL module driver * @{ */ #ifdef HAL_PCD_MODULE_ENABLED -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup PCD_Private_Macros PCD Private Macros + * @{ + */ #define PCD_MIN(a, b) (((a) < (b)) ? (a) : (b)) #define PCD_MAX(a, b) (((a) > (b)) ? (a) : (b)) -/* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ +/** + * @} + */ + +/* Private functions prototypes ----------------------------------------------*/ +/** @defgroup PCD_Private_Functions PCD Private Functions + * @{ + */ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t epnum); -/* Private functions ---------------------------------------------------------*/ +/** + * @} + */ -/** @defgroup PCD_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup PCD_Exported_Functions PCD Exported Functions * @{ */ -/** @defgroup PCD_Group1 Initialization and de-initialization functions +/** @defgroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * -@verbatim +@verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== @@ -153,7 +166,7 @@ HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd) hpcd->IN_ep[i].is_in = 1; hpcd->IN_ep[i].num = i; hpcd->IN_ep[i].tx_fifo_num = i; - /* Control until ep is actvated */ + /* Control until ep is activated */ hpcd->IN_ep[i].type = EP_TYPE_CTRL; hpcd->IN_ep[i].maxpacket = 0; hpcd->IN_ep[i].xfer_buff = 0; @@ -179,6 +192,14 @@ HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd) hpcd->State= HAL_PCD_STATE_READY; +#ifdef USB_OTG_GLPMCFG_LPMEN + /* Activate LPM */ + if (hpcd->Init.lpm_enable == 1) + { + HAL_PCDEx_ActivateLPM(hpcd); + } +#endif /* USB_OTG_GLPMCFG_LPMEN */ + USB_DevDisconnect (hpcd->Instance); return HAL_OK; } @@ -217,7 +238,7 @@ HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_MspInit could be implenetd in the user file + the HAL_PCD_MspInit could be implemented in the user file */ } @@ -229,7 +250,7 @@ __weak void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_MspDeInit could be implenetd in the user file + the HAL_PCD_MspDeInit could be implemented in the user file */ } @@ -237,10 +258,10 @@ __weak void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd) * @} */ -/** @defgroup PCD_Group2 IO operation functions +/** @defgroup PCD_Exported_Functions_Group2 IO operation functions * @brief Data transfers functions * -@verbatim +@verbatim =============================================================================== ##### IO operation functions ##### =============================================================================== @@ -276,7 +297,7 @@ HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd) __HAL_LOCK(hpcd); __HAL_PCD_DISABLE(hpcd); USB_StopDevice(hpcd->Instance); - USB_DevDisconnect (hpcd->Instance); + USB_DevDisconnect(hpcd->Instance); __HAL_UNLOCK(hpcd); return HAL_OK; } @@ -425,12 +446,21 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) /* Handle Resume Interrupt */ if(__HAL_PCD_GET_FLAG(hpcd, USB_OTG_GINTSTS_WKUINT)) { - /* Clear the Remote Wake-up Signaling */ + /* Clear the Remote Wake-up Signaling */ USBx_DEVICE->DCTL &= ~USB_OTG_DCTL_RWUSIG; - - HAL_PCD_ResumeCallback(hpcd); - __HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_WKUINT); +#ifdef USB_OTG_GLPMCFG_LPMEN + if(hpcd->LPM_State == LPM_L1) + { + hpcd->LPM_State = LPM_L0; + HAL_PCDEx_LPM_Callback(hpcd, PCD_LPM_L0_ACTIVE); + } + else +#endif /* USB_OTG_GLPMCFG_LPMEN */ + { + HAL_PCD_ResumeCallback(hpcd); + } + __HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_WKUINT); } /* Handle Suspend Interrupt */ @@ -444,8 +474,24 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) } __HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_USBSUSP); } - +#ifdef USB_OTG_GLPMCFG_LPMEN + /* Handle LPM Interrupt */ + if(__HAL_PCD_GET_FLAG(hpcd, USB_OTG_GINTSTS_LPMINT)) + { + __HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_LPMINT); + if( hpcd->LPM_State == LPM_L0) + { + hpcd->LPM_State = LPM_L1; + hpcd->BESL = (hpcd->Instance->GLPMCFG & USB_OTG_GLPMCFG_BESL) >>2 ; + HAL_PCDEx_LPM_Callback(hpcd, PCD_LPM_L1_ACTIVE); + } + else + { + HAL_PCD_SuspendCallback(hpcd); + } + } +#endif /* USB_OTG_GLPMCFG_LPMEN */ /* Handle Reset Interrupt */ if(__HAL_PCD_GET_FLAG(hpcd, USB_OTG_GINTSTS_USBRST)) @@ -504,8 +550,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_ENUMDNE); } - - + /* Handle RxQLevel Interrupt */ if(__HAL_PCD_GET_FLAG(hpcd, USB_OTG_GINTSTS_RXFLVL)) { @@ -573,26 +618,28 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) } /** - * @brief Data out stage callbacks + * @brief Data OUT stage callbacks * @param hpcd: PCD handle + * @param epnum: endpoint number * @retval None */ __weak void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_DataOutStageCallback could be implemented in the user file */ } /** * @brief Data IN stage callbacks * @param hpcd: PCD handle + * @param epnum: endpoint number * @retval None */ __weak void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_DataInStageCallback could be implemented in the user file */ } /** @@ -603,7 +650,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_SetupStageCallback could be implemented in the user file */ } @@ -615,7 +662,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_SOFCallback could be implemented in the user file */ } @@ -627,7 +674,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_ResetCallback could be implemented in the user file */ } @@ -640,7 +687,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_SuspendCallback could be implemented in the user file */ } @@ -652,31 +699,33 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_ResumeCallback could be implemented in the user file */ } /** * @brief Incomplete ISO OUT callbacks * @param hpcd: PCD handle + * @param epnum: endpoint number * @retval None */ __weak void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_ISOOUTIncompleteCallback could be implemented in the user file */ } /** - * @brief Incomplete ISO IN callbacks + * @brief Incomplete ISO IN callbacks * @param hpcd: PCD handle + * @param epnum: endpoint number * @retval None */ __weak void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_ISOINIncompleteCallback could be implemented in the user file */ } @@ -688,7 +737,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_ConnectCallback could be implemented in the user file */ } @@ -700,18 +749,18 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) __weak void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_PCD_DataOutStageCallback could be implenetd in the user file + the HAL_PCD_DisconnectCallback could be implemented in the user file */ } /** * @} */ - -/** @defgroup PCD_Group3 Peripheral Control functions - * @brief management functions + +/** @defgroup PCD_Exported_Functions_Group3 Peripheral Control functions + * @brief management functions * -@verbatim +@verbatim =============================================================================== ##### Peripheral Control functions ##### =============================================================================== @@ -724,7 +773,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) */ /** - * @brief Send an amount of data in blocking mode + * @brief Connect the USB device * @param hpcd: PCD handle * @retval HAL status */ @@ -737,7 +786,7 @@ HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd) } /** - * @brief Send an amount of data in blocking mode + * @brief Disconnect the USB device * @param hpcd: PCD handle * @retval HAL status */ @@ -766,7 +815,7 @@ HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address) * @brief Open and configure an endpoint * @param hpcd: PCD handle * @param ep_addr: endpoint address - * @param ep_mps: endpoint max packert size + * @param ep_mps: endpoint max packet size * @param ep_type: endpoint type * @retval HAL status */ @@ -845,7 +894,6 @@ HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr) */ HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len) { - USB_OTG_EPTypeDef *ep; ep = &hpcd->OUT_ep[ep_addr & 0x7F]; @@ -1019,43 +1067,43 @@ HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr) } /** - * @brief HAL_PCD_ActiveRemoteWakeup : active remote wakeup signalling + * @brief HAL_PCD_ActivateRemoteWakeup : Active remote wake-up signalling * @param hpcd: PCD handle * @retval HAL status */ -HAL_StatusTypeDef HAL_PCD_ActiveRemoteWakeup(PCD_HandleTypeDef *hpcd) +HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd) { USB_OTG_GlobalTypeDef *USBx = hpcd->Instance; if((USBx_DEVICE->DSTS & USB_OTG_DSTS_SUSPSTS) == USB_OTG_DSTS_SUSPSTS) { - /* active Remote wakeup signaling */ + /* Activate Remote wake-up signaling */ USBx_DEVICE->DCTL |= USB_OTG_DCTL_RWUSIG; } return HAL_OK; } /** - * @brief HAL_PCD_DeActiveRemoteWakeup : de-active remote wakeup signalling + * @brief HAL_PCD_DeActivateRemoteWakeup : de-active remote wake-up signalling * @param hpcd: PCD handle * @retval HAL status */ -HAL_StatusTypeDef HAL_PCD_DeActiveRemoteWakeup(PCD_HandleTypeDef *hpcd) +HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd) { USB_OTG_GlobalTypeDef *USBx = hpcd->Instance; - /* active Remote wakeup signaling */ - USBx_DEVICE->DCTL &= ~(USB_OTG_DCTL_RWUSIG); + /* De-activate Remote wake-up signaling */ + USBx_DEVICE->DCTL &= ~(USB_OTG_DCTL_RWUSIG); return HAL_OK; } /** * @} */ -/** @defgroup PCD_Group4 Peripheral State functions - * @brief Peripheral State functions +/** @defgroup PCD_Exported_Functions_Group4 Peripheral State functions + * @brief Peripheral State functions * -@verbatim +@verbatim =============================================================================== ##### Peripheral State functions ##### =============================================================================== @@ -1080,10 +1128,20 @@ PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd) * @} */ +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @addtogroup PCD_Private_Functions + * @{ + */ + /** * @brief DCD_WriteEmptyTxFifo * check FIFO for the next packet to be loaded * @param hpcd: PCD handle + * @param epnum : endpoint number * @retval HAL status */ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t epnum) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.h index 6dc7625bd70..40964eae9ce 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_pcd.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of PCD HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,10 +55,13 @@ */ /* Exported types ------------------------------------------------------------*/ - - /** - * @brief PCD State structures definition - */ +/** @defgroup PCD_Exported_Types PCD Exported Types + * @{ + */ + +/** + * @brief PCD State structure definition + */ typedef enum { HAL_PCD_STATE_RESET = 0x00, @@ -68,6 +71,16 @@ typedef enum HAL_PCD_STATE_TIMEOUT = 0x04 } PCD_StateTypeDef; +#ifdef USB_OTG_GLPMCFG_LPMEN +/* Device LPM suspend state */ +typedef enum +{ + LPM_L0 = 0x00, /* on */ + LPM_L1 = 0x01, /* LPM L1 sleep */ + LPM_L2 = 0x02, /* suspend */ + LPM_L3 = 0x03, /* off */ +}PCD_LPM_StateTypeDef; +#endif /* USB_OTG_GLPMCFG_LPMEN */ typedef USB_OTG_GlobalTypeDef PCD_TypeDef; typedef USB_OTG_CfgTypeDef PCD_InitTypeDef; @@ -78,23 +91,35 @@ typedef USB_OTG_EPTypeDef PCD_EPTypeDef ; */ typedef struct { - PCD_TypeDef *Instance; /*!< Register base address */ - PCD_InitTypeDef Init; /*!< PCD required parameters */ - PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */ - PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */ - HAL_LockTypeDef Lock; /*!< PCD peripheral status */ - __IO PCD_StateTypeDef State; /*!< PCD communication state */ - uint32_t Setup[12]; /*!< Setup packet buffer */ - void *pData; /*!< Pointer to upper stack Handler */ - + PCD_TypeDef *Instance; /*!< Register base address */ + PCD_InitTypeDef Init; /*!< PCD required parameters */ + PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */ + PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */ + HAL_LockTypeDef Lock; /*!< PCD peripheral status */ + __IO PCD_StateTypeDef State; /*!< PCD communication state */ + uint32_t Setup[12]; /*!< Setup packet buffer */ +#ifdef USB_OTG_GLPMCFG_LPMEN + PCD_LPM_StateTypeDef LPM_State; /*!< LPM State */ + uint32_t BESL; + uint32_t lpm_active; /*!< Enable or disable the Link Power Management . + This parameter can be set to ENABLE or DISABLE */ +#endif /* USB_OTG_GLPMCFG_LPMEN */ + void *pData; /*!< Pointer to upper stack Handler */ } PCD_HandleTypeDef; - + +/** + * @} + */ + +/* Include PCD HAL Extension module */ +#include "stm32f4xx_hal_pcd_ex.h" + /* Exported constants --------------------------------------------------------*/ -/** @defgroup PCD_Exported_Constants +/** @defgroup PCD_Exported_Constants PCD Exported Constants * @{ */ -/** @defgroup PCD_Speed +/** @defgroup PCD_Speed PCD Speed * @{ */ #define PCD_SPEED_HIGH 0 @@ -104,7 +129,7 @@ typedef struct * @} */ - /** @defgroup PCD_PHY_Module +/** @defgroup PCD_PHY_Module PCD PHY Module * @{ */ #define PCD_PHY_ULPI 1 @@ -112,28 +137,13 @@ typedef struct /** * @} */ - -/** @defgroup PCD_Instance_definition - * @{ - */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \ - ((INSTANCE) == USB_OTG_HS)) -#elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) - #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS)) -#endif /** * @} */ -/** - * @} - */ - -/* Exported macro ------------------------------------------------------------*/ - -/** @defgroup PCD_Interrupt_Clock +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup PCD_Exported_Macros PCD Exported Macros * @brief macros to handle interrupts and specific clock configurations * @{ */ @@ -146,85 +156,83 @@ typedef struct #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= \ - ~(USB_OTG_PCGCCTL_STOPCLK) - + ~(USB_OTG_PCGCCTL_STOPCLK) #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10) -#define USB_FS_EXTI_TRIGGER_RISING_EDGE ((uint32_t)0x08) -#define USB_FS_EXTI_TRIGGER_FALLING_EDGE ((uint32_t)0x0C) -#define USB_FS_EXTI_TRIGGER_BOTH_EDGE ((uint32_t)0x10) - -#define USB_HS_EXTI_TRIGGER_RISING_EDGE ((uint32_t)0x08) -#define USB_HS_EXTI_TRIGGER_FALLING_EDGE ((uint32_t)0x0C) -#define USB_HS_EXTI_TRIGGER_BOTH_EDGE ((uint32_t)0x10) - +#define USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08) +#define USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C) +#define USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10) -#define USB_HS_EXTI_LINE_WAKEUP ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */ -#define USB_FS_EXTI_LINE_WAKEUP ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */ +#define USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08) +#define USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C) +#define USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10) +#define USB_OTG_HS_WAKEUP_EXTI_LINE ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */ +#define USB_OTG_FS_WAKEUP_EXTI_LINE ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */ +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE) +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE) +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE) +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE) -#define __HAL_USB_HS_EXTI_ENABLE_IT() EXTI->IMR |= (USB_HS_EXTI_LINE_WAKEUP) -#define __HAL_USB_HS_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_HS_EXTI_LINE_WAKEUP) -#define __HAL_USB_HS_EXTI_GET_FLAG() EXTI->PR & (USB_HS_EXTI_LINE_WAKEUP) -#define __HAL_USB_HS_EXTI_CLEAR_FLAG() EXTI->PR = (USB_HS_EXTI_LINE_WAKEUP) - -#define __HAL_USB_HS_EXTI_SET_RISING_EGDE_TRIGGER() EXTI->FTSR &= ~(USB_HS_EXTI_LINE_WAKEUP);\ - EXTI->RTSR |= USB_HS_EXTI_LINE_WAKEUP - +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\ + EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE -#define __HAL_USB_HS_EXTI_SET_FALLING_EGDE_TRIGGER() EXTI->FTSR |= (USB_HS_EXTI_LINE_WAKEUP);\ - EXTI->RTSR &= ~(USB_HS_EXTI_LINE_WAKEUP) - +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_HS_WAKEUP_EXTI_LINE);\ + EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE) -#define __HAL_USB_HS_EXTI_SET_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(USB_HS_EXTI_LINE_WAKEUP);\ - EXTI->FTSR &= ~(USB_HS_EXTI_LINE_WAKEUP;)\ - EXTI->RTSR |= USB_HS_EXTI_LINE_WAKEUP;\ - EXTI->FTSR |= USB_HS_EXTI_LINE_WAKEUP +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\ + EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE;)\ + EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE;\ + EXTI->FTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE -#define __HAL_USB_HS_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_FS_EXTI_LINE_WAKEUP) - - -#define __HAL_USB_FS_EXTI_ENABLE_IT() EXTI->IMR |= USB_FS_EXTI_LINE_WAKEUP -#define __HAL_USB_FS_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_FS_EXTI_LINE_WAKEUP) -#define __HAL_USB_FS_EXTI_GET_FLAG() EXTI->PR & (USB_FS_EXTI_LINE_WAKEUP) -#define __HAL_USB_FS_EXTI_CLEAR_FLAG() EXTI->PR = USB_FS_EXTI_LINE_WAKEUP +#define __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE) + +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE) +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE) +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE -#define __HAL_USB_FS_EXTI_SET_RISING_EGDE_TRIGGER() EXTI->FTSR &= ~(USB_FS_EXTI_LINE_WAKEUP);\ - EXTI->RTSR |= USB_FS_EXTI_LINE_WAKEUP +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\ + EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE -#define __HAL_USB_FS_EXTI_SET_FALLING_EGDE_TRIGGER() EXTI->FTSR |= (USB_FS_EXTI_LINE_WAKEUP);\ - EXTI->RTSR &= ~(USB_FS_EXTI_LINE_WAKEUP) +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_FS_WAKEUP_EXTI_LINE);\ + EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE) - -#define __HAL_USB_FS_EXTI_SET_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(USB_FS_EXTI_LINE_WAKEUP);\ - EXTI->FTSR &= ~(USB_FS_EXTI_LINE_WAKEUP);\ - EXTI->RTSR |= USB_FS_EXTI_LINE_WAKEUP;\ - EXTI->FTSR |= USB_FS_EXTI_LINE_WAKEUP +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\ + EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\ + EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE;\ + EXTI->FTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE -#define __HAL_USB_FS_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_FS_EXTI_LINE_WAKEUP) - -/** - * @} - */ - -/* Include PCD HAL Extension module */ -#include "stm32f4xx_hal_pcd_ex.h" +#define __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE) /* Exported functions --------------------------------------------------------*/ +/** @addtogroup PCD_Exported_Functions PCD Exported Functions + * @{ + */ -/* Initialization/de-initialization functions **********************************/ +/* Initialization/de-initialization functions ********************************/ +/** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd); -HAL_StatusTypeDef HAL_PCD_DeInit (PCD_HandleTypeDef *hpcd); +HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd); void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd); void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd); +/** + * @} + */ -/* I/O operation functions *****************************************************/ - /* Non-Blocking mode: Interrupt */ +/* I/O operation functions ***************************************************/ +/* Non-Blocking mode: Interrupt */ +/** @addtogroup PCD_Exported_Functions_Group2 IO operation functions + * @{ + */ +/* Non-Blocking mode: Interrupt */ HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd); HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd); void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd); @@ -240,8 +248,14 @@ void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd); void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd); +/** + * @} + */ -/* Peripheral Control functions ************************************************/ +/* Peripheral Control functions **********************************************/ +/** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions + * @{ + */ HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd); HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd); HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address); @@ -253,15 +267,42 @@ uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); -HAL_StatusTypeDef HAL_PCD_ActiveRemoteWakeup(PCD_HandleTypeDef *hpcd); -HAL_StatusTypeDef HAL_PCD_DeActiveRemoteWakeup(PCD_HandleTypeDef *hpcd); - -/* Create an alias to keep compatibility with the old name */ -#define HAL_PCD_SetTxFiFo HAL_PCDEx_SetTxFiFo -#define HAL_PCD_SetRxFiFo HAL_PCDEx_SetRxFiFo +HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd); +HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd); +/** + * @} + */ -/* Peripheral State functions **************************************************/ +/* Peripheral State functions ************************************************/ +/** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions + * @{ + */ PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd); +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup PCD_Instance_definition PCD Instance definition + * @{ + */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\ + defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) + #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \ + ((INSTANCE) == USB_OTG_HS)) +#elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) + #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS)) +#endif +/** + * @} + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.c index aa412ca8a8e..ac40e85d80c 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_pcd_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief PCD HAL module driver. * This file provides firmware functions to manage the following * functionalities of the USB Peripheral Controller: @@ -12,7 +12,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,29 +46,27 @@ * @{ */ -/** @defgroup PCDEx +/** @defgroup PCDEx PCDEx * @brief PCD Extended HAL module driver * @{ */ - #ifdef HAL_PCD_MODULE_ENABLED -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ +/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ -/** @defgroup PCDEx_Private_Functions +/** @defgroup PCDEx_Exported_Functions PCDEx Exported Functions * @{ */ - -/** @defgroup PCDEx_Group1 Extended features functions - * @brief Extended features functions - * -@verbatim +/** @defgroup PCDEx_Exported_Functions_Group1 Peripheral Control functions + * @brief PCDEx control functions + * +@verbatim =============================================================================== ##### Extended features functions ##### =============================================================================== @@ -80,8 +78,10 @@ */ /** - * @brief Update FIFO configuration + * @brief Set Tx FIFO * @param hpcd: PCD handle + * @param fifo: The number of Tx fifo + * @param size: Fifo size * @retval HAL status */ HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size) @@ -122,18 +122,63 @@ HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uin } /** - * @brief Update FIFO configuration + * @brief Set Rx FIFO * @param hpcd: PCD handle + * @param size: Size of Rx fifo * @retval HAL status */ HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size) { - hpcd->Instance->GRXFSIZ = size; return HAL_OK; } +#if defined(STM32F446xx) +/** + * @brief HAL_PCDEx_ActivateLPM : active LPM Feature + * @param hpcd: PCD handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd) +{ + USB_OTG_GlobalTypeDef *USBx = hpcd->Instance; + + hpcd->lpm_active = ENABLE; + hpcd->LPM_State = LPM_L0; + USBx->GINTMSK |= USB_OTG_GINTMSK_LPMINTM; + USBx->GLPMCFG |= (USB_OTG_GLPMCFG_LPMEN | USB_OTG_GLPMCFG_LPMACK | USB_OTG_GLPMCFG_ENBESL); + + return HAL_OK; +} + +/** + * @brief HAL_PCDEx_DeActivateLPM : de-active LPM feature + * @param hpcd: PCD handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd) +{ + USB_OTG_GlobalTypeDef *USBx = hpcd->Instance; + + hpcd->lpm_active = DISABLE; + USBx->GINTMSK &= ~USB_OTG_GINTMSK_LPMINTM; + USBx->GLPMCFG &= ~(USB_OTG_GLPMCFG_LPMEN | USB_OTG_GLPMCFG_LPMACK | USB_OTG_GLPMCFG_ENBESL); + + return HAL_OK; +} + +/** + * @brief HAL_PCDEx_LPM_Callback : Send LPM message to user layer + * @param hpcd: PCD handle + * @param msg: LPM message + * @retval HAL status + */ +__weak void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) +{ +} +#endif /* STM32F446xx */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.h index 81deed795d9..ae4085c31fc 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pcd_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_pcd_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of PCD HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -53,12 +53,31 @@ /** @addtogroup PCDEx * @{ */ +/* Exported types ------------------------------------------------------------*/ +#if defined(STM32F446xx) +typedef enum +{ + PCD_LPM_L0_ACTIVE = 0x00, /* on */ + PCD_LPM_L1_ACTIVE = 0x01, /* LPM L1 sleep */ +}PCD_LPM_MsgTypeDef; +#endif /* STM32F446xx */ +/* Exported constants --------------------------------------------------------*/ +/* Exported macros -----------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ - -/* Peripheral Extended functions *********************************************/ +/** @addtogroup PCDEx_Exported_Functions PCDEx Exported Functions + * @{ + */ +/** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions + * @{ + */ HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size); HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size); +#if defined(STM32F446xx) +HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd); +HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd); +void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg); +#endif /* STM32F446xx */ /** * @} @@ -68,6 +87,14 @@ HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size); * @} */ +/** + * @} + */ + +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.c index 9d684bd0e12..a917ea6f95a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_pwr.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief PWR HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Power Controller (PWR) peripheral: @@ -13,7 +13,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -47,7 +47,7 @@ * @{ */ -/** @defgroup PWR +/** @defgroup PWR PWR * @brief PWR HAL module driver * @{ */ @@ -56,16 +56,34 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup PWR_Private_Constants + * @{ + */ + +/** @defgroup PWR_PVD_Mode_Mask PWR PVD Mode Mask + * @{ + */ +#define PVD_MODE_IT ((uint32_t)0x00010000) +#define PVD_MODE_EVT ((uint32_t)0x00020000) +#define PVD_RISING_EDGE ((uint32_t)0x00000001) +#define PVD_FALLING_EDGE ((uint32_t)0x00000002) +/** + * @} + */ + +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -/** @defgroup PWR_Private_Functions +/** @defgroup PWR_Exported_Functions PWR Exported Functions * @{ */ -/** @defgroup PWR_Group1 Initialization and de-initialization functions +/** @defgroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and de-initialization functions * @verbatim @@ -78,7 +96,7 @@ write accesses. To enable access to the RTC Domain and RTC registers, proceed as follows: (+) Enable the Power Controller (PWR) APB1 interface clock using the - __PWR_CLK_ENABLE() macro. + __HAL_RCC_PWR_CLK_ENABLE() macro. (+) Enable access to RTC domain using the HAL_PWR_EnableBkUpAccess() function. @endverbatim @@ -87,13 +105,12 @@ /** * @brief Deinitializes the HAL PWR peripheral registers to their default reset values. - * @param None * @retval None */ void HAL_PWR_DeInit(void) { - __PWR_FORCE_RESET(); - __PWR_RELEASE_RESET(); + __HAL_RCC_PWR_FORCE_RESET(); + __HAL_RCC_PWR_RELEASE_RESET(); } /** @@ -101,7 +118,6 @@ void HAL_PWR_DeInit(void) * backup data registers and backup SRAM). * @note If the HSE divided by 2, 3, ..31 is used as the RTC clock, the * Backup Domain Access should be kept enabled. - * @param None * @retval None */ void HAL_PWR_EnableBkUpAccess(void) @@ -114,7 +130,6 @@ void HAL_PWR_EnableBkUpAccess(void) * backup data registers and backup SRAM). * @note If the HSE divided by 2, 3, ..31 is used as the RTC clock, the * Backup Domain Access should be kept enabled. - * @param None * @retval None */ void HAL_PWR_DisableBkUpAccess(void) @@ -126,7 +141,7 @@ void HAL_PWR_DisableBkUpAccess(void) * @} */ -/** @defgroup PWR_Group2 Peripheral Control functions +/** @defgroup PWR_Exported_Functions_Group2 Peripheral Control functions * @brief Low Power modes configuration functions * @verbatim @@ -143,15 +158,16 @@ void HAL_PWR_DisableBkUpAccess(void) (+) A PVDO flag is available to indicate if VDD/VDDA is higher or lower than the PVD threshold. This event is internally connected to the EXTI line16 and can generate an interrupt if enabled. This is done through - __HAL_PVD_EXTI_ENABLE_IT() macro. + __HAL_PWR_PVD_EXTI_ENABLE_IT() macro. (+) The PVD is stopped in Standby mode. - *** WakeUp pin configuration *** + *** Wake-up pin configuration *** ================================ [..] - (+) WakeUp pin is used to wake up the system from Standby mode. This pin is + (+) Wake-up pin is used to wake up the system from Standby mode. This pin is forced in input pull-down configuration and is active on rising edges. - (+) There is only one WakeUp pin: WakeUp Pin 1 on PA.00. + (+) There is one Wake-up pin: Wake-up Pin 1 on PA.00. + Only for STM32F446xx there are two Wake-Up pins: Pin1 on PA.00 and Pin 2 on PC.13 *** Low Power modes configuration *** ===================================== @@ -186,9 +202,9 @@ void HAL_PWR_DisableBkUpAccess(void) are preserved. The voltage regulator can be configured either in normal or low-power mode. To minimize the consumption In Stop mode, FLASH can be powered off before - entering the Stop mode using the HAL_PWR_EnableFlashPowerDown() function. + entering the Stop mode using the HAL_PWREx_EnableFlashPowerDown() function. It can be switched on again by software after exiting the Stop mode using - the HAL_PWR_DisableFlashPowerDown() function. + the HAL_PWREx_DisableFlashPowerDown() function. (+) Entry: The Stop mode is entered using the HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON) @@ -214,18 +230,18 @@ void HAL_PWR_DisableBkUpAccess(void) (++) Entry: (+++) The Standby mode is entered using the HAL_PWR_EnterSTANDBYMode() function. (++) Exit: - (+++) WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wakeup, + (+++) WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wake-up, tamper event, time-stamp event, external reset in NRST pin, IWDG reset. - *** Auto-wakeup (AWU) from low-power mode *** + *** Auto-wake-up (AWU) from low-power mode *** ============================================= [..] (+) The MCU can be woken up from low-power mode by an RTC Alarm event, an RTC - Wakeup event, a tamper event or a time-stamp event, without depending on - an external interrupt (Auto-wakeup mode). + Wake-up event, a tamper event or a time-stamp event, without depending on + an external interrupt (Auto-wake-up mode). - (+) RTC auto-wakeup (AWU) from the Stop and Standby modes + (+) RTC auto-wake-up (AWU) from the Stop and Standby modes (++) To wake up from the Stop mode with an RTC alarm event, it is necessary to configure the RTC to generate the RTC alarm using the HAL_RTC_SetAlarm_IT() function. @@ -234,8 +250,8 @@ void HAL_PWR_DisableBkUpAccess(void) is necessary to configure the RTC to detect the tamper or time stamp event using the HAL_RTCEx_SetTimeStamp_IT() or HAL_RTCEx_SetTamper_IT() functions. - (++) To wake up from the Stop mode with an RTC WakeUp event, it is necessary to - configure the RTC to generate the RTC WakeUp event using the HAL_RTCEx_SetWakeUpTimer_IT() function. + (++) To wake up from the Stop mode with an RTC Wake-up event, it is necessary to + configure the RTC to generate the RTC Wake-up event using the HAL_RTCEx_SetWakeUpTimer_IT() function. @endverbatim * @{ @@ -250,52 +266,47 @@ void HAL_PWR_DisableBkUpAccess(void) * detection level. * @retval None */ -void HAL_PWR_PVDConfig(PWR_PVDTypeDef *sConfigPVD) +void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD) { - uint32_t tmpreg = 0; - /* Check the parameters */ assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel)); assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode)); - tmpreg = PWR->CR; - - /* Clear PLS[7:5] bits */ - tmpreg &= ~ (uint32_t)PWR_CR_PLS; - /* Set PLS[7:5] bits according to PVDLevel value */ - tmpreg |= sConfigPVD->PVDLevel; + MODIFY_REG(PWR->CR, PWR_CR_PLS, sConfigPVD->PVDLevel); - /* Store the new value */ - PWR->CR = tmpreg; + /* Clear any previous config. Keep it clear if no event or IT mode is selected */ + __HAL_PWR_PVD_EXTI_DISABLE_EVENT(); + __HAL_PWR_PVD_EXTI_DISABLE_IT(); + __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE(); + __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); + + /* Configure interrupt mode */ + if((sConfigPVD->Mode & PVD_MODE_IT) == PVD_MODE_IT) + { + __HAL_PWR_PVD_EXTI_ENABLE_IT(); + } - /* Configure the EXTI 16 interrupt */ - if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\ - (sConfigPVD->Mode == PWR_MODE_IT_FALLING) ||\ - (sConfigPVD->Mode == PWR_MODE_IT_RISING)) + /* Configure event mode */ + if((sConfigPVD->Mode & PVD_MODE_EVT) == PVD_MODE_EVT) { - __HAL_PVD_EXTI_ENABLE_IT(PWR_EXTI_LINE_PVD); + __HAL_PWR_PVD_EXTI_ENABLE_EVENT(); } - /* Clear the edge trigger for the EXTI Line 16 (PVD) */ - EXTI->RTSR &= ~EXTI_RTSR_TR16; - EXTI->FTSR &= ~EXTI_FTSR_TR16; - /* Configure the rising edge */ - if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\ - (sConfigPVD->Mode == PWR_MODE_IT_RISING)) + + /* Configure the edge */ + if((sConfigPVD->Mode & PVD_RISING_EDGE) == PVD_RISING_EDGE) { - EXTI->RTSR |= PWR_EXTI_LINE_PVD; + __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE(); } - /* Configure the falling edge */ - if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\ - (sConfigPVD->Mode == PWR_MODE_IT_FALLING)) + + if((sConfigPVD->Mode & PVD_FALLING_EDGE) == PVD_FALLING_EDGE) { - EXTI->FTSR |= PWR_EXTI_LINE_PVD; + __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); } } /** * @brief Enables the Power Voltage Detector(PVD). - * @param None * @retval None */ void HAL_PWR_EnablePVD(void) @@ -305,7 +316,6 @@ void HAL_PWR_EnablePVD(void) /** * @brief Disables the Power Voltage Detector(PVD). - * @param None * @retval None */ void HAL_PWR_DisablePVD(void) @@ -314,31 +324,37 @@ void HAL_PWR_DisablePVD(void) } /** - * @brief Enables the WakeUp PINx functionality. + * @brief Enables the Wake-up PINx functionality. * @param WakeUpPinx: Specifies the Power Wake-Up pin to enable. * This parameter can be one of the following values: * @arg PWR_WAKEUP_PIN1 + * @arg PWR_WAKEUP_PIN2 only available in case of STM32F446xx devices * @retval None */ void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx) { /* Check the parameter */ assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinx)); - *(__IO uint32_t *) CSR_EWUP_BB = (uint32_t)ENABLE; + + /* Enable the wake up pin */ + SET_BIT(PWR->CSR, WakeUpPinx); } /** - * @brief Disables the WakeUp PINx functionality. + * @brief Disables the Wake-up PINx functionality. * @param WakeUpPinx: Specifies the Power Wake-Up pin to disable. * This parameter can be one of the following values: * @arg PWR_WAKEUP_PIN1 + * @arg PWR_WAKEUP_PIN2 only available in case of STM32F446xx devices * @retval None */ void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx) { /* Check the parameter */ assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinx)); - *(__IO uint32_t *) CSR_EWUP_BB = (uint32_t)DISABLE; + + /* Disable the wake up pin */ + CLEAR_BIT(PWR->CSR, WakeUpPinx); } /** @@ -367,6 +383,9 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry) assert_param(IS_PWR_REGULATOR(Regulator)); assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry)); + /* Clear SLEEPDEEP bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); + /* Select SLEEP mode entry -------------------------------------------------*/ if(SLEEPEntry == PWR_SLEEPENTRY_WFI) { @@ -385,7 +404,7 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry) /** * @brief Enters Stop mode. * @note In Stop mode, all I/O pins keep the same state as in Run mode. - * @note When exiting Stop mode by issuing an interrupt or a wakeup event, + * @note When exiting Stop mode by issuing an interrupt or a wake-up event, * the HSI RC oscillator is selected as system clock. * @note When the voltage regulator operates in low power mode, an additional * startup delay is incurred when waking up from Stop mode. @@ -403,25 +422,15 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry) */ void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry) { - uint32_t tmpreg = 0; - /* Check the parameters */ assert_param(IS_PWR_REGULATOR(Regulator)); assert_param(IS_PWR_STOP_ENTRY(STOPEntry)); - /* Select the regulator state in Stop mode ---------------------------------*/ - tmpreg = PWR->CR; - /* Clear PDDS and LPDS bits */ - tmpreg &= (uint32_t)~(PWR_CR_PDDS | PWR_CR_LPDS); - - /* Set LPDS, MRLVDS and LPLVDS bits according to Regulator value */ - tmpreg |= Regulator; - - /* Store the new value */ - PWR->CR = tmpreg; + /* Select the regulator state in Stop mode: Set PDDS and LPDS bits according to PWR_Regulator value */ + MODIFY_REG(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPDS), Regulator); /* Set SLEEPDEEP bit of Cortex System Control Register */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); /* Select Stop mode entry --------------------------------------------------*/ if(STOPEntry == PWR_STOPENTRY_WFI) @@ -432,10 +441,12 @@ void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry) else { /* Request Wait For Event */ + __SEV(); + __WFE(); __WFE(); } /* Reset SLEEPDEEP bit of Cortex System Control Register */ - SCB->SCR &= (uint32_t)~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); } /** @@ -446,16 +457,15 @@ void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry) * Alarm out, or RTC clock calibration out. * - RTC_AF2 pin (PI8) if configured for tamper or time-stamp. * - WKUP pin 1 (PA0) if enabled. - * @param None * @retval None */ void HAL_PWR_EnterSTANDBYMode(void) { /* Select Standby mode */ - PWR->CR |= PWR_CR_PDDS; - + SET_BIT(PWR->CR, PWR_CR_PDDS); + /* Set SLEEPDEEP bit of Cortex System Control Register */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); /* This option is used to ensure that store operations are completed */ #if defined ( __CC_ARM) @@ -468,25 +478,23 @@ void HAL_PWR_EnterSTANDBYMode(void) /** * @brief This function handles the PWR PVD interrupt request. * @note This API should be called under the PVD_IRQHandler(). - * @param None * @retval None */ void HAL_PWR_PVD_IRQHandler(void) { - /* Check PWR exti flag */ - if(__HAL_PVD_EXTI_GET_FLAG(PWR_EXTI_LINE_PVD) != RESET) + /* Check PWR Exti flag */ + if(__HAL_PWR_PVD_EXTI_GET_FLAG() != RESET) { /* PWR PVD interrupt user callback */ HAL_PWR_PVDCallback(); /* Clear PWR Exti pending bit */ - __HAL_PVD_EXTI_CLEAR_FLAG(PWR_EXTI_LINE_PVD); + __HAL_PWR_PVD_EXTI_CLEAR_FLAG(); } } /** * @brief PWR PVD interrupt callback - * @param None * @retval None */ __weak void HAL_PWR_PVDCallback(void) @@ -496,6 +504,56 @@ __weak void HAL_PWR_PVDCallback(void) */ } +/** + * @brief Indicates Sleep-On-Exit when returning from Handler mode to Thread mode. + * @note Set SLEEPONEXIT bit of SCR register. When this bit is set, the processor + * re-enters SLEEP mode when an interruption handling is over. + * Setting this bit is useful when the processor is expected to run only on + * interruptions handling. + * @retval None + */ +void HAL_PWR_EnableSleepOnExit(void) +{ + /* Set SLEEPONEXIT bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk)); +} + +/** + * @brief Disables Sleep-On-Exit feature when returning from Handler mode to Thread mode. + * @note Clears SLEEPONEXIT bit of SCR register. When this bit is set, the processor + * re-enters SLEEP mode when an interruption handling is over. + * @retval None + */ +void HAL_PWR_DisableSleepOnExit(void) +{ + /* Clear SLEEPONEXIT bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk)); +} + +/** + * @brief Enables CORTEX M4 SEVONPEND bit. + * @note Sets SEVONPEND bit of SCR register. When this bit is set, this causes + * WFE to wake up when an interrupt moves from inactive to pended. + * @retval None + */ +void HAL_PWR_EnableSEVOnPend(void) +{ + /* Set SEVONPEND bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk)); +} + +/** + * @brief Disables CORTEX M4 SEVONPEND bit. + * @note Clears SEVONPEND bit of SCR register. When this bit is set, this causes + * WFE to wake up when an interrupt moves from inactive to pended. + * @retval None + */ +void HAL_PWR_DisableSEVOnPend(void) +{ + /* Clear SEVONPEND bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk)); +} + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.h index 7795ca65bd7..6158ae5087d 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_pwr.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of PWR HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,6 +55,11 @@ */ /* Exported types ------------------------------------------------------------*/ + +/** @defgroup PWR_Exported_Types PWR Exported Types + * @{ + */ + /** * @brief PWR PVD configuration structure definition */ @@ -67,45 +72,25 @@ typedef struct This parameter can be a value of @ref PWR_PVD_Mode */ }PWR_PVDTypeDef; -/* Exported constants --------------------------------------------------------*/ -/* ------------- PWR registers bit address in the alias region ---------------*/ -#define PWR_OFFSET (PWR_BASE - PERIPH_BASE) - -/* --- CR Register ---*/ -/* Alias word address of DBP bit */ -#define CR_OFFSET (PWR_OFFSET + 0x00) -#define DBP_BitNumber 0x08 -#define CR_DBP_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (DBP_BitNumber * 4)) - -/* Alias word address of PVDE bit */ -#define PVDE_BitNumber 0x04 -#define CR_PVDE_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PVDE_BitNumber * 4)) - -/* Alias word address of PMODE bit */ -#define PMODE_BitNumber 0x0E -#define CR_PMODE_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PMODE_BitNumber * 4)) +/** + * @} + */ -/* --- CSR Register ---*/ -/* Alias word address of EWUP bit */ -#define CSR_OFFSET (PWR_OFFSET + 0x04) -#define EWUP_BitNumber 0x08 -#define CSR_EWUP_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (EWUP_BitNumber * 4)) - -/** @defgroup PWR_Exported_Constants +/* Exported constants --------------------------------------------------------*/ +/** @defgroup PWR_Exported_Constants PWR Exported Constants * @{ */ - -/** @defgroup PWR_WakeUp_Pins + +/** @defgroup PWR_WakeUp_Pins PWR WakeUp Pins * @{ */ - -#define PWR_WAKEUP_PIN1 PWR_CSR_EWUP -#define IS_PWR_WAKEUP_PIN(PIN) ((PIN) == PWR_WAKEUP_PIN1) +#define PWR_WAKEUP_PIN1 ((uint32_t)0x00000100) +#define PWR_WAKEUP_PIN2 ((uint32_t)0x00000080) /** * @} */ -/** @defgroup PWR_PVD_detection_level +/** @defgroup PWR_PVD_detection_level PWR PVD detection level * @{ */ #define PWR_PVDLEVEL_0 PWR_CR_PLS_LEV0 @@ -115,74 +100,55 @@ typedef struct #define PWR_PVDLEVEL_4 PWR_CR_PLS_LEV4 #define PWR_PVDLEVEL_5 PWR_CR_PLS_LEV5 #define PWR_PVDLEVEL_6 PWR_CR_PLS_LEV6 -#define PWR_PVDLEVEL_7 PWR_CR_PLS_LEV7 -#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \ - ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \ - ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \ - ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7)) +#define PWR_PVDLEVEL_7 PWR_CR_PLS_LEV7/* External input analog voltage + (Compare internally to VREFINT) */ /** * @} */ -/** @defgroup PWR_PVD_Mode +/** @defgroup PWR_PVD_Mode PWR PVD Mode * @{ */ -#define PWR_MODE_EVT ((uint32_t)0x00000000) /*!< No Interrupt */ -#define PWR_MODE_IT_RISING ((uint32_t)0x00000001) /*!< External Interrupt Mode with Rising edge trigger detection */ -#define PWR_MODE_IT_FALLING ((uint32_t)0x00000002) /*!< External Interrupt Mode with Falling edge trigger detection */ -#define PWR_MODE_IT_RISING_FALLING ((uint32_t)0x00000003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */ -#define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_MODE_EVT) || ((MODE) == PWR_MODE_IT_RISING)|| \ - ((MODE) == PWR_MODE_IT_FALLING) || ((MODE) == PWR_MODE_IT_RISING_FALLING)) +#define PWR_PVD_MODE_NORMAL ((uint32_t)0x00000000) /*!< basic mode is used */ +#define PWR_PVD_MODE_IT_RISING ((uint32_t)0x00010001) /*!< External Interrupt Mode with Rising edge trigger detection */ +#define PWR_PVD_MODE_IT_FALLING ((uint32_t)0x00010002) /*!< External Interrupt Mode with Falling edge trigger detection */ +#define PWR_PVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */ +#define PWR_PVD_MODE_EVENT_RISING ((uint32_t)0x00020001) /*!< Event Mode with Rising edge trigger detection */ +#define PWR_PVD_MODE_EVENT_FALLING ((uint32_t)0x00020002) /*!< Event Mode with Falling edge trigger detection */ +#define PWR_PVD_MODE_EVENT_RISING_FALLING ((uint32_t)0x00020003) /*!< Event Mode with Rising/Falling edge trigger detection */ /** * @} - */ + */ + -/** @defgroup PWR_Regulator_state_in_STOP_mode +/** @defgroup PWR_Regulator_state_in_STOP_mode PWR Regulator state in SLEEP/STOP mode * @{ */ #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000) #define PWR_LOWPOWERREGULATOR_ON PWR_CR_LPDS - -#define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \ - ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON)) /** * @} */ -/** @defgroup PWR_SLEEP_mode_entry +/** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry * @{ */ #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01) #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02) -#define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE)) /** * @} */ -/** @defgroup PWR_STOP_mode_entry +/** @defgroup PWR_STOP_mode_entry PWR STOP mode entry * @{ */ #define PWR_STOPENTRY_WFI ((uint8_t)0x01) #define PWR_STOPENTRY_WFE ((uint8_t)0x02) -#define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE)) /** * @} */ -/** @defgroup PWR_Regulator_Voltage_Scale - * @{ - */ -#define PWR_REGULATOR_VOLTAGE_SCALE1 ((uint32_t)0x0000C000) -#define PWR_REGULATOR_VOLTAGE_SCALE2 ((uint32_t)0x00008000) -#define PWR_REGULATOR_VOLTAGE_SCALE3 ((uint32_t)0x00004000) -#define IS_PWR_REGULATOR_VOLTAGE(VOLTAGE) (((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \ - ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE2) || \ - ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE3)) -/** - * @} - */ - -/** @defgroup PWR_Flag +/** @defgroup PWR_Flag PWR Flag * @{ */ #define PWR_FLAG_WU PWR_CSR_WUF @@ -190,7 +156,6 @@ typedef struct #define PWR_FLAG_PVDO PWR_CSR_PVDO #define PWR_FLAG_BRR PWR_CSR_BRR #define PWR_FLAG_VOSRDY PWR_CSR_VOSRDY - /** * @} */ @@ -200,7 +165,28 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup PWR_Exported_Macro PWR Exported Macro + * @{ + */ +#if defined(STM32F405xx) || defined(STM32F407xx) || defined(STM32F415xx) || defined(STM32F17xx) +/** @brief macros configure the main internal regulator output voltage. + * @param __REGULATOR__: specifies the regulator output voltage to achieve + * a tradeoff between performance and power consumption when the device does + * not operate at the maximum frequency (refer to the datasheets for more details). + * This parameter can be one of the following values: + * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output Scale 1 mode + * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output Scale 2 mode + * @retval None + */ +#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__) do { \ + __IO uint32_t tmpreg; \ + MODIFY_REG(PWR->CR, PWR_CR_VOS, (__REGULATOR__)); \ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(PWR->CR, PWR_CR_VOS); \ + UNUSED(tmpreg); \ + } while(0) +#else /** @brief macros configure the main internal regulator output voltage. * @param __REGULATOR__: specifies the regulator output voltage to achieve * a tradeoff between performance and power consumption when the device does @@ -211,7 +197,14 @@ typedef struct * @arg PWR_REGULATOR_VOLTAGE_SCALE3: Regulator voltage output Scale 3 mode * @retval None */ -#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__) (MODIFY_REG(PWR->CR, PWR_CR_VOS, (__REGULATOR__))) +#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__) do { \ + __IO uint32_t tmpreg; \ + MODIFY_REG(PWR->CR, PWR_CR_VOS, (__REGULATOR__)); \ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(PWR->CR, PWR_CR_VOS); \ + UNUSED(tmpreg); \ + } while(0) +#endif /* STM32F405xx || STM32F407xx || STM32F415xx || STM32F417xx */ /** @brief Check PWR flag is set or not. * @param __FLAG__: specifies the flag to check. @@ -244,65 +237,116 @@ typedef struct */ #define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR |= (__FLAG__) << 2) -#define PWR_EXTI_LINE_PVD ((uint32_t)0x00010000) /*!< External interrupt line 16 Connected to the PVD EXTI Line */ /** - * @brief Enable the PVD Exti Line. - * @param __EXTILINE__: specifies the PVD Exti sources to be enabled. - * This parameter can be: - * @arg PWR_EXTI_LINE_PVD + * @brief Enable the PVD Exti Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_IT() (EXTI->IMR |= (PWR_EXTI_LINE_PVD)) + +/** + * @brief Disable the PVD EXTI Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_IT() (EXTI->IMR &= ~(PWR_EXTI_LINE_PVD)) + +/** + * @brief Enable event on PVD Exti Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() (EXTI->EMR |= (PWR_EXTI_LINE_PVD)) + +/** + * @brief Disable event on PVD Exti Line 16. * @retval None. */ -#define __HAL_PVD_EXTI_ENABLE_IT(__EXTILINE__) (EXTI->IMR |= (__EXTILINE__)) +#define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(PWR_EXTI_LINE_PVD)) /** - * @brief Disable the PVD EXTI Line. - * @param __EXTILINE__: specifies the PVD EXTI sources to be disabled. + * @brief Enable the PVD Extended Interrupt Rising Trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD) + +/** + * @brief Disable the PVD Extended Interrupt Rising Trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD) + +/** + * @brief Enable the PVD Extended Interrupt Falling Trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD) + + +/** + * @brief Disable the PVD Extended Interrupt Falling Trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD) + + +/** + * @brief PVD EXTI line configuration: set rising & falling edge trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); + +/** + * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger. * This parameter can be: - * @arg PWR_EXTI_LINE_PVD * @retval None. */ -#define __HAL_PVD_EXTI_DISABLE_IT(__EXTILINE__) (EXTI->IMR &= ~(__EXTILINE__)) +#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); /** * @brief checks whether the specified PVD Exti interrupt flag is set or not. - * @param __EXTILINE__: specifies the PVD Exti sources to be cleared. - * This parameter can be: - * @arg PWR_EXTI_LINE_PVD * @retval EXTI PVD Line Status. */ -#define __HAL_PVD_EXTI_GET_FLAG(__EXTILINE__) (EXTI->PR & (__EXTILINE__)) +#define __HAL_PWR_PVD_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_PVD)) /** * @brief Clear the PVD Exti flag. - * @param __EXTILINE__: specifies the PVD Exti sources to be cleared. - * This parameter can be: - * @arg PWR_EXTI_LINE_PVD * @retval None. */ -#define __HAL_PVD_EXTI_CLEAR_FLAG(__EXTILINE__) (EXTI->PR = (__EXTILINE__)) +#define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_PVD)) /** - * @brief Generates a Software interrupt on selected EXTI line. - * @param __EXTILINE__: specifies the PVD EXTI sources to be disabled. - * This parameter can be: - * @arg PWR_EXTI_LINE_PVD + * @brief Generates a Software interrupt on PVD EXTI line. * @retval None */ -#define __HAL_PVD_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__)) +#define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (PWR_EXTI_LINE_PVD)) + +/** + * @} + */ /* Include PWR HAL Extension module */ #include "stm32f4xx_hal_pwr_ex.h" /* Exported functions --------------------------------------------------------*/ - +/** @addtogroup PWR_Exported_Functions PWR Exported Functions + * @{ + */ + +/** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ /* Initialization and de-initialization functions *****************************/ void HAL_PWR_DeInit(void); void HAL_PWR_EnableBkUpAccess(void); void HAL_PWR_DisableBkUpAccess(void); +/** + * @} + */ +/** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions + * @{ + */ /* Peripheral Control functions **********************************************/ /* PVD configuration */ -void HAL_PWR_PVDConfig(PWR_PVDTypeDef *sConfigPVD); +void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD); void HAL_PWR_EnablePVD(void); void HAL_PWR_DisablePVD(void); @@ -315,9 +359,112 @@ void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry); void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry); void HAL_PWR_EnterSTANDBYMode(void); +/* Power PVD IRQ Handler */ void HAL_PWR_PVD_IRQHandler(void); void HAL_PWR_PVDCallback(void); +/* Cortex System Control functions *******************************************/ +void HAL_PWR_EnableSleepOnExit(void); +void HAL_PWR_DisableSleepOnExit(void); +void HAL_PWR_EnableSEVOnPend(void); +void HAL_PWR_DisableSEVOnPend(void); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup PWR_Private_Constants PWR Private Constants + * @{ + */ + +/** @defgroup PWR_PVD_EXTI_Line PWR PVD EXTI Line + * @{ + */ +#define PWR_EXTI_LINE_PVD ((uint32_t)EXTI_IMR_MR16) /*!< External interrupt line 16 Connected to the PVD EXTI Line */ +/** + * @} + */ + +/** @defgroup PWR_register_alias_address PWR Register alias address + * @{ + */ +/* ------------- PWR registers bit address in the alias region ---------------*/ +#define PWR_OFFSET (PWR_BASE - PERIPH_BASE) +#define PWR_CR_OFFSET 0x00 +#define PWR_CSR_OFFSET 0x04 +#define PWR_CR_OFFSET_BB (PWR_OFFSET + PWR_CR_OFFSET) +#define PWR_CSR_OFFSET_BB (PWR_OFFSET + PWR_CSR_OFFSET) +/** + * @} + */ + +/** @defgroup PWR_CR_register_alias PWR CR Register alias address + * @{ + */ +/* --- CR Register ---*/ +/* Alias word address of DBP bit */ +#define DBP_BIT_NUMBER POSITION_VAL(PWR_CR_DBP) +#define CR_DBP_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (DBP_BIT_NUMBER * 4)) + +/* Alias word address of PVDE bit */ +#define PVDE_BIT_NUMBER POSITION_VAL(PWR_CR_PVDE) +#define CR_PVDE_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (PVDE_BIT_NUMBER * 4)) + +/* Alias word address of PMODE bit */ +#define PMODE_BIT_NUMBER POSITION_VAL(PWR_CR_PMODE) +#define CR_PMODE_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (PMODE_BIT_NUMBER * 4)) +/** + * @} + */ + +/** @defgroup PWR_CSR_register_alias PWR CSR Register alias address + * @{ + */ +/* --- CSR Register ---*/ +/* Alias word address of EWUP bit */ +#define EWUP_BIT_NUMBER POSITION_VAL(PWR_CSR_EWUP) +#define CSR_EWUP_BB (PERIPH_BB_BASE + (PWR_CSR_OFFSET_BB * 32) + (EWUP_BIT_NUMBER * 4)) +/** + * @} + */ + +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup PWR_Private_Macros PWR Private Macros + * @{ + */ + +/** @defgroup PWR_IS_PWR_Definitions PWR Private macros to check input parameters + * @{ + */ +#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || ((PIN) == PWR_WAKEUP_PIN2)) +#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \ + ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \ + ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \ + ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7)) +#define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \ + ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \ + ((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \ + ((MODE) == PWR_PVD_MODE_NORMAL)) +#define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \ + ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON)) +#define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE)) +#define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE)) +/** + * @} + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.c index 5a939785353..78a544c4ac4 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_pwr_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Extended PWR HAL module driver. * This file provides firmware functions to manage the following * functionalities of PWR extension peripheral: @@ -12,7 +12,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,7 +46,7 @@ * @{ */ -/** @defgroup PWREx +/** @defgroup PWREx PWREx * @brief PWR HAL module driver * @{ */ @@ -55,19 +55,27 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup PWREx_Private_Constants + * @{ + */ #define PWR_OVERDRIVE_TIMEOUT_VALUE 1000 #define PWR_UDERDRIVE_TIMEOUT_VALUE 1000 #define PWR_BKPREG_TIMEOUT_VALUE 1000 +#define PWR_VOSRDY_TIMEOUT_VALUE 1000 +/** + * @} + */ + + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup PWREx_Private_Functions - * @{ +/** @defgroup PWREx_Exported_Functions PWREx Exported Functions + * @{ */ -/** @defgroup PWREx_Group1 Peripheral Extended features functions +/** @defgroup PWREx_Exported_Functions_Group1 Peripheral Extended features functions * @brief Peripheral Extended features functions * @verbatim @@ -83,7 +91,7 @@ the CPU, and address in 32-bit, 16-bit or 8-bit mode. Its content is retained even in Standby or VBAT mode when the low power backup regulator is enabled. It can be considered as an internal EEPROM when VBAT is - always present. You can use the HAL_PWR_EnableBkUpReg() function to + always present. You can use the HAL_PWREx_EnableBkUpReg() function to enable the low power backup regulator. (+) When the backup domain is supplied by VDD (analog switch connected to VDD) @@ -109,7 +117,7 @@ ======================================= [..] (+) By setting the FPDS bit in the PWR_CR register by using the - HAL_PWR_EnableFlashPowerDown() function, the Flash memory also enters power + HAL_PWREx_EnableFlashPowerDown() function, the Flash memory also enters power down mode when the device enters Stop mode. When the Flash memory is in power down mode, an additional startup delay is incurred when waking up from Stop mode. @@ -148,7 +156,6 @@ /** * @brief Enables the Backup Regulator. - * @param None * @retval HAL status */ HAL_StatusTypeDef HAL_PWREx_EnableBkUpReg(void) @@ -173,7 +180,6 @@ HAL_StatusTypeDef HAL_PWREx_EnableBkUpReg(void) /** * @brief Disables the Backup Regulator. - * @param None * @retval HAL status */ HAL_StatusTypeDef HAL_PWREx_DisableBkUpReg(void) @@ -198,7 +204,6 @@ HAL_StatusTypeDef HAL_PWREx_DisableBkUpReg(void) /** * @brief Enables the Flash Power Down in Stop mode. - * @param None * @retval None */ void HAL_PWREx_EnableFlashPowerDown(void) @@ -208,7 +213,6 @@ void HAL_PWREx_EnableFlashPowerDown(void) /** * @brief Disables the Flash Power Down in Stop mode. - * @param None * @retval None */ void HAL_PWREx_DisableFlashPowerDown(void) @@ -216,11 +220,154 @@ void HAL_PWREx_DisableFlashPowerDown(void) *(__IO uint32_t *) CR_FPDS_BB = (uint32_t)DISABLE; } +/** + * @brief Return Voltage Scaling Range. + * @retval The configured scale for the regulator voltage(VOS bit field). + * The returned value can be one of the following: + * - @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output Scale 1 mode + * - @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output Scale 2 mode + * - @arg PWR_REGULATOR_VOLTAGE_SCALE3: Regulator voltage output Scale 3 mode + */ +uint32_t HAL_PWREx_GetVoltageRange(void) +{ + return (PWR->CR & PWR_CR_VOS); +} + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) +/** + * @brief Configures the main internal regulator output voltage. + * @param VoltageScaling: specifies the regulator output voltage to achieve + * a tradeoff between performance and power consumption. + * This parameter can be one of the following values: + * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output range 1 mode, + * the maximum value of fHCLK = 168 MHz. + * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output range 2 mode, + * the maximum value of fHCLK = 144 MHz. + * @note When moving from Range 1 to Range 2, the system frequency must be decreased to + * a value below 144 MHz before calling HAL_PWREx_ConfigVoltageScaling() API. + * When moving from Range 2 to Range 1, the system frequency can be increased to + * a value up to 168 MHz after calling HAL_PWREx_ConfigVoltageScaling() API. + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling(uint32_t VoltageScaling) +{ + uint32_t tickstart = 0; + + assert_param(IS_PWR_VOLTAGE_SCALING_RANGE(VoltageScaling)); + + /* Enable PWR RCC Clock Peripheral */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* Set Range */ + __HAL_PWR_VOLTAGESCALING_CONFIG(VoltageScaling); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + while((__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY) == RESET)) + { + if((HAL_GetTick() - tickstart ) > PWR_VOSRDY_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + return HAL_OK; +} + +#elif defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +/** + * @brief Configures the main internal regulator output voltage. + * @param VoltageScaling: specifies the regulator output voltage to achieve + * a tradeoff between performance and power consumption. + * This parameter can be one of the following values: + * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output range 1 mode, + * the maximum value of fHCLK is 168 MHz. It can be extended to + * 180 MHz by activating the over-drive mode. + * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output range 2 mode, + * the maximum value of fHCLK is 144 MHz. It can be extended to, + * 168 MHz by activating the over-drive mode. + * @arg PWR_REGULATOR_VOLTAGE_SCALE3: Regulator voltage output range 3 mode, + * the maximum value of fHCLK is 120 MHz. + * @note To update the system clock frequency(SYSCLK): + * - Set the HSI or HSE as system clock frequency using the HAL_RCC_ClockConfig(). + * - Call the HAL_RCC_OscConfig() to configure the PLL. + * - Call HAL_PWREx_ConfigVoltageScaling() API to adjust the voltage scale. + * - Set the new system clock frequency using the HAL_RCC_ClockConfig(). + * @note The scale can be modified only when the HSI or HSE clock source is selected + * as system clock source, otherwise the API returns HAL_ERROR. + * @note When the PLL is OFF, the voltage scale 3 is automatically selected and the VOS bits + * value in the PWR_CR1 register are not taken in account. + * @note This API forces the PLL state ON to allow the possibility to configure the voltage scale 1 or 2. + * @note The new voltage scale is active only when the PLL is ON. + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling(uint32_t VoltageScaling) +{ + uint32_t tickstart = 0; + + assert_param(IS_PWR_VOLTAGE_SCALING_RANGE(VoltageScaling)); + + /* Enable PWR RCC Clock Peripheral */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* Check if the PLL is used as system clock or not */ + if(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL) + { + /* Disable the main PLL */ + __HAL_RCC_PLL_DISABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + /* Wait till PLL is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Set Range */ + __HAL_PWR_VOLTAGESCALING_CONFIG(VoltageScaling); + + /* Enable the main PLL */ + __HAL_RCC_PLL_ENABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + while((__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY) == RESET)) + { + if((HAL_GetTick() - tickstart ) > PWR_VOSRDY_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + return HAL_ERROR; + } + + return HAL_OK; +} +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ + #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) /** * @brief Enables Main Regulator low voltage mode. * @note This mode is only available for STM32F401xx/STM32F411xx devices. - * @param None * @retval None */ void HAL_PWREx_EnableMainRegulatorLowVoltage(void) @@ -231,7 +378,6 @@ void HAL_PWREx_EnableMainRegulatorLowVoltage(void) /** * @brief Disables Main Regulator low voltage mode. * @note This mode is only available for STM32F401xx/STM32F411xx devices. - * @param None * @retval None */ void HAL_PWREx_DisableMainRegulatorLowVoltage(void) @@ -242,7 +388,6 @@ void HAL_PWREx_DisableMainRegulatorLowVoltage(void) /** * @brief Enables Low Power Regulator low voltage mode. * @note This mode is only available for STM32F401xx/STM32F411xx devices. - * @param None * @retval None */ void HAL_PWREx_EnableLowRegulatorLowVoltage(void) @@ -253,7 +398,6 @@ void HAL_PWREx_EnableLowRegulatorLowVoltage(void) /** * @brief Disables Low Power Regulator low voltage mode. * @note This mode is only available for STM32F401xx/STM32F411xx devices. - * @param None * @retval None */ void HAL_PWREx_DisableLowRegulatorLowVoltage(void) @@ -263,7 +407,7 @@ void HAL_PWREx_DisableLowRegulatorLowVoltage(void) #endif /* STM32F401xC || STM32F401xE || STM32F411xE */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /** * @brief Activates the Over-Drive mode. * @note This function can be used only for STM32F42xx/STM32F43xx devices. @@ -273,14 +417,13 @@ void HAL_PWREx_DisableLowRegulatorLowVoltage(void) * critical tasks and when the system clock source is either HSI or HSE. * During the Over-drive switch activation, no peripheral clocks should be enabled. * The peripheral clocks must be enabled once the Over-drive mode is activated. - * @param None * @retval HAL status */ -HAL_StatusTypeDef HAL_PWREx_ActivateOverDrive(void) +HAL_StatusTypeDef HAL_PWREx_EnableOverDrive(void) { uint32_t tickstart = 0; - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Enable the Over-drive to extend the clock frequency to 180 Mhz */ __HAL_PWR_OVERDRIVE_ENABLE(); @@ -321,14 +464,13 @@ HAL_StatusTypeDef HAL_PWREx_ActivateOverDrive(void) * critical tasks and when the system clock source is either HSI or HSE. * During the Over-drive switch activation, no peripheral clocks should be enabled. * The peripheral clocks must be enabled once the Over-drive mode is activated. - * @param None * @retval HAL status */ -HAL_StatusTypeDef HAL_PWREx_DeactivateOverDrive(void) +HAL_StatusTypeDef HAL_PWREx_DisableOverDrive(void) { uint32_t tickstart = 0; - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Disable the Over-drive switch */ __HAL_PWR_OVERDRIVESWITCHING_DISABLE(); @@ -380,7 +522,7 @@ HAL_StatusTypeDef HAL_PWREx_DeactivateOverDrive(void) * * @note In Stop mode, all I/O pins keep the same state as in Run mode. * - * @note When exiting Stop mode by issuing an interrupt or a wakeup event, + * @note When exiting Stop mode by issuing an interrupt or a wake-up event, * the HSI RC oscillator is selected as system clock. * * @note When the voltage regulator operates in low power mode, an additional @@ -402,7 +544,7 @@ HAL_StatusTypeDef HAL_PWREx_DeactivateOverDrive(void) */ HAL_StatusTypeDef HAL_PWREx_EnterUnderDriveSTOPMode(uint32_t Regulator, uint8_t STOPEntry) { - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; uint32_t tickstart = 0; /* Check the parameters */ @@ -410,7 +552,7 @@ HAL_StatusTypeDef HAL_PWREx_EnterUnderDriveSTOPMode(uint32_t Regulator, uint8_t assert_param(IS_PWR_STOP_ENTRY(STOPEntry)); /* Enable Power ctrl clock */ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Enable the Under-drive Mode ---------------------------------------------*/ /* Clear Under-drive flag */ __HAL_PWR_CLEAR_ODRUDR_FLAG(); @@ -431,15 +573,15 @@ HAL_StatusTypeDef HAL_PWREx_EnterUnderDriveSTOPMode(uint32_t Regulator, uint8_t } /* Select the regulator state in STOP mode ---------------------------------*/ - tmpreg = PWR->CR; + tmpreg1 = PWR->CR; /* Clear PDDS, LPDS, MRLUDS and LPLUDS bits */ - tmpreg &= (uint32_t)~(PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_LPUDS | PWR_CR_MRUDS); + tmpreg1 &= (uint32_t)~(PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_LPUDS | PWR_CR_MRUDS); /* Set LPDS, MRLUDS and LPLUDS bits according to PWR_Regulator value */ - tmpreg |= Regulator; + tmpreg1 |= Regulator; /* Store the new value */ - PWR->CR = tmpreg; + PWR->CR = tmpreg1; /* Set SLEEPDEEP bit of Cortex System Control Register */ SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; @@ -461,7 +603,7 @@ HAL_StatusTypeDef HAL_PWREx_EnterUnderDriveSTOPMode(uint32_t Regulator, uint8_t return HAL_OK; } -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.h index 822e421e4b7..65f8dedd5c9 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_pwr_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_pwr_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of PWR HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -56,48 +56,22 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -/* ------------- PWR registers bit address in the alias region ---------------*/ -/* --- CR Register ---*/ -/* Alias word address of FPDS bit */ -#define FPDS_BitNumber 0x09 -#define CR_FPDS_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (FPDS_BitNumber * 4)) - -/* Alias word address of ODEN bit */ -#define ODEN_BitNumber 0x10 -#define CR_ODEN_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (ODEN_BitNumber * 4)) - -/* Alias word address of ODSWEN bit */ -#define ODSWEN_BitNumber 0x11 -#define CR_ODSWEN_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (ODSWEN_BitNumber * 4)) - -/* Alias word address of MRLVDS bit */ -#define MRLVDS_BitNumber 0x0B -#define CR_MRLVDS_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (MRLVDS_BitNumber * 4)) - -/* Alias word address of LPLVDS bit */ -#define LPLVDS_BitNumber 0x0A -#define CR_LPLVDS_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (LPLVDS_BitNumber * 4)) - -/* --- CSR Register ---*/ -/* Alias word address of BRE bit */ -#define BRE_BitNumber 0x09 -#define CSR_BRE_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (BRE_BitNumber * 4)) +/** @defgroup PWREx_Exported_Constants PWREx Exported Constants + * @{ + */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) -/** @defgroup PWREx_Regulator_state_in_UnderDrive_mode +/** @defgroup PWREx_Regulator_state_in_UnderDrive_mode PWREx Regulator state in UnderDrive mode * @{ */ #define PWR_MAINREGULATOR_UNDERDRIVE_ON PWR_CR_MRUDS #define PWR_LOWPOWERREGULATOR_UNDERDRIVE_ON ((uint32_t)(PWR_CR_LPDS | PWR_CR_LPUDS)) - -#define IS_PWR_REGULATOR_UNDERDRIVE(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_UNDERDRIVE_ON) || \ - ((REGULATOR) == PWR_LOWPOWERREGULATOR_UNDERDRIVE_ON)) /** * @} */ -/** @defgroup PWREx_Over_Under_Drive_Flag +/** @defgroup PWREx_Over_Under_Drive_Flag PWREx Over Under Drive Flag * @{ */ #define PWR_FLAG_ODRDY PWR_CSR_ODRDY @@ -106,14 +80,34 @@ /** * @} */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +/** @defgroup PWR_Regulator_Voltage_Scale PWR Regulator Voltage Scale + * @{ + */ +#if defined(STM32F405xx) || defined(STM32F407xx) || defined(STM32F415xx) || defined(STM32F17xx) +#define PWR_REGULATOR_VOLTAGE_SCALE1 PWR_CR_VOS /* Scale 1 mode(default value at reset): the maximum value of fHCLK = 168 MHz. */ +#define PWR_REGULATOR_VOLTAGE_SCALE2 ((uint32_t)0x00000000) /* Scale 2 mode: the maximum value of fHCLK = 144 MHz. */ +#else +#define PWR_REGULATOR_VOLTAGE_SCALE1 PWR_CR_VOS /* Scale 1 mode(default value at reset): the maximum value of fHCLK is 168 MHz. It can be extended to + 180 MHz by activating the over-drive mode. */ +#define PWR_REGULATOR_VOLTAGE_SCALE2 PWR_CR_VOS_1 /* Scale 2 mode: the maximum value of fHCLK is 144 MHz. It can be extended to + 168 MHz by activating the over-drive mode. */ +#define PWR_REGULATOR_VOLTAGE_SCALE3 PWR_CR_VOS_0 /* Scale 3 mode: the maximum value of fHCLK is 120 MHz. */ +#endif /* STM32F405xx || STM32F407xx || STM32F415xx || STM32F417xx */ +/** + * @} + */ + /** * @} */ /* Exported macro ------------------------------------------------------------*/ - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @defgroup PWREx_Exported_Constants PWREx Exported Constants + * @{ + */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /** @brief Macros to enable or disable the Over drive mode. * @note These macros can be used only for STM32F42xx/STM3243xx devices. */ @@ -158,13 +152,25 @@ */ #define __HAL_PWR_CLEAR_ODRUDR_FLAG() (PWR->CSR |= PWR_FLAG_UDRDY) -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ -void HAL_PWREx_EnableFlashPowerDown(void); -void HAL_PWREx_DisableFlashPowerDown(void); +/** @addtogroup PWREx_Exported_Functions PWREx Exported Functions + * @{ + */ + +/** @addtogroup PWREx_Exported_Functions_Group1 + * @{ + */ +void HAL_PWREx_EnableFlashPowerDown(void); +void HAL_PWREx_DisableFlashPowerDown(void); HAL_StatusTypeDef HAL_PWREx_EnableBkUpReg(void); HAL_StatusTypeDef HAL_PWREx_DisableBkUpReg(void); +uint32_t HAL_PWREx_GetVoltageRange(void); +HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling(uint32_t VoltageScaling); #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) void HAL_PWREx_EnableMainRegulatorLowVoltage(void); @@ -173,11 +179,99 @@ void HAL_PWREx_EnableLowRegulatorLowVoltage(void); void HAL_PWREx_DisableLowRegulatorLowVoltage(void); #endif /* STM32F401xC || STM32F401xE || STM32F411xE */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) -HAL_StatusTypeDef HAL_PWREx_ActivateOverDrive(void); -HAL_StatusTypeDef HAL_PWREx_DeactivateOverDrive(void); +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +HAL_StatusTypeDef HAL_PWREx_EnableOverDrive(void); +HAL_StatusTypeDef HAL_PWREx_DisableOverDrive(void); HAL_StatusTypeDef HAL_PWREx_EnterUnderDriveSTOPMode(uint32_t Regulator, uint8_t STOPEntry); -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup PWREx_Private_Constants PWREx Private Constants + * @{ + */ + +/** @defgroup PWREx_register_alias_address PWREx Register alias address + * @{ + */ +/* ------------- PWR registers bit address in the alias region ---------------*/ +/* --- CR Register ---*/ +/* Alias word address of FPDS bit */ +#define FPDS_BIT_NUMBER POSITION_VAL(PWR_CR_FPDS) +#define CR_FPDS_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (FPDS_BIT_NUMBER * 4)) + +/* Alias word address of ODEN bit */ +#define ODEN_BIT_NUMBER POSITION_VAL(PWR_CR_ODEN) +#define CR_ODEN_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (ODEN_BIT_NUMBER * 4)) + +/* Alias word address of ODSWEN bit */ +#define ODSWEN_BIT_NUMBER POSITION_VAL(PWR_CR_ODSWEN) +#define CR_ODSWEN_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (ODSWEN_BIT_NUMBER * 4)) + +/* Alias word address of MRLVDS bit */ +#define MRLVDS_BIT_NUMBER POSITION_VAL(PWR_CR_MRLVDS) +#define CR_MRLVDS_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (MRLVDS_BIT_NUMBER * 4)) + +/* Alias word address of LPLVDS bit */ +#define LPLVDS_BIT_NUMBER POSITION_VAL(PWR_CR_LPLVDS) +#define CR_LPLVDS_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CR_OFFSET_BB * 32) + (LPLVDS_BIT_NUMBER * 4)) + + /** + * @} + */ + +/** @defgroup PWREx_CSR_register_alias PWRx CSR Register alias address + * @{ + */ +/* --- CSR Register ---*/ +/* Alias word address of BRE bit */ +#define BRE_BIT_NUMBER POSITION_VAL(PWR_CSR_BRE) +#define CSR_BRE_BB (uint32_t)(PERIPH_BB_BASE + (PWR_CSR_OFFSET_BB * 32) + (BRE_BIT_NUMBER * 4)) +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup PWREx_Private_Macros PWREx Private Macros + * @{ + */ + +/** @defgroup PWREx_IS_PWR_Definitions PWREx Private macros to check input parameters + * @{ + */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +#define IS_PWR_REGULATOR_UNDERDRIVE(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_UNDERDRIVE_ON) || \ + ((REGULATOR) == PWR_LOWPOWERREGULATOR_UNDERDRIVE_ON)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +#if defined(STM32F405xx) || defined(STM32F407xx) || defined(STM32F415xx) || defined(STM32F17xx) +#define IS_PWR_VOLTAGE_SCALING_RANGE(VOLTAGE) (((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \ + ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE2)) +#else +#define IS_PWR_VOLTAGE_SCALING_RANGE(VOLTAGE) (((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \ + ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE2) || \ + ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE3)) +#endif /* STM32F405xx || STM32F407xx || STM32F415xx || STM32F417xx */ + +/** + * @} + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.c new file mode 100644 index 00000000000..5e0fd2fa199 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.c @@ -0,0 +1,1942 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_qspi.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief QSPI HAL module driver. + * + * This file provides firmware functions to manage the following + * functionalities of the QuadSPI interface (QSPI). + * + Initialization and de-initialization functions + * + Indirect functional mode management + * + Memory-mapped functional mode management + * + Auto-polling functional mode management + * + Interrupts and flags management + * + DMA channel configuration for indirect functional mode + * + Errors management and abort functionality + * + @verbatim + =============================================================================== + ##### How to use this driver ##### + =============================================================================== + [..] + *** Initialization *** + ====================== + [..] + (#) As prerequisite, fill in the HAL_QSPI_MspInit() : + (+) Enable QuadSPI clock interface with __HAL_RCC_QSPI_CLK_ENABLE(). + (+) Reset QuadSPI IP with __HAL_RCC_QSPI_FORCE_RESET() and __HAL_RCC_QSPI_RELEASE_RESET(). + (+) Enable the clocks for the QuadSPI GPIOS with __HAL_RCC_GPIOx_CLK_ENABLE(). + (+) Configure these QuadSPI pins in alternate mode using HAL_GPIO_Init(). + (+) If interrupt mode is used, enable and configure QuadSPI global + interrupt with HAL_NVIC_SetPriority() and HAL_NVIC_EnableIRQ(). + (+) If DMA mode is used, enable the clocks for the QuadSPI DMA channel + with __HAL_RCC_DMAx_CLK_ENABLE(), configure DMA with HAL_DMA_Init(), + link it with QuadSPI handle using __HAL_LINKDMA(), enable and configure + DMA channel global interrupt with HAL_NVIC_SetPriority() and HAL_NVIC_EnableIRQ(). + (#) Configure the flash size, the clock prescaler, the fifo threshold, the + clock mode, the sample shifting and the CS high time using the HAL_QSPI_Init() function. + + *** Indirect functional mode *** + ================================ + [..] + (#) Configure the command sequence using the HAL_QSPI_Command() or HAL_QSPI_Command_IT() + functions : + (+) Instruction phase : the mode used and if present the instruction opcode. + (+) Address phase : the mode used and if present the size and the address value. + (+) Alternate-bytes phase : the mode used and if present the size and the alternate + bytes values. + (+) Dummy-cycles phase : the number of dummy cycles (mode used is same as data phase). + (+) Data phase : the mode used and if present the number of bytes. + (+) Double Data Rate (DDR) mode : the activation (or not) of this mode and the delay + if activated. + (+) Sending Instruction Only Once (SIOO) mode : the activation (or not) of this mode. + (#) If no data is required for the command, it is sent directly to the memory : + (+) In polling mode, the output of the function is done when the transfer is complete. + (+) In interrupt mode, HAL_QSPI_CmdCpltCallback() will be called when the transfer is complete. + (#) For the indirect write mode, use HAL_QSPI_Transmit(), HAL_QSPI_Transmit_DMA() or + HAL_QSPI_Transmit_IT() after the command configuration : + (+) In polling mode, the output of the function is done when the transfer is complete. + (+) In interrupt mode, HAL_QSPI_FifoThresholdCallback() will be called when the fifo threshold + is reached and HAL_QSPI_TxCpltCallback() will be called when the transfer is complete. + (+) In DMA mode, HAL_QSPI_TxHalfCpltCallback() will be called at the half transfer and + HAL_QSPI_TxCpltCallback() will be called when the transfer is complete. + (#) For the indirect read mode, use HAL_QSPI_Receive(), HAL_QSPI_Receive_DMA() or + HAL_QSPI_Receive_IT() after the command configuration : + (+) In polling mode, the output of the function is done when the transfer is complete. + (+) In interrupt mode, HAL_QSPI_FifoThresholdCallback() will be called when the fifo threshold + is reached and HAL_QSPI_RxCpltCallback() will be called when the transfer is complete. + (+) In DMA mode, HAL_QSPI_RxHalfCpltCallback() will be called at the half transfer and + HAL_QSPI_RxCpltCallback() will be called when the transfer is complete. + + *** Auto-polling functional mode *** + ==================================== + [..] + (#) Configure the command sequence and the auto-polling functional mode using the + HAL_QSPI_AutoPolling() or HAL_QSPI_AutoPolling_IT() functions : + (+) Instruction phase : the mode used and if present the instruction opcode. + (+) Address phase : the mode used and if present the size and the address value. + (+) Alternate-bytes phase : the mode used and if present the size and the alternate + bytes values. + (+) Dummy-cycles phase : the number of dummy cycles (mode used is same as data phase). + (+) Data phase : the mode used. + (+) Double Data Rate (DDR) mode : the activation (or not) of this mode and the delay + if activated. + (+) Sending Instruction Only Once (SIOO) mode : the activation (or not) of this mode. + (+) The size of the status bytes, the match value, the mask used, the match mode (OR/AND), + the polling interval and the automatic stop activation. + (#) After the configuration : + (+) In polling mode, the output of the function is done when the status match is reached. The + automatic stop is activated to avoid an infinite loop. + (+) In interrupt mode, HAL_QSPI_StatusMatchCallback() will be called each time the status match is reached. + + *** Memory-mapped functional mode *** + ===================================== + [..] + (#) Configure the command sequence and the memory-mapped functional mode using the + HAL_QSPI_MemoryMapped() functions : + (+) Instruction phase : the mode used and if present the instruction opcode. + (+) Address phase : the mode used and the size. + (+) Alternate-bytes phase : the mode used and if present the size and the alternate + bytes values. + (+) Dummy-cycles phase : the number of dummy cycles (mode used is same as data phase). + (+) Data phase : the mode used. + (+) Double Data Rate (DDR) mode : the activation (or not) of this mode and the delay + if activated. + (+) Sending Instruction Only Once (SIOO) mode : the activation (or not) of this mode. + (+) The timeout activation and the timeout period. + (#) After the configuration, the QuadSPI will be used as soon as an access on the AHB is done on + the address range. HAL_QSPI_TimeOutCallback() will be called when the timeout expires. + + *** Errors management and abort functionality *** + ================================================== + [..] + (#) HAL_QSPI_GetError() function gives the error rised during the last operation. + (#) HAL_QSPI_Abort() function aborts any on-going operation and flushes the fifo. + (#) HAL_QSPI_GetState() function gives the current state of the HAL QuadSPI driver. + + *** Workarounds linked to Silicon Limitation *** + ==================================================== + [..] + (#) Workarounds Implemented inside HAL Driver + (+) Extra data written in the FIFO at the end of a read transfer + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @defgroup QSPI QSPI + * @brief HAL QSPI module driver + * @{ + */ +#ifdef HAL_QSPI_MODULE_ENABLED + +#if defined(STM32F446xx) + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @addtogroup QSPI_Private_Constants + * @{ + */ +#define QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE ((uint32_t)0x00000000) /*!Instance)); + assert_param(IS_QSPI_CLOCK_PRESCALER(hqspi->Init.ClockPrescaler)); + assert_param(IS_QSPI_FIFO_THRESHOLD(hqspi->Init.FifoThreshold)); + assert_param(IS_QSPI_SSHIFT(hqspi->Init.SampleShifting)); + assert_param(IS_QSPI_FLASH_SIZE(hqspi->Init.FlashSize)); + assert_param(IS_QSPI_CS_HIGH_TIME(hqspi->Init.ChipSelectHighTime)); + assert_param(IS_QSPI_CLOCK_MODE(hqspi->Init.ClockMode)); + assert_param(IS_QSPI_DUAL_FLASH_MODE(hqspi->Init.DualFlash)); + + if (hqspi->Init.DualFlash != QSPI_DUALFLASH_ENABLE ) + { + assert_param(IS_QSPI_FLASH_ID(hqspi->Init.FlashID)); + } + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hqspi->Lock = HAL_UNLOCKED; + + /* Init the low level hardware : GPIO, CLOCK */ + HAL_QSPI_MspInit(hqspi); + + /* Configure the default timeout for the QSPI memory access */ + HAL_QSPI_SetTimeout(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE); + } + + /* Configure QSPI FIFO Threshold */ + MODIFY_REG(hqspi->Instance->CR, QUADSPI_CR_FTHRES, ((hqspi->Init.FifoThreshold - 1) << 8)); + + /* Wait till BUSY flag reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, hqspi->Timeout); + + if(status == HAL_OK) + { + + /* Configure QSPI Clock Prescaler and Sample Shift */ + MODIFY_REG(hqspi->Instance->CR,(QUADSPI_CR_PRESCALER | QUADSPI_CR_SSHIFT | QUADSPI_CR_FSEL | QUADSPI_CR_DFM), ((hqspi->Init.ClockPrescaler << 24)| hqspi->Init.SampleShifting | hqspi->Init.FlashID| hqspi->Init.DualFlash )); + + /* Configure QSPI Flash Size, CS High Time and Clock Mode */ + MODIFY_REG(hqspi->Instance->DCR, (QUADSPI_DCR_FSIZE | QUADSPI_DCR_CSHT | QUADSPI_DCR_CKMODE), + ((hqspi->Init.FlashSize << 16) | hqspi->Init.ChipSelectHighTime | hqspi->Init.ClockMode)); + + /* Enable the QSPI peripheral */ + __HAL_QSPI_ENABLE(hqspi); + + /* Set QSPI error code to none */ + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Initialize the QSPI state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + + /* Release Lock */ + __HAL_UNLOCK(hqspi); + + /* Return function status */ + return status; +} + +/** + * @brief DeInitializes the QSPI peripheral + * @param hqspi: qspi handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_DeInit(QSPI_HandleTypeDef *hqspi) +{ + /* Check the QSPI handle allocation */ + if(hqspi == NULL) + { + return HAL_ERROR; + } + + /* Process locked */ + __HAL_LOCK(hqspi); + + /* Disable the QSPI Peripheral Clock */ + __HAL_QSPI_DISABLE(hqspi); + + /* DeInit the low level hardware: GPIO, CLOCK, NVIC... */ + HAL_QSPI_MspDeInit(hqspi); + + /* Set QSPI error code to none */ + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Initialize the QSPI state */ + hqspi->State = HAL_QSPI_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(hqspi); + + return HAL_OK; +} + +/** + * @brief QSPI MSP Init + * @param hqspi: QSPI handle + * @retval None + */ + __weak void HAL_QSPI_MspInit(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_QSPI_MspInit can be implemented in the user file + */ +} + +/** + * @brief QSPI MSP DeInit + * @param hqspi: QSPI handle + * @retval None + */ + __weak void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_QSPI_MspDeInit can be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup QSPI_Exported_Functions_Group2 IO operation functions + * @brief QSPI Transmit/Receive functions + * +@verbatim + =============================================================================== + ##### I/O operation functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to : + (+) Handle the interrupts. + (+) Handle the command sequence. + (+) Transmit data in blocking, interrupt or DMA mode. + (+) Receive data in blocking, interrupt or DMA mode. + (+) Manage the auto-polling functional mode. + (+) Manage the memory-mapped functional mode. + +@endverbatim + * @{ + */ + +/** + * @brief This function handles QSPI interrupt request. + * @param hqspi: QSPI handle + * @retval None. + */ +void HAL_QSPI_IRQHandler(QSPI_HandleTypeDef *hqspi) +{ + __IO uint32_t *data_reg; + uint32_t flag = 0, itsource = 0; + + /* QSPI FIFO Threshold interrupt occurred ----------------------------------*/ + flag = __HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_FT); + itsource = __HAL_QSPI_GET_IT_SOURCE(hqspi, QSPI_IT_FT); + + if((flag != RESET) && (itsource != RESET)) + { + data_reg = &hqspi->Instance->DR; + + if(hqspi->State == HAL_QSPI_STATE_BUSY_INDIRECT_TX) + { + /* Transmission process */ + while(__HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_FT) != 0) + { + if (hqspi->TxXferCount > 0) + { + /* Fill the FIFO until it is full */ + *(__IO uint8_t *)data_reg = *hqspi->pTxBuffPtr++; + hqspi->TxXferCount--; + } + else + { + /* No more data available for the transfer */ + break; + } + } + } + else if(hqspi->State == HAL_QSPI_STATE_BUSY_INDIRECT_RX) + { + /* Receiving Process */ + while(__HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_FT) != 0) + { + if (hqspi->RxXferCount > 0) + { + /* Read the FIFO until it is empty */ + *hqspi->pRxBuffPtr++ = *(__IO uint8_t *)data_reg; + hqspi->RxXferCount--; + } + else + { + /* All data have been received for the transfer */ + break; + } + } + } + + /* FIFO Threshold callback */ + HAL_QSPI_FifoThresholdCallback(hqspi); + } + + /* QSPI Transfer Complete interrupt occurred -------------------------------*/ + flag = __HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_TC); + itsource = __HAL_QSPI_GET_IT_SOURCE(hqspi, QSPI_IT_TC); + + if((flag != RESET) && (itsource != RESET)) + { + /* Clear interrupt */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Disable the QSPI FIFO Threshold, Transfer Error and Transfer complete Interrupts */ + __HAL_QSPI_DISABLE_IT(hqspi, QSPI_IT_TC | QSPI_IT_TE | QSPI_IT_FT); + + /* Transfer complete callback */ + if(hqspi->State == HAL_QSPI_STATE_BUSY_INDIRECT_TX) + { + /* Clear Busy bit */ + HAL_QSPI_Abort(hqspi); + + /* TX Complete callback */ + HAL_QSPI_TxCpltCallback(hqspi); + } + else if(hqspi->State == HAL_QSPI_STATE_BUSY_INDIRECT_RX) + { + data_reg = &hqspi->Instance->DR; + while(READ_BIT(hqspi->Instance->SR, QUADSPI_SR_FLEVEL) != 0) + { + if (hqspi->RxXferCount > 0) + { + /* Read the last data received in the FIFO until it is empty */ + *hqspi->pRxBuffPtr++ = *(__IO uint8_t *)data_reg; + hqspi->RxXferCount--; + } + else + { + /* All data have been received for the transfer */ + break; + } + } + + /* Workaround - Extra data written in the FIFO at the end of a read transfer */ + HAL_QSPI_Abort(hqspi); + + /* RX Complete callback */ + HAL_QSPI_RxCpltCallback(hqspi); + } + else if(hqspi->State == HAL_QSPI_STATE_BUSY) + { + /* Command Complete callback */ + HAL_QSPI_CmdCpltCallback(hqspi); + } + + /* Change state of QSPI */ + hqspi->State = HAL_QSPI_STATE_READY; + } + + /* QSPI Status Match interrupt occurred ------------------------------------*/ + flag = __HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_SM); + itsource = __HAL_QSPI_GET_IT_SOURCE(hqspi, QSPI_IT_SM); + + if((flag != RESET) && (itsource != RESET)) + { + /* Clear interrupt */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_SM); + + /* Check if the automatic poll mode stop is activated */ + if(READ_BIT(hqspi->Instance->CR, QUADSPI_CR_APMS) != 0) + { + /* Disable the QSPI FIFO Threshold, Transfer Error and Status Match Interrupts */ + __HAL_QSPI_DISABLE_IT(hqspi, QSPI_IT_SM | QSPI_IT_FT | QSPI_IT_TE); + + /* Change state of QSPI */ + hqspi->State = HAL_QSPI_STATE_READY; + } + + /* Status match callback */ + HAL_QSPI_StatusMatchCallback(hqspi); + } + + /* QSPI Transfer Error interrupt occurred ----------------------------------*/ + flag = __HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_TE); + itsource = __HAL_QSPI_GET_IT_SOURCE(hqspi, QSPI_IT_TE); + + if((flag != RESET) && (itsource != RESET)) + { + /* Clear interrupt */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TE); + + /* Disable all the QSPI Interrupts */ + __HAL_QSPI_DISABLE_IT(hqspi, QSPI_IT_SM | QSPI_IT_TC | QSPI_IT_TE | QSPI_IT_FT); + + /* Set error code */ + hqspi->ErrorCode |= HAL_QSPI_ERROR_TRANSFER; + + /* Change state of QSPI */ + hqspi->State = HAL_QSPI_STATE_ERROR; + + /* Error callback */ + HAL_QSPI_ErrorCallback(hqspi); + } + + /* QSPI Time out interrupt occurred -----------------------------------------*/ + flag = __HAL_QSPI_GET_FLAG(hqspi, QSPI_FLAG_TO); + itsource = __HAL_QSPI_GET_IT_SOURCE(hqspi, QSPI_IT_TO); + + if((flag != RESET) && (itsource != RESET)) + { + /* Clear interrupt */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TO); + + /* Time out callback */ + HAL_QSPI_TimeOutCallback(hqspi); + } +} + +/** + * @brief Sets the command configuration. + * @param hqspi: QSPI handle + * @param cmd : structure that contains the command configuration information + * @param Timeout : Time out duration + * @note This function is used only in Indirect Read or Write Modes + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Command(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, uint32_t Timeout) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Check the parameters */ + assert_param(IS_QSPI_INSTRUCTION_MODE(cmd->InstructionMode)); + if (cmd->InstructionMode != QSPI_INSTRUCTION_NONE) + { + assert_param(IS_QSPI_INSTRUCTION(cmd->Instruction)); + } + + assert_param(IS_QSPI_ADDRESS_MODE(cmd->AddressMode)); + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + assert_param(IS_QSPI_ADDRESS_SIZE(cmd->AddressSize)); + } + + assert_param(IS_QSPI_ALTERNATE_BYTES_MODE(cmd->AlternateByteMode)); + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + assert_param(IS_QSPI_ALTERNATE_BYTES_SIZE(cmd->AlternateBytesSize)); + } + + assert_param(IS_QSPI_DUMMY_CYCLES(cmd->DummyCycles)); + assert_param(IS_QSPI_DATA_MODE(cmd->DataMode)); + + assert_param(IS_QSPI_DDR_MODE(cmd->DdrMode)); + assert_param(IS_QSPI_DDR_HHC(cmd->DdrHoldHalfCycle)); + assert_param(IS_QSPI_SIOO_MODE(cmd->SIOOMode)); + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_BUSY; + + /* Wait till BUSY flag reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, Timeout); + + if (status == HAL_OK) + { + /* Call the configuration function */ + QSPI_Config(hqspi, cmd, QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE); + + if (cmd->DataMode == QSPI_DATA_NONE) + { + /* When there is no data phase, the transfer start as soon as the configuration is done + so wait until TC flag is set to go back in idle state */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_TC, SET, Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + } + else + { + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + + } + else + { + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + /* Return function status */ + return status; +} + +/** + * @brief Sets the command configuration in interrupt mode. + * @param hqspi: QSPI handle + * @param cmd : structure that contains the command configuration information + * @note This function is used only in Indirect Read or Write Modes + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Command_IT(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Check the parameters */ + assert_param(IS_QSPI_INSTRUCTION_MODE(cmd->InstructionMode)); + if (cmd->InstructionMode != QSPI_INSTRUCTION_NONE) + { + assert_param(IS_QSPI_INSTRUCTION(cmd->Instruction)); + } + + assert_param(IS_QSPI_ADDRESS_MODE(cmd->AddressMode)); + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + assert_param(IS_QSPI_ADDRESS_SIZE(cmd->AddressSize)); + } + + assert_param(IS_QSPI_ALTERNATE_BYTES_MODE(cmd->AlternateByteMode)); + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + assert_param(IS_QSPI_ALTERNATE_BYTES_SIZE(cmd->AlternateBytesSize)); + } + + assert_param(IS_QSPI_DUMMY_CYCLES(cmd->DummyCycles)); + assert_param(IS_QSPI_DATA_MODE(cmd->DataMode)); + + assert_param(IS_QSPI_DDR_MODE(cmd->DdrMode)); + assert_param(IS_QSPI_DDR_HHC(cmd->DdrHoldHalfCycle)); + assert_param(IS_QSPI_SIOO_MODE(cmd->SIOOMode)); + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_BUSY; + + /* Wait till BUSY flag reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, hqspi->Timeout); + + if (status == HAL_OK) + { + if (cmd->DataMode == QSPI_DATA_NONE) + { + /* When there is no data phase, the transfer start as soon as the configuration is done + so activate TC and TE interrupts */ + /* Enable the QSPI Transfer Error Interrupt */ + __HAL_QSPI_ENABLE_IT(hqspi, QSPI_IT_TE | QSPI_IT_TC); + } + + /* Call the configuration function */ + QSPI_Config(hqspi, cmd, QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE); + + if (cmd->DataMode != QSPI_DATA_NONE) + { + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + /* Return function status */ + return status; +} + +/** + * @brief Transmit an amount of data in blocking mode. + * @param hqspi: QSPI handle + * @param pData: pointer to data buffer + * @param Timeout : Time out duration + * @note This function is used only in Indirect Write Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Transmit(QSPI_HandleTypeDef *hqspi, uint8_t *pData, uint32_t Timeout) +{ + HAL_StatusTypeDef status = HAL_OK; + __IO uint32_t *data_reg = &hqspi->Instance->DR; + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + if(pData != NULL ) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_INDIRECT_TX; + + /* Configure counters and size of the handle */ + hqspi->TxXferCount = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->TxXferSize = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->pTxBuffPtr = pData; + + /* Configure QSPI: CCR register with functional as indirect write */ + MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE); + + while(hqspi->TxXferCount > 0) + { + /* Wait until FT flag is set to send data */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_FT, SET, Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + break; + } + + *(__IO uint8_t *)data_reg = *hqspi->pTxBuffPtr++; + hqspi->TxXferCount--; + } + + if (status == HAL_OK) + { + /* Wait until TC flag is set to go back in idle state */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_TC, SET, Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + } + else + { + /* Clear Transfer Complete bit */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Clear Busy bit */ + status = HAL_QSPI_Abort(hqspi); + } + } + + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + else + { + status = HAL_ERROR; + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + return status; +} + + +/** + * @brief Receive an amount of data in blocking mode + * @param hqspi: QSPI handle + * @param pData: pointer to data buffer + * @param Timeout : Time out duration + * @note This function is used only in Indirect Read Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Receive(QSPI_HandleTypeDef *hqspi, uint8_t *pData, uint32_t Timeout) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t addr_reg = READ_REG(hqspi->Instance->AR); + __IO uint32_t *data_reg = &hqspi->Instance->DR; + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + if(pData != NULL ) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_INDIRECT_RX; + + /* Configure counters and size of the handle */ + hqspi->RxXferCount = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->RxXferSize = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->pRxBuffPtr = pData; + + /* Configure QSPI: CCR register with functional as indirect read */ + MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_READ); + + /* Start the transfer by re-writing the address in AR register */ + WRITE_REG(hqspi->Instance->AR, addr_reg); + + while(hqspi->RxXferCount > 0) + { + /* Wait until FT or TC flag is set to read received data */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, (QSPI_FLAG_FT | QSPI_FLAG_TC), SET, Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + break; + } + + *hqspi->pRxBuffPtr++ = *(__IO uint8_t *)data_reg; + hqspi->RxXferCount--; + } + + if (status == HAL_OK) + { + /* Wait until TC flag is set to go back in idle state */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_TC, SET, Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + } + else + { + /* Clear Transfer Complete bit */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Workaround - Extra data written in the FIFO at the end of a read transfer */ + status = HAL_QSPI_Abort(hqspi); + } + } + + /* Update QSPI state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + else + { + status = HAL_ERROR; + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + return status; +} + +/** + * @brief Send an amount of data in interrupt mode + * @param hqspi: QSPI handle + * @param pData: pointer to data buffer + * @note This function is used only in Indirect Write Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Transmit_IT(QSPI_HandleTypeDef *hqspi, uint8_t *pData) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + if(pData != NULL ) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_INDIRECT_TX; + + /* Configure counters and size of the handle */ + hqspi->TxXferCount = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->TxXferSize = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->pTxBuffPtr = pData; + + /* Configure QSPI: CCR register with functional as indirect write */ + MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE); + + /* Enable the QSPI transfer error, FIFO threshold and transfert complete Interrupts */ + __HAL_QSPI_ENABLE_IT(hqspi, QSPI_IT_TE | QSPI_IT_FT | QSPI_IT_TC); + + } + else + { + status = HAL_ERROR; + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + return status; +} + +/** + * @brief Receive an amount of data in no-blocking mode with Interrupt + * @param hqspi: QSPI handle + * @param pData: pointer to data buffer + * @note This function is used only in Indirect Read Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Receive_IT(QSPI_HandleTypeDef *hqspi, uint8_t *pData) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t addr_reg = READ_REG(hqspi->Instance->AR); + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + if(pData != NULL ) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_INDIRECT_RX; + + /* Configure counters and size of the handle */ + hqspi->RxXferCount = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->RxXferSize = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->pRxBuffPtr = pData; + + /* Configure QSPI: CCR register with functional as indirect read */ + MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_READ); + + /* Start the transfer by re-writing the address in AR register */ + WRITE_REG(hqspi->Instance->AR, addr_reg); + + /* Enable the QSPI transfer error, FIFO threshold and transfert complete Interrupts */ + __HAL_QSPI_ENABLE_IT(hqspi, QSPI_IT_TE | QSPI_IT_FT | QSPI_IT_TC); + } + else + { + status = HAL_ERROR; + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + return status; +} + +/** + * @brief Sends an amount of data in non blocking mode with DMA. + * @param hqspi: QSPI handle + * @param pData: pointer to data buffer + * @note This function is used only in Indirect Write Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Transmit_DMA(QSPI_HandleTypeDef *hqspi, uint8_t *pData) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t *tmp; + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + if(pData != NULL ) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_INDIRECT_TX; + + /* Configure counters and size of the handle */ + hqspi->TxXferCount = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->TxXferSize = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->pTxBuffPtr = pData; + + /* Configure QSPI: CCR register with functional mode as indirect write */ + MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE); + + /* Set the QSPI DMA transfer complete callback */ + hqspi->hdma->XferCpltCallback = QSPI_DMATxCplt; + + /* Set the QSPI DMA Half transfer complete callback */ + hqspi->hdma->XferHalfCpltCallback = QSPI_DMATxHalfCplt; + + /* Set the DMA error callback */ + hqspi->hdma->XferErrorCallback = QSPI_DMAError; + + /* Configure the direction of the DMA */ + hqspi->hdma->Init.Direction = DMA_MEMORY_TO_PERIPH; + MODIFY_REG(hqspi->hdma->Instance->CR, DMA_SxCR_DIR, hqspi->hdma->Init.Direction); + + /* Enable the QSPI transmit DMA Channel */ + tmp = (uint32_t*)&pData; + HAL_DMA_Start_IT(hqspi->hdma, *(uint32_t*)tmp, (uint32_t)&hqspi->Instance->DR, hqspi->TxXferSize); + + /* Enable the DMA transfer by setting the DMAEN bit in the QSPI CR register */ + SET_BIT(hqspi->Instance->CR, QUADSPI_CR_DMAEN); + } + else + { + status = HAL_OK; + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + return status; +} + +/** + * @brief Receives an amount of data in non blocking mode with DMA. + * @param hqspi: QSPI handle + * @param pData: pointer to data buffer. + * @note This function is used only in Indirect Read Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_Receive_DMA(QSPI_HandleTypeDef *hqspi, uint8_t *pData) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t *tmp; + uint32_t addr_reg = READ_REG(hqspi->Instance->AR); + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + if(pData != NULL ) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_INDIRECT_RX; + + /* Configure counters and size of the handle */ + hqspi->RxXferCount = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->RxXferSize = READ_REG(hqspi->Instance->DLR) + 1; + hqspi->pRxBuffPtr = pData; + + /* Set the QSPI DMA transfer complete callback */ + hqspi->hdma->XferCpltCallback = QSPI_DMARxCplt; + + /* Set the QSPI DMA Half transfer complete callback */ + hqspi->hdma->XferHalfCpltCallback = QSPI_DMARxHalfCplt; + + /* Set the DMA error callback */ + hqspi->hdma->XferErrorCallback = QSPI_DMAError; + + /* Configure the direction of the DMA */ + hqspi->hdma->Init.Direction = DMA_PERIPH_TO_MEMORY; + MODIFY_REG(hqspi->hdma->Instance->CR, DMA_SxCR_DIR, hqspi->hdma->Init.Direction); + + /* Enable the DMA Channel */ + tmp = (uint32_t*)&pData; + HAL_DMA_Start_IT(hqspi->hdma, (uint32_t)&hqspi->Instance->DR, *(uint32_t*)tmp, hqspi->RxXferSize); + + /* Configure QSPI: CCR register with functional as indirect read */ + MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_READ); + + /* Start the transfer by re-writing the address in AR register */ + WRITE_REG(hqspi->Instance->AR, addr_reg); + + /* Enable the DMA transfer by setting the DMAEN bit in the QSPI CR register */ + SET_BIT(hqspi->Instance->CR, QUADSPI_CR_DMAEN); + } + else + { + status = HAL_ERROR; + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + return status; +} + +/** + * @brief Configure the QSPI Automatic Polling Mode in blocking mode. + * @param hqspi: QSPI handle + * @param cmd: structure that contains the command configuration information. + * @param cfg: structure that contains the polling configuration information. + * @param Timeout : Time out duration + * @note This function is used only in Automatic Polling Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_AutoPolling(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg, uint32_t Timeout) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Check the parameters */ + assert_param(IS_QSPI_INSTRUCTION_MODE(cmd->InstructionMode)); + if (cmd->InstructionMode != QSPI_INSTRUCTION_NONE) + { + assert_param(IS_QSPI_INSTRUCTION(cmd->Instruction)); + } + + assert_param(IS_QSPI_ADDRESS_MODE(cmd->AddressMode)); + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + assert_param(IS_QSPI_ADDRESS_SIZE(cmd->AddressSize)); + } + + assert_param(IS_QSPI_ALTERNATE_BYTES_MODE(cmd->AlternateByteMode)); + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + assert_param(IS_QSPI_ALTERNATE_BYTES_SIZE(cmd->AlternateBytesSize)); + } + + assert_param(IS_QSPI_DUMMY_CYCLES(cmd->DummyCycles)); + assert_param(IS_QSPI_DATA_MODE(cmd->DataMode)); + + assert_param(IS_QSPI_DDR_MODE(cmd->DdrMode)); + assert_param(IS_QSPI_DDR_HHC(cmd->DdrHoldHalfCycle)); + assert_param(IS_QSPI_SIOO_MODE(cmd->SIOOMode)); + + assert_param(IS_QSPI_INTERVAL(cfg->Interval)); + assert_param(IS_QSPI_STATUS_BYTES_SIZE(cfg->StatusBytesSize)); + assert_param(IS_QSPI_MATCH_MODE(cfg->MatchMode)); + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_AUTO_POLLING; + + /* Wait till BUSY flag reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, Timeout); + + if (status == HAL_OK) + { + /* Configure QSPI: PSMAR register with the status match value */ + WRITE_REG(hqspi->Instance->PSMAR, cfg->Match); + + /* Configure QSPI: PSMKR register with the status mask value */ + WRITE_REG(hqspi->Instance->PSMKR, cfg->Mask); + + /* Configure QSPI: PIR register with the interval value */ + WRITE_REG(hqspi->Instance->PIR, cfg->Interval); + + /* Configure QSPI: CR register with Match mode and Automatic stop enabled + (otherwise there will be an infinite loop in blocking mode) */ + MODIFY_REG(hqspi->Instance->CR, (QUADSPI_CR_PMM | QUADSPI_CR_APMS), + (cfg->MatchMode | QSPI_AUTOMATIC_STOP_ENABLE)); + + /* Call the configuration function */ + cmd->NbData = cfg->StatusBytesSize; + QSPI_Config(hqspi, cmd, QSPI_FUNCTIONAL_MODE_AUTO_POLLING); + + /* Wait until SM flag is set to go back in idle state */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_SM, SET, Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + } + else + { + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_SM); + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + } + } + else + { + status = HAL_BUSY; + } + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + /* Return function status */ + return status; +} + +/** + * @brief Configure the QSPI Automatic Polling Mode in non-blocking mode. + * @param hqspi: QSPI handle + * @param cmd: structure that contains the command configuration information. + * @param cfg: structure that contains the polling configuration information. + * @note This function is used only in Automatic Polling Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_AutoPolling_IT(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Check the parameters */ + assert_param(IS_QSPI_INSTRUCTION_MODE(cmd->InstructionMode)); + if (cmd->InstructionMode != QSPI_INSTRUCTION_NONE) + { + assert_param(IS_QSPI_INSTRUCTION(cmd->Instruction)); + } + + assert_param(IS_QSPI_ADDRESS_MODE(cmd->AddressMode)); + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + assert_param(IS_QSPI_ADDRESS_SIZE(cmd->AddressSize)); + } + + assert_param(IS_QSPI_ALTERNATE_BYTES_MODE(cmd->AlternateByteMode)); + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + assert_param(IS_QSPI_ALTERNATE_BYTES_SIZE(cmd->AlternateBytesSize)); + } + + assert_param(IS_QSPI_DUMMY_CYCLES(cmd->DummyCycles)); + assert_param(IS_QSPI_DATA_MODE(cmd->DataMode)); + + assert_param(IS_QSPI_DDR_MODE(cmd->DdrMode)); + assert_param(IS_QSPI_DDR_HHC(cmd->DdrHoldHalfCycle)); + assert_param(IS_QSPI_SIOO_MODE(cmd->SIOOMode)); + + assert_param(IS_QSPI_INTERVAL(cfg->Interval)); + assert_param(IS_QSPI_STATUS_BYTES_SIZE(cfg->StatusBytesSize)); + assert_param(IS_QSPI_MATCH_MODE(cfg->MatchMode)); + assert_param(IS_QSPI_AUTOMATIC_STOP(cfg->AutomaticStop)); + + /* Process locked */ + __HAL_LOCK(hqspi); + +if(hqspi->State == HAL_QSPI_STATE_READY) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_AUTO_POLLING; + + /* Wait till BUSY flag reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, hqspi->Timeout); + + if (status == HAL_OK) + { + /* Configure QSPI: PSMAR register with the status match value */ + WRITE_REG(hqspi->Instance->PSMAR, cfg->Match); + + /* Configure QSPI: PSMKR register with the status mask value */ + WRITE_REG(hqspi->Instance->PSMKR, cfg->Mask); + + /* Configure QSPI: PIR register with the interval value */ + WRITE_REG(hqspi->Instance->PIR, cfg->Interval); + + /* Configure QSPI: CR register with Match mode and Automatic stop mode */ + MODIFY_REG(hqspi->Instance->CR, (QUADSPI_CR_PMM | QUADSPI_CR_APMS), + (cfg->MatchMode | cfg->AutomaticStop)); + + /* Call the configuration function */ + cmd->NbData = cfg->StatusBytesSize; + QSPI_Config(hqspi, cmd, QSPI_FUNCTIONAL_MODE_AUTO_POLLING); + + /* Enable the QSPI Transfer Error, FIFO threshold and status match Interrupt */ + __HAL_QSPI_ENABLE_IT(hqspi, (QSPI_IT_FT | QSPI_IT_SM | QSPI_IT_TE)); + } + } + else + { + status = HAL_BUSY; + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + /* Return function status */ + return status; +} + +/** + * @brief Configure the Memory Mapped mode. + * @param hqspi: QSPI handle + * @param cmd: structure that contains the command configuration information. + * @param cfg: structure that contains the memory mapped configuration information. + * @note This function is used only in Memory mapped Mode + * @retval HAL status + */ +HAL_StatusTypeDef HAL_QSPI_MemoryMapped(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_MemoryMappedTypeDef *cfg) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Check the parameters */ + assert_param(IS_QSPI_INSTRUCTION_MODE(cmd->InstructionMode)); + if (cmd->InstructionMode != QSPI_INSTRUCTION_NONE) + { + assert_param(IS_QSPI_INSTRUCTION(cmd->Instruction)); + } + + assert_param(IS_QSPI_ADDRESS_MODE(cmd->AddressMode)); + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + assert_param(IS_QSPI_ADDRESS_SIZE(cmd->AddressSize)); + } + + assert_param(IS_QSPI_ALTERNATE_BYTES_MODE(cmd->AlternateByteMode)); + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + assert_param(IS_QSPI_ALTERNATE_BYTES_SIZE(cmd->AlternateBytesSize)); + } + + assert_param(IS_QSPI_DUMMY_CYCLES(cmd->DummyCycles)); + assert_param(IS_QSPI_DATA_MODE(cmd->DataMode)); + + assert_param(IS_QSPI_DDR_MODE(cmd->DdrMode)); + assert_param(IS_QSPI_DDR_HHC(cmd->DdrHoldHalfCycle)); + assert_param(IS_QSPI_SIOO_MODE(cmd->SIOOMode)); + + assert_param(IS_QSPI_TIMEOUT_ACTIVATION(cfg->TimeOutActivation)); + + /* Process locked */ + __HAL_LOCK(hqspi); + + if(hqspi->State == HAL_QSPI_STATE_READY) + { + hqspi->ErrorCode = HAL_QSPI_ERROR_NONE; + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_BUSY_MEM_MAPPED; + + /* Wait till BUSY flag reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, hqspi->Timeout); + + if (status == HAL_OK) + { + /* Configure QSPI: CR register with time out counter enable */ + MODIFY_REG(hqspi->Instance->CR, QUADSPI_CR_TCEN, cfg->TimeOutActivation); + + if (cfg->TimeOutActivation == QSPI_TIMEOUT_COUNTER_ENABLE) + { + assert_param(IS_QSPI_TIMEOUT_PERIOD(cfg->TimeOutPeriod)); + + /* Configure QSPI: LPTR register with the low-power time out value */ + WRITE_REG(hqspi->Instance->LPTR, cfg->TimeOutPeriod); + + /* Enable the QSPI TimeOut Interrupt */ + __HAL_QSPI_ENABLE_IT(hqspi, QSPI_IT_TO); + } + + /* Call the configuration function */ + QSPI_Config(hqspi, cmd, QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED); + + } + } + else + { + status = HAL_BUSY; + + } + + /* Process unlocked */ + __HAL_UNLOCK(hqspi); + + /* Return function status */ + return status; +} + +/** + * @brief Transfer Error callbacks + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_ErrorCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_QSPI_ErrorCallback could be implemented in the user file + */ +} + +/** + * @brief Command completed callbacks. + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_CmdCpltCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_QSPI_CmdCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Rx Transfer completed callbacks. + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_RxCpltCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_QSPI_RxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Tx Transfer completed callbacks. + * @param hqspi: QSPI handle + * @retval None + */ + __weak void HAL_QSPI_TxCpltCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_QSPI_TxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Rx Half Transfer completed callbacks. + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_RxHalfCpltCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_QSPI_RxHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Tx Half Transfer completed callbacks. + * @param hqspi: QSPI handle + * @retval None + */ + __weak void HAL_QSPI_TxHalfCpltCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_QSPI_TxHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief FIFO Threshold callbacks + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_FifoThresholdCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_QSPI_FIFOThresholdCallback could be implemented in the user file + */ +} + +/** + * @brief Status Match callbacks + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_StatusMatchCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_QSPI_StatusMatchCallback could be implemented in the user file + */ +} + +/** + * @brief Timeout callbacks + * @param hqspi: QSPI handle + * @retval None + */ +__weak void HAL_QSPI_TimeOutCallback(QSPI_HandleTypeDef *hqspi) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_QSPI_TimeOutCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup QSPI_Exported_Functions_Group3 Peripheral Control and State functions + * @brief QSPI control and State functions + * +@verbatim + =============================================================================== + ##### Peripheral Control and State functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to : + (+) Check in run-time the state of the driver. + (+) Check the error code set during last operation. + (+) Abort any operation. +..... +@endverbatim + * @{ + */ + +/** + * @brief Return the QSPI state. + * @param hqspi: QSPI handle + * @retval HAL state + */ +HAL_QSPI_StateTypeDef HAL_QSPI_GetState(QSPI_HandleTypeDef *hqspi) +{ + return hqspi->State; +} + +/** +* @brief Return the QSPI error code +* @param hqspi: QSPI handle +* @retval QSPI Error Code +*/ +uint32_t HAL_QSPI_GetError(QSPI_HandleTypeDef *hqspi) +{ + return hqspi->ErrorCode; +} + +/** +* @brief Abort the current transmission +* @param hqspi: QSPI handle +* @retval HAL status +*/ +HAL_StatusTypeDef HAL_QSPI_Abort(QSPI_HandleTypeDef *hqspi) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Configure QSPI: CR register with Abort request */ + SET_BIT(hqspi->Instance->CR, QUADSPI_CR_ABORT); + + /* Wait until TC flag is set to go back in idle state */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_TC, SET, hqspi->Timeout) != HAL_OK) + { + status = HAL_TIMEOUT; + } + else + { + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Wait until BUSY flag is reset */ + status = QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_BUSY, RESET, hqspi->Timeout); + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_READY; + } + + return status; +} + +/** @brief Set QSPI timeout + * @param hqspi: QSPI handle. + * @param Timeout: Timeout for the QSPI memory access. + * @retval None + */ +void HAL_QSPI_SetTimeout(QSPI_HandleTypeDef *hqspi, uint32_t Timeout) +{ + hqspi->Timeout = Timeout; +} + +/** +* @} +*/ + +/* Private functions ---------------------------------------------------------*/ + +/** + * @brief DMA QSPI receive process complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void QSPI_DMARxCplt(DMA_HandleTypeDef *hdma) +{ + QSPI_HandleTypeDef* hqspi = ( QSPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + hqspi->RxXferCount = 0; + + /* Wait for QSPI TC Flag */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_TC, SET, hqspi->Timeout) != HAL_OK) + { + /* Time out Occurred */ + HAL_QSPI_ErrorCallback(hqspi); + } + else + { + /* Disable the DMA transfer by clearing the DMAEN bit in the QSPI CR register */ + CLEAR_BIT(hqspi->Instance->CR, QUADSPI_CR_DMAEN); + + /* Disable the DMA channel */ + HAL_DMA_Abort(hdma); + + /* Clear Transfer Complete bit */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Workaround - Extra data written in the FIFO at the end of a read transfer */ + HAL_QSPI_Abort(hqspi); + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_READY; + + HAL_QSPI_RxCpltCallback(hqspi); + } +} + +/** + * @brief DMA QSPI transmit process complete callback. + * @param hdma: DMA handle + * @retval None + */ +static void QSPI_DMATxCplt(DMA_HandleTypeDef *hdma) +{ + QSPI_HandleTypeDef* hqspi = ( QSPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + hqspi->TxXferCount = 0; + + /* Wait for QSPI TC Flag */ + if(QSPI_WaitFlagStateUntilTimeout(hqspi, QSPI_FLAG_TC, SET, hqspi->Timeout) != HAL_OK) + { + /* Time out Occurred */ + HAL_QSPI_ErrorCallback(hqspi); + } + else + { + /* Disable the DMA transfer by clearing the DMAEN bit in the QSPI CR register */ + CLEAR_BIT(hqspi->Instance->CR, QUADSPI_CR_DMAEN); + + /* Disable the DMA channel */ + HAL_DMA_Abort(hdma); + + /* Clear Transfer Complete bit */ + __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC); + + /* Clear Busy bit */ + HAL_QSPI_Abort(hqspi); + + /* Update state */ + hqspi->State = HAL_QSPI_STATE_READY; + + HAL_QSPI_TxCpltCallback(hqspi); + } +} + +/** + * @brief DMA QSPI receive process half complete callback + * @param hdma : DMA handle + * @retval None + */ +static void QSPI_DMARxHalfCplt(DMA_HandleTypeDef *hdma) +{ + QSPI_HandleTypeDef* hqspi = (QSPI_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + HAL_QSPI_RxHalfCpltCallback(hqspi); +} + +/** + * @brief DMA QSPI transmit process half complete callback + * @param hdma : DMA handle + * @retval None + */ +static void QSPI_DMATxHalfCplt(DMA_HandleTypeDef *hdma) +{ + QSPI_HandleTypeDef* hqspi = (QSPI_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + HAL_QSPI_TxHalfCpltCallback(hqspi); +} + +/** + * @brief DMA QSPI communication error callback. + * @param hdma: DMA handle + * @retval None + */ +static void QSPI_DMAError(DMA_HandleTypeDef *hdma) +{ + QSPI_HandleTypeDef* hqspi = ( QSPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + hqspi->RxXferCount = 0; + hqspi->TxXferCount = 0; + hqspi->State = HAL_QSPI_STATE_ERROR; + hqspi->ErrorCode |= HAL_QSPI_ERROR_DMA; + + HAL_QSPI_ErrorCallback(hqspi); +} + +/** + * @brief This function wait a flag state until time out. + * @param hqspi: QSPI handle + * @param Flag: Flag checked + * @param State: Value of the flag expected + * @param Timeout: Duration of the time out + * @retval HAL status + */ +static HAL_StatusTypeDef QSPI_WaitFlagStateUntilTimeout(QSPI_HandleTypeDef *hqspi, uint32_t Flag, + FlagStatus State, uint32_t Timeout) +{ + uint32_t tickstart = HAL_GetTick(); + + /* Wait until flag is in expected state */ + while((FlagStatus)(__HAL_QSPI_GET_FLAG(hqspi, Flag)) != State) + { + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0) || ((HAL_GetTick() - tickstart) > Timeout)) + { + hqspi->State = HAL_QSPI_STATE_ERROR; + hqspi->ErrorCode |= HAL_QSPI_ERROR_TIMEOUT; + + return HAL_TIMEOUT; + } + } + } + return HAL_OK; +} + +/** + * @brief This function configures the communication registers + * @param hqspi: QSPI handle + * @param cmd: structure that contains the command configuration information + * @param FunctionalMode: functional mode to configured + * This parameter can be one of the following values: + * @arg QSPI_FUNCTIONAL_MODE_INDIRECT_WRITE: Indirect write mode + * @arg QSPI_FUNCTIONAL_MODE_INDIRECT_READ: Indirect read mode + * @arg QSPI_FUNCTIONAL_MODE_AUTO_POLLING: Automatic polling mode + * @arg QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED: Memory-mapped mode + * @retval None + */ +static void QSPI_Config(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, uint32_t FunctionalMode) +{ + assert_param(IS_QSPI_FUNCTIONAL_MODE(FunctionalMode)); + + if ((cmd->DataMode != QSPI_DATA_NONE) && (FunctionalMode != QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED)) + { + /* Configure QSPI: DLR register with the number of data to read or write */ + WRITE_REG(hqspi->Instance->DLR, (cmd->NbData - 1)); + } + + if (cmd->InstructionMode != QSPI_INSTRUCTION_NONE) + { + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + /* Configure QSPI: ABR register with alternate bytes value */ + WRITE_REG(hqspi->Instance->ABR, cmd->AlternateBytes); + + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + /*---- Command with instruction, address and alternate bytes ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateBytesSize | + cmd->AlternateByteMode | cmd->AddressSize | cmd->AddressMode | + cmd->InstructionMode | cmd->Instruction | FunctionalMode)); + + if (FunctionalMode != QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED) + { + /* Configure QSPI: AR register with address value */ + WRITE_REG(hqspi->Instance->AR, cmd->Address); + } + } + else + { + /*---- Command with instruction and alternate bytes ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateBytesSize | + cmd->AlternateByteMode | cmd->AddressMode | cmd->InstructionMode | + cmd->Instruction | FunctionalMode)); + } + } + else + { + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + /*---- Command with instruction and address ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateByteMode | + cmd->AddressSize | cmd->AddressMode | cmd->InstructionMode | + cmd->Instruction | FunctionalMode)); + + if (FunctionalMode != QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED) + { + /* Configure QSPI: AR register with address value */ + WRITE_REG(hqspi->Instance->AR, cmd->Address); + } + } + else + { + /*---- Command with only instruction ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateByteMode | + cmd->AddressMode | cmd->InstructionMode | cmd->Instruction | + FunctionalMode)); + } + } + } + else + { + if (cmd->AlternateByteMode != QSPI_ALTERNATE_BYTES_NONE) + { + /* Configure QSPI: ABR register with alternate bytes value */ + WRITE_REG(hqspi->Instance->ABR, cmd->AlternateBytes); + + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + /*---- Command with address and alternate bytes ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateBytesSize | + cmd->AlternateByteMode | cmd->AddressSize | cmd->AddressMode | + cmd->InstructionMode | FunctionalMode)); + + if (FunctionalMode != QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED) + { + /* Configure QSPI: AR register with address value */ + WRITE_REG(hqspi->Instance->AR, cmd->Address); + } + } + else + { + /*---- Command with only alternate bytes ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateBytesSize | + cmd->AlternateByteMode | cmd->AddressMode | cmd->InstructionMode | + FunctionalMode)); + } + } + else + { + if (cmd->AddressMode != QSPI_ADDRESS_NONE) + { + /*---- Command with only address ----*/ + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateByteMode | + cmd->AddressSize | cmd->AddressMode | cmd->InstructionMode | + FunctionalMode)); + + if (FunctionalMode != QSPI_FUNCTIONAL_MODE_MEMORY_MAPPED) + { + /* Configure QSPI: AR register with address value */ + WRITE_REG(hqspi->Instance->AR, cmd->Address); + } + } + else + { + /*---- Command with only data phase ----*/ + if (cmd->DataMode != QSPI_DATA_NONE) + { + /* Configure QSPI: CCR register with all communications parameters */ + WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode | + cmd->DataMode | (cmd->DummyCycles << 18) | cmd->AlternateByteMode | + cmd->AddressMode | cmd->InstructionMode | FunctionalMode)); + } + } + } + } +} + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ + +#endif /* HAL_QSPI_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.h new file mode 100644 index 00000000000..e88938d21cd --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_qspi.h @@ -0,0 +1,788 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_qspi.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of QSPI HAL module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_QSPI_H +#define __STM32F4xx_HAL_QSPI_H + +#ifdef __cplusplus + extern "C" { +#endif + +#if defined(STM32F446xx) +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup QSPI + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup QSPI_Exported_Types QSPI Exported Types + * @{ + */ + +/** + * @brief QSPI Init structure definition + */ + +typedef struct +{ + uint32_t ClockPrescaler; /* Specifies the prescaler factor for generating clock based on the AHB clock. + This parameter can be a number between 0 and 255 */ + + uint32_t FifoThreshold; /* Specifies the threshold number of bytes in the FIFO (used only in indirect mode) + This parameter can be a value between 1 and 32 */ + + uint32_t SampleShifting; /* Specifies the Sample Shift. The data is sampled 1/2 clock cycle delay later to + take in account external signal delays. (It should be QSPI_SAMPLE_SHIFTING_NONE in DDR mode) + This parameter can be a value of @ref QSPI_SampleShifting */ + + uint32_t FlashSize; /* Specifies the Flash Size. FlashSize+1 is effectively the number of address bits + required to address the flash memory. The flash capacity can be up to 4GB + (addressed using 32 bits) in indirect mode, but the addressable space in + memory-mapped mode is limited to 256MB + This parameter can be a number between 0 and 31 */ + + uint32_t ChipSelectHighTime; /* Specifies the Chip Select High Time. ChipSelectHighTime+1 defines the minimum number + of clock cycles which the chip select must remain high between commands. + This parameter can be a value of @ref QSPI_ChipSelectHighTime */ + + uint32_t ClockMode; /* Specifies the Clock Mode. It indicates the level that clock takes between commands. + This parameter can be a value of @ref QSPI_ClockMode */ + + uint32_t FlashID; /* Specifies the Flash which will be used, + This parameter can be a value of @ref QSPI_Flash_Select */ + + uint32_t DualFlash; /* Specifies the Dual Flash Mode State + This parameter can be a value of @ref QSPI_DualFlash_Mode */ +}QSPI_InitTypeDef; + +/** + * @brief HAL QSPI State structures definition + */ +typedef enum +{ + HAL_QSPI_STATE_RESET = 0x00, /*!< Peripheral not initialized */ + HAL_QSPI_STATE_READY = 0x01, /*!< Peripheral initialized and ready for use */ + HAL_QSPI_STATE_BUSY = 0x02, /*!< Peripheral in indirect mode and busy */ + HAL_QSPI_STATE_BUSY_INDIRECT_TX = 0x12, /*!< Peripheral in indirect mode with transmission ongoing */ + HAL_QSPI_STATE_BUSY_INDIRECT_RX = 0x22, /*!< Peripheral in indirect mode with reception ongoing */ + HAL_QSPI_STATE_BUSY_AUTO_POLLING = 0x42, /*!< Peripheral in auto polling mode ongoing */ + HAL_QSPI_STATE_BUSY_MEM_MAPPED = 0x82, /*!< Peripheral in memory mapped mode ongoing */ + HAL_QSPI_STATE_ERROR = 0x04 /*!< Peripheral in error */ +}HAL_QSPI_StateTypeDef; + +/** + * @brief QSPI Handle Structure definition + */ +typedef struct +{ + QUADSPI_TypeDef *Instance; /* QSPI registers base address */ + QSPI_InitTypeDef Init; /* QSPI communication parameters */ + uint8_t *pTxBuffPtr; /* Pointer to QSPI Tx transfer Buffer */ + __IO uint16_t TxXferSize; /* QSPI Tx Transfer size */ + __IO uint16_t TxXferCount; /* QSPI Tx Transfer Counter */ + uint8_t *pRxBuffPtr; /* Pointer to QSPI Rx transfer Buffer */ + __IO uint16_t RxXferSize; /* QSPI Rx Transfer size */ + __IO uint16_t RxXferCount; /* QSPI Rx Transfer Counter */ + DMA_HandleTypeDef *hdma; /* QSPI Rx/Tx DMA Handle parameters */ + __IO HAL_LockTypeDef Lock; /* Locking object */ + __IO HAL_QSPI_StateTypeDef State; /* QSPI communication state */ + __IO uint32_t ErrorCode; /* QSPI Error code */ + uint32_t Timeout; /* Timeout for the QSPI memory access */ +}QSPI_HandleTypeDef; + +/** + * @brief QSPI Command structure definition + */ +typedef struct +{ + uint32_t Instruction; /* Specifies the Instruction to be sent + This parameter can be a value (8-bit) between 0x00 and 0xFF */ + uint32_t Address; /* Specifies the Address to be sent (Size from 1 to 4 bytes according AddressSize) + This parameter can be a value (32-bits) between 0x0 and 0xFFFFFFFF */ + uint32_t AlternateBytes; /* Specifies the Alternate Bytes to be sent (Size from 1 to 4 bytes according AlternateBytesSize) + This parameter can be a value (32-bits) between 0x0 and 0xFFFFFFFF */ + uint32_t AddressSize; /* Specifies the Address Size + This parameter can be a value of @ref QSPI_AddressSize */ + uint32_t AlternateBytesSize; /* Specifies the Alternate Bytes Size + This parameter can be a value of @ref QSPI_AlternateBytesSize */ + uint32_t DummyCycles; /* Specifies the Number of Dummy Cycles. + This parameter can be a number between 0 and 31 */ + uint32_t InstructionMode; /* Specifies the Instruction Mode + This parameter can be a value of @ref QSPI_InstructionMode */ + uint32_t AddressMode; /* Specifies the Address Mode + This parameter can be a value of @ref QSPI_AddressMode */ + uint32_t AlternateByteMode; /* Specifies the Alternate Bytes Mode + This parameter can be a value of @ref QSPI_AlternateBytesMode */ + uint32_t DataMode; /* Specifies the Data Mode (used for dummy cycles and data phases) + This parameter can be a value of @ref QSPI_DataMode */ + uint32_t NbData; /* Specifies the number of data to transfer. + This parameter can be any value between 0 and 0xFFFFFFFF (0 means undefined length + until end of memory)*/ + uint32_t DdrMode; /* Specifies the double data rate mode for address, alternate byte and data phase + This parameter can be a value of @ref QSPI_DdrMode */ + uint32_t DdrHoldHalfCycle; /* Specifies the DDR hold half cycle. It delays the data output by one half of + system clock in DDR mode. + This parameter can be a value of @ref QSPI_DdrHoldHalfCycle */ + uint32_t SIOOMode; /* Specifies the send instruction only once mode + This parameter can be a value of @ref QSPI_SIOOMode */ +}QSPI_CommandTypeDef; + +/** + * @brief QSPI Auto Polling mode configuration structure definition + */ +typedef struct +{ + uint32_t Match; /* Specifies the value to be compared with the masked status register to get a match. + This parameter can be any value between 0 and 0xFFFFFFFF */ + uint32_t Mask; /* Specifies the mask to be applied to the status bytes received. + This parameter can be any value between 0 and 0xFFFFFFFF */ + uint32_t Interval; /* Specifies the number of clock cycles between two read during automatic polling phases. + This parameter can be any value between 0 and 0xFFFF */ + uint32_t StatusBytesSize; /* Specifies the size of the status bytes received. + This parameter can be any value between 1 and 4 */ + uint32_t MatchMode; /* Specifies the method used for determining a match. + This parameter can be a value of @ref QSPI_MatchMode */ + uint32_t AutomaticStop; /* Specifies if automatic polling is stopped after a match. + This parameter can be a value of @ref QSPI_AutomaticStop */ +}QSPI_AutoPollingTypeDef; + +/** + * @brief QSPI Memory Mapped mode configuration structure definition + */ +typedef struct +{ + uint32_t TimeOutPeriod; /* Specifies the number of clock to wait when the FIFO is full before to release the chip select. + This parameter can be any value between 0 and 0xFFFF */ + uint32_t TimeOutActivation; /* Specifies if the time out counter is enabled to release the chip select. + This parameter can be a value of @ref QSPI_TimeOutActivation */ +}QSPI_MemoryMappedTypeDef; +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup QSPI_Exported_Constants QSPI Exported Constants + * @{ + */ +/** @defgroup QSPI_ErrorCode QSPI Error Code + * @{ + */ +#define HAL_QSPI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_QSPI_ERROR_TIMEOUT ((uint32_t)0x00000001) /*!< Timeout error */ +#define HAL_QSPI_ERROR_TRANSFER ((uint32_t)0x00000002) /*!< Transfer error */ +#define HAL_QSPI_ERROR_DMA ((uint32_t)0x00000004) /*!< DMA transfer error */ +/** + * @} + */ + +/** @defgroup QSPI_SampleShifting QSPI Sample Shifting + * @{ + */ +#define QSPI_SAMPLE_SHIFTING_NONE ((uint32_t)0x00000000) /*!State = HAL_QSPI_STATE_RESET) + +/** @brief Enable QSPI + * @param __HANDLE__: specifies the QSPI Handle. + * @retval None + */ +#define __HAL_QSPI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, QUADSPI_CR_EN) + +/** @brief Disable QSPI + * @param __HANDLE__: specifies the QSPI Handle. + * @retval None + */ +#define __HAL_QSPI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, QUADSPI_CR_EN) + +/** @brief Enables the specified QSPI interrupt. + * @param __HANDLE__: specifies the QSPI Handle. + * @param __INTERRUPT__: specifies the QSPI interrupt source to enable. + * This parameter can be one of the following values: + * @arg QSPI_IT_TO: QSPI Time out interrupt + * @arg QSPI_IT_SM: QSPI Status match interrupt + * @arg QSPI_IT_FT: QSPI FIFO threshold interrupt + * @arg QSPI_IT_TC: QSPI Transfer complete interrupt + * @arg QSPI_IT_TE: QSPI Transfer error interrupt + * @retval None + */ +#define __HAL_QSPI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) + + +/** @brief Disables the specified QSPI interrupt. + * @param __HANDLE__: specifies the QSPI Handle. + * @param __INTERRUPT__: specifies the QSPI interrupt source to disable. + * This parameter can be one of the following values: + * @arg QSPI_IT_TO: QSPI Timeout interrupt + * @arg QSPI_IT_SM: QSPI Status match interrupt + * @arg QSPI_IT_FT: QSPI FIFO threshold interrupt + * @arg QSPI_IT_TC: QSPI Transfer complete interrupt + * @arg QSPI_IT_TE: QSPI Transfer error interrupt + * @retval None + */ +#define __HAL_QSPI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) + +/** @brief Checks whether the specified QSPI interrupt source is enabled. + * @param __HANDLE__: specifies the QSPI Handle. + * @param __INTERRUPT__: specifies the QSPI interrupt source to check. + * This parameter can be one of the following values: + * @arg QSPI_IT_TO: QSPI Time out interrupt + * @arg QSPI_IT_SM: QSPI Status match interrupt + * @arg QSPI_IT_FT: QSPI FIFO threshold interrupt + * @arg QSPI_IT_TC: QSPI Transfer complete interrupt + * @arg QSPI_IT_TE: QSPI Transfer error interrupt + * @retval The new state of __INTERRUPT__ (TRUE or FALSE). + */ +#define __HAL_QSPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (READ_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) == (__INTERRUPT__)) + +/** + * @brief Get the selected QSPI's flag status. + * @param __HANDLE__: specifies the QSPI Handle. + * @param __FLAG__: specifies the QSPI flag to check. + * This parameter can be one of the following values: + * @arg QSPI_FLAG_BUSY: QSPI Busy flag + * @arg QSPI_FLAG_TO: QSPI Time out flag + * @arg QSPI_FLAG_SM: QSPI Status match flag + * @arg QSPI_FLAG_FT: QSPI FIFO threshold flag + * @arg QSPI_FLAG_TC: QSPI Transfer complete flag + * @arg QSPI_FLAG_TE: QSPI Transfer error flag + * @retval None + */ +#define __HAL_QSPI_GET_FLAG(__HANDLE__, __FLAG__) (READ_BIT((__HANDLE__)->Instance->SR, (__FLAG__)) != 0) + +/** @brief Clears the specified QSPI's flag status. + * @param __HANDLE__: specifies the QSPI Handle. + * @param __FLAG__: specifies the QSPI clear register flag that needs to be set + * This parameter can be one of the following values: + * @arg QSPI_FLAG_TO: QSPI Time out flag + * @arg QSPI_FLAG_SM: QSPI Status match flag + * @arg QSPI_FLAG_TC: QSPI Transfer complete flag + * @arg QSPI_FLAG_TE: QSPI Transfer error flag + * @retval None + */ +#define __HAL_QSPI_CLEAR_FLAG(__HANDLE__, __FLAG__) WRITE_REG((__HANDLE__)->Instance->FCR, (__FLAG__)) +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup QSPI_Exported_Functions + * @{ + */ + +/** @addtogroup QSPI_Exported_Functions_Group1 + * @{ + */ +/* Initialization/de-initialization functions ********************************/ +HAL_StatusTypeDef HAL_QSPI_Init (QSPI_HandleTypeDef *hqspi); +HAL_StatusTypeDef HAL_QSPI_DeInit (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_MspInit (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi); +/** + * @} + */ + +/** @addtogroup QSPI_Exported_Functions_Group2 + * @{ + */ +/* IO operation functions *****************************************************/ +/* QSPI IRQ handler method */ +void HAL_QSPI_IRQHandler(QSPI_HandleTypeDef *hqspi); + +/* QSPI indirect mode */ +HAL_StatusTypeDef HAL_QSPI_Command (QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, uint32_t Timeout); +HAL_StatusTypeDef HAL_QSPI_Transmit (QSPI_HandleTypeDef *hqspi, uint8_t *pData, uint32_t Timeout); +HAL_StatusTypeDef HAL_QSPI_Receive (QSPI_HandleTypeDef *hqspi, uint8_t *pData, uint32_t Timeout); +HAL_StatusTypeDef HAL_QSPI_Command_IT (QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd); +HAL_StatusTypeDef HAL_QSPI_Transmit_IT (QSPI_HandleTypeDef *hqspi, uint8_t *pData); +HAL_StatusTypeDef HAL_QSPI_Receive_IT (QSPI_HandleTypeDef *hqspi, uint8_t *pData); +HAL_StatusTypeDef HAL_QSPI_Transmit_DMA (QSPI_HandleTypeDef *hqspi, uint8_t *pData); +HAL_StatusTypeDef HAL_QSPI_Receive_DMA (QSPI_HandleTypeDef *hqspi, uint8_t *pData); + +/* QSPI status flag polling mode */ +HAL_StatusTypeDef HAL_QSPI_AutoPolling (QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg, uint32_t Timeout); +HAL_StatusTypeDef HAL_QSPI_AutoPolling_IT(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg); + +/* QSPI memory-mapped mode */ +HAL_StatusTypeDef HAL_QSPI_MemoryMapped(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_MemoryMappedTypeDef *cfg); +/** + * @} + */ + +/** @addtogroup QSPI_Exported_Functions_Group3 + * @{ + */ +/* Callback functions in non-blocking modes ***********************************/ +void HAL_QSPI_ErrorCallback (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_FifoThresholdCallback(QSPI_HandleTypeDef *hqspi); + +/* QSPI indirect mode */ +void HAL_QSPI_CmdCpltCallback (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_RxCpltCallback (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_TxCpltCallback (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_RxHalfCpltCallback (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_TxHalfCpltCallback (QSPI_HandleTypeDef *hqspi); + +/* QSPI status flag polling mode */ +void HAL_QSPI_StatusMatchCallback (QSPI_HandleTypeDef *hqspi); + +/* QSPI memory-mapped mode */ +void HAL_QSPI_TimeOutCallback (QSPI_HandleTypeDef *hqspi); +/** + * @} + */ + +/** @addtogroup QSPI_Exported_Functions_Group4 + * @{ + */ +/* Peripheral Control and State functions ************************************/ +HAL_QSPI_StateTypeDef HAL_QSPI_GetState(QSPI_HandleTypeDef *hqspi); +uint32_t HAL_QSPI_GetError(QSPI_HandleTypeDef *hqspi); +HAL_StatusTypeDef HAL_QSPI_Abort (QSPI_HandleTypeDef *hqspi); +void HAL_QSPI_SetTimeout(QSPI_HandleTypeDef *hqspi, uint32_t Timeout); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup QSPI_Private_Constants QSPI Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup QSPI_Private_Macros QSPI Private Macros + * @{ + */ +/** @defgroup QSPI_ClockPrescaler QSPI Clock Prescaler + * @{ + */ +#define IS_QSPI_CLOCK_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFF) +/** + * @} + */ + +/** @defgroup QSPI_FifoThreshold QSPI Fifo Threshold + * @{ + */ +#define IS_QSPI_FIFO_THRESHOLD(THR) (((THR) > 0) && ((THR) <= 32)) +/** + * @} + */ + +#define IS_QSPI_SSHIFT(SSHIFT) (((SSHIFT) == QSPI_SAMPLE_SHIFTING_NONE) || \ + ((SSHIFT) == QSPI_SAMPLE_SHIFTING_HALFCYCLE)) + +/** @defgroup QSPI_FlashSize QSPI Flash Size + * @{ + */ +#define IS_QSPI_FLASH_SIZE(FSIZE) (((FSIZE) <= 31)) +/** + * @} + */ + +#define IS_QSPI_CS_HIGH_TIME(CSHTIME) (((CSHTIME) == QSPI_CS_HIGH_TIME_1_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_2_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_3_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_4_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_5_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_6_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_7_CYCLE) || \ + ((CSHTIME) == QSPI_CS_HIGH_TIME_8_CYCLE)) + +#define IS_QSPI_CLOCK_MODE(CLKMODE) (((CLKMODE) == QSPI_CLOCK_MODE_0) || \ + ((CLKMODE) == QSPI_CLOCK_MODE_3)) + +#define IS_QSPI_FLASH_ID(FLA) (((FLA) == QSPI_FLASH_ID_1) || \ + ((FLA) == QSPI_FLASH_ID_2)) + +#define IS_QSPI_DUAL_FLASH_MODE(MODE) (((MODE) == QSPI_DUALFLASH_ENABLE) || \ + ((MODE) == QSPI_DUALFLASH_DISABLE)) + + +/** @defgroup QSPI_Instruction QSPI Instruction + * @{ + */ +#define IS_QSPI_INSTRUCTION(INSTRUCTION) ((INSTRUCTION) <= 0xFF) +/** + * @} + */ + +#define IS_QSPI_ADDRESS_SIZE(ADDR_SIZE) (((ADDR_SIZE) == QSPI_ADDRESS_8_BITS) || \ + ((ADDR_SIZE) == QSPI_ADDRESS_16_BITS) || \ + ((ADDR_SIZE) == QSPI_ADDRESS_24_BITS) || \ + ((ADDR_SIZE) == QSPI_ADDRESS_32_BITS)) + +#define IS_QSPI_ALTERNATE_BYTES_SIZE(SIZE) (((SIZE) == QSPI_ALTERNATE_BYTES_8_BITS) || \ + ((SIZE) == QSPI_ALTERNATE_BYTES_16_BITS) || \ + ((SIZE) == QSPI_ALTERNATE_BYTES_24_BITS) || \ + ((SIZE) == QSPI_ALTERNATE_BYTES_32_BITS)) + + +/** @defgroup QSPI_DummyCycles QSPI Dummy Cycles + * @{ + */ +#define IS_QSPI_DUMMY_CYCLES(DCY) ((DCY) <= 31) +/** + * @} + */ + +#define IS_QSPI_INSTRUCTION_MODE(MODE) (((MODE) == QSPI_INSTRUCTION_NONE) || \ + ((MODE) == QSPI_INSTRUCTION_1_LINE) || \ + ((MODE) == QSPI_INSTRUCTION_2_LINES) || \ + ((MODE) == QSPI_INSTRUCTION_4_LINES)) + +#define IS_QSPI_ADDRESS_MODE(MODE) (((MODE) == QSPI_ADDRESS_NONE) || \ + ((MODE) == QSPI_ADDRESS_1_LINE) || \ + ((MODE) == QSPI_ADDRESS_2_LINES) || \ + ((MODE) == QSPI_ADDRESS_4_LINES)) + +#define IS_QSPI_ALTERNATE_BYTES_MODE(MODE) (((MODE) == QSPI_ALTERNATE_BYTES_NONE) || \ + ((MODE) == QSPI_ALTERNATE_BYTES_1_LINE) || \ + ((MODE) == QSPI_ALTERNATE_BYTES_2_LINES) || \ + ((MODE) == QSPI_ALTERNATE_BYTES_4_LINES)) + +#define IS_QSPI_DATA_MODE(MODE) (((MODE) == QSPI_DATA_NONE) || \ + ((MODE) == QSPI_DATA_1_LINE) || \ + ((MODE) == QSPI_DATA_2_LINES) || \ + ((MODE) == QSPI_DATA_4_LINES)) + +#define IS_QSPI_DDR_MODE(DDR_MODE) (((DDR_MODE) == QSPI_DDR_MODE_DISABLE) || \ + ((DDR_MODE) == QSPI_DDR_MODE_ENABLE)) + +#define IS_QSPI_DDR_HHC(DDR_HHC) (((DDR_HHC) == QSPI_DDR_HHC_ANALOG_DELAY) || \ + ((DDR_HHC) == QSPI_DDR_HHC_HALF_CLK_DELAY)) + +#define IS_QSPI_SIOO_MODE(SIOO_MODE) (((SIOO_MODE) == QSPI_SIOO_INST_EVERY_CMD) || \ + ((SIOO_MODE) == QSPI_SIOO_INST_ONLY_FIRST_CMD)) + +/** @defgroup QSPI_Interval QSPI Interval + * @{ + */ +#define IS_QSPI_INTERVAL(INTERVAL) ((INTERVAL) <= QUADSPI_PIR_INTERVAL) +/** + * @} + */ + +/** @defgroup QSPI_StatusBytesSize QSPI Status Bytes Size + * @{ + */ +#define IS_QSPI_STATUS_BYTES_SIZE(SIZE) (((SIZE) >= 1) && ((SIZE) <= 4)) +/** + * @} + */ +#define IS_QSPI_MATCH_MODE(MODE) (((MODE) == QSPI_MATCH_MODE_AND) || \ + ((MODE) == QSPI_MATCH_MODE_OR)) + +#define IS_QSPI_AUTOMATIC_STOP(APMS) (((APMS) == QSPI_AUTOMATIC_STOP_DISABLE) || \ + ((APMS) == QSPI_AUTOMATIC_STOP_ENABLE)) + +#define IS_QSPI_TIMEOUT_ACTIVATION(TCEN) (((TCEN) == QSPI_TIMEOUT_COUNTER_DISABLE) || \ + ((TCEN) == QSPI_TIMEOUT_COUNTER_ENABLE)) + +/** @defgroup QSPI_TimeOutPeriod QSPI TimeOut Period + * @{ + */ +#define IS_QSPI_TIMEOUT_PERIOD(PERIOD) ((PERIOD) <= 0xFFFF) +/** + * @} + */ + +#define IS_QSPI_GET_FLAG(FLAG) (((FLAG) == QSPI_FLAG_BUSY) || \ + ((FLAG) == QSPI_FLAG_TO) || \ + ((FLAG) == QSPI_FLAG_SM) || \ + ((FLAG) == QSPI_FLAG_FT) || \ + ((FLAG) == QSPI_FLAG_TC) || \ + ((FLAG) == QSPI_FLAG_TE)) + +#define IS_QSPI_IT(IT) ((((IT) & (uint32_t)0xFFE0FFFF) == 0x00000000) && ((IT) != 0x00000000)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup QSPI_Private_Functions QSPI Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_QSPI_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.c index 34f815d2daf..5c1f8164bdd 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_rcc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief RCC HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Reset and Clock Control (RCC) peripheral: @@ -35,11 +35,30 @@ (+) Configure the clock source(s) for peripherals which clocks are not derived from the System clock (I2S, RTC, ADC, USB OTG FS/SDIO/RNG) + ##### RCC Limitations ##### + ============================================================================== + [..] + A delay between an RCC peripheral clock enable and the effective peripheral + enabling should be taken into account in order to manage the peripheral read/write + from/to registers. + (+) This delay depends on the peripheral mapping. + (+) If peripheral is mapped on AHB: the delay is 2 AHB clock cycle + after the clock enable bit is set on the hardware register + (+) If peripheral is mapped on APB: the delay is 2 APB clock cycle + after the clock enable bit is set on the hardware register + + [..] + Possible Workarounds: + (#) Enable the peripheral clock sometimes before the peripheral read/write + register is required. + (#) For AHB peripheral, insert two dummy read to the peripheral register. + (#) For APB peripheral, insert a dummy read to the peripheral register. + @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -73,7 +92,7 @@ * @{ */ -/** @defgroup RCC +/** @defgroup RCC RCC * @brief RCC HAL module driver * @{ */ @@ -82,32 +101,40 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ -#define HSE_TIMEOUT_VALUE HSE_STARTUP_TIMEOUT -#define HSI_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */ -#define LSI_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */ -#define PLL_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */ +/** @addtogroup RCC_Private_Constants + * @{ + */ #define CLOCKSWITCH_TIMEOUT_VALUE ((uint32_t)5000) /* 5 s */ /* Private macro -------------------------------------------------------------*/ -#define __MCO1_CLK_ENABLE() __GPIOA_CLK_ENABLE() +#define __MCO1_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() #define MCO1_GPIO_PORT GPIOA #define MCO1_PIN GPIO_PIN_8 -#define __MCO2_CLK_ENABLE() __GPIOC_CLK_ENABLE() +#define __MCO2_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() #define MCO2_GPIO_PORT GPIOC #define MCO2_PIN GPIO_PIN_9 +/** + * @} + */ /* Private variables ---------------------------------------------------------*/ +/** @defgroup RCC_Private_Variables RCC Private Variables + * @{ + */ const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; +/** + * @} + */ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -/** @defgroup RCC_Private_Functions - * @{ +/** @defgroup RCC_Exported_Functions RCC Exported Functions + * @{ */ -/** @defgroup RCC_Group1 Initialization and de-initialization functions +/** @defgroup RCC_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -138,7 +165,7 @@ const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, (#) CSS (Clock security system), once enable using the macro __HAL_RCC_CSS_ENABLE() and if a HSE clock failure occurs(HSE used directly or through PLL as System - clock source), the System clockis automatically switched to HSI and an interrupt + clock source), the System clocks automatically switched to HSI and an interrupt is generated if enabled. The interrupt is linked to the Cortex-M4 NMI (Non-Maskable Interrupt) exception vector. @@ -202,7 +229,6 @@ const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, * @note This function doesn't modify the configuration of the * - Peripheral clocks * - LSI, LSE and RTC clocks - * @param None * @retval None */ void HAL_RCC_DeInit(void) @@ -239,9 +265,9 @@ void HAL_RCC_DeInit(void) * @note The PLL is not disabled when used as system clock. * @retval HAL status */ -HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +__weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) { - uint32_t tickstart = 0; + uint32_t tickstart = 0; /* Check the parameters */ assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType)); @@ -251,9 +277,10 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) /* Check the parameters */ assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState)); /* When the HSE is used as system clock or clock source for PLL in these cases HSE will not disabled */ - if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) || ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE))) + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) ||\ + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE))) { - if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState != RCC_HSE_ON)) + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) { return HAL_ERROR; } @@ -279,7 +306,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); /* Check the HSE State */ - if((RCC_OscInitStruct->HSEState) == RCC_HSE_ON) + if((RCC_OscInitStruct->HSEState) != RCC_HSE_OFF) { /* Get Start Tick*/ tickstart = HAL_GetTick(); @@ -316,8 +343,9 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState)); assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue)); - /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ - if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) || ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI))) + /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) ||\ + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI))) { /* When HSI is used as system clock it will not disabled */ if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) @@ -422,7 +450,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState)); /* Enable Power Clock*/ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Enable write access to Backup domain */ PWR->CR |= PWR_CR_DBP; @@ -432,7 +460,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) while((PWR->CR & PWR_CR_DBP) == RESET) { - if((HAL_GetTick() - tickstart ) > DBP_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_DBP_TIMEOUT_VALUE) { return HAL_TIMEOUT; } @@ -447,7 +475,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) /* Wait till LSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) { - if((HAL_GetTick() - tickstart ) > LSE_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; } @@ -456,7 +484,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) /* Set the new LSE configuration -----------------------------------------*/ __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState); /* Check the LSE State */ - if((RCC_OscInitStruct->LSEState) == RCC_LSE_ON) + if((RCC_OscInitStruct->LSEState) != RCC_LSE_OFF) { /* Get Start Tick*/ tickstart = HAL_GetTick(); @@ -464,7 +492,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) /* Wait till LSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { - if((HAL_GetTick() - tickstart ) > LSE_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; } @@ -478,7 +506,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) /* Wait till LSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) { - if((HAL_GetTick() - tickstart ) > LSE_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; } @@ -501,7 +529,7 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) assert_param(IS_RCC_PLLN_VALUE(RCC_OscInitStruct->PLL.PLLN)); assert_param(IS_RCC_PLLP_VALUE(RCC_OscInitStruct->PLL.PLLP)); assert_param(IS_RCC_PLLQ_VALUE(RCC_OscInitStruct->PLL.PLLQ)); - + /* Disable the main PLL. */ __HAL_RCC_PLL_DISABLE(); @@ -518,11 +546,11 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) } /* Configure the main PLL clock source, multiplication and division factors. */ - __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource, - RCC_OscInitStruct->PLL.PLLM, - RCC_OscInitStruct->PLL.PLLN, - RCC_OscInitStruct->PLL.PLLP, - RCC_OscInitStruct->PLL.PLLQ); + WRITE_REG(RCC->PLLCFGR, (RCC_OscInitStruct->PLL.PLLSource | \ + RCC_OscInitStruct->PLL.PLLM | \ + (RCC_OscInitStruct->PLL.PLLN << POSITION_VAL(RCC_PLLCFGR_PLLN)) | \ + (((RCC_OscInitStruct->PLL.PLLP >> 1) -1) << POSITION_VAL(RCC_PLLCFGR_PLLP)) | \ + (RCC_OscInitStruct->PLL.PLLQ << POSITION_VAL(RCC_PLLCFGR_PLLQ)))); /* Enable the main PLL. */ __HAL_RCC_PLL_ENABLE(); @@ -636,7 +664,8 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui } } /* PLL is selected as System Clock Source */ - else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) + else if((RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) || + (RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLRCLK)) { /* Check the PLL ready flag */ if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) @@ -653,14 +682,14 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui return HAL_ERROR; } } - MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, RCC_ClkInitStruct->SYSCLKSource); - + + __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource); /* Get Start Tick*/ tickstart = HAL_GetTick(); if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) { - while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_HSE) + while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSE) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) { @@ -670,7 +699,17 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui } else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) { - while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL) + while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK) + { + if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLRCLK) + { + while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLRCLK) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) { @@ -680,7 +719,7 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui } else { - while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_HSI) + while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSI) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) { @@ -715,7 +754,8 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui } } /* PLL is selected as System Clock Source */ - else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) + else if((RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) || + (RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLRCLK)) { /* Check the PLL ready flag */ if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) @@ -732,14 +772,13 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui return HAL_ERROR; } } - MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, RCC_ClkInitStruct->SYSCLKSource); - + __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource); /* Get Start Tick*/ tickstart = HAL_GetTick(); if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) { - while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_HSE) + while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSE) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) { @@ -749,7 +788,17 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui } else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) { - while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL) + while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK) + { + if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLRCLK) + { + while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLRCLK) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) { @@ -759,7 +808,7 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui } else { - while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_HSI) + while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSI) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) { @@ -804,7 +853,7 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui * @} */ -/** @defgroup RCC_Group2 Peripheral Control functions +/** @defgroup RCC_Exported_Functions_Group2 Peripheral Control functions * @brief RCC clocks control functions * @verbatim @@ -859,7 +908,7 @@ void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_M /* MCO1 Clock Enable */ __MCO1_CLK_ENABLE(); - /* Configue the MCO1 pin in alternate function mode */ + /* Configure the MCO1 pin in alternate function mode */ GPIO_InitStruct.Pin = MCO1_PIN; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; @@ -877,7 +926,7 @@ void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_M /* MCO2 Clock Enable */ __MCO2_CLK_ENABLE(); - /* Configue the MCO2 pin in alternate function mode */ + /* Configure the MCO2 pin in alternate function mode */ GPIO_InitStruct.Pin = MCO2_PIN; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; @@ -897,22 +946,20 @@ void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_M * software about the failure (Clock Security System Interrupt, CSSI), * allowing the MCU to perform rescue operations. The CSSI is linked to * the Cortex-M4 NMI (Non-Maskable Interrupt) exception vector. - * @param None * @retval None */ void HAL_RCC_EnableCSS(void) { - *(__IO uint32_t *) CR_CSSON_BB = (uint32_t)ENABLE; + *(__IO uint32_t *) RCC_CR_CSSON_BB = (uint32_t)ENABLE; } /** * @brief Disables the Clock Security System. - * @param None * @retval None */ void HAL_RCC_DisableCSS(void) { - *(__IO uint32_t *) CR_CSSON_BB = (uint32_t)DISABLE; + *(__IO uint32_t *) RCC_CR_CSSON_BB = (uint32_t)DISABLE; } /** @@ -943,10 +990,9 @@ void HAL_RCC_DisableCSS(void) * right SYSCLK value. Otherwise, any configuration based on this function will be incorrect. * * - * @param None * @retval SYSCLK frequency */ -uint32_t HAL_RCC_GetSysClockFreq(void) +__weak uint32_t HAL_RCC_GetSysClockFreq(void) { uint32_t pllm = 0, pllvco = 0, pllp = 0; uint32_t sysclockfreq = 0; @@ -969,7 +1015,7 @@ uint32_t HAL_RCC_GetSysClockFreq(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN SYSCLK = PLL_VCO / PLLP */ pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - if (__RCC_PLLSRC() != 0) + if(__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI) { /* HSE used as PLL clock source */ pllvco = ((HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN))); @@ -1000,7 +1046,6 @@ uint32_t HAL_RCC_GetSysClockFreq(void) * * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency * and updated within this function - * @param None * @retval HCLK frequency */ uint32_t HAL_RCC_GetHCLKFreq(void) @@ -1013,7 +1058,6 @@ uint32_t HAL_RCC_GetHCLKFreq(void) * @brief Returns the PCLK1 frequency * @note Each time PCLK1 changes, this function must be called to update the * right PCLK1 value. Otherwise, any configuration based on this function will be incorrect. - * @param None * @retval PCLK1 frequency */ uint32_t HAL_RCC_GetPCLK1Freq(void) @@ -1026,7 +1070,6 @@ uint32_t HAL_RCC_GetPCLK1Freq(void) * @brief Returns the PCLK2 frequency * @note Each time PCLK2 changes, this function must be called to update the * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect. - * @param None * @retval PCLK2 frequency */ uint32_t HAL_RCC_GetPCLK2Freq(void) @@ -1042,7 +1085,7 @@ uint32_t HAL_RCC_GetPCLK2Freq(void) * will be configured. * @retval None */ -void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +__weak void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) { /* Set all possible values for the Oscillator type parameter ---------------*/ RCC_OscInitStruct->OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_LSI; @@ -1116,7 +1159,7 @@ void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) /** * @brief Configures the RCC_ClkInitStruct according to the internal * RCC configuration registers. - * @param RCC_OscInitStruct: pointer to an RCC_ClkInitTypeDef structure that + * @param RCC_ClkInitStruct: pointer to an RCC_ClkInitTypeDef structure that * will be configured. * @param pFLatency: Pointer on the Flash Latency. * @retval None @@ -1145,7 +1188,6 @@ void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pF /** * @brief This function handles the RCC CSS interrupt request. * @note This API should be called under the NMI_Handler(). - * @param None * @retval None */ void HAL_RCC_NMI_IRQHandler(void) @@ -1154,7 +1196,7 @@ void HAL_RCC_NMI_IRQHandler(void) if(__HAL_RCC_GET_IT(RCC_IT_CSS)) { /* RCC Clock Security System interrupt user callback */ - HAL_RCC_CCSCallback(); + HAL_RCC_CSSCallback(); /* Clear RCC CSS pending bit */ __HAL_RCC_CLEAR_IT(RCC_IT_CSS); @@ -1163,13 +1205,12 @@ void HAL_RCC_NMI_IRQHandler(void) /** * @brief RCC Clock Security System interrupt callback - * @param none - * @retval none + * @retval None */ -__weak void HAL_RCC_CCSCallback(void) +__weak void HAL_RCC_CSSCallback(void) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RCC_CCSCallback could be implemented in the user file + the HAL_RCC_CSSCallback could be implemented in the user file */ } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.h index fa720c9474f..0433616fda8 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_rcc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of RCC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,41 +46,23 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" +/* Include RCC HAL Extended module */ +/* (include on top of file since RCC structures are defined in extended file) */ +#include "stm32f4xx_hal_rcc_ex.h" + /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @addtogroup RCC +/** @addtogroup RCC * @{ */ -/* Exported types ------------------------------------------------------------*/ - -/** - * @brief RCC PLL configuration structure definition +/* Exported types ------------------------------------------------------------*/ +/** @defgroup RCC_Exported_Types RCC Exported Types + * @{ */ -typedef struct -{ - uint32_t PLLState; /*!< The new state of the PLL. - This parameter can be a value of @ref RCC_PLL_Config */ - - uint32_t PLLSource; /*!< RCC_PLLSource: PLL entry clock source. - This parameter must be a value of @ref RCC_PLL_Clock_Source */ - - uint32_t PLLM; /*!< PLLM: Division factor for PLL VCO input clock. - This parameter must be a number between Min_Data = 0 and Max_Data = 63 */ - - uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock. - This parameter must be a number between Min_Data = 192 and Max_Data = 432 */ - - uint32_t PLLP; /*!< PLLP: Division factor for main system clock (SYSCLK). - This parameter must be a value of @ref RCC_PLLP_Clock_Divider */ - - uint32_t PLLQ; /*!< PLLQ: Division factor for OTG FS, SDIO and RNG clocks. - This parameter must be a number between Min_Data = 0 and Max_Data = 63 */ - -}RCC_PLLInitTypeDef; - + /** * @brief RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition */ @@ -130,72 +112,16 @@ typedef struct }RCC_ClkInitTypeDef; -/* Exported constants --------------------------------------------------------*/ -/** @defgroup RCC_Exported_Constants - * @{ +/** + * @} */ -/** @defgroup RCC_BitAddress_AliasRegion - * @brief RCC registers bit address in the alias region +/* Exported constants --------------------------------------------------------*/ +/** @defgroup RCC_Exported_Constants RCC Exported Constants * @{ */ -#define RCC_OFFSET (RCC_BASE - PERIPH_BASE) -/* --- CR Register ---*/ -/* Alias word address of HSION bit */ -#define RCC_CR_OFFSET (RCC_OFFSET + 0x00) -#define HSION_BitNumber 0x00 -#define CR_HSION_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (HSION_BitNumber * 4)) -/* Alias word address of CSSON bit */ -#define CSSON_BitNumber 0x13 -#define CR_CSSON_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (CSSON_BitNumber * 4)) -/* Alias word address of PLLON bit */ -#define PLLON_BitNumber 0x18 -#define CR_PLLON_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (PLLON_BitNumber * 4)) -/* Alias word address of PLLI2SON bit */ -#define PLLI2SON_BitNumber 0x1A -#define CR_PLLI2SON_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (PLLI2SON_BitNumber * 4)) - -/* --- CFGR Register ---*/ -/* Alias word address of I2SSRC bit */ -#define RCC_CFGR_OFFSET (RCC_OFFSET + 0x08) -#define I2SSRC_BitNumber 0x17 -#define CFGR_I2SSRC_BB (PERIPH_BB_BASE + (RCC_CFGR_OFFSET * 32) + (I2SSRC_BitNumber * 4)) - -/* --- BDCR Register ---*/ -/* Alias word address of RTCEN bit */ -#define RCC_BDCR_OFFSET (RCC_OFFSET + 0x70) -#define RTCEN_BitNumber 0x0F -#define BDCR_RTCEN_BB (PERIPH_BB_BASE + (RCC_BDCR_OFFSET * 32) + (RTCEN_BitNumber * 4)) -/* Alias word address of BDRST bit */ -#define BDRST_BitNumber 0x10 -#define BDCR_BDRST_BB (PERIPH_BB_BASE + (RCC_BDCR_OFFSET * 32) + (BDRST_BitNumber * 4)) - -/* --- CSR Register ---*/ -/* Alias word address of LSION bit */ -#define RCC_CSR_OFFSET (RCC_OFFSET + 0x74) -#define LSION_BitNumber 0x00 -#define CSR_LSION_BB (PERIPH_BB_BASE + (RCC_CSR_OFFSET * 32) + (LSION_BitNumber * 4)) - -/* CR register byte 3 (Bits[23:16]) base address */ -#define CR_BYTE2_ADDRESS ((uint32_t)0x40023802) - -/* CIR register byte 2 (Bits[15:8]) base address */ -#define CIR_BYTE1_ADDRESS ((uint32_t)(RCC_BASE + 0x0C + 0x01)) - -/* CIR register byte 3 (Bits[23:16]) base address */ -#define CIR_BYTE2_ADDRESS ((uint32_t)(RCC_BASE + 0x0C + 0x02)) - -/* BDCR register base address */ -#define BDCR_BYTE0_ADDRESS (PERIPH_BASE + RCC_BDCR_OFFSET) - - -#define DBP_TIMEOUT_VALUE ((uint32_t)100) -#define LSE_TIMEOUT_VALUE ((uint32_t)5000) -/** - * @} - */ -/** @defgroup RCC_Oscillator_Type +/** @defgroup RCC_Oscillator_Type Oscillator Type * @{ */ #define RCC_OSCILLATORTYPE_NONE ((uint32_t)0x00000000) @@ -203,73 +129,59 @@ typedef struct #define RCC_OSCILLATORTYPE_HSI ((uint32_t)0x00000002) #define RCC_OSCILLATORTYPE_LSE ((uint32_t)0x00000004) #define RCC_OSCILLATORTYPE_LSI ((uint32_t)0x00000008) - -#define IS_RCC_OSCILLATORTYPE(OSCILLATOR) ((OSCILLATOR) <= 15) /** * @} */ -/** @defgroup RCC_HSE_Config +/** @defgroup RCC_HSE_Config HSE Config * @{ */ #define RCC_HSE_OFF ((uint8_t)0x00) #define RCC_HSE_ON ((uint8_t)0x01) #define RCC_HSE_BYPASS ((uint8_t)0x05) - -#define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \ - ((HSE) == RCC_HSE_BYPASS)) /** * @} */ -/** @defgroup RCC_LSE_Config +/** @defgroup RCC_LSE_Config LSE Config * @{ */ #define RCC_LSE_OFF ((uint8_t)0x00) #define RCC_LSE_ON ((uint8_t)0x01) #define RCC_LSE_BYPASS ((uint8_t)0x05) - -#define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \ - ((LSE) == RCC_LSE_BYPASS)) /** * @} */ -/** @defgroup RCC_HSI_Config +/** @defgroup RCC_HSI_Config HSI Config * @{ */ #define RCC_HSI_OFF ((uint8_t)0x00) #define RCC_HSI_ON ((uint8_t)0x01) - -#define IS_RCC_HSI(HSI) (((HSI) == RCC_HSI_OFF) || ((HSI) == RCC_HSI_ON)) /** * @} */ -/** @defgroup RCC_LSI_Config +/** @defgroup RCC_LSI_Config LSI Config * @{ */ #define RCC_LSI_OFF ((uint8_t)0x00) #define RCC_LSI_ON ((uint8_t)0x01) - -#define IS_RCC_LSI(LSI) (((LSI) == RCC_LSI_OFF) || ((LSI) == RCC_LSI_ON)) /** * @} */ -/** @defgroup RCC_PLL_Config +/** @defgroup RCC_PLL_Config PLL Config * @{ */ #define RCC_PLL_NONE ((uint8_t)0x00) #define RCC_PLL_OFF ((uint8_t)0x01) #define RCC_PLL_ON ((uint8_t)0x02) - -#define IS_RCC_PLL(PLL) (((PLL) == RCC_PLL_NONE) ||((PLL) == RCC_PLL_OFF) || ((PLL) == RCC_PLL_ON)) /** * @} */ -/** @defgroup RCC_PLLP_Clock_Divider +/** @defgroup RCC_PLLP_Clock_Divider PLLP Clock Divider * @{ */ #define RCC_PLLP_DIV2 ((uint32_t)0x00000002) @@ -280,54 +192,49 @@ typedef struct * @} */ -/** @defgroup RCC_PLL_Clock_Source +/** @defgroup RCC_PLL_Clock_Source PLL Clock Source * @{ */ #define RCC_PLLSOURCE_HSI RCC_PLLCFGR_PLLSRC_HSI #define RCC_PLLSOURCE_HSE RCC_PLLCFGR_PLLSRC_HSE - -#define IS_RCC_PLLSOURCE(SOURCE) (((SOURCE) == RCC_PLLSOURCE_HSI) || \ - ((SOURCE) == RCC_PLLSOURCE_HSE)) -#define IS_RCC_PLLM_VALUE(VALUE) ((VALUE) <= 63) -#define IS_RCC_PLLN_VALUE(VALUE) ((192 <= (VALUE)) && ((VALUE) <= 432)) -#define IS_RCC_PLLP_VALUE(VALUE) (((VALUE) == 2) || ((VALUE) == 4) || ((VALUE) == 6) || ((VALUE) == 8)) -#define IS_RCC_PLLQ_VALUE(VALUE) ((4 <= (VALUE)) && ((VALUE) <= 15)) - -#define IS_RCC_PLLI2SN_VALUE(VALUE) ((192 <= (VALUE)) && ((VALUE) <= 432)) -#define IS_RCC_PLLI2SR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7)) - /** * @} */ -/** @defgroup RCC_System_Clock_Type +/** @defgroup RCC_System_Clock_Type System Clock Type * @{ */ #define RCC_CLOCKTYPE_SYSCLK ((uint32_t)0x00000001) #define RCC_CLOCKTYPE_HCLK ((uint32_t)0x00000002) #define RCC_CLOCKTYPE_PCLK1 ((uint32_t)0x00000004) #define RCC_CLOCKTYPE_PCLK2 ((uint32_t)0x00000008) - -#define IS_RCC_CLOCKTYPE(CLK) ((1 <= (CLK)) && ((CLK) <= 15)) /** * @} */ -/** @defgroup RCC_System_Clock_Source +/** @defgroup RCC_System_Clock_Source System Clock Source * @{ */ #define RCC_SYSCLKSOURCE_HSI RCC_CFGR_SW_HSI #define RCC_SYSCLKSOURCE_HSE RCC_CFGR_SW_HSE #define RCC_SYSCLKSOURCE_PLLCLK RCC_CFGR_SW_PLL +#define RCC_SYSCLKSOURCE_PLLRCLK ((uint32_t)(RCC_CFGR_SW_0 | RCC_CFGR_SW_1)) +/** + * @} + */ -#define IS_RCC_SYSCLKSOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSOURCE_HSI) || \ - ((SOURCE) == RCC_SYSCLKSOURCE_HSE) || \ - ((SOURCE) == RCC_SYSCLKSOURCE_PLLCLK)) +/** @defgroup RCC_System_Clock_Source_Status System Clock Source Status + * @{ + */ +#define RCC_SYSCLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */ +#define RCC_SYSCLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */ +#define RCC_SYSCLKSOURCE_STATUS_PLLCLK RCC_CFGR_SWS_PLL /*!< PLL used as system clock */ +#define RCC_SYSCLKSOURCE_STATUS_PLLRCLK ((uint32_t)(RCC_CFGR_SW_0 | RCC_CFGR_SW_1)) /*!< PLLR used as system clock */ /** * @} - */ + */ -/** @defgroup RCC_AHB_Clock_Source +/** @defgroup RCC_AHB_Clock_Source AHB Clock Source * @{ */ #define RCC_SYSCLK_DIV1 RCC_CFGR_HPRE_DIV1 @@ -339,17 +246,11 @@ typedef struct #define RCC_SYSCLK_DIV128 RCC_CFGR_HPRE_DIV128 #define RCC_SYSCLK_DIV256 RCC_CFGR_HPRE_DIV256 #define RCC_SYSCLK_DIV512 RCC_CFGR_HPRE_DIV512 - -#define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_SYSCLK_DIV1) || ((HCLK) == RCC_SYSCLK_DIV2) || \ - ((HCLK) == RCC_SYSCLK_DIV4) || ((HCLK) == RCC_SYSCLK_DIV8) || \ - ((HCLK) == RCC_SYSCLK_DIV16) || ((HCLK) == RCC_SYSCLK_DIV64) || \ - ((HCLK) == RCC_SYSCLK_DIV128) || ((HCLK) == RCC_SYSCLK_DIV256) || \ - ((HCLK) == RCC_SYSCLK_DIV512)) /** * @} */ -/** @defgroup RCC_APB1_APB2_Clock_Source +/** @defgroup RCC_APB1_APB2_Clock_Source APB1/APB2 Clock Source * @{ */ #define RCC_HCLK_DIV1 RCC_CFGR_PPRE1_DIV1 @@ -357,15 +258,11 @@ typedef struct #define RCC_HCLK_DIV4 RCC_CFGR_PPRE1_DIV4 #define RCC_HCLK_DIV8 RCC_CFGR_PPRE1_DIV8 #define RCC_HCLK_DIV16 RCC_CFGR_PPRE1_DIV16 - -#define IS_RCC_PCLK(PCLK) (((PCLK) == RCC_HCLK_DIV1) || ((PCLK) == RCC_HCLK_DIV2) || \ - ((PCLK) == RCC_HCLK_DIV4) || ((PCLK) == RCC_HCLK_DIV8) || \ - ((PCLK) == RCC_HCLK_DIV16)) /** * @} */ -/** @defgroup RCC_RTC_Clock_Source +/** @defgroup RCC_RTC_Clock_Source RTC Clock Source * @{ */ #define RCC_RTCCLKSOURCE_LSE ((uint32_t)0x00000100) @@ -404,7 +301,7 @@ typedef struct * @} */ -/** @defgroup RCC_I2S_Clock_Source +/** @defgroup RCC_I2S_Clock_Source I2S Clock Source * @{ */ #define RCC_I2SCLKSOURCE_PLLI2S ((uint32_t)0x00000000) @@ -413,46 +310,38 @@ typedef struct * @} */ -/** @defgroup RCC_MCO_Index +/** @defgroup RCC_MCO_Index MCO Index * @{ */ #define RCC_MCO1 ((uint32_t)0x00000000) #define RCC_MCO2 ((uint32_t)0x00000001) - -#define IS_RCC_MCO(MCOx) (((MCOx) == RCC_MCO1) || ((MCOx) == RCC_MCO2)) /** * @} */ -/** @defgroup RCC_MCO1_Clock_Source +/** @defgroup RCC_MCO1_Clock_Source MCO1 Clock Source * @{ */ #define RCC_MCO1SOURCE_HSI ((uint32_t)0x00000000) #define RCC_MCO1SOURCE_LSE RCC_CFGR_MCO1_0 #define RCC_MCO1SOURCE_HSE RCC_CFGR_MCO1_1 #define RCC_MCO1SOURCE_PLLCLK RCC_CFGR_MCO1 - -#define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1SOURCE_HSI) || ((SOURCE) == RCC_MCO1SOURCE_LSE) || \ - ((SOURCE) == RCC_MCO1SOURCE_HSE) || ((SOURCE) == RCC_MCO1SOURCE_PLLCLK)) /** * @} */ -/** @defgroup RCC_MCO2_Clock_Source +/** @defgroup RCC_MCO2_Clock_Source MCO2 Clock Source * @{ */ #define RCC_MCO2SOURCE_SYSCLK ((uint32_t)0x00000000) #define RCC_MCO2SOURCE_PLLI2SCLK RCC_CFGR_MCO2_0 #define RCC_MCO2SOURCE_HSE RCC_CFGR_MCO2_1 #define RCC_MCO2SOURCE_PLLCLK RCC_CFGR_MCO2 - -#define IS_RCC_MCO2SOURCE(SOURCE) (((SOURCE) == RCC_MCO2SOURCE_SYSCLK) || ((SOURCE) == RCC_MCO2SOURCE_PLLI2SCLK)|| \ - ((SOURCE) == RCC_MCO2SOURCE_HSE) || ((SOURCE) == RCC_MCO2SOURCE_PLLCLK)) /** * @} */ -/** @defgroup RCC_MCOx_Clock_Prescaler +/** @defgroup RCC_MCOx_Clock_Prescaler MCOx Clock Prescaler * @{ */ #define RCC_MCODIV_1 ((uint32_t)0x00000000) @@ -460,15 +349,11 @@ typedef struct #define RCC_MCODIV_3 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_2) #define RCC_MCODIV_4 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2) #define RCC_MCODIV_5 RCC_CFGR_MCO1PRE - -#define IS_RCC_MCODIV(DIV) (((DIV) == RCC_MCODIV_1) || ((DIV) == RCC_MCODIV_2) || \ - ((DIV) == RCC_MCODIV_3) || ((DIV) == RCC_MCODIV_4) || \ - ((DIV) == RCC_MCODIV_5)) /** * @} */ -/** @defgroup RCC_Interrupt +/** @defgroup RCC_Interrupt Interrupts * @{ */ #define RCC_IT_LSIRDY ((uint8_t)0x01) @@ -482,7 +367,7 @@ typedef struct * @} */ -/** @defgroup RCC_Flag +/** @defgroup RCC_Flag Flags * Elements values convention: 0XXYYYYYb * - YYYYY : Flag position in the register * - 0XX : Register index @@ -509,346 +394,610 @@ typedef struct #define RCC_FLAG_IWDGRST ((uint8_t)0x7D) #define RCC_FLAG_WWDGRST ((uint8_t)0x7E) #define RCC_FLAG_LPWRRST ((uint8_t)0x7F) - -#define IS_RCC_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F) /** * @} */ /** * @} - */ + */ + /* Exported macro ------------------------------------------------------------*/ +/** @defgroup RCC_Exported_Macros RCC Exported Macros + * @{ + */ -/** @brief Enable or disable the AHB1 peripheral clock. +/** @defgroup RCC_AHB1_Clock_Enable_Disable AHB1 Peripheral Clock Enable Disable + * @brief Enable or disable the AHB1 peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. + * @{ */ -#define __GPIOA_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOAEN)) -#define __GPIOB_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOBEN)) -#define __GPIOC_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOCEN)) -#define __GPIOD_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIODEN)) -#define __GPIOE_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOEEN)) -#define __GPIOF_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOFEN)) -#define __GPIOG_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOGEN)) -#define __GPIOH_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOHEN)) -#define __CRC_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_CRCEN)) -#define __BKPSRAM_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_BKPSRAMEN)) -#define __CCMDATARAMEN_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_CCMDATARAMEN)) -#define __DMA1_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_DMA1EN)) -#define __DMA2_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_DMA2EN)) - -#define __GPIOA_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOAEN)) -#define __GPIOB_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOBEN)) -#define __GPIOC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOCEN)) -#define __GPIOD_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIODEN)) -#define __GPIOE_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOEEN)) -#define __GPIOF_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN)) -#define __GPIOG_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN)) -#define __GPIOH_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOHEN)) -#define __CRC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_CRCEN)) -#define __BKPSRAM_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_BKPSRAMEN)) -#define __CCMDATARAMEN_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_CCMDATARAMEN)) -#define __DMA1_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA1EN)) -#define __DMA2_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA2EN)) - -/** @brief Enable or disable the AHB2 peripheral clock. +#define __HAL_RCC_GPIOA_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOAEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOAEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOB_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOBEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOBEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOD_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOE_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOH_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOHEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOHEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CRC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_BKPSRAM_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_BKPSRAMEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_BKPSRAMEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CCMDATARAMEN_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CCMDATARAMEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CCMDATARAMEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DMA1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DMA2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_GPIOA_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOAEN)) +#define __HAL_RCC_GPIOB_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOBEN)) +#define __HAL_RCC_GPIOC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOCEN)) +#define __HAL_RCC_GPIOD_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIODEN)) +#define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOEEN)) +#define __HAL_RCC_GPIOH_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOHEN)) +#define __HAL_RCC_CRC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_CRCEN)) +#define __HAL_RCC_BKPSRAM_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_BKPSRAMEN)) +#define __HAL_RCC_CCMDATARAMEN_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_CCMDATARAMEN)) +#define __HAL_RCC_DMA1_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA1EN)) +#define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA2EN)) + +/** + * @} + */ + +/** @defgroup RCC_AHB2_Clock_Enable_Disable AHB2 Peripheral Clock Enable Disable + * @brief Enable or disable the AHB2 peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. + * @{ */ -#define __USB_OTG_FS_CLK_ENABLE() do {(RCC->AHB2ENR |= (RCC_AHB2ENR_OTGFSEN));\ - __SYSCFG_CLK_ENABLE();\ - }while(0) +#define __HAL_RCC_USB_OTG_FS_CLK_ENABLE() do {(RCC->AHB2ENR |= (RCC_AHB2ENR_OTGFSEN));\ + __HAL_RCC_SYSCFG_CLK_ENABLE();\ + }while(0) +#define __HAL_RCC_USB_OTG_FS_CLK_DISABLE() do { (RCC->AHB2ENR &= ~(RCC_AHB2ENR_OTGFSEN));\ + __HAL_RCC_SYSCFG_CLK_DISABLE();\ + }while(0) -#define __USB_OTG_FS_CLK_DISABLE() do { (RCC->AHB2ENR &= ~(RCC_AHB2ENR_OTGFSEN));\ - __SYSCFG_CLK_DISABLE();\ - }while(0) +#define __HAL_RCC_RNG_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_RNGEN)) +#define __HAL_RCC_RNG_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_RNGEN)) -#define __RNG_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_RNGEN)) -#define __RNG_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_RNGEN)) -/** @brief Enable or disable the Low Speed APB (APB1) peripheral clock. +/** + * @} + */ + +/** @defgroup RCC_APB1_Clock_Enable_Disable APB1 Peripheral Clock Enable Disable + * @brief Enable or disable the Low Speed APB (APB1) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. + * @{ + */ +#define __HAL_RCC_TIM2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_WWDG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_WWDGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_WWDGEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USART2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_I2C1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_I2C2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_I2C3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_PWR_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM2EN)) +#define __HAL_RCC_TIM3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN)) +#define __HAL_RCC_TIM4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM4EN)) +#define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN)) +#define __HAL_RCC_WWDG_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_WWDGEN)) +#define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN)) +#define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN)) +#define __HAL_RCC_USART2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART2EN)) +#define __HAL_RCC_I2C1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN)) +#define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN)) +#define __HAL_RCC_I2C3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C3EN)) +#define __HAL_RCC_PWR_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_PWREN)) +/** + * @} */ -#define __TIM2_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM2EN)) -#define __TIM3_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM3EN)) -#define __TIM4_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM4EN)) -#define __TIM5_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM5EN)) -#define __WWDG_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_WWDGEN)) -#define __SPI2_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_SPI2EN)) -#define __SPI3_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_SPI3EN)) -#define __USART2_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_USART2EN)) -#define __I2C1_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_I2C1EN)) -#define __I2C2_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_I2C2EN)) -#define __I2C3_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_I2C3EN)) -#define __PWR_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_PWREN)) - -#define __TIM2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM2EN)) -#define __TIM3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN)) -#define __TIM4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM4EN)) -#define __TIM5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN)) -#define __WWDG_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_WWDGEN)) -#define __SPI2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN)) -#define __SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN)) -#define __USART2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART2EN)) -#define __I2C1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN)) -#define __I2C2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN)) -#define __I2C3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C3EN)) -#define __PWR_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_PWREN)) - -/** @brief Enable or disable the High Speed APB (APB2) peripheral clock. + +/** @defgroup RCC_APB2_Clock_Enable_Disable APB2 Peripheral Clock Enable Disable + * @brief Enable or disable the High Speed APB (APB2) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. + * @{ */ -#define __TIM1_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_TIM1EN)) -#define __USART1_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_USART1EN)) -#define __USART6_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_USART6EN)) -#define __ADC1_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_ADC1EN)) -#define __SDIO_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SDIOEN)) -#define __SPI1_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SPI1EN)) -#define __SPI4_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SPI4EN)) -#define __SYSCFG_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SYSCFGEN)) -#define __TIM9_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_TIM9EN)) -#define __TIM10_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_TIM10EN)) -#define __TIM11_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_TIM11EN)) - -#define __TIM1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM1EN)) -#define __USART1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART1EN)) -#define __USART6_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART6EN)) -#define __ADC1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC1EN)) -#define __SDIO_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDIOEN)) -#define __SPI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI1EN)) -#define __SPI4_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI4EN)) -#define __SYSCFG_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SYSCFGEN)) -#define __TIM9_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM9EN)) -#define __TIM10_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM10EN)) -#define __TIM11_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM11EN)) - -/** @brief Force or release AHB1 peripheral reset. - */ -#define __AHB1_FORCE_RESET() (RCC->AHB1RSTR = 0xFFFFFFFF) -#define __GPIOA_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOARST)) -#define __GPIOB_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOBRST)) -#define __GPIOC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOCRST)) -#define __GPIOD_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIODRST)) -#define __GPIOE_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOERST)) -#define __GPIOH_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOHRST)) -#define __CRC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_CRCRST)) -#define __DMA1_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA1RST)) -#define __DMA2_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2RST)) - -#define __AHB1_RELEASE_RESET() (RCC->AHB1RSTR = 0x00) -#define __GPIOA_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOARST)) -#define __GPIOB_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOBRST)) -#define __GPIOC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOCRST)) -#define __GPIOD_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIODRST)) -#define __GPIOE_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOERST)) -#define __GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) -#define __GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) -#define __GPIOH_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOHRST)) -#define __GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST)) -#define __CRC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_CRCRST)) -#define __DMA1_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA1RST)) -#define __DMA2_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA2RST)) - -/** @brief Force or release AHB2 peripheral reset. - */ -#define __AHB2_FORCE_RESET() (RCC->AHB2RSTR = 0xFFFFFFFF) -#define __USB_OTG_FS_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_OTGFSRST)) - -#define __AHB2_RELEASE_RESET() (RCC->AHB2RSTR = 0x00) -#define __USB_OTG_FS_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_OTGFSRST)) - -/* alias define maintained for legacy */ -#define __OTGFS_FORCE_RESET __USB_OTG_FS_FORCE_RESET -#define __OTGFS_RELEASE_RESET __USB_OTG_FS_RELEASE_RESET - -#define __RNG_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_RNGRST)) -#define __RNG_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_RNGRST)) - -/** @brief Force or release APB1 peripheral reset. - */ -#define __APB1_FORCE_RESET() (RCC->APB1RSTR = 0xFFFFFFFF) -#define __TIM2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM2RST)) -#define __TIM3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM3RST)) -#define __TIM4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM4RST)) -#define __TIM5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST)) -#define __WWDG_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_WWDGRST)) -#define __SPI2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST)) -#define __SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST)) -#define __USART2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART2RST)) -#define __I2C1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C1RST)) -#define __I2C2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST)) -#define __I2C3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C3RST)) -#define __PWR_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_PWRRST)) - -#define __APB1_RELEASE_RESET() (RCC->APB1RSTR = 0x00) -#define __TIM2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM2RST)) -#define __TIM3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM3RST)) -#define __TIM4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM4RST)) -#define __TIM5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST)) -#define __WWDG_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_WWDGRST)) -#define __SPI2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST)) -#define __SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST)) -#define __USART2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART2RST)) -#define __I2C1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C1RST)) -#define __I2C2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST)) -#define __I2C3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C3RST)) -#define __PWR_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_PWRRST)) - -/** @brief Force or release APB2 peripheral reset. - */ -#define __APB2_FORCE_RESET() (RCC->APB2RSTR = 0xFFFFFFFF) -#define __TIM1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM1RST)) -#define __USART1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_USART1RST)) -#define __USART6_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_USART6RST)) -#define __ADC_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_ADCRST)) -#define __SDIO_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SDIORST)) -#define __SPI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI1RST)) -#define __SPI4_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI4RST)) -#define __SYSCFG_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SYSCFGRST)) -#define __TIM9_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM9RST)) -#define __TIM10_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM10RST)) -#define __TIM11_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM11RST)) - -#define __APB2_RELEASE_RESET() (RCC->APB2RSTR = 0x00) -#define __TIM1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM1RST)) -#define __USART1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART1RST)) -#define __USART6_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART6RST)) -#define __ADC_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_ADCRST)) -#define __SDIO_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDIORST)) -#define __SPI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI1RST)) -#define __SPI4_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI4RST)) -#define __SYSCFG_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SYSCFGRST)) -#define __TIM9_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM9RST)) -#define __TIM10_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM10RST)) -#define __TIM11_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM11RST)) - -/** @brief Force or release AHB3 peripheral reset. +#define __HAL_RCC_TIM1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USART1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USART6_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SDIO_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDIOEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDIOEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SYSCFG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM9_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM9EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM9EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM10_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM10EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM10EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM11_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM11EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM11EN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM1EN)) +#define __HAL_RCC_USART1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART1EN)) +#define __HAL_RCC_USART6_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART6EN)) +#define __HAL_RCC_ADC1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC1EN)) +#define __HAL_RCC_SDIO_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDIOEN)) +#define __HAL_RCC_SPI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI1EN)) +#define __HAL_RCC_SPI4_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI4EN)) +#define __HAL_RCC_SYSCFG_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SYSCFGEN)) +#define __HAL_RCC_TIM9_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM9EN)) +#define __HAL_RCC_TIM10_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM10EN)) +#define __HAL_RCC_TIM11_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM11EN)) +/** + * @} + */ + +/** @defgroup RCC_AHB1_Force_Release_Reset AHB1 Force Release Reset + * @brief Force or release AHB1 peripheral reset. + * @{ */ -#define __AHB3_FORCE_RESET() (RCC->AHB3RSTR = 0xFFFFFFFF) -#define __AHB3_RELEASE_RESET() (RCC->AHB3RSTR = 0x00) +#define __HAL_RCC_AHB1_FORCE_RESET() (RCC->AHB1RSTR = 0xFFFFFFFF) +#define __HAL_RCC_GPIOA_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOARST)) +#define __HAL_RCC_GPIOB_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOBRST)) +#define __HAL_RCC_GPIOC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOCRST)) +#define __HAL_RCC_GPIOD_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIODRST)) +#define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOERST)) +#define __HAL_RCC_GPIOH_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOHRST)) +#define __HAL_RCC_CRC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_CRCRST)) +#define __HAL_RCC_DMA1_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA1RST)) +#define __HAL_RCC_DMA2_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2RST)) + +#define __HAL_RCC_AHB1_RELEASE_RESET() (RCC->AHB1RSTR = 0x00) +#define __HAL_RCC_GPIOA_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOARST)) +#define __HAL_RCC_GPIOB_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOBRST)) +#define __HAL_RCC_GPIOC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOCRST)) +#define __HAL_RCC_GPIOD_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIODRST)) +#define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOERST)) +#define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_GPIOH_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOHRST)) +#define __HAL_RCC_GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST)) +#define __HAL_RCC_CRC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_CRCRST)) +#define __HAL_RCC_DMA1_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA1RST)) +#define __HAL_RCC_DMA2_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA2RST)) +/** + * @} + */ + +/** @defgroup RCC_AHB2_Force_Release_Reset AHB2 Force Release Reset + * @brief Force or release AHB2 peripheral reset. + * @{ + */ +#define __HAL_RCC_AHB2_FORCE_RESET() (RCC->AHB2RSTR = 0xFFFFFFFF) +#define __HAL_RCC_USB_OTG_FS_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_OTGFSRST)) + +#define __HAL_RCC_AHB2_RELEASE_RESET() (RCC->AHB2RSTR = 0x00) +#define __HAL_RCC_USB_OTG_FS_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_OTGFSRST)) -/** @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode. +#define __HAL_RCC_RNG_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_RNGRST)) +#define __HAL_RCC_RNG_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_RNGRST)) +/** + * @} + */ + +/** @defgroup RCC_APB1_Force_Release_Reset APB1 Force Release Reset + * @brief Force or release APB1 peripheral reset. + * @{ + */ +#define __HAL_RCC_APB1_FORCE_RESET() (RCC->APB1RSTR = 0xFFFFFFFF) +#define __HAL_RCC_TIM2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM2RST)) +#define __HAL_RCC_TIM3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_TIM4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM4RST)) +#define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST)) +#define __HAL_RCC_WWDG_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_WWDGRST)) +#define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_USART2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART2RST)) +#define __HAL_RCC_I2C1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C1RST)) +#define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST)) +#define __HAL_RCC_I2C3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C3RST)) +#define __HAL_RCC_PWR_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_PWRRST)) + +#define __HAL_RCC_APB1_RELEASE_RESET() (RCC->APB1RSTR = 0x00) +#define __HAL_RCC_TIM2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM2RST)) +#define __HAL_RCC_TIM3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_TIM4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM4RST)) +#define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST)) +#define __HAL_RCC_WWDG_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_WWDGRST)) +#define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_USART2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART2RST)) +#define __HAL_RCC_I2C1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C1RST)) +#define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST)) +#define __HAL_RCC_I2C3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C3RST)) +#define __HAL_RCC_PWR_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_PWRRST)) +/** + * @} + */ + +/** @defgroup RCC_APB2_Force_Release_Reset APB2 Force Release Reset + * @brief Force or release APB2 peripheral reset. + * @{ + */ +#define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0xFFFFFFFF) +#define __HAL_RCC_TIM1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM1RST)) +#define __HAL_RCC_USART1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_USART1RST)) +#define __HAL_RCC_USART6_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_USART6RST)) +#define __HAL_RCC_ADC_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_ADCRST)) +#define __HAL_RCC_SDIO_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SDIORST)) +#define __HAL_RCC_SPI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI1RST)) +#define __HAL_RCC_SPI4_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI4RST)) +#define __HAL_RCC_SYSCFG_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SYSCFGRST)) +#define __HAL_RCC_TIM9_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM9RST)) +#define __HAL_RCC_TIM10_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM10RST)) +#define __HAL_RCC_TIM11_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM11RST)) + +#define __HAL_RCC_APB2_RELEASE_RESET() (RCC->APB2RSTR = 0x00) +#define __HAL_RCC_TIM1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM1RST)) +#define __HAL_RCC_USART1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART1RST)) +#define __HAL_RCC_USART6_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART6RST)) +#define __HAL_RCC_ADC_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_ADCRST)) +#define __HAL_RCC_SDIO_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDIORST)) +#define __HAL_RCC_SPI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI1RST)) +#define __HAL_RCC_SPI4_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI4RST)) +#define __HAL_RCC_SYSCFG_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SYSCFGRST)) +#define __HAL_RCC_TIM9_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM9RST)) +#define __HAL_RCC_TIM10_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM10RST)) +#define __HAL_RCC_TIM11_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM11RST)) +/** + * @} + */ + +/** @defgroup RCC_AHB3_Force_Release_Reset AHB3 Force Release Reset + * @brief Force or release AHB3 peripheral reset. + * @{ + */ +#define __HAL_RCC_AHB3_FORCE_RESET() (RCC->AHB3RSTR = 0xFFFFFFFF) +#define __HAL_RCC_AHB3_RELEASE_RESET() (RCC->AHB3RSTR = 0x00) +/** + * @} + */ + +/** @defgroup RCC_AHB1_LowPower_Enable_Disable AHB1 Peripheral Low Power Enable Disable + * @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. - * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note After wake-up from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. + * @{ */ -#define __GPIOA_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOALPEN)) -#define __GPIOB_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOBLPEN)) -#define __GPIOC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOCLPEN)) -#define __GPIOD_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIODLPEN)) -#define __GPIOE_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOELPEN)) -#define __GPIOH_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOHLPEN)) -#define __CRC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_CRCLPEN)) -#define __FLITF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_FLITFLPEN)) -#define __SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM1LPEN)) -#define __BKPSRAM_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_BKPSRAMLPEN)) -#define __DMA1_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN)) -#define __DMA2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN)) - -#define __GPIOA_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOALPEN)) -#define __GPIOB_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOBLPEN)) -#define __GPIOC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOCLPEN)) -#define __GPIOD_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIODLPEN)) -#define __GPIOE_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOELPEN)) -#define __GPIOH_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOHLPEN)) -#define __CRC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_CRCLPEN)) -#define __FLITF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_FLITFLPEN)) -#define __SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM1LPEN)) -#define __BKPSRAM_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_BKPSRAMLPEN)) -#define __DMA1_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA1LPEN)) -#define __DMA2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA2LPEN)) - -/** @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode. +#define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOALPEN)) +#define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOBLPEN)) +#define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOCLPEN)) +#define __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIODLPEN)) +#define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOELPEN)) +#define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOHLPEN)) +#define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_CRCLPEN)) +#define __HAL_RCC_FLITF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_FLITFLPEN)) +#define __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM1LPEN)) +#define __HAL_RCC_BKPSRAM_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_BKPSRAMLPEN)) +#define __HAL_RCC_DMA1_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN)) +#define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN)) + +#define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOALPEN)) +#define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOBLPEN)) +#define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOCLPEN)) +#define __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIODLPEN)) +#define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOELPEN)) +#define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOHLPEN)) +#define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_CRCLPEN)) +#define __HAL_RCC_FLITF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_FLITFLPEN)) +#define __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM1LPEN)) +#define __HAL_RCC_BKPSRAM_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_BKPSRAMLPEN)) +#define __HAL_RCC_DMA1_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA1LPEN)) +#define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA2LPEN)) +/** + * @} + */ + +/** @defgroup RCC_AHB2_LowPower_Enable_Disable AHB2 Peripheral Low Power Enable Disable + * @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. - * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note After wake-up from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. + * @{ */ -#define __USB_OTG_FS_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_OTGFSLPEN)) +#define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_OTGFSLPEN)) -#define __USB_OTG_FS_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_OTGFSLPEN)) +#define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_OTGFSLPEN)) -/* alias define maintained for legacy */ -#define __OTGFS_CLK_SLEEP_ENABLE __USB_OTG_FS_CLK_SLEEP_ENABLE -#define __OTGFS_CLK_SLEEP_DISABLE __USB_OTG_FS_CLK_SLEEP_DISABLE - -#define __RNG_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN)) -#define __RNG_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_RNGLPEN)) +#define __HAL_RCC_RNG_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN)) +#define __HAL_RCC_RNG_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_RNGLPEN)) +/** + * @} + */ -/** @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode. +/** @defgroup RCC_APB1_LowPower_Enable_Disable APB1 Peripheral Low Power Enable Disable + * @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. - * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note After wake-up from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. + * @{ */ -#define __TIM2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM2LPEN)) -#define __TIM3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM3LPEN)) -#define __TIM4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM4LPEN)) -#define __TIM5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM5LPEN)) -#define __WWDG_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_WWDGLPEN)) -#define __SPI2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI2LPEN)) -#define __SPI3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI3LPEN)) -#define __USART2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART2LPEN)) -#define __I2C1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C1LPEN)) -#define __I2C2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C2LPEN)) -#define __I2C3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C3LPEN)) -#define __PWR_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_PWRLPEN)) - -#define __TIM2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM2LPEN)) -#define __TIM3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM3LPEN)) -#define __TIM4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM4LPEN)) -#define __TIM5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM5LPEN)) -#define __WWDG_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_WWDGLPEN)) -#define __SPI2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI2LPEN)) -#define __SPI3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI3LPEN)) -#define __USART2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART2LPEN)) -#define __I2C1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C1LPEN)) -#define __I2C2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C2LPEN)) -#define __I2C3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C3LPEN)) -#define __PWR_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_PWRLPEN)) - -/** @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. +#define __HAL_RCC_TIM2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM2LPEN)) +#define __HAL_RCC_TIM3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM3LPEN)) +#define __HAL_RCC_TIM4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM4LPEN)) +#define __HAL_RCC_TIM5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM5LPEN)) +#define __HAL_RCC_WWDG_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_WWDGLPEN)) +#define __HAL_RCC_SPI2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI2LPEN)) +#define __HAL_RCC_SPI3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI3LPEN)) +#define __HAL_RCC_USART2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART2LPEN)) +#define __HAL_RCC_I2C1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C1LPEN)) +#define __HAL_RCC_I2C2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C2LPEN)) +#define __HAL_RCC_I2C3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C3LPEN)) +#define __HAL_RCC_PWR_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_PWRLPEN)) + +#define __HAL_RCC_TIM2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM2LPEN)) +#define __HAL_RCC_TIM3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM3LPEN)) +#define __HAL_RCC_TIM4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM4LPEN)) +#define __HAL_RCC_TIM5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM5LPEN)) +#define __HAL_RCC_WWDG_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_WWDGLPEN)) +#define __HAL_RCC_SPI2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI2LPEN)) +#define __HAL_RCC_SPI3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI3LPEN)) +#define __HAL_RCC_USART2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART2LPEN)) +#define __HAL_RCC_I2C1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C1LPEN)) +#define __HAL_RCC_I2C2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C2LPEN)) +#define __HAL_RCC_I2C3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C3LPEN)) +#define __HAL_RCC_PWR_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_PWRLPEN)) +/** + * @} + */ + +/** @defgroup RCC_APB2_LowPower_Enable_Disable APB2 Peripheral Low Power Enable Disable + * @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce * power consumption. - * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note After wake-up from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. + * @{ + */ +#define __HAL_RCC_TIM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM1LPEN)) +#define __HAL_RCC_USART1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_USART1LPEN)) +#define __HAL_RCC_USART6_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_USART6LPEN)) +#define __HAL_RCC_ADC1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC1LPEN)) +#define __HAL_RCC_SDIO_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SDIOLPEN)) +#define __HAL_RCC_SPI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI1LPEN)) +#define __HAL_RCC_SPI4_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI4LPEN)) +#define __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SYSCFGLPEN)) +#define __HAL_RCC_TIM9_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM9LPEN)) +#define __HAL_RCC_TIM10_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM10LPEN)) +#define __HAL_RCC_TIM11_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM11LPEN)) + +#define __HAL_RCC_TIM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM1LPEN)) +#define __HAL_RCC_USART1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_USART1LPEN)) +#define __HAL_RCC_USART6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_USART6LPEN)) +#define __HAL_RCC_ADC1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC1LPEN)) +#define __HAL_RCC_SDIO_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SDIOLPEN)) +#define __HAL_RCC_SPI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI1LPEN)) +#define __HAL_RCC_SPI4_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI4LPEN)) +#define __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SYSCFGLPEN)) +#define __HAL_RCC_TIM9_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM9LPEN)) +#define __HAL_RCC_TIM10_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM10LPEN)) +#define __HAL_RCC_TIM11_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM11LPEN)) +/** + * @} */ -#define __TIM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM1LPEN)) -#define __USART1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_USART1LPEN)) -#define __USART6_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_USART6LPEN)) -#define __ADC1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC1LPEN)) -#define __SDIO_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SDIOLPEN)) -#define __SPI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI1LPEN)) -#define __SPI4_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI4LPEN)) -#define __SYSCFG_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SYSCFGLPEN)) -#define __TIM9_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM9LPEN)) -#define __TIM10_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM10LPEN)) -#define __TIM11_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM11LPEN)) - -#define __TIM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM1LPEN)) -#define __USART1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_USART1LPEN)) -#define __USART6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_USART6LPEN)) -#define __ADC1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC1LPEN)) -#define __SDIO_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SDIOLPEN)) -#define __SPI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI1LPEN)) -#define __SPI4_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI4LPEN)) -#define __SYSCFG_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SYSCFGLPEN)) -#define __TIM9_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM9LPEN)) -#define __TIM10_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM10LPEN)) -#define __TIM11_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM11LPEN)) +/** @defgroup RCC_HSI_Configuration HSI Configuration + * @{ + */ + /** @brief Macros to enable or disable the Internal High Speed oscillator (HSI). * @note The HSI is stopped by hardware when entering STOP and STANDBY modes. * It is used (enabled by hardware) as system clock source after startup - * from Reset, wakeup from STOP and STANDBY mode, or in case of failure + * from Reset, wake-up from STOP and STANDBY mode, or in case of failure * of the HSE used directly or indirectly as system clock (if the Clock * Security System CSS is enabled). * @note HSI can not be stopped if it is used as system clock source. In this case, @@ -860,8 +1009,8 @@ typedef struct * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator * clock cycles. */ -#define __HAL_RCC_HSI_ENABLE() (*(__IO uint32_t *) CR_HSION_BB = ENABLE) -#define __HAL_RCC_HSI_DISABLE() (*(__IO uint32_t *) CR_HSION_BB = DISABLE) +#define __HAL_RCC_HSI_ENABLE() (*(__IO uint32_t *) RCC_CR_HSION_BB = ENABLE) +#define __HAL_RCC_HSI_DISABLE() (*(__IO uint32_t *) RCC_CR_HSION_BB = DISABLE) /** @brief Macro to adjust the Internal High Speed oscillator (HSI) calibration value. * @note The calibration is used to compensate for the variations in voltage @@ -871,6 +1020,13 @@ typedef struct */ #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICalibrationValue__) (MODIFY_REG(RCC->CR,\ RCC_CR_HSITRIM, (uint32_t)(__HSICalibrationValue__) << POSITION_VAL(RCC_CR_HSITRIM))) +/** + * @} + */ + +/** @defgroup RCC_LSI_Configuration LSI Configuration + * @{ + */ /** @brief Macros to enable or disable the Internal Low Speed oscillator (LSI). * @note After enabling the LSI, the application software should wait on @@ -880,11 +1036,20 @@ typedef struct * @note When the LSI is stopped, LSIRDY flag goes low after 6 LSI oscillator * clock cycles. */ -#define __HAL_RCC_LSI_ENABLE() (*(__IO uint32_t *) CSR_LSION_BB = ENABLE) -#define __HAL_RCC_LSI_DISABLE() (*(__IO uint32_t *) CSR_LSION_BB = DISABLE) +#define __HAL_RCC_LSI_ENABLE() (*(__IO uint32_t *) RCC_CSR_LSION_BB = ENABLE) +#define __HAL_RCC_LSI_DISABLE() (*(__IO uint32_t *) RCC_CSR_LSION_BB = DISABLE) +/** + * @} + */ + +/** @defgroup RCC_HSE_Configuration HSE Configuration + * @{ + */ /** * @brief Macro to configure the External High Speed oscillator (HSE). + * @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not supported by this macro. + * User should request a transition to HSE Off first and then HSE On or HSE Bypass. * @note After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application * software should wait on HSERDY flag to be set indicating that HSE clock * is stable and can be used to clock the PLL and/or system clock. @@ -902,10 +1067,19 @@ typedef struct * @arg RCC_HSE_ON: turn ON the HSE oscillator. * @arg RCC_HSE_BYPASS: HSE oscillator bypassed with external clock. */ -#define __HAL_RCC_HSE_CONFIG(__STATE__) (*(__IO uint8_t *) CR_BYTE2_ADDRESS = (__STATE__)) +#define __HAL_RCC_HSE_CONFIG(__STATE__) (*(__IO uint8_t *) RCC_CR_BYTE2_ADDRESS = (__STATE__)) +/** + * @} + */ + +/** @defgroup RCC_LSE_Configuration LSE Configuration + * @{ + */ /** * @brief Macro to configure the External Low Speed oscillator (LSE). + * @note Transition LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro. + * User should request a transition to LSE Off first and then LSE On or LSE Bypass. * @note As the LSE is in the Backup domain and write access is denied to * this domain after reset, you have to enable write access using * HAL_PWR_EnableBkUpAccess() function before to configure the LSE @@ -920,13 +1094,21 @@ typedef struct * @arg RCC_LSE_ON: turn ON the LSE oscillator. * @arg RCC_LSE_BYPASS: LSE oscillator bypassed with external clock. */ -#define __HAL_RCC_LSE_CONFIG(__STATE__) (*(__IO uint8_t *) BDCR_BYTE0_ADDRESS = (__STATE__)) +#define __HAL_RCC_LSE_CONFIG(__STATE__) (*(__IO uint8_t *) RCC_BDCR_BYTE0_ADDRESS = (__STATE__)) + +/** + * @} + */ -/** @brief Macros to enable or disable the the RTC clock. +/** @defgroup RCC_Internal_RTC_Clock_Configuration RTC Clock Configuration + * @{ + */ + +/** @brief Macros to enable or disable the RTC clock. * @note These macros must be used only after the RTC clock source was selected. */ -#define __HAL_RCC_RTC_ENABLE() (*(__IO uint32_t *) BDCR_RTCEN_BB = ENABLE) -#define __HAL_RCC_RTC_DISABLE() (*(__IO uint32_t *) BDCR_RTCEN_BB = DISABLE) +#define __HAL_RCC_RTC_ENABLE() (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = ENABLE) +#define __HAL_RCC_RTC_DISABLE() (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = DISABLE) /** @brief Macros to configure the RTC clock (RTCCLK). * @note As the RTC clock configuration bits are in the Backup domain and write @@ -943,7 +1125,7 @@ typedef struct * @arg RCC_RTCCLKSOURCE_HSE_DIVx: HSE clock divided by x selected * as RTC clock, where x:[2,31] * @note If the LSE or LSI is used as RTC clock source, the RTC continues to - * work in STOP and STANDBY modes, and can be used as wakeup source. + * work in STOP and STANDBY modes, and can be used as wake-up source. * However, when the HSE clock is used as RTC clock source, the RTC * cannot be used in STOP and STANDBY modes. * @note The maximum input clock frequency for RTC is 1MHz (when using HSE as @@ -961,8 +1143,15 @@ typedef struct * and the RTC clock source selection in RCC_CSR register. * @note The BKPSRAM is not affected by this reset. */ -#define __HAL_RCC_BACKUPRESET_FORCE() (*(__IO uint32_t *) BDCR_BDRST_BB = ENABLE) -#define __HAL_RCC_BACKUPRESET_RELEASE() (*(__IO uint32_t *) BDCR_BDRST_BB = DISABLE) +#define __HAL_RCC_BACKUPRESET_FORCE() (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = ENABLE) +#define __HAL_RCC_BACKUPRESET_RELEASE() (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = DISABLE) +/** + * @} + */ + +/** @defgroup RCC_PLL_Configuration PLL Configuration + * @{ + */ /** @brief Macros to enable or disable the main PLL. * @note After enabling the main PLL, the application software should wait on @@ -971,78 +1160,67 @@ typedef struct * @note The main PLL can not be disabled if it is used as system clock source * @note The main PLL is disabled by hardware when entering STOP and STANDBY modes. */ -#define __HAL_RCC_PLL_ENABLE() (*(__IO uint32_t *) CR_PLLON_BB = ENABLE) -#define __HAL_RCC_PLL_DISABLE() (*(__IO uint32_t *) CR_PLLON_BB = DISABLE) +#define __HAL_RCC_PLL_ENABLE() (*(__IO uint32_t *) RCC_CR_PLLON_BB = ENABLE) +#define __HAL_RCC_PLL_DISABLE() (*(__IO uint32_t *) RCC_CR_PLLON_BB = DISABLE) +/** + * @} + */ -/** @brief Macro to configure the main PLL clock source, multiplication and division factors. +/** @brief Macro to configure the PLL clock source. * @note This function must be used only when the main PLL is disabled. - * @param __RCC_PLLSource__: specifies the PLL entry clock source. + * @param __PLLSOURCE__: specifies the PLL entry clock source. * This parameter can be one of the following values: * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry - * @note This clock source (RCC_PLLSource) is common for the main PLL and PLLI2S. + * + */ +#define __HAL_RCC_PLL_PLLSOURCE_CONFIG(__PLLSOURCE__) MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__)) + +/** @brief Macro to configure the PLL multiplication factor. + * @note This function must be used only when the main PLL is disabled. * @param __PLLM__: specifies the division factor for PLL VCO input clock * This parameter must be a number between Min_Data = 2 and Max_Data = 63. * @note You have to set the PLLM parameter correctly to ensure that the VCO input * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency * of 2 MHz to limit PLL jitter. - * @param __PLLN__: specifies the multiplication factor for PLL VCO output clock - * This parameter must be a number between Min_Data = 192 and Max_Data = 432. - * @note You have to set the PLLN parameter correctly to ensure that the VCO - * output frequency is between 192 and 432 MHz. - * @param __PLLP__: specifies the division factor for main system clock (SYSCLK) - * This parameter must be a number in the range {2, 4, 6, or 8}. - * @note You have to set the PLLP parameter correctly to not exceed 168 MHz on - * the System clock frequency. - * @param __PLLQ__: specifies the division factor for OTG FS, SDIO and RNG clocks - * This parameter must be a number between Min_Data = 2 and Max_Data = 15. - * @note If the USB OTG FS is used in your application, you have to set the - * PLLQ parameter correctly to have 48 MHz clock for the USB. However, - * the SDIO and RNG need a frequency lower than or equal to 48 MHz to work - * correctly. - */ -#define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__)\ - (RCC->PLLCFGR = (0x20000000 | (__PLLM__) | ((__PLLN__) << POSITION_VAL(RCC_PLLCFGR_PLLN)) | \ - ((((__PLLP__) >> 1) -1) << POSITION_VAL(RCC_PLLCFGR_PLLP)) | (__RCC_PLLSource__) | \ - ((__PLLQ__) << POSITION_VAL(RCC_PLLCFGR_PLLQ)))) - -/** @brief Macro to configure the I2S clock source (I2SCLK). - * @note This function must be called before enabling the I2S APB clock. - * @param __SOURCE__: specifies the I2S clock source. - * This parameter can be one of the following values: - * @arg RCC_I2SCLKSOURCE_PLLI2S: PLLI2S clock used as I2S clock source. - * @arg RCC_I2SCLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin - * used as I2S clock source. + * + */ +#define __HAL_RCC_PLL_PLLM_CONFIG(__PLLM__) MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLM, (__PLLM__)) + +/** @defgroup RCC_PLL_I2S_Configuration PLL I2S Configuration + * @{ */ -#define __HAL_RCC_I2SCLK(__SOURCE__) (*(__IO uint32_t *) CFGR_I2SSRC_BB = (__SOURCE__)) /** @brief Macros to enable or disable the PLLI2S. * @note The PLLI2S is disabled by hardware when entering STOP and STANDBY modes. */ -#define __HAL_RCC_PLLI2S_ENABLE() (*(__IO uint32_t *) CR_PLLI2SON_BB = ENABLE) -#define __HAL_RCC_PLLI2S_DISABLE() (*(__IO uint32_t *) CR_PLLI2SON_BB = DISABLE) +#define __HAL_RCC_PLLI2S_ENABLE() (*(__IO uint32_t *) RCC_CR_PLLI2SON_BB = ENABLE) +#define __HAL_RCC_PLLI2S_DISABLE() (*(__IO uint32_t *) RCC_CR_PLLI2SON_BB = DISABLE) +/** + * @} + */ -/** @brief Macro to configure the PLLI2S clock multiplication and division factors . - * @note This macro must be used only when the PLLI2S is disabled. - * @note PLLI2S clock source is common with the main PLL (configured in - * HAL_RCC_ClockConfig() API). - * @param __PLLI2SN__: specifies the multiplication factor for PLLI2S VCO output clock - * This parameter must be a number between Min_Data = 192 and Max_Data = 432. - * @note You have to set the PLLI2SN parameter correctly to ensure that the VCO - * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. - * @param __PLLI2SR__: specifies the division factor for I2S clock - * This parameter must be a number between Min_Data = 2 and Max_Data = 7. - * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz - * on the I2S clock frequency. +/** @defgroup RCC_Get_Clock_source Get Clock source + * @{ + */ +/** + * @brief Macro to configure the system clock source. + * @param __RCC_SYSCLKSOURCE__: specifies the system clock source. + * This parameter can be one of the following values: + * - RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source. + * - RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source. + * - RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source. + * - RCC_SYSCLKSOURCE_PLLRCLK: PLLR output is used as system clock source. */ -#define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SN__, __PLLI2SR__) (RCC->PLLI2SCFGR = ((__PLLI2SN__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SN)) | ((__PLLI2SR__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR))) +#define __HAL_RCC_SYSCLK_CONFIG(__RCC_SYSCLKSOURCE__) MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__)) /** @brief Macro to get the clock source used as system clock. * @retval The clock source used as system clock. The returned value can be one * of the following: - * - RCC_CFGR_SWS_HSI: HSI used as system clock. - * - RCC_CFGR_SWS_HSE: HSE used as system clock. - * - RCC_CFGR_SWS_PLL: PLL used as system clock. + * - RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock. + * - RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock. + * - RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock. + * - RCC_SYSCLKSOURCE_STATUS_PLLRCLK: PLLR used as system clock. */ #define __HAL_RCC_GET_SYSCLK_SOURCE() ((uint32_t)(RCC->CFGR & RCC_CFGR_SWS)) @@ -1053,6 +1231,14 @@ typedef struct * - RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source. */ #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC)) +/** + * @} + */ + +/** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management + * @brief macros to manage the specified RCC Flags and interrupts. + * @{ + */ /** @brief Enable RCC interrupt (Perform Byte access to RCC_CIR[14:8] bits to enable * the selected interrupts). @@ -1065,7 +1251,7 @@ typedef struct * @arg RCC_IT_PLLRDY: Main PLL ready interrupt. * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt. */ -#define __HAL_RCC_ENABLE_IT(__INTERRUPT__) (*(__IO uint8_t *) CIR_BYTE1_ADDRESS |= (__INTERRUPT__)) +#define __HAL_RCC_ENABLE_IT(__INTERRUPT__) (*(__IO uint8_t *) RCC_CIR_BYTE1_ADDRESS |= (__INTERRUPT__)) /** @brief Disable RCC interrupt (Perform Byte access to RCC_CIR[14:8] bits to disable * the selected interrupts). @@ -1078,7 +1264,7 @@ typedef struct * @arg RCC_IT_PLLRDY: Main PLL ready interrupt. * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt. */ -#define __HAL_RCC_DISABLE_IT(__INTERRUPT__) (*(__IO uint8_t *) CIR_BYTE1_ADDRESS &= ~(__INTERRUPT__)) +#define __HAL_RCC_DISABLE_IT(__INTERRUPT__) (*(__IO uint8_t *) RCC_CIR_BYTE1_ADDRESS &= ~(__INTERRUPT__)) /** @brief Clear the RCC's interrupt pending bits (Perform Byte access to RCC_CIR[23:16] * bits to clear the selected interrupt pending bits. @@ -1092,7 +1278,7 @@ typedef struct * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt. * @arg RCC_IT_CSS: Clock Security System interrupt */ -#define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (*(__IO uint8_t *) CIR_BYTE2_ADDRESS = (__INTERRUPT__)) +#define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (*(__IO uint8_t *) RCC_CIR_BYTE2_ADDRESS = (__INTERRUPT__)) /** @brief Check the RCC's interrupt has occurred or not. * @param __INTERRUPT__: specifies the RCC interrupt source to check. @@ -1134,19 +1320,33 @@ typedef struct #define RCC_FLAG_MASK ((uint8_t)0x1F) #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5) == 1)? RCC->CR :((((__FLAG__) >> 5) == 2) ? RCC->BDCR :((((__FLAG__) >> 5) == 3)? RCC->CSR :RCC->CIR))) & ((uint32_t)1 << ((__FLAG__) & RCC_FLAG_MASK)))!= 0)? 1 : 0) -#define __RCC_PLLSRC() ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> POSITION_VAL(RCC_PLLCFGR_PLLSRC)) - - -/* Include RCC HAL Extension module */ -#include "stm32f4xx_hal_rcc_ex.h" +/** + * @} + */ + +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ - + /** @addtogroup RCC_Exported_Functions + * @{ + */ + +/** @addtogroup RCC_Exported_Functions_Group1 + * @{ + */ /* Initialization and de-initialization functions ******************************/ void HAL_RCC_DeInit(void); HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct); HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency); +/** + * @} + */ +/** @addtogroup RCC_Exported_Functions_Group2 + * @{ + */ /* Peripheral Control functions ************************************************/ void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv); void HAL_RCC_EnableCSS(void); @@ -1162,7 +1362,163 @@ void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t void HAL_RCC_NMI_IRQHandler(void); /* User Callbacks in non blocking mode (IT mode) */ -void HAL_RCC_CCSCallback(void); +void HAL_RCC_CSSCallback(void); + +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup RCC_Private_Constants RCC Private Constants + * @{ + */ + +/** @defgroup RCC_BitAddress_AliasRegion RCC BitAddress AliasRegion + * @brief RCC registers bit address in the alias region + * @{ + */ +#define RCC_OFFSET (RCC_BASE - PERIPH_BASE) +/* --- CR Register ---*/ +/* Alias word address of HSION bit */ +#define RCC_CR_OFFSET (RCC_OFFSET + 0x00) +#define RCC_HSION_BIT_NUMBER 0x00 +#define RCC_CR_HSION_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (RCC_HSION_BIT_NUMBER * 4)) +/* Alias word address of CSSON bit */ +#define RCC_CSSON_BIT_NUMBER 0x13 +#define RCC_CR_CSSON_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (RCC_CSSON_BIT_NUMBER * 4)) +/* Alias word address of PLLON bit */ +#define RCC_PLLON_BIT_NUMBER 0x18 +#define RCC_CR_PLLON_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (RCC_PLLON_BIT_NUMBER * 4)) +/* Alias word address of PLLI2SON bit */ +#define RCC_PLLI2SON_BIT_NUMBER 0x1A +#define RCC_CR_PLLI2SON_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (RCC_PLLI2SON_BIT_NUMBER * 4)) + +/* --- CFGR Register ---*/ +/* Alias word address of I2SSRC bit */ +#define RCC_CFGR_OFFSET (RCC_OFFSET + 0x08) +#define RCC_I2SSRC_BIT_NUMBER 0x17 +#define RCC_CFGR_I2SSRC_BB (PERIPH_BB_BASE + (RCC_CFGR_OFFSET * 32) + (RCC_I2SSRC_BIT_NUMBER * 4)) + +/* --- BDCR Register ---*/ +/* Alias word address of RTCEN bit */ +#define RCC_BDCR_OFFSET (RCC_OFFSET + 0x70) +#define RCC_RTCEN_BIT_NUMBER 0x0F +#define RCC_BDCR_RTCEN_BB (PERIPH_BB_BASE + (RCC_BDCR_OFFSET * 32) + (RCC_RTCEN_BIT_NUMBER * 4)) +/* Alias word address of BDRST bit */ +#define RCC_BDRST_BIT_NUMBER 0x10 +#define RCC_BDCR_BDRST_BB (PERIPH_BB_BASE + (RCC_BDCR_OFFSET * 32) + (RCC_BDRST_BIT_NUMBER * 4)) + +/* --- CSR Register ---*/ +/* Alias word address of LSION bit */ +#define RCC_CSR_OFFSET (RCC_OFFSET + 0x74) +#define RCC_LSION_BIT_NUMBER 0x00 +#define RCC_CSR_LSION_BB (PERIPH_BB_BASE + (RCC_CSR_OFFSET * 32) + (RCC_LSION_BIT_NUMBER * 4)) + +/* CR register byte 3 (Bits[23:16]) base address */ +#define RCC_CR_BYTE2_ADDRESS ((uint32_t)0x40023802) + +/* CIR register byte 2 (Bits[15:8]) base address */ +#define RCC_CIR_BYTE1_ADDRESS ((uint32_t)(RCC_BASE + 0x0C + 0x01)) + +/* CIR register byte 3 (Bits[23:16]) base address */ +#define RCC_CIR_BYTE2_ADDRESS ((uint32_t)(RCC_BASE + 0x0C + 0x02)) + +/* BDCR register base address */ +#define RCC_BDCR_BYTE0_ADDRESS (PERIPH_BASE + RCC_BDCR_OFFSET) + +#define RCC_DBP_TIMEOUT_VALUE ((uint32_t)100) +#define RCC_LSE_TIMEOUT_VALUE ((uint32_t)5000) + +#define HSE_TIMEOUT_VALUE HSE_STARTUP_TIMEOUT +#define HSI_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */ +#define LSI_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */ + +#define PLLI2S_TIMEOUT_VALUE ((uint32_t)100) /* Timeout value fixed to 100 ms */ +#define PLLSAI_TIMEOUT_VALUE ((uint32_t)100) /* Timeout value fixed to 100 ms */ +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @addtogroup RCC_Private_Macros RCC Private Macros + * @{ + */ + +/** @defgroup RCC_IS_RCC_Definitions RCC Private macros to check input parameters + * @{ + */ +#define IS_RCC_OSCILLATORTYPE(OSCILLATOR) ((OSCILLATOR) <= 15) + +#define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \ + ((HSE) == RCC_HSE_BYPASS)) + +#define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \ + ((LSE) == RCC_LSE_BYPASS)) + +#define IS_RCC_HSI(HSI) (((HSI) == RCC_HSI_OFF) || ((HSI) == RCC_HSI_ON)) + +#define IS_RCC_LSI(LSI) (((LSI) == RCC_LSI_OFF) || ((LSI) == RCC_LSI_ON)) + +#define IS_RCC_PLL(PLL) (((PLL) == RCC_PLL_NONE) ||((PLL) == RCC_PLL_OFF) || ((PLL) == RCC_PLL_ON)) + +#define IS_RCC_PLLSOURCE(SOURCE) (((SOURCE) == RCC_PLLSOURCE_HSI) || \ + ((SOURCE) == RCC_PLLSOURCE_HSE)) + +#define IS_RCC_SYSCLKSOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSOURCE_HSI) || \ + ((SOURCE) == RCC_SYSCLKSOURCE_HSE) || \ + ((SOURCE) == RCC_SYSCLKSOURCE_PLLCLK) || \ + ((SOURCE) == RCC_SYSCLKSOURCE_PLLRCLK)) + +#define IS_RCC_PLLM_VALUE(VALUE) ((VALUE) <= 63) + +#define IS_RCC_PLLN_VALUE(VALUE) ((192 <= (VALUE)) && ((VALUE) <= 432)) + +#define IS_RCC_PLLP_VALUE(VALUE) (((VALUE) == 2) || ((VALUE) == 4) || ((VALUE) == 6) || ((VALUE) == 8)) + +#define IS_RCC_PLLQ_VALUE(VALUE) ((4 <= (VALUE)) && ((VALUE) <= 15)) + +#define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_SYSCLK_DIV1) || ((HCLK) == RCC_SYSCLK_DIV2) || \ + ((HCLK) == RCC_SYSCLK_DIV4) || ((HCLK) == RCC_SYSCLK_DIV8) || \ + ((HCLK) == RCC_SYSCLK_DIV16) || ((HCLK) == RCC_SYSCLK_DIV64) || \ + ((HCLK) == RCC_SYSCLK_DIV128) || ((HCLK) == RCC_SYSCLK_DIV256) || \ + ((HCLK) == RCC_SYSCLK_DIV512)) + +#define IS_RCC_CLOCKTYPE(CLK) ((1 <= (CLK)) && ((CLK) <= 15)) + +#define IS_RCC_PCLK(PCLK) (((PCLK) == RCC_HCLK_DIV1) || ((PCLK) == RCC_HCLK_DIV2) || \ + ((PCLK) == RCC_HCLK_DIV4) || ((PCLK) == RCC_HCLK_DIV8) || \ + ((PCLK) == RCC_HCLK_DIV16)) + +#define IS_RCC_MCO(MCOx) (((MCOx) == RCC_MCO1) || ((MCOx) == RCC_MCO2)) + +#define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1SOURCE_HSI) || ((SOURCE) == RCC_MCO1SOURCE_LSE) || \ + ((SOURCE) == RCC_MCO1SOURCE_HSE) || ((SOURCE) == RCC_MCO1SOURCE_PLLCLK)) + +#define IS_RCC_MCO2SOURCE(SOURCE) (((SOURCE) == RCC_MCO2SOURCE_SYSCLK) || ((SOURCE) == RCC_MCO2SOURCE_PLLI2SCLK)|| \ + ((SOURCE) == RCC_MCO2SOURCE_HSE) || ((SOURCE) == RCC_MCO2SOURCE_PLLCLK)) + +#define IS_RCC_MCODIV(DIV) (((DIV) == RCC_MCODIV_1) || ((DIV) == RCC_MCODIV_2) || \ + ((DIV) == RCC_MCODIV_3) || ((DIV) == RCC_MCODIV_4) || \ + ((DIV) == RCC_MCODIV_5)) +#define IS_RCC_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F) + +/** + * @} + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.c index 6b07831eb8f..f7ae5eb8339 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_rcc_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Extension RCC HAL module driver. * This file provides firmware functions to manage the following * functionalities RCC extension peripheral: @@ -12,7 +12,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,8 +46,8 @@ * @{ */ -/** @defgroup RCC - * @brief RCC HAL module driver +/** @defgroup RCCEx RCCEx + * @brief RCCEx HAL module driver * @{ */ @@ -55,37 +55,637 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ -#define PLLI2S_TIMEOUT_VALUE 100 /* Timeout value fixed to 100 ms */ -#define PLLSAI_TIMEOUT_VALUE 100 /* Timeout value fixed to 100 ms */ +/** @addtogroup RCCEx_Private_Constants + * @{ + */ +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ +/** @defgroup RCCEx_Exported_Functions RCCEx Exported Functions + * @{ + */ + +/** @defgroup RCCEx_Exported_Functions_Group1 Extended Peripheral Control functions + * @brief Extended Peripheral Control functions + * +@verbatim + =============================================================================== + ##### Extended Peripheral Control functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to control the RCC Clocks + frequencies. + [..] + (@) Important note: Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to + select the RTC clock source; in this case the Backup domain will be reset in + order to modify the RTC Clock source, as consequence RTC registers (including + the backup registers) and RCC_BDCR register are set to their reset values. + +@endverbatim + * @{ + */ +#if defined(STM32F446xx) +/** + * @brief Initializes the RCC extended peripherals clocks according to the specified + * parameters in the RCC_PeriphCLKInitTypeDef. + * @param PeriphClkInit: pointer to an RCC_PeriphCLKInitTypeDef structure that + * contains the configuration information for the Extended Peripherals + * clocks(I2S, SAI, LTDC RTC and TIM). + * + * @note Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select + * the RTC clock source; in this case the Backup domain will be reset in + * order to modify the RTC Clock source, as consequence RTC registers (including + * the backup registers) and RCC_BDCR register are set to their reset values. + * + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) +{ + uint32_t tickstart = 0; + uint32_t tmpreg1 = 0; + uint32_t plli2sp = 0; + uint32_t plli2sq = 0; + uint32_t plli2sr = 0; + uint32_t pllsaip = 0; + uint32_t pllsaiq = 0; + uint32_t plli2sused = 0; + uint32_t pllsaiused = 0; + + /* Check the peripheral clock selection parameters */ + assert_param(IS_RCC_PERIPHCLOCK(PeriphClkInit->PeriphClockSelection)); + + /*----------------------------------- I2S APB1 configuration ----------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2S_APB1) == (RCC_PERIPHCLK_I2S_APB1)) + { + /* Check the parameters */ + assert_param(IS_RCC_I2SAPB1CLKSOURCE(PeriphClkInit->I2sApb1ClockSelection)); + + /* Configure I2S Clock source */ + __HAL_RCC_I2S_APB1_CONFIG(PeriphClkInit->I2sApb1ClockSelection); + /* Enable the PLLI2S when it's used as clock source for I2S */ + if(PeriphClkInit->I2sApb1ClockSelection == RCC_I2SAPB1CLKSOURCE_PLLI2S) + { + plli2sused = 1; + } + } + + /*----------------------------------- I2S APB2 configuration -----------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2S_APB2) == (RCC_PERIPHCLK_I2S_APB2)) + { + /* Check the parameters */ + assert_param(IS_RCC_I2SAPB2CLKSOURCE(PeriphClkInit->I2sApb2ClockSelection)); + + /* Configure I2S Clock source */ + __HAL_RCC_I2S_APB2_CONFIG(PeriphClkInit->I2sApb2ClockSelection); + /* Enable the PLLI2S when it's used as clock source for I2S */ + if(PeriphClkInit->I2sApb2ClockSelection == RCC_I2SAPB2CLKSOURCE_PLLI2S) + { + plli2sused = 1; + } + } + + /*------------------------------------ SAI1 configuration --------------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI1) == (RCC_PERIPHCLK_SAI1)) + { + /* Check the parameters */ + assert_param(IS_RCC_SAI1CLKSOURCE(PeriphClkInit->Sai1ClockSelection)); + + /* Configure SAI1 Clock source */ + __HAL_RCC_SAI1_CONFIG(PeriphClkInit->Sai1ClockSelection); + /* Enable the PLLI2S when it's used as clock source for SAI */ + if(PeriphClkInit->Sai1ClockSelection == RCC_SAI1CLKSOURCE_PLLI2S) + { + plli2sused = 1; + } + /* Enable the PLLSAI when it's used as clock source for SAI */ + if(PeriphClkInit->Sai1ClockSelection == RCC_SAI1CLKSOURCE_PLLSAI) + { + pllsaiused = 1; + } + } + + /*------------------------------------ SAI2 configuration --------------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI2) == (RCC_PERIPHCLK_SAI2)) + { + /* Check the parameters */ + assert_param(IS_RCC_SAI2CLKSOURCE(PeriphClkInit->Sai2ClockSelection)); + + /* Configure SAI2 Clock source */ + __HAL_RCC_SAI2_CONFIG(PeriphClkInit->Sai2ClockSelection); + + /* Enable the PLLI2S when it's used as clock source for SAI */ + if(PeriphClkInit->Sai2ClockSelection == RCC_SAI2CLKSOURCE_PLLI2S) + { + plli2sused = 1; + } + /* Enable the PLLSAI when it's used as clock source for SAI */ + if(PeriphClkInit->Sai2ClockSelection == RCC_SAI2CLKSOURCE_PLLSAI) + { + pllsaiused = 1; + } + } + + /*------------------------------------ RTC configuration --------------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_RTC) == (RCC_PERIPHCLK_RTC)) + { + /* Enable Power Clock*/ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* Enable write access to Backup domain */ + PWR->CR |= PWR_CR_DBP; + + /* Get tick */ + tickstart = HAL_GetTick(); + + while((PWR->CR & PWR_CR_DBP) == RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_DBP_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Reset the Backup domain only if the RTC Clock source selction is modified */ + if((RCC->BDCR & RCC_BDCR_RTCSEL) != (PeriphClkInit->RTCClockSelection & RCC_BDCR_RTCSEL)) + { + /* Store the content of BDCR register before the reset of Backup Domain */ + tmpreg1 = (RCC->BDCR & ~(RCC_BDCR_RTCSEL)); + /* RTC Clock selection can be changed only if the Backup Domain is reset */ + __HAL_RCC_BACKUPRESET_FORCE(); + __HAL_RCC_BACKUPRESET_RELEASE(); + /* Restore the Content of BDCR register */ + RCC->BDCR = tmpreg1; + } + + /* If LSE is selected as RTC clock source, wait for LSE reactivation */ + if(PeriphClkInit->RTCClockSelection == RCC_RTCCLKSOURCE_LSE) + { + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + __HAL_RCC_RTC_CONFIG(PeriphClkInit->RTCClockSelection); + } + + /*------------------------------------ TIM configuration --------------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM) == (RCC_PERIPHCLK_TIM)) + { + /* Configure Timer Prescaler */ + __HAL_RCC_TIMCLKPRESCALER(PeriphClkInit->TIMPresSelection); + } + + /*------------------------------------- FMPI2C1 Configuration ----------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_FMPI2C1) == RCC_PERIPHCLK_FMPI2C1) + { + /* Check the parameters */ + assert_param(IS_RCC_FMPI2C1CLKSOURCE(PeriphClkInit->Fmpi2c1ClockSelection)); + + /* Configure the FMPI2C1 clock source */ + __HAL_RCC_FMPI2C1_CONFIG(PeriphClkInit->Fmpi2c1ClockSelection); + } + + /*--------------------------------------- CEC Configuration -----------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_CEC) == RCC_PERIPHCLK_CEC) + { + /* Check the parameters */ + assert_param(IS_RCC_CECCLKSOURCE(PeriphClkInit->CecClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_CEC_CONFIG(PeriphClkInit->CecClockSelection); + } + + /*-------------------------------------- CK48 Configuration -----------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_CK48) == RCC_PERIPHCLK_CK48) + { + /* Check the parameters */ + assert_param(IS_RCC_CK48CLKSOURCE(PeriphClkInit->Clk48ClockSelection)); + + /* Configure the SDIO clock source */ + __HAL_RCC_CLK48_CONFIG(PeriphClkInit->Clk48ClockSelection); + + /* Enable the PLLSAI when it's used as clock source for CK48 */ + if(PeriphClkInit->Clk48ClockSelection == RCC_CK48CLKSOURCE_PLLSAIP) + { + pllsaiused = 1; + } + } + + /*------------------------------------- SDIO Configuration ------------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SDIO) == RCC_PERIPHCLK_SDIO) + { + /* Check the parameters */ + assert_param(IS_RCC_SDIOCLKSOURCE(PeriphClkInit->SdioClockSelection)); + + /* Configure the SDIO clock source */ + __HAL_RCC_SDIO_CONFIG(PeriphClkInit->SdioClockSelection); + } + + /*------------------------------------- SPDIFRX Configuration --------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SPDIFRX) == RCC_PERIPHCLK_SPDIFRX) + { + /* Check the parameters */ + assert_param(IS_RCC_SPDIFRXCLKSOURCE(PeriphClkInit->SpdifClockSelection)); + + /* Configure the SPDIFRX clock source */ + __HAL_RCC_SPDIFRX_CONFIG(PeriphClkInit->SpdifClockSelection); + /* Enable the PLLI2S when it's used as clock source for SPDIFRX */ + if(PeriphClkInit->SpdifClockSelection == RCC_SPDIFRXCLKSOURCE_PLLI2SP) + { + plli2sused = 1; + } + } + + /*-------------------------------------- PLLI2S Configuration --------------*/ + /* PLLI2S is configured when a peripheral will use it as source clock : SAI1, SAI2, I2S on APB1, + I2S on APB2 or SPDIFRX */ + if((plli2sused == 1) || (PeriphClkInit->PeriphClockSelection == RCC_PERIPHCLK_PLLI2S)) + { + /* Disable the PLLI2S */ + __HAL_RCC_PLLI2S_DISABLE(); + /* Get tick */ + tickstart = HAL_GetTick(); + /* Wait till PLLI2S is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLI2SRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > PLLI2S_TIMEOUT_VALUE) + { + /* return in case of Timeout detected */ + return HAL_TIMEOUT; + } + } + + /* check for common PLLI2S Parameters */ + assert_param(IS_RCC_PLLI2SM_VALUE(PeriphClkInit->PLLI2S.PLLI2SM)); + assert_param(IS_RCC_PLLI2SN_VALUE(PeriphClkInit->PLLI2S.PLLI2SN)); + + /*----------------- In Case of PLLI2S is selected as source clock for I2S -------------------*/ + if(((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2S_APB1) == RCC_PERIPHCLK_I2S_APB1) && (PeriphClkInit->I2sApb1ClockSelection == RCC_I2SAPB1CLKSOURCE_PLLI2S)) || + ((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2S_APB2) == RCC_PERIPHCLK_I2S_APB2) && (PeriphClkInit->I2sApb2ClockSelection == RCC_I2SAPB2CLKSOURCE_PLLI2S))) + { + /* check for Parameters */ + assert_param(IS_RCC_PLLI2SR_VALUE(PeriphClkInit->PLLI2S.PLLI2SR)); + + /* Read PLLI2SP/PLLI2SQ value from PLLI2SCFGR register (this value is not needed for I2S configuration) */ + plli2sp = ((((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SP) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SP)) + 1) << 1); + plli2sq = ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SQ) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SQ)); + /* Configure the PLLI2S division factors */ + /* PLLI2S_VCO = f(VCO clock) = f(PLLI2S clock input) × (PLLI2SN/PLLI2SM) */ + /* I2SCLK = f(PLLI2S clock output) = f(VCO clock) / PLLI2SR */ + __HAL_RCC_PLLI2S_CONFIG(PeriphClkInit->PLLI2S.PLLI2SM, PeriphClkInit->PLLI2S.PLLI2SN , plli2sp, plli2sq, PeriphClkInit->PLLI2S.PLLI2SR); + } + + /*----------------- In Case of PLLI2S is selected as source clock for SAI -------------------*/ + if(((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) && (PeriphClkInit->Sai1ClockSelection == RCC_SAI1CLKSOURCE_PLLI2S)) || + ((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) && (PeriphClkInit->Sai2ClockSelection == RCC_SAI2CLKSOURCE_PLLI2S))) + { + /* Check for PLLI2S Parameters */ + assert_param(IS_RCC_PLLI2SQ_VALUE(PeriphClkInit->PLLI2S.PLLI2SQ)); + /* Check for PLLI2S/DIVQ parameters */ + assert_param(IS_RCC_PLLI2S_DIVQ_VALUE(PeriphClkInit->PLLI2SDivQ)); + + /* Read PLLI2SP/PLLI2SR value from PLLI2SCFGR register (this value is not needed for SAI configuration) */ + plli2sp = ((((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SP) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SP)) + 1) << 1); + plli2sr = ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)); + /* Configure the PLLI2S division factors */ + /* PLLI2S_VCO Input = PLL_SOURCE/PLLI2SM */ + /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ + /* SAI_CLK(first level) = PLLI2S_VCO Output/PLLI2SQ */ + __HAL_RCC_PLLI2S_CONFIG(PeriphClkInit->PLLI2S.PLLI2SM, PeriphClkInit->PLLI2S.PLLI2SN , plli2sp, PeriphClkInit->PLLI2S.PLLI2SQ, plli2sr); + + /* SAI_CLK_x = SAI_CLK(first level)/PLLI2SDIVQ */ + __HAL_RCC_PLLI2S_PLLSAICLKDIVQ_CONFIG(PeriphClkInit->PLLI2SDivQ); + } + + /*----------------- In Case of PLLI2S is selected as source clock for SPDIFRX -------------------*/ + if((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SPDIFRX) == RCC_PERIPHCLK_SPDIFRX) && (PeriphClkInit->SpdifClockSelection == RCC_SPDIFRXCLKSOURCE_PLLI2SP)) + { + /* check for Parameters */ + assert_param(IS_RCC_PLLI2SP_VALUE(PeriphClkInit->PLLI2S.PLLI2SP)); + /* Read PLLI2SR value from PLLI2SCFGR register (this value is not need for SAI configuration) */ + plli2sq = ((((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SP) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SP)) + 1) << 1); + plli2sr = ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)); + /* Configure the PLLI2S division factors */ + /* PLLI2S_VCO = f(VCO clock) = f(PLLI2S clock input) × (PLLI2SN/PLLI2SM) */ + /* SPDIFRXCLK = f(PLLI2S clock output) = f(VCO clock) / PLLI2SP */ + __HAL_RCC_PLLI2S_CONFIG(PeriphClkInit->PLLI2S.PLLI2SM, PeriphClkInit->PLLI2S.PLLI2SN , PeriphClkInit->PLLI2S.PLLI2SP, plli2sq, plli2sr); + } + + /*----------------- In Case of PLLI2S is just selected -----------------*/ + if((PeriphClkInit->PeriphClockSelection & RCC_PERIPHCLK_PLLI2S) == RCC_PERIPHCLK_PLLI2S) + { + /* Check for Parameters */ + assert_param(IS_RCC_PLLI2SP_VALUE(PeriphClkInit->PLLI2S.PLLI2SP)); + assert_param(IS_RCC_PLLI2SR_VALUE(PeriphClkInit->PLLI2S.PLLI2SR)); + assert_param(IS_RCC_PLLI2SR_VALUE(PeriphClkInit->PLLI2S.PLLI2SQ)); + + /* Configure the PLLI2S division factors */ + /* PLLI2S_VCO = f(VCO clock) = f(PLLI2S clock input) × (PLLI2SN/PLLI2SM) */ + /* SPDIFRXCLK = f(PLLI2S clock output) = f(VCO clock) / PLLI2SP */ + __HAL_RCC_PLLI2S_CONFIG(PeriphClkInit->PLLI2S.PLLI2SM, PeriphClkInit->PLLI2S.PLLI2SN , PeriphClkInit->PLLI2S.PLLI2SP, PeriphClkInit->PLLI2S.PLLI2SQ, PeriphClkInit->PLLI2S.PLLI2SR); + } + + /* Enable the PLLI2S */ + __HAL_RCC_PLLI2S_ENABLE(); + /* Get tick */ + tickstart = HAL_GetTick(); + /* Wait till PLLI2S is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLI2SRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > PLLI2S_TIMEOUT_VALUE) + { + /* return in case of Timeout detected */ + return HAL_TIMEOUT; + } + } + } + /*-------------------------------------- PLLSAI Configuration ---------------------------------*/ + /* PLLSAI is configured when a peripheral will use it as source clock : SAI1, SAI2, CK48 or SDIO */ + if(pllsaiused == 1) + { + /* Disable PLLSAI Clock */ + __HAL_RCC_PLLSAI_DISABLE(); + /* Get tick */ + tickstart = HAL_GetTick(); + /* Wait till PLLSAI is disabled */ + while(__HAL_RCC_PLLSAI_GET_FLAG() != RESET) + { + if((HAL_GetTick() - tickstart ) > PLLSAI_TIMEOUT_VALUE) + { + /* return in case of Timeout detected */ + return HAL_TIMEOUT; + } + } + + /* Check the PLLSAI division factors */ + assert_param(IS_RCC_PLLSAIM_VALUE(PeriphClkInit->PLLSAI.PLLSAIM)); + assert_param(IS_RCC_PLLSAIN_VALUE(PeriphClkInit->PLLSAI.PLLSAIN)); + + /*----------------- In Case of PLLSAI is selected as source clock for SAI -------------------*/ + if(((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) && (PeriphClkInit->Sai1ClockSelection == RCC_SAI1CLKSOURCE_PLLSAI)) || + ((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) && (PeriphClkInit->Sai2ClockSelection == RCC_SAI2CLKSOURCE_PLLSAI))) + { + /* check for PLLSAIQ Parameter */ + assert_param(IS_RCC_PLLSAIQ_VALUE(PeriphClkInit->PLLSAI.PLLSAIQ)); + /* check for PLLSAI/DIVQ Parameter */ + assert_param(IS_RCC_PLLSAI_DIVQ_VALUE(PeriphClkInit->PLLSAIDivQ)); + + /* Read PLLSAIP value from PLLSAICFGR register (this value is not needed for SAI configuration) */ + pllsaip = ((((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIP) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIP)) + 1) << 1); + /* PLLSAI_VCO Input = PLL_SOURCE/PLLM */ + /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN */ + /* SAI_CLK(first level) = PLLSAI_VCO Output/PLLSAIQ */ + __HAL_RCC_PLLSAI_CONFIG(PeriphClkInit->PLLSAI.PLLSAIM, PeriphClkInit->PLLSAI.PLLSAIN , pllsaip, PeriphClkInit->PLLSAI.PLLSAIQ, 0); + + /* SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ */ + __HAL_RCC_PLLSAI_PLLSAICLKDIVQ_CONFIG(PeriphClkInit->PLLSAIDivQ); + } + + /*----------------- In Case of PLLSAI is selected as source clock for CK48 -------------------*/ + /* In Case of PLLI2S is selected as source clock for CK48 */ + if((((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_CK48) == RCC_PERIPHCLK_CK48) && (PeriphClkInit->Clk48ClockSelection == RCC_CK48CLKSOURCE_PLLSAIP)) + { + /* check for Parameters */ + assert_param(IS_RCC_PLLSAIP_VALUE(PeriphClkInit->PLLSAI.PLLSAIP)); + /* Read PLLSAIQ value from PLLI2SCFGR register (this value is not need for SAI configuration) */ + pllsaiq = ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIQ)); + /* Configure the PLLSAI division factors */ + /* PLLSAI_VCO = f(VCO clock) = f(PLLSAI clock input) × (PLLI2SN/PLLSAIM) */ + /* 48CLK = f(PLLSAI clock output) = f(VCO clock) / PLLSAIP */ + __HAL_RCC_PLLSAI_CONFIG(PeriphClkInit->PLLSAI.PLLSAIM, PeriphClkInit->PLLSAI.PLLSAIN , PeriphClkInit->PLLSAI.PLLSAIP, pllsaiq, 0); + } + + /* Enable PLLSAI Clock */ + __HAL_RCC_PLLSAI_ENABLE(); + /* Get tick */ + tickstart = HAL_GetTick(); + /* Wait till PLLSAI is ready */ + while(__HAL_RCC_PLLSAI_GET_FLAG() == RESET) + { + if((HAL_GetTick() - tickstart ) > PLLSAI_TIMEOUT_VALUE) + { + /* return in case of Timeout detected */ + return HAL_TIMEOUT; + } + } + } + return HAL_OK; +} + +/** + * @brief Get the RCC_PeriphCLKInitTypeDef according to the internal + * RCC configuration registers. + * @param PeriphClkInit: pointer to an RCC_PeriphCLKInitTypeDef structure that + * will be configured. + * @retval None + */ +void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) +{ + uint32_t tempreg; + + /* Set all possible values for the extended clock type parameter------------*/ + PeriphClkInit->PeriphClockSelection = RCC_PERIPHCLK_I2S_APB1 | RCC_PERIPHCLK_I2S_APB2 |\ + RCC_PERIPHCLK_SAI1 | RCC_PERIPHCLK_SAI2 |\ + RCC_PERIPHCLK_TIM | RCC_PERIPHCLK_RTC |\ + RCC_PERIPHCLK_CEC | RCC_PERIPHCLK_FMPI2C1 |\ + RCC_PERIPHCLK_CK48 | RCC_PERIPHCLK_SDIO |\ + RCC_PERIPHCLK_SPDIFRX; + + /* Get the PLLI2S Clock configuration -----------------------------------------------*/ + PeriphClkInit->PLLI2S.PLLI2SM = (uint32_t)((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SM)); + PeriphClkInit->PLLI2S.PLLI2SN = (uint32_t)((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SN)); + PeriphClkInit->PLLI2S.PLLI2SP = (uint32_t)((((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SP) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SP)) + 1) << 1); + PeriphClkInit->PLLI2S.PLLI2SQ = (uint32_t)((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SQ) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SQ)); + PeriphClkInit->PLLI2S.PLLI2SR = (uint32_t)((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)); + /* Get the PLLSAI Clock configuration -----------------------------------------------*/ + PeriphClkInit->PLLSAI.PLLSAIM = (uint32_t)((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIM) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIM)); + PeriphClkInit->PLLSAI.PLLSAIN = (uint32_t)((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIN) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIN)); + PeriphClkInit->PLLSAI.PLLSAIP = (uint32_t)((((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIP) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIP)) + 1) << 1); + PeriphClkInit->PLLSAI.PLLSAIQ = (uint32_t)((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIQ)); + /* Get the PLLSAI/PLLI2S division factors -------------------------------------------*/ + PeriphClkInit->PLLI2SDivQ = (uint32_t)((RCC->DCKCFGR & RCC_DCKCFGR_PLLI2SDIVQ) >> POSITION_VAL(RCC_DCKCFGR_PLLI2SDIVQ)); + PeriphClkInit->PLLSAIDivQ = (uint32_t)((RCC->DCKCFGR & RCC_DCKCFGR_PLLSAIDIVQ) >> POSITION_VAL(RCC_DCKCFGR_PLLSAIDIVQ)); + + /* Get the SAI1 clock configuration ----------------------------------------------*/ + PeriphClkInit->Sai1ClockSelection = __HAL_RCC_GET_SAI1_SOURCE(); + + /* Get the SAI2 clock configuration ----------------------------------------------*/ + PeriphClkInit->Sai2ClockSelection = __HAL_RCC_GET_SAI2_SOURCE(); + + /* Get the I2S APB1 clock configuration ------------------------------------------*/ + PeriphClkInit->I2sApb1ClockSelection = __HAL_RCC_GET_I2S_APB1_SOURCE(); + + /* Get the I2S APB2 clock configuration ------------------------------------------*/ + PeriphClkInit->I2sApb2ClockSelection = __HAL_RCC_GET_I2S_APB2_SOURCE(); + + /* Get the RTC Clock configuration -----------------------------------------------*/ + tempreg = (RCC->CFGR & RCC_CFGR_RTCPRE); + PeriphClkInit->RTCClockSelection = (uint32_t)((tempreg) | (RCC->BDCR & RCC_BDCR_RTCSEL)); + + /* Get the CEC clock configuration -----------------------------------------------*/ + PeriphClkInit->CecClockSelection = __HAL_RCC_GET_CEC_SOURCE(); + + /* Get the FMPI2C1 clock configuration -----------------------------------------------*/ + PeriphClkInit->Fmpi2c1ClockSelection = __HAL_RCC_GET_FMPI2C1_SOURCE(); + + /* Get the CK48 clock configuration -----------------------------------------------*/ + PeriphClkInit->Clk48ClockSelection = __HAL_RCC_GET_CLK48_SOURCE(); + + /* Get the SDIO clock configuration -----------------------------------------------*/ + PeriphClkInit->SdioClockSelection = __HAL_RCC_GET_SDIO_SOURCE(); + + /* Get the SPDIFRX clock configuration ----------------------------------------------*/ + PeriphClkInit->SpdifClockSelection = __HAL_RCC_GET_SPDIFRX_SOURCE(); + + /* Get the TIM Prescaler configuration --------------------------------------------*/ + if ((RCC->DCKCFGR & RCC_DCKCFGR_TIMPRE) == RESET) + { + PeriphClkInit->TIMPresSelection = RCC_TIMPRES_DESACTIVATED; + } + else + { + PeriphClkInit->TIMPresSelection = RCC_TIMPRES_ACTIVATED; + } +} + +/** + * @brief Return the peripheral clock frequency for a given peripheral(SAI..) + * @note Return 0 if peripheral clock identifier not managed by this API + * @param PeriphClk: Peripheral clock identifier + * This parameter can be one of the following values: + * @arg RCC_PERIPHCLK_SAI1: SAI1 peripheral clock + * @arg RCC_PERIPHCLK_SAI2: SAI2 peripheral clock + * @retval Frequency in KHz + */ +uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk) +{ + uint32_t tmpreg1 = 0; + /* This variable used to store the SAI clock frequency (value in Hz) */ + uint32_t frequency = 0; + /* This variable used to store the VCO Input (value in Hz) */ + uint32_t vcoinput = 0; + /* This variable used to store the SAI clock source */ + uint32_t saiclocksource = 0; + if ((PeriphClk == RCC_PERIPHCLK_SAI1) || (PeriphClk == RCC_PERIPHCLK_SAI2)) + { + saiclocksource = RCC->DCKCFGR; + saiclocksource &= (RCC_DCKCFGR_SAI1SRC | RCC_DCKCFGR_SAI2SRC); + switch (saiclocksource) + { + case 0: /* PLLSAI is the clock source for SAI*/ + { + /* Configure the PLLSAI division factor */ + /* PLLSAI_VCO Input = PLL_SOURCE/PLLSAIM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI) + { + /* In Case the PLL Source is HSI (Internal Clock) */ + vcoinput = (HSI_VALUE / (uint32_t)(RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIM)); + } + else + { + /* In Case the PLL Source is HSE (External Clock) */ + vcoinput = ((HSE_VALUE / (uint32_t)(RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIM))); + } + /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN */ + /* SAI_CLK(first level) = PLLSAI_VCO Output/PLLSAIQ */ + tmpreg1 = (RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> 24; + frequency = (vcoinput * ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIN) >> 6))/(tmpreg1); + + /* SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ */ + tmpreg1 = (((RCC->DCKCFGR & RCC_DCKCFGR_PLLSAIDIVQ) >> 8) + 1); + frequency = frequency/(tmpreg1); + break; + } + case RCC_DCKCFGR_SAI1SRC_0: /* PLLI2S is the clock source for SAI*/ + case RCC_DCKCFGR_SAI2SRC_0: /* PLLI2S is the clock source for SAI*/ + { + /* Configure the PLLI2S division factor */ + /* PLLI2S_VCO Input = PLL_SOURCE/PLLI2SM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI) + { + /* In Case the PLL Source is HSI (Internal Clock) */ + vcoinput = (HSI_VALUE / (uint32_t)(RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM)); + } + else + { + /* In Case the PLL Source is HSE (External Clock) */ + vcoinput = ((HSE_VALUE / (uint32_t)(RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SM))); + } + + /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ + /* SAI_CLK(first level) = PLLI2S_VCO Output/PLLI2SQ */ + tmpreg1 = (RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SQ) >> 24; + frequency = (vcoinput * ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6))/(tmpreg1); + + /* SAI_CLK_x = SAI_CLK(first level)/PLLI2SDIVQ */ + tmpreg1 = ((RCC->DCKCFGR & RCC_DCKCFGR_PLLI2SDIVQ) + 1); + frequency = frequency/(tmpreg1); + break; + } + case RCC_DCKCFGR_SAI1SRC_1: /* PLLR is the clock source for SAI*/ + case RCC_DCKCFGR_SAI2SRC_1: /* PLLR is the clock source for SAI*/ + { + /* Configure the PLLI2S division factor */ + /* PLL_VCO Input = PLL_SOURCE/PLLM */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI) + { + /* In Case the PLL Source is HSI (Internal Clock) */ + vcoinput = (HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); + } + else + { + /* In Case the PLL Source is HSE (External Clock) */ + vcoinput = ((HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM))); + } + + /* PLL_VCO Output = PLL_VCO Input * PLLN */ + /* SAI_CLK_x = PLL_VCO Output/PLLR */ + tmpreg1 = (RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 28; + frequency = (vcoinput * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6))/(tmpreg1); + break; + } + case RCC_DCKCFGR_SAI1SRC: /* External clock is the clock source for SAI*/ + { + frequency = EXTERNAL_CLOCK_VALUE; + break; + } + case RCC_DCKCFGR_SAI2SRC: /* PLLSRC(HSE or HSI) is the clock source for SAI*/ + { + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI) + { + /* In Case the PLL Source is HSI (Internal Clock) */ + frequency = (uint32_t)(HSI_VALUE); + } + else + { + /* In Case the PLL Source is HSE (External Clock) */ + frequency = (uint32_t)(HSE_VALUE); + } + break; + } + default : + { + break; + } + } + } + return frequency; +} -/** @defgroup RCCEx_Private_Functions - * @{ - */ +#endif /* STM32F446xx */ -/** @defgroup RCCEx_Group1 Extended Peripheral Control functions - * @brief Extended Peripheral Control functions - * -@verbatim - =============================================================================== - ##### Extended Peripheral Control functions ##### - =============================================================================== - [..] - This subsection provides a set of functions allowing to control the RCC Clocks - frequencies. - [..] - (@) Important note: Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to - select the RTC clock source; in this case the Backup domain will be reset in - order to modify the RTC Clock source, as consequence RTC registers (including - the backup registers) and RCC_BDCR register are set to their reset values. - -@endverbatim - * @{ - */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) /** * @brief Initializes the RCC extended peripherals clocks according to the specified * parameters in the RCC_PeriphCLKInitTypeDef. @@ -103,7 +703,7 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) { uint32_t tickstart = 0; - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; /* Check the parameters */ assert_param(IS_RCC_PERIPHCLOCK(PeriphClkInit->PeriphClockSelection)); @@ -156,12 +756,12 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk assert_param(IS_RCC_PLLI2S_DIVQ_VALUE(PeriphClkInit->PLLI2SDivQ)); /* Read PLLI2SR value from PLLI2SCFGR register (this value is not need for SAI configuration) */ - tmpreg = ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)); + tmpreg1 = ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)); /* Configure the PLLI2S division factors */ /* PLLI2S_VCO Input = PLL_SOURCE/PLLM */ /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ /* SAI_CLK(first level) = PLLI2S_VCO Output/PLLI2SQ */ - __HAL_RCC_PLLI2S_SAICLK_CONFIG(PeriphClkInit->PLLI2S.PLLI2SN , PeriphClkInit->PLLI2S.PLLI2SQ , tmpreg); + __HAL_RCC_PLLI2S_SAICLK_CONFIG(PeriphClkInit->PLLI2S.PLLI2SN , PeriphClkInit->PLLI2S.PLLI2SQ , tmpreg1); /* SAI_CLK_x = SAI_CLK(first level)/PLLI2SDIVQ */ __HAL_RCC_PLLI2S_PLLSAICLKDIVQ_CONFIG(PeriphClkInit->PLLI2SDivQ); } @@ -215,11 +815,11 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk assert_param(IS_RCC_PLLSAI_DIVQ_VALUE(PeriphClkInit->PLLSAIDivQ)); /* Read PLLSAIR value from PLLSAICFGR register (this value is not need for SAI configuration) */ - tmpreg = ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIR) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIR)); + tmpreg1 = ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIR) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIR)); /* PLLSAI_VCO Input = PLL_SOURCE/PLLM */ /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN */ /* SAI_CLK(first level) = PLLSAI_VCO Output/PLLSAIQ */ - __HAL_RCC_PLLSAI_CONFIG(PeriphClkInit->PLLSAI.PLLSAIN , PeriphClkInit->PLLSAI.PLLSAIQ, tmpreg); + __HAL_RCC_PLLSAI_CONFIG(PeriphClkInit->PLLSAI.PLLSAIN , PeriphClkInit->PLLSAI.PLLSAIQ, tmpreg1); /* SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ */ __HAL_RCC_PLLSAI_PLLSAICLKDIVQ_CONFIG(PeriphClkInit->PLLSAIDivQ); } @@ -231,11 +831,11 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk assert_param(IS_RCC_PLLSAI_DIVR_VALUE(PeriphClkInit->PLLSAIDivR)); /* Read PLLSAIR value from PLLSAICFGR register (this value is not need for SAI configuration) */ - tmpreg = ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIQ)); + tmpreg1 = ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> POSITION_VAL(RCC_PLLSAICFGR_PLLSAIQ)); /* PLLSAI_VCO Input = PLL_SOURCE/PLLM */ /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN */ /* LTDC_CLK(first level) = PLLSAI_VCO Output/PLLSAIR */ - __HAL_RCC_PLLSAI_CONFIG(PeriphClkInit->PLLSAI.PLLSAIN , tmpreg, PeriphClkInit->PLLSAI.PLLSAIR); + __HAL_RCC_PLLSAI_CONFIG(PeriphClkInit->PLLSAI.PLLSAIN , tmpreg1, PeriphClkInit->PLLSAI.PLLSAIR); /* LTDC_CLK = LTDC_CLK(first level)/PLLSAIDIVR */ __HAL_RCC_PLLSAI_PLLSAICLKDIVR_CONFIG(PeriphClkInit->PLLSAIDivR); } @@ -259,7 +859,7 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_RTC) == (RCC_PERIPHCLK_RTC)) { /* Enable Power Clock*/ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Enable write access to Backup domain */ PWR->CR |= PWR_CR_DBP; @@ -269,22 +869,22 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk while((PWR->CR & PWR_CR_DBP) == RESET) { - if((HAL_GetTick() - tickstart ) > DBP_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_DBP_TIMEOUT_VALUE) { return HAL_TIMEOUT; } } - /* Reset the Backup domain only if the RTC Clock source selction is modified */ + /* Reset the Backup domain only if the RTC Clock source selection is modified */ if((RCC->BDCR & RCC_BDCR_RTCSEL) != (PeriphClkInit->RTCClockSelection & RCC_BDCR_RTCSEL)) { /* Store the content of BDCR register before the reset of Backup Domain */ - tmpreg = (RCC->BDCR & ~(RCC_BDCR_RTCSEL)); + tmpreg1 = (RCC->BDCR & ~(RCC_BDCR_RTCSEL)); /* RTC Clock selection can be changed only if the Backup Domain is reset */ __HAL_RCC_BACKUPRESET_FORCE(); __HAL_RCC_BACKUPRESET_RELEASE(); /* Restore the Content of BDCR register */ - RCC->BDCR = tmpreg; + RCC->BDCR = tmpreg1; } /* If LSE is selected as RTC clock source, wait for LSE reactivation */ @@ -296,7 +896,7 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk /* Wait till LSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { - if((HAL_GetTick() - tickstart ) > LSE_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; } @@ -352,6 +952,7 @@ void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) PeriphClkInit->TIMPresSelection = RCC_TIMPRES_ACTIVATED; } } + #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) ||\ @@ -371,7 +972,7 @@ void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) { uint32_t tickstart = 0; - uint32_t tmpreg = 0; + uint32_t tmpreg1 = 0; /* Check the parameters */ assert_param(IS_RCC_PERIPHCLOCK(PeriphClkInit->PeriphClockSelection)); @@ -430,7 +1031,7 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_RTC) == (RCC_PERIPHCLK_RTC)) { /* Enable Power Clock*/ - __PWR_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); /* Enable write access to Backup domain */ PWR->CR |= PWR_CR_DBP; @@ -440,22 +1041,22 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk while((PWR->CR & PWR_CR_DBP) == RESET) { - if((HAL_GetTick() - tickstart ) > DBP_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_DBP_TIMEOUT_VALUE) { return HAL_TIMEOUT; } } - /* Reset the Backup domain only if the RTC Clock source selction is modified */ + /* Reset the Backup domain only if the RTC Clock source selection is modified */ if((RCC->BDCR & RCC_BDCR_RTCSEL) != (PeriphClkInit->RTCClockSelection & RCC_BDCR_RTCSEL)) { /* Store the content of BDCR register before the reset of Backup Domain */ - tmpreg = (RCC->BDCR & ~(RCC_BDCR_RTCSEL)); + tmpreg1 = (RCC->BDCR & ~(RCC_BDCR_RTCSEL)); /* RTC Clock selection can be changed only if the Backup Domain is reset */ __HAL_RCC_BACKUPRESET_FORCE(); __HAL_RCC_BACKUPRESET_RELEASE(); /* Restore the Content of BDCR register */ - RCC->BDCR = tmpreg; + RCC->BDCR = tmpreg1; } /* If LSE is selected as RTC clock source, wait for LSE reactivation */ @@ -467,7 +1068,7 @@ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClk /* Wait till LSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { - if((HAL_GetTick() - tickstart ) > LSE_TIMEOUT_VALUE) + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; } @@ -506,7 +1107,7 @@ void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) } #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ -#if defined(STM32F411xE) +#if defined(STM32F411xE) || defined(STM32F446xx) /** * @brief Select LSE mode * @@ -532,7 +1133,534 @@ void HAL_RCCEx_SelectLSEMode(uint8_t Mode) } } -#endif /* STM32F411xE */ +#endif /* STM32F411xE || STM32F446xx */ + +#if defined(STM32F446xx) +/** + * @brief Initializes the RCC Oscillators according to the specified parameters in the + * RCC_OscInitTypeDef. + * @param RCC_OscInitStruct: pointer to an RCC_OscInitTypeDef structure that + * contains the configuration information for the RCC Oscillators. + * @note The PLL is not disabled when used as system clock. + * @note This function add the PLL/PLLR factor management during PLL configuration this feature is only available in STM32F446xx devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +{ + uint32_t tickstart = 0; + + /* Check the parameters */ + assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType)); + /*------------------------------- HSE Configuration ------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) + { + /* Check the parameters */ + assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState)); + /* When the HSE is used as system clock or clock source for PLL in these cases HSE will not disabled */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) ||\ + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE)) ||\ + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLLR) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE))) + { + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) + { + return HAL_ERROR; + } + } + else + { + /* Reset HSEON and HSEBYP bits before configuring the HSE --------------*/ + __HAL_RCC_HSE_CONFIG(RCC_HSE_OFF); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till HSE is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Set the new HSE configuration ---------------------------------------*/ + __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); + + /* Check the HSE State */ + if((RCC_OscInitStruct->HSEState) != RCC_HSE_OFF) + { + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till HSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till HSE is bypassed or disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + } + /*----------------------------- HSI Configuration --------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) + { + /* Check the parameters */ + assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState)); + assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue)); + + /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) ||\ + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI)) ||\ + ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLLR) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI))) + { + /* When HSI is used as system clock it will not disabled */ + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) + { + return HAL_ERROR; + } + /* Otherwise, just the calibration is allowed */ + else + { + /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ + __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); + } + } + else + { + /* Check the HSI State */ + if((RCC_OscInitStruct->HSIState)!= RCC_HSI_OFF) + { + /* Enable the Internal High Speed oscillator (HSI). */ + __HAL_RCC_HSI_ENABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till HSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ + __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); + } + else + { + /* Disable the Internal High Speed oscillator (HSI). */ + __HAL_RCC_HSI_DISABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till HSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + } + /*------------------------------ LSI Configuration -------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) + { + /* Check the parameters */ + assert_param(IS_RCC_LSI(RCC_OscInitStruct->LSIState)); + + /* Check the LSI State */ + if((RCC_OscInitStruct->LSIState)!= RCC_LSI_OFF) + { + /* Enable the Internal Low Speed oscillator (LSI). */ + __HAL_RCC_LSI_ENABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till LSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Disable the Internal Low Speed oscillator (LSI). */ + __HAL_RCC_LSI_DISABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till LSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + /*------------------------------ LSE Configuration -------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) + { + /* Check the parameters */ + assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState)); + + /* Enable Power Clock*/ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* Enable write access to Backup domain */ + PWR->CR |= PWR_CR_DBP; + + /* Wait for Backup domain Write protection disable */ + tickstart = HAL_GetTick(); + + while((PWR->CR & PWR_CR_DBP) == RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_DBP_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Reset LSEON and LSEBYP bits before configuring the LSE ----------------*/ + __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Set the new LSE configuration -----------------------------------------*/ + __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState); + /* Check the LSE State */ + if((RCC_OscInitStruct->LSEState) != RCC_LSE_OFF) + { + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + /*-------------------------------- PLL Configuration -----------------------*/ + /* Check the parameters */ + assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState)); + if ((RCC_OscInitStruct->PLL.PLLState) != RCC_PLL_NONE) + { + /* Check if the PLL is used as system clock or not */ + if(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL) + { + if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_ON) + { + /* Check the parameters */ + assert_param(IS_RCC_PLLSOURCE(RCC_OscInitStruct->PLL.PLLSource)); + assert_param(IS_RCC_PLLM_VALUE(RCC_OscInitStruct->PLL.PLLM)); + assert_param(IS_RCC_PLLN_VALUE(RCC_OscInitStruct->PLL.PLLN)); + assert_param(IS_RCC_PLLP_VALUE(RCC_OscInitStruct->PLL.PLLP)); + assert_param(IS_RCC_PLLQ_VALUE(RCC_OscInitStruct->PLL.PLLQ)); + assert_param(IS_RCC_PLLR_VALUE(RCC_OscInitStruct->PLL.PLLR)); + + /* Disable the main PLL. */ + __HAL_RCC_PLL_DISABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Configure the main PLL clock source, multiplication and division factors. */ + __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource, + RCC_OscInitStruct->PLL.PLLM, + RCC_OscInitStruct->PLL.PLLN, + RCC_OscInitStruct->PLL.PLLP, + RCC_OscInitStruct->PLL.PLLQ, + RCC_OscInitStruct->PLL.PLLR); + + /* Enable the main PLL. */ + __HAL_RCC_PLL_ENABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Disable the main PLL. */ + __HAL_RCC_PLL_DISABLE(); + + /* Get Start Tick*/ + tickstart = HAL_GetTick(); + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + else + { + return HAL_ERROR; + } + } + return HAL_OK; +} + +/** + * @brief Configures the RCC_OscInitStruct according to the internal + * RCC configuration registers. + * @param RCC_OscInitStruct: pointer to an RCC_OscInitTypeDef structure that will be configured. + * + * @note This function is only available in case of STM32F446xx devices. + * @note This function add the PLL/PLLR factor management + * @retval None + */ +void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +{ + /* Set all possible values for the Oscillator type parameter ---------------*/ + RCC_OscInitStruct->OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_LSI; + + /* Get the HSE configuration -----------------------------------------------*/ + if((RCC->CR &RCC_CR_HSEBYP) == RCC_CR_HSEBYP) + { + RCC_OscInitStruct->HSEState = RCC_HSE_BYPASS; + } + else if((RCC->CR &RCC_CR_HSEON) == RCC_CR_HSEON) + { + RCC_OscInitStruct->HSEState = RCC_HSE_ON; + } + else + { + RCC_OscInitStruct->HSEState = RCC_HSE_OFF; + } + + /* Get the HSI configuration -----------------------------------------------*/ + if((RCC->CR &RCC_CR_HSION) == RCC_CR_HSION) + { + RCC_OscInitStruct->HSIState = RCC_HSI_ON; + } + else + { + RCC_OscInitStruct->HSIState = RCC_HSI_OFF; + } + + RCC_OscInitStruct->HSICalibrationValue = (uint32_t)((RCC->CR &RCC_CR_HSITRIM) >> POSITION_VAL(RCC_CR_HSITRIM)); + + /* Get the LSE configuration -----------------------------------------------*/ + if((RCC->BDCR &RCC_BDCR_LSEBYP) == RCC_BDCR_LSEBYP) + { + RCC_OscInitStruct->LSEState = RCC_LSE_BYPASS; + } + else if((RCC->BDCR &RCC_BDCR_LSEON) == RCC_BDCR_LSEON) + { + RCC_OscInitStruct->LSEState = RCC_LSE_ON; + } + else + { + RCC_OscInitStruct->LSEState = RCC_LSE_OFF; + } + + /* Get the LSI configuration -----------------------------------------------*/ + if((RCC->CSR &RCC_CSR_LSION) == RCC_CSR_LSION) + { + RCC_OscInitStruct->LSIState = RCC_LSI_ON; + } + else + { + RCC_OscInitStruct->LSIState = RCC_LSI_OFF; + } + + /* Get the PLL configuration -----------------------------------------------*/ + if((RCC->CR &RCC_CR_PLLON) == RCC_CR_PLLON) + { + RCC_OscInitStruct->PLL.PLLState = RCC_PLL_ON; + } + else + { + RCC_OscInitStruct->PLL.PLLState = RCC_PLL_OFF; + } + RCC_OscInitStruct->PLL.PLLSource = (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); + RCC_OscInitStruct->PLL.PLLM = (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM); + RCC_OscInitStruct->PLL.PLLN = (uint32_t)((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN)); + RCC_OscInitStruct->PLL.PLLP = (uint32_t)((((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) + RCC_PLLCFGR_PLLP_0) << 1) >> POSITION_VAL(RCC_PLLCFGR_PLLP)); + RCC_OscInitStruct->PLL.PLLQ = (uint32_t)((RCC->PLLCFGR & RCC_PLLCFGR_PLLQ) >> POSITION_VAL(RCC_PLLCFGR_PLLQ)); + RCC_OscInitStruct->PLL.PLLR = (uint32_t)((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> POSITION_VAL(RCC_PLLCFGR_PLLR)); +} + +/** + * @brief Returns the SYSCLK frequency + * + * @note This function is only available in case of STM32F446xx devices. + * @note This function add the PLL/PLLR System clock source + * + * @note The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * @note If SYSCLK source is HSI, function returns values based on HSI_VALUE(*) + * @note If SYSCLK source is HSE, function returns values based on HSE_VALUE(**) + * @note If SYSCLK source is PLL, function returns values based on HSE_VALUE(**) + * or HSI_VALUE(*) multiplied/divided by the PLL factors. + * @note (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value + * 16 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * @note (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value + * 25 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * @note The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @note This function can be used by the user application to compute the + * baudrate for the communication peripherals or configure other parameters. + * + * @note Each time SYSCLK changes, this function must be called to update the + * right SYSCLK value. Otherwise, any configuration based on this function will be incorrect. + * + * + * @retval SYSCLK frequency + */ +uint32_t HAL_RCC_GetSysClockFreq(void) +{ + uint32_t pllm = 0; + uint32_t pllvco = 0; + uint32_t pllp = 0; + uint32_t pllr = 0; + uint32_t sysclockfreq = 0; + + /* Get SYSCLK source -------------------------------------------------------*/ + switch (RCC->CFGR & RCC_CFGR_SWS) + { + case RCC_CFGR_SWS_HSI: /* HSI used as system clock source */ + { + sysclockfreq = HSI_VALUE; + break; + } + case RCC_CFGR_SWS_HSE: /* HSE used as system clock source */ + { + sysclockfreq = HSE_VALUE; + break; + } + case RCC_CFGR_SWS_PLL: /* PLL/PLLP used as system clock source */ + { + /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN + SYSCLK = PLL_VCO / PLLP */ + pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; + if(__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI) + { + /* HSE used as PLL clock source */ + pllvco = ((HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN))); + } + else + { + /* HSI used as PLL clock source */ + pllvco = ((HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN))); + } + pllp = ((((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> POSITION_VAL(RCC_PLLCFGR_PLLP)) + 1 ) *2); + + sysclockfreq = pllvco/pllp; + break; + } + case RCC_CFGR_SWS_PLLR: /* PLL/PLLR used as system clock source */ + { + /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN + SYSCLK = PLL_VCO / PLLR */ + pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; + if(__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI) + { + /* HSE used as PLL clock source */ + pllvco = ((HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN))); + } + else + { + /* HSI used as PLL clock source */ + pllvco = ((HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN))); + } + pllr = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> POSITION_VAL(RCC_PLLCFGR_PLLR)); + + sysclockfreq = pllvco/pllr; + break; + } + default: + { + sysclockfreq = HSI_VALUE; + break; + } + } + return sysclockfreq; +} +#endif /* STM32F446xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.h index 639a8c45f19..2cb37e997cf 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_rcc_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of RCC HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,8 +54,141 @@ * @{ */ -/* Exported types ------------------------------------------------------------*/ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +/* Exported types ------------------------------------------------------------*/ +/** @defgroup RCCEx_Exported_Types RCCEx Exported Types + * @{ + */ + +/** + * @brief RCC PLL configuration structure definition + */ +typedef struct +{ + uint32_t PLLState; /*!< The new state of the PLL. + This parameter can be a value of @ref RCC_PLL_Config */ + + uint32_t PLLSource; /*!< RCC_PLLSource: PLL entry clock source. + This parameter must be a value of @ref RCC_PLL_Clock_Source */ + + uint32_t PLLM; /*!< PLLM: Division factor for PLL VCO input clock. + This parameter must be a number between Min_Data = 0 and Max_Data = 63 */ + + uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock. + This parameter must be a number between Min_Data = 192 and Max_Data = 432 */ + + uint32_t PLLP; /*!< PLLP: Division factor for main system clock (SYSCLK). + This parameter must be a value of @ref RCC_PLLP_Clock_Divider */ + + uint32_t PLLQ; /*!< PLLQ: Division factor for OTG FS, SDIO and RNG clocks. + This parameter must be a number between Min_Data = 4 and Max_Data = 15 */ +#if defined(STM32F446xx) + uint32_t PLLR; /*!< PLLR: PLL division factor for I2S, SAI, SYSTEM, SPDIFRX clocks. + This parameter is only available in STM32F446xx devices. + This parameter must be a number between Min_Data = 2 and Max_Data = 7 */ +#endif /* STM32F446xx */ +}RCC_PLLInitTypeDef; + +#if defined(STM32F446xx) +/** + * @brief PLLI2S Clock structure definition + */ +typedef struct +{ + uint32_t PLLI2SM; /*!< Specifies division factor for PLL VCO input clock. + This parameter must be a number between Min_Data = 2 and Max_Data = 63 */ + + uint32_t PLLI2SN; /*!< Specifies the multiplication factor for PLLI2S VCO output clock. + This parameter must be a number between Min_Data = 192 and Max_Data = 432 */ + + uint32_t PLLI2SP; /*!< Specifies division factor for SPDIFRX Clock. + This parameter must be a value of @ref RCCEx_PLLI2SP_Clock_Divider */ + + uint32_t PLLI2SQ; /*!< Specifies the division factor for SAI clock. + This parameter must be a number between Min_Data = 2 and Max_Data = 15. + This parameter will be used only when PLLI2S is selected as Clock Source SAI */ + + uint32_t PLLI2SR; /*!< Specifies the division factor for I2S clock. + This parameter must be a number between Min_Data = 2 and Max_Data = 7. + This parameter will be used only when PLLI2S is selected as Clock Source I2S */ +}RCC_PLLI2SInitTypeDef; + +/** + * @brief PLLSAI Clock structure definition + */ +typedef struct +{ + uint32_t PLLSAIM; /*!< Spcifies division factor for PLL VCO input clock. + This parameter must be a number between Min_Data = 2 and Max_Data = 63 */ + + uint32_t PLLSAIN; /*!< Specifies the multiplication factor for PLLI2S VCO output clock. + This parameter must be a number between Min_Data = 192 and Max_Data = 432 */ + + uint32_t PLLSAIP; /*!< Specifies division factor for OTG FS, SDIO and RNG clocks. + This parameter must be a value of @ref RCCEx_PLLSAIP_Clock_Divider */ + + uint32_t PLLSAIQ; /*!< Specifies the division factor for SAI clock. + This parameter must be a number between Min_Data = 2 and Max_Data = 15. + This parameter will be used only when PLLSAI is selected as Clock Source SAI */ +}RCC_PLLSAIInitTypeDef; +/** + * @brief RCC extended clocks structure definition + */ +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + RCC_PLLI2SInitTypeDef PLLI2S; /*!< PLL I2S structure parameters. + This parameter will be used only when PLLI2S is selected as Clock Source I2S or SAI */ + + RCC_PLLSAIInitTypeDef PLLSAI; /*!< PLL SAI structure parameters. + This parameter will be used only when PLLI2S is selected as Clock Source SAI or LTDC */ + + uint32_t PLLI2SDivQ; /*!< Specifies the PLLI2S division factor for SAI1 clock. + This parameter must be a number between Min_Data = 1 and Max_Data = 32 + This parameter will be used only when PLLI2S is selected as Clock Source SAI */ + + uint32_t PLLSAIDivQ; /*!< Specifies the PLLI2S division factor for SAI1 clock. + This parameter must be a number between Min_Data = 1 and Max_Data = 32 + This parameter will be used only when PLLSAI is selected as Clock Source SAI */ + + uint32_t Sai1ClockSelection; /*!< Specifies SAI1 Clock Source Selection. + This parameter can be a value of @ref RCCEx_SAI1_Clock_Source */ + + uint32_t Sai2ClockSelection; /*!< Specifies SAI2 Clock Source Selection. + This parameter can be a value of @ref RCCEx_SAI2_Clock_Source */ + + uint32_t I2sApb1ClockSelection; /*!< Specifies I2S APB1 Clock Source Selection. + This parameter can be a value of @ref RCCEx_I2SAPB1_Clock_Source */ + + uint32_t I2sApb2ClockSelection; /*!< Specifies I2S APB2 Clock Source Selection. + This parameter can be a value of @ref RCCEx_I2SAPB2_Clock_Source */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Source Selection. + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t SdioClockSelection; /*!< Specifies SDIO Clock Source Selection. + This parameter can be a value of @ref RCCEx_SDIO_Clock_Source */ + + uint32_t CecClockSelection; /*!< Specifies CEC Clock Source Selection. + This parameter can be a value of @ref RCCEx_CEC_Clock_Source */ + + uint32_t Fmpi2c1ClockSelection; /*!< Specifies FMPI2C1 Clock Source Selection. + This parameter can be a value of @ref RCCEx_FMPI2C1_Clock_Source */ + + uint32_t SpdifClockSelection; /*!< Specifies SPDIFRX Clock Source Selection. + This parameter can be a value of @ref RCCEx_SPDIFRX_Clock_Source */ + + uint32_t Clk48ClockSelection; /*!< Specifies CK48 Clock Selection this clock used OTG FS, SDIO and RNG clocks. + This parameter can be a value of @ref RCCEx_CK48_Clock_Source */ + + uint8_t TIMPresSelection; /*!< Specifies TIM Clock Source Selection. + This parameter can be a value of @ref RCCEx_TIM_PRescaler_Selection */ +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /** * @brief PLLI2S Clock structure definition */ @@ -165,211 +298,365 @@ typedef struct }RCC_PeriphCLKInitTypeDef; #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup RCCEx_Exported_Constants +/** @defgroup RCCEx_Exported_Constants RCCEx Exported Constants * @{ */ -/** @defgroup RCCEx_Periph_Clock_Selection +/** @defgroup RCCEx_Periph_Clock_Selection RCC Periph Clock Selection * @{ */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +/*------------------------------- Peripheral Clock source for STM32F446xx -----------------------------*/ +#if defined(STM32F446xx) +#define RCC_PERIPHCLK_I2S_APB1 ((uint32_t)0x00000001) +#define RCC_PERIPHCLK_I2S_APB2 ((uint32_t)0x00000002) +#define RCC_PERIPHCLK_SAI1 ((uint32_t)0x00000004) +#define RCC_PERIPHCLK_SAI2 ((uint32_t)0x00000008) +#define RCC_PERIPHCLK_TIM ((uint32_t)0x00000010) +#define RCC_PERIPHCLK_RTC ((uint32_t)0x00000020) +#define RCC_PERIPHCLK_CEC ((uint32_t)0x00000040) +#define RCC_PERIPHCLK_FMPI2C1 ((uint32_t)0x00000080) +#define RCC_PERIPHCLK_CK48 ((uint32_t)0x00000100) +#define RCC_PERIPHCLK_SDIO ((uint32_t)0x00000200) +#define RCC_PERIPHCLK_SPDIFRX ((uint32_t)0x00000400) +#define RCC_PERIPHCLK_PLLI2S ((uint32_t)0x00000800) +#endif /* STM32F446xx */ +/*-----------------------------------------------------------------------------------------------------*/ + +/*--------------- Peripheral Clock source for STM32F42xxx/STM32F43xxx ---------------------*/ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) #define RCC_PERIPHCLK_I2S ((uint32_t)0x00000001) #define RCC_PERIPHCLK_SAI_PLLI2S ((uint32_t)0x00000002) #define RCC_PERIPHCLK_SAI_PLLSAI ((uint32_t)0x00000004) #define RCC_PERIPHCLK_LTDC ((uint32_t)0x00000008) #define RCC_PERIPHCLK_TIM ((uint32_t)0x00000010) #define RCC_PERIPHCLK_RTC ((uint32_t)0x00000020) -#define IS_RCC_PERIPHCLOCK(SELECTION) ((1 <= (SELECTION)) && ((SELECTION) <= 0x0000002F)) +#define RCC_PERIPHCLK_PLLI2S ((uint32_t)0x00000040) #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/*-----------------------------------------------------------------------------------------------------*/ +/*------------------------ Peripheral Clock source for STM32F40xxx/STM32F41xxx ------------------------*/ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) ||\ defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) #define RCC_PERIPHCLK_I2S ((uint32_t)0x00000001) #define RCC_PERIPHCLK_RTC ((uint32_t)0x00000002) -#define IS_RCC_PERIPHCLOCK(SELECTION) ((1 <= (SELECTION)) && ((SELECTION) <= 0x00000003)) +#define RCC_PERIPHCLK_PLLI2S ((uint32_t)0x00000004) #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ - +/*-----------------------------------------------------------------------------------------------------*/ /** * @} */ - -/** @defgroup RCCEx_BitAddress_AliasRegion - * @brief RCC registers bit address in the alias region + +/** @defgroup RCCEx_PLLSAI_DIVR RCC PLLSAI DIVR * @{ */ -/* --- CR Register ---*/ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) -/* Alias word address of PLLSAION bit */ -#define PLLSAION_BitNumber 0x1C -#define CR_PLLSAION_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (PLLSAION_BitNumber * 4)) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +#define RCC_PLLSAIDIVR_2 ((uint32_t)0x00000000) +#define RCC_PLLSAIDIVR_4 ((uint32_t)0x00010000) +#define RCC_PLLSAIDIVR_8 ((uint32_t)0x00020000) +#define RCC_PLLSAIDIVR_16 ((uint32_t)0x00030000) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +/** + * @} + */ -/* --- DCKCFGR Register ---*/ -/* Alias word address of TIMPRE bit */ -#define RCC_DCKCFGR_OFFSET (RCC_OFFSET + 0x8C) -#define TIMPRE_BitNumber 0x18 -#define DCKCFGR_TIMPRE_BB (PERIPH_BB_BASE + (RCC_DCKCFGR_OFFSET * 32) + (TIMPRE_BitNumber * 4)) +/** @defgroup RCCEx_PLLI2SP_Clock_Divider RCC PLLI2SP Clock Divider + * @{ + */ +#if defined(STM32F446xx) +#define RCC_PLLI2SP_DIV2 ((uint32_t)0x00000002) +#define RCC_PLLI2SP_DIV4 ((uint32_t)0x00000004) +#define RCC_PLLI2SP_DIV6 ((uint32_t)0x00000006) +#define RCC_PLLI2SP_DIV8 ((uint32_t)0x00000008) +#endif /* STM32F446xx */ /** * @} */ -/** @defgroup RCCEx_PLLI2S_Clock_Source +/** @defgroup RCCEx_PLLSAIP_Clock_Divider RCC PLLSAIP Clock Divider * @{ - */ -#define IS_RCC_PLLI2SQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15)) + */ +#if defined(STM32F446xx) +#define RCC_PLLSAIP_DIV2 ((uint32_t)0x00000002) +#define RCC_PLLSAIP_DIV4 ((uint32_t)0x00000004) +#define RCC_PLLSAIP_DIV6 ((uint32_t)0x00000006) +#define RCC_PLLSAIP_DIV8 ((uint32_t)0x00000008) +#endif /* STM32F446xx */ /** * @} */ -/** @defgroup RCCEx_PLLSAI_Clock_Source +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @defgroup RCCEx_SAI_BlockA_Clock_Source RCC SAI BlockA Clock Source + * @{ + */ +#define RCC_SAIACLKSOURCE_PLLSAI ((uint32_t)0x00000000) +#define RCC_SAIACLKSOURCE_PLLI2S ((uint32_t)0x00100000) +#define RCC_SAIACLKSOURCE_EXT ((uint32_t)0x00200000) +/** + * @} + */ + +/** @defgroup RCCEx_SAI_BlockB_Clock_Source RCC SAI BlockB Clock Source * @{ */ -#define IS_RCC_PLLSAIN_VALUE(VALUE) ((192 <= (VALUE)) && ((VALUE) <= 432)) -#define IS_RCC_PLLSAIQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15)) -#define IS_RCC_PLLSAIR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7)) +#define RCC_SAIBCLKSOURCE_PLLSAI ((uint32_t)0x00000000) +#define RCC_SAIBCLKSOURCE_PLLI2S ((uint32_t)0x00400000) +#define RCC_SAIBCLKSOURCE_EXT ((uint32_t)0x00800000) /** * @} + */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#if defined(STM32F446xx) +/** @defgroup RCCEx_SAI1_Clock_Source RCC SAI1 Clock Source + * @{ */ +#define RCC_SAI1CLKSOURCE_PLLSAI ((uint32_t)0x00000000) +#define RCC_SAI1CLKSOURCE_PLLI2S ((uint32_t)RCC_DCKCFGR_SAI1SRC_0) +#define RCC_SAI1CLKSOURCE_PLLR ((uint32_t)RCC_DCKCFGR_SAI1SRC_1) +#define RCC_SAI1CLKSOURCE_EXT ((uint32_t)RCC_DCKCFGR_SAI1SRC) +/** + * @} + */ -/** @defgroup RCCEx_PLLSAI_DIVQ +/** @defgroup RCCEx_SAI2_Clock_Source RCC SAI2 Clock Source * @{ - */ -#define IS_RCC_PLLSAI_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32)) + */ +#define RCC_SAI2CLKSOURCE_PLLSAI ((uint32_t)0x00000000) +#define RCC_SAI2CLKSOURCE_PLLI2S ((uint32_t)RCC_DCKCFGR_SAI2SRC_0) +#define RCC_SAI2CLKSOURCE_PLLR ((uint32_t)RCC_DCKCFGR_SAI2SRC_1) +#define RCC_SAI2CLKSOURCE_PLLSRC ((uint32_t)RCC_DCKCFGR_SAI2SRC) /** * @} */ -/** @defgroup RCCEx_PLLI2S_DIVQ +/** @defgroup RCCEx_I2SAPB1_Clock_Source RCC I2S APB1 Clock Source * @{ + */ +#define RCC_I2SAPB1CLKSOURCE_PLLI2S ((uint32_t)0x00000000) +#define RCC_I2SAPB1CLKSOURCE_EXT ((uint32_t)RCC_DCKCFGR_I2S1SRC_0) +#define RCC_I2SAPB1CLKSOURCE_PLLR ((uint32_t)RCC_DCKCFGR_I2S1SRC_1) +#define RCC_I2SAPB1CLKSOURCE_PLLSRC ((uint32_t)RCC_DCKCFGR_I2S1SRC) +/** + * @} */ -#define IS_RCC_PLLI2S_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32)) +/** @defgroup RCCEx_I2SAPB2_Clock_Source RCC I2S APB2 Clock Source + * @{ + */ +#define RCC_I2SAPB2CLKSOURCE_PLLI2S ((uint32_t)0x00000000) +#define RCC_I2SAPB2CLKSOURCE_EXT ((uint32_t)RCC_DCKCFGR_I2S2SRC_0) +#define RCC_I2SAPB2CLKSOURCE_PLLR ((uint32_t)RCC_DCKCFGR_I2S2SRC_1) +#define RCC_I2SAPB2CLKSOURCE_PLLSRC ((uint32_t)RCC_DCKCFGR_I2S2SRC) /** * @} */ -/** @defgroup RCCEx_PLLSAI_DIVR +/** @defgroup RCCEx_FMPI2C1_Clock_Source RCC FMPI2C1 Clock Source * @{ */ -#define RCC_PLLSAIDIVR_2 ((uint32_t)0x00000000) -#define RCC_PLLSAIDIVR_4 ((uint32_t)0x00010000) -#define RCC_PLLSAIDIVR_8 ((uint32_t)0x00020000) -#define RCC_PLLSAIDIVR_16 ((uint32_t)0x00030000) -#define IS_RCC_PLLSAI_DIVR_VALUE(VALUE) (((VALUE) == RCC_PLLSAIDIVR_2) ||\ - ((VALUE) == RCC_PLLSAIDIVR_4) ||\ - ((VALUE) == RCC_PLLSAIDIVR_8) ||\ - ((VALUE) == RCC_PLLSAIDIVR_16)) +#define RCC_FMPI2C1CLKSOURCE_APB ((uint32_t)0x00000000) +#define RCC_FMPI2C1CLKSOURCE_SYSCLK ((uint32_t)RCC_DCKCFGR2_FMPI2C1SEL_0) +#define RCC_FMPI2C1CLKSOURCE_HSI ((uint32_t)RCC_DCKCFGR2_FMPI2C1SEL_1) +/** + * @} + */ +/** @defgroup RCCEx_CEC_Clock_Source RCC CEC Clock Source + * @{ + */ +#define RCC_CECCLKSOURCE_HSI ((uint32_t)0x00000000) +#define RCC_CECCLKSOURCE_LSE ((uint32_t)RCC_DCKCFGR2_CECSEL) /** * @} */ - -/** @defgroup RCCEx_SAI_BlockA_Clock_Source + +/** @defgroup RCCEx_CK48_Clock_Source RCC CK48 Clock Source * @{ */ -#define RCC_SAIACLKSOURCE_PLLSAI ((uint32_t)0x00000000) -#define RCC_SAIACLKSOURCE_PLLI2S ((uint32_t)0x00100000) -#define RCC_SAIACLKSOURCE_EXT ((uint32_t)0x00200000) +#define RCC_CK48CLKSOURCE_PLLQ ((uint32_t)0x00000000) +#define RCC_CK48CLKSOURCE_PLLSAIP ((uint32_t)RCC_DCKCFGR2_CK48MSEL) /** * @} - */ + */ -/** @defgroup RCCEx_SAI_BlockB_Clock_Source +/** @defgroup RCCEx_SDIO_Clock_Source RCC SDIO Clock Source * @{ */ -#define RCC_SAIBCLKSOURCE_PLLSAI ((uint32_t)0x00000000) -#define RCC_SAIBCLKSOURCE_PLLI2S ((uint32_t)0x00400000) -#define RCC_SAIBCLKSOURCE_EXT ((uint32_t)0x00800000) +#define RCC_SDIOCLKSOURCE_CK48 ((uint32_t)0x00000000) +#define RCC_SDIOCLKSOURCE_SYSCLK ((uint32_t)RCC_DCKCFGR2_SDIOSEL) /** * @} - */ + */ -/** @defgroup RCCEx_TIM_PRescaler_Selection +/** @defgroup RCCEx_SPDIFRX_Clock_Source RCC SPDIFRX Clock Source * @{ */ -#define RCC_TIMPRES_DESACTIVATED ((uint8_t)0x00) -#define RCC_TIMPRES_ACTIVATED ((uint8_t)0x01) +#define RCC_SPDIFRXCLKSOURCE_PLLR ((uint32_t)0x00000000) +#define RCC_SPDIFRXCLKSOURCE_PLLI2SP ((uint32_t)RCC_DCKCFGR2_SPDIFRXSEL) /** * @} */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#endif /* STM32F446xx */ -#if defined(STM32F411xE) -/** @defgroup RCCEx_PLLI2S_PLLI2SM +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) +/** @defgroup RCCEx_TIM_PRescaler_Selection RCC TIM PRescaler Selection * @{ */ -#define IS_RCC_PLLI2SM_VALUE(VALUE) ((VALUE) <= 63) +#define RCC_TIMPRES_DESACTIVATED ((uint8_t)0x00) +#define RCC_TIMPRES_ACTIVATED ((uint8_t)0x01) /** * @} */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx) || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ -/** @defgroup RCCEx_LSE_Dual_Mode_Selection +#if defined(STM32F411xE) || defined(STM32F446xx) +/** @defgroup RCCEx_LSE_Dual_Mode_Selection RCC LSE Dual Mode Selection * @{ */ #define RCC_LSE_LOWPOWER_MODE ((uint8_t)0x00) #define RCC_LSE_HIGHDRIVE_MODE ((uint8_t)0x01) -#define IS_RCC_LSE_MODE(MODE) (((MODE) == RCC_LSE_LOWPOWER_MODE) ||\ - ((MODE) == RCC_LSE_HIGHDRIVE_MODE)) /** * @} */ - -#endif /* STM32F411xE */ +#endif /* STM32F411xE || STM32F446xx */ + /** * @} */ /* Exported macro ------------------------------------------------------------*/ - -/*----------------------------------- STM32F42xxx/STM32F43xxx----------------------------------*/ +/** @defgroup RCCEx_Exported_Macros RCCEx Exported Macros + * @{ + */ +/*------------------------------- STM32F42xxx/STM32F43xxx ----------------------------------*/ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) /** @brief Enables or disables the AHB1 peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. */ -#define __GPIOI_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOIEN)) -#define __GPIOF_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOFEN)) -#define __GPIOG_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOGEN)) -#define __GPIOJ_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOJEN)) -#define __GPIOK_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOKEN)) -#define __DMA2D_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_DMA2DEN)) -#define __ETHMAC_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACEN)) -#define __ETHMACTX_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACTXEN)) -#define __ETHMACRX_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACRXEN)) -#define __ETHMACPTP_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACPTPEN)) -#define __USB_OTG_HS_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_OTGHSEN)) -#define __USB_OTG_HS_ULPI_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_OTGHSULPIEN)) - -#define __GPIOF_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN)) -#define __GPIOG_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN)) -#define __GPIOI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOIEN)) -#define __GPIOJ_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOJEN)) -#define __GPIOK_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOKEN)) -#define __DMA2D_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA2DEN)) -#define __ETHMAC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACEN)) -#define __ETHMACTX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACTXEN)) -#define __ETHMACRX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACRXEN)) -#define __ETHMACPTP_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACPTPEN)) -#define __USB_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSEN)) -#define __USB_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSULPIEN)) +#define __HAL_RCC_GPIOI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOIEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOF_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOJ_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOJEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOJEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOK_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOKEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOKEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DMA2D_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2DEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2DEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMAC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMACTX_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACTXEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACTXEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMACRX_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACRXEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACRXEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMACPTP_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACPTPEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACPTPEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USB_OTG_HS_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN)) +#define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN)) +#define __HAL_RCC_GPIOI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOIEN)) +#define __HAL_RCC_GPIOJ_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOJEN)) +#define __HAL_RCC_GPIOK_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOKEN)) +#define __HAL_RCC_DMA2D_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA2DEN)) +#define __HAL_RCC_ETHMAC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACEN)) +#define __HAL_RCC_ETHMACTX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACTXEN)) +#define __HAL_RCC_ETHMACRX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACRXEN)) +#define __HAL_RCC_ETHMACPTP_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACPTPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSULPIEN)) /** * @brief Enable ETHERNET clock. */ -#define __ETH_CLK_ENABLE() do { \ - __ETHMAC_CLK_ENABLE(); \ - __ETHMACTX_CLK_ENABLE(); \ - __ETHMACRX_CLK_ENABLE(); \ - } while(0) +#define __HAL_RCC_ETH_CLK_ENABLE() do { \ + __HAL_RCC_ETHMAC_CLK_ENABLE(); \ + __HAL_RCC_ETHMACTX_CLK_ENABLE(); \ + __HAL_RCC_ETHMACRX_CLK_ENABLE(); \ + } while(0) /** * @brief Disable ETHERNET clock. */ -#define __ETH_CLK_DISABLE() do { \ - __ETHMACTX_CLK_DISABLE(); \ - __ETHMACRX_CLK_DISABLE(); \ - __ETHMAC_CLK_DISABLE(); \ - } while(0) +#define __HAL_RCC_ETH_CLK_DISABLE() do { \ + __HAL_RCC_ETHMACTX_CLK_DISABLE(); \ + __HAL_RCC_ETHMACRX_CLK_DISABLE(); \ + __HAL_RCC_ETHMAC_CLK_DISABLE(); \ + } while(0) /** @brief Enable or disable the AHB2 peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) @@ -377,15 +664,33 @@ typedef struct * using it. */ -#define __DCMI_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_DCMIEN)) -#define __DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_DCMIEN)) +#define __HAL_RCC_DCMI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_DCMIEN)) #if defined(STM32F437xx)|| defined(STM32F439xx) -#define __CRYP_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_CRYPEN)) -#define __HASH_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_HASHEN)) - -#define __CRYP_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_CRYPEN)) -#define __HASH_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_HASHEN)) +#define __HAL_RCC_CRYP_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_HASH_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_CRYP_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_CRYPEN)) +#define __HAL_RCC_HASH_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_HASHEN)) #endif /* STM32F437xx || STM32F439xx */ /** @brief Enables or disables the AHB3 peripheral clock. @@ -393,152 +698,277 @@ typedef struct * is disabled and the application software has to enable this clock before * using it. */ -#define __FMC_CLK_ENABLE() (RCC->AHB3ENR |= (RCC_AHB3ENR_FMCEN)) -#define __FMC_CLK_DISABLE() (RCC->AHB3ENR &= ~(RCC_AHB3ENR_FMCEN)) +#define __HAL_RCC_FMC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_FMC_CLK_DISABLE() (RCC->AHB3ENR &= ~(RCC_AHB3ENR_FMCEN)) /** @brief Enable or disable the Low Speed APB (APB1) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. */ -#define __TIM6_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM6EN)) -#define __TIM7_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM7EN)) -#define __TIM12_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM12EN)) -#define __TIM13_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM13EN)) -#define __TIM14_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM14EN)) -#define __WWDG_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_WWDGEN)) -#define __USART3_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_USART3EN)) -#define __UART4_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_UART4EN)) -#define __UART5_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_UART5EN)) -#define __CAN1_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_CAN1EN)) -#define __CAN2_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_CAN2EN)) -#define __DAC_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_DACEN)) -#define __UART7_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_UART7EN)) -#define __UART8_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_UART8EN)) - -#define __TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN)) -#define __TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN)) -#define __TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN)) -#define __TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN)) -#define __TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN)) -#define __WWDG_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_WWDGEN)) -#define __USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN)) -#define __UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN)) -#define __UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN)) -#define __CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN)) -#define __CAN2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN)) -#define __DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN)) -#define __UART7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART7EN)) -#define __UART8_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART8EN)) +#define __HAL_RCC_TIM6_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM7_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM12_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM13_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM14_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM14_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USART3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CAN1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CAN2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DAC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART7_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART7EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART7EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART8_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART8EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART8EN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN)) +#define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN)) +#define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN)) +#define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN)) +#define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN)) +#define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN)) +#define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN)) +#define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN)) +#define __HAL_RCC_CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN)) +#define __HAL_RCC_CAN2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN)) +#define __HAL_RCC_DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN)) +#define __HAL_RCC_UART7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART7EN)) +#define __HAL_RCC_UART8_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART8EN)) /** @brief Enable or disable the High Speed APB (APB2) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. */ -#define __TIM8_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_TIM8EN)) -#define __ADC2_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_ADC2EN)) -#define __ADC3_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_ADC3EN)) -#define __SPI5_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SPI5EN)) -#define __SPI6_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SPI6EN)) -#define __SAI1_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SAI1EN)) - -#define __TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN)) -#define __ADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN)) -#define __ADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN)) -#define __SPI5_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI5EN)) -#define __SPI6_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI6EN)) -#define __SAI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SAI1EN)) +#define __HAL_RCC_TIM8_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI6_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI6EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI6EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SAI1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN)) +#define __HAL_RCC_ADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN)) +#define __HAL_RCC_ADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN)) +#define __HAL_RCC_SPI5_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI5EN)) +#define __HAL_RCC_SPI6_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI6EN)) +#define __HAL_RCC_SAI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SAI1EN)) #if defined(STM32F429xx)|| defined(STM32F439xx) -#define __LTDC_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_LTDCEN)) +#define __HAL_RCC_LTDC_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_LTDCEN)) -#define __LTDC_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_LTDCEN)) +#define __HAL_RCC_LTDC_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_LTDCEN)) #endif /* STM32F429xx || STM32F439xx */ /** @brief Force or release AHB1 peripheral reset. */ -#define __GPIOF_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOFRST)) -#define __GPIOG_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOGRST)) -#define __GPIOI_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOIRST)) -#define __ETHMAC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETHMACRST)) -#define __OTGHS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_OTGHRST)) -#define __GPIOJ_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOJRST)) -#define __GPIOK_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOKRST)) -#define __DMA2D_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2DRST)) - -#define __GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) -#define __GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) -#define __GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST)) -#define __ETHMAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_ETHMACRST)) -#define __OTGHS_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_OTGHRST)) -#define __GPIOJ_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOJRST)) -#define __GPIOK_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOKRST)) -#define __DMA2D_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA2DRST)) +#define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_GPIOI_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOIRST)) +#define __HAL_RCC_ETHMAC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETHMACRST)) +#define __HAL_RCC_USB_OTG_HS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_OTGHRST)) +#define __HAL_RCC_GPIOJ_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOJRST)) +#define __HAL_RCC_GPIOK_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOKRST)) +#define __HAL_RCC_DMA2D_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2DRST)) + +#define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST)) +#define __HAL_RCC_ETHMAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_ETHMACRST)) +#define __HAL_RCC_USB_OTG_HS_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_OTGHRST)) +#define __HAL_RCC_GPIOJ_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOJRST)) +#define __HAL_RCC_GPIOK_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOKRST)) +#define __HAL_RCC_DMA2D_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA2DRST)) /** @brief Force or release AHB2 peripheral reset. */ -#define __DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST)) -#define __DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_DCMIRST)) +#define __HAL_RCC_DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST)) +#define __HAL_RCC_DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_DCMIRST)) -#if defined(STM32F437xx)|| defined(STM32F439xx) -#define __CRYP_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST)) -#define __HASH_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST)) +#if defined(STM32F437xx)|| defined(STM32F439xx) +#define __HAL_RCC_CRYP_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST)) +#define __HAL_RCC_HASH_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST)) -#define __CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_CRYPRST)) -#define __HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_HASHRST)) +#define __HAL_RCC_CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_CRYPRST)) +#define __HAL_RCC_HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_HASHRST)) #endif /* STM32F437xx || STM32F439xx */ /** @brief Force or release AHB3 peripheral reset */ -#define __FMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FMCRST)) -#define __FMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_FMCRST)) +#define __HAL_RCC_FMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FMCRST)) +#define __HAL_RCC_FMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_FMCRST)) /** @brief Force or release APB1 peripheral reset. */ -#define __TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST)) -#define __TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST)) -#define __TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST)) -#define __TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST)) -#define __TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST)) -#define __USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST)) -#define __UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST)) -#define __UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST)) -#define __CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST)) -#define __CAN2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST)) -#define __DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST)) -#define __UART7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART7RST)) -#define __UART8_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART8RST)) - -#define __TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST)) -#define __TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST)) -#define __TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST)) -#define __TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST)) -#define __TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST)) -#define __USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST)) -#define __UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST)) -#define __UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST)) -#define __CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST)) -#define __CAN2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST)) -#define __DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST)) -#define __UART7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART7RST)) -#define __UART8_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART8RST)) +#define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST)) +#define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST)) +#define __HAL_RCC_CAN2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST)) +#define __HAL_RCC_DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST)) +#define __HAL_RCC_UART7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART7RST)) +#define __HAL_RCC_UART8_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART8RST)) + +#define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST)) +#define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST)) +#define __HAL_RCC_CAN2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST)) +#define __HAL_RCC_DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST)) +#define __HAL_RCC_UART7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART7RST)) +#define __HAL_RCC_UART8_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART8RST)) /** @brief Force or release APB2 peripheral reset. */ -#define __TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST)) -#define __SPI5_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI5RST)) -#define __SPI6_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI6RST)) -#define __SAI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SAI1RST)) +#define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST)) +#define __HAL_RCC_SPI5_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI5RST)) +#define __HAL_RCC_SPI6_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI6RST)) +#define __HAL_RCC_SAI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SAI1RST)) -#define __TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST)) -#define __SPI5_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI5RST)) -#define __SPI6_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI6RST)) -#define __SAI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SAI1RST)) +#define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST)) +#define __HAL_RCC_SPI5_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI5RST)) +#define __HAL_RCC_SPI6_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI6RST)) +#define __HAL_RCC_SAI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SAI1RST)) #if defined(STM32F429xx)|| defined(STM32F439xx) -#define __LTDC_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_LTDCRST)) -#define __LTDC_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_LTDCRST)) +#define __HAL_RCC_LTDC_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_LTDCRST)) +#define __HAL_RCC_LTDC_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_LTDCRST)) #endif /* STM32F429xx|| STM32F439xx */ /** @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode. @@ -547,34 +977,34 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOFLPEN)) -#define __GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOGLPEN)) -#define __GPIOI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOILPEN)) -#define __SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM2LPEN)) -#define __ETHMAC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACLPEN)) -#define __ETHMACTX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACTXLPEN)) -#define __ETHMACRX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACRXLPEN)) -#define __ETHMACPTP_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACPTPLPEN)) -#define __OTGHS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSLPEN)) -#define __OTGHSULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSULPILPEN)) -#define __GPIOJ_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOJLPEN)) -#define __GPIOK_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOKLPEN)) -#define __SRAM3_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM3LPEN)) -#define __DMA2D_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2DLPEN)) - -#define __GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOFLPEN)) -#define __GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOGLPEN)) -#define __GPIOI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOILPEN)) -#define __SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM2LPEN)) -#define __ETHMAC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACLPEN)) -#define __ETHMACTX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACTXLPEN)) -#define __ETHMACRX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACRXLPEN)) -#define __ETHMACPTP_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACPTPLPEN)) -#define __OTGHS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSLPEN)) -#define __OTGHSULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSULPILPEN)) -#define __GPIOJ_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOJLPEN)) -#define __GPIOK_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOKLPEN)) -#define __DMA2D_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA2DLPEN)) +#define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOFLPEN)) +#define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOGLPEN)) +#define __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOILPEN)) +#define __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM2LPEN)) +#define __HAL_RCC_ETHMAC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACLPEN)) +#define __HAL_RCC_ETHMACTX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACTXLPEN)) +#define __HAL_RCC_ETHMACRX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACRXLPEN)) +#define __HAL_RCC_ETHMACPTP_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACPTPLPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSLPEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSULPILPEN)) +#define __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOJLPEN)) +#define __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOKLPEN)) +#define __HAL_RCC_SRAM3_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM3LPEN)) +#define __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2DLPEN)) + +#define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOFLPEN)) +#define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOGLPEN)) +#define __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOILPEN)) +#define __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM2LPEN)) +#define __HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACLPEN)) +#define __HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACTXLPEN)) +#define __HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACRXLPEN)) +#define __HAL_RCC_ETHMACPTP_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACPTPLPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSLPEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSULPILPEN)) +#define __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOJLPEN)) +#define __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOKLPEN)) +#define __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA2DLPEN)) /** @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -582,15 +1012,15 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN)) -#define __DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_DCMILPEN)) +#define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN)) +#define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_DCMILPEN)) -#if defined(STM32F437xx)|| defined(STM32F439xx) -#define __CRYP_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN)) -#define __HASH_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN)) +#if defined(STM32F437xx)|| defined(STM32F439xx) +#define __HAL_RCC_CRYP_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN)) +#define __HAL_RCC_HASH_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN)) -#define __CRYP_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_CRYPLPEN)) -#define __HASH_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_HASHLPEN)) +#define __HAL_RCC_CRYP_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_CRYPLPEN)) +#define __HAL_RCC_HASH_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_HASHLPEN)) #endif /* STM32F437xx || STM32F439xx */ /** @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode. @@ -599,8 +1029,8 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __FMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN)) -#define __FMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_FMCLPEN)) +#define __HAL_RCC_FMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN)) +#define __HAL_RCC_FMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_FMCLPEN)) /** @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -608,33 +1038,33 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM6LPEN)) -#define __TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM7LPEN)) -#define __TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM12LPEN)) -#define __TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM13LPEN)) -#define __TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM14LPEN)) -#define __USART3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART3LPEN)) -#define __UART4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN)) -#define __UART5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN)) -#define __CAN1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN1LPEN)) -#define __CAN2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN2LPEN)) -#define __DAC_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_DACLPEN)) -#define __UART7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART7LPEN)) -#define __UART8_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART8LPEN)) - -#define __TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM6LPEN)) -#define __TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM7LPEN)) -#define __TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM12LPEN)) -#define __TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM13LPEN)) -#define __TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM14LPEN)) -#define __USART3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART3LPEN)) -#define __UART4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN)) -#define __UART5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN)) -#define __CAN1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN1LPEN)) -#define __CAN2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN2LPEN)) -#define __DAC_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_DACLPEN)) -#define __UART7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART7LPEN)) -#define __UART8_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART8LPEN)) +#define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM6LPEN)) +#define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM7LPEN)) +#define __HAL_RCC_TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM12LPEN)) +#define __HAL_RCC_TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM13LPEN)) +#define __HAL_RCC_TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM14LPEN)) +#define __HAL_RCC_USART3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART3LPEN)) +#define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN)) +#define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN)) +#define __HAL_RCC_CAN1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN1LPEN)) +#define __HAL_RCC_CAN2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN2LPEN)) +#define __HAL_RCC_DAC_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_DACLPEN)) +#define __HAL_RCC_UART7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART7LPEN)) +#define __HAL_RCC_UART8_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART8LPEN)) + +#define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM6LPEN)) +#define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM7LPEN)) +#define __HAL_RCC_TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM12LPEN)) +#define __HAL_RCC_TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM13LPEN)) +#define __HAL_RCC_TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM14LPEN)) +#define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART3LPEN)) +#define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN)) +#define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN)) +#define __HAL_RCC_CAN1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN1LPEN)) +#define __HAL_RCC_CAN2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN2LPEN)) +#define __HAL_RCC_DAC_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_DACLPEN)) +#define __HAL_RCC_UART7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART7LPEN)) +#define __HAL_RCC_UART8_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART8LPEN)) /** @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -642,25 +1072,26 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM8LPEN)) -#define __ADC2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC2LPEN)) -#define __ADC3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC3LPEN)) -#define __SPI5_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI5LPEN)) -#define __SPI6_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI6LPEN)) -#define __SAI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SAI1LPEN)) - -#define __TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM8LPEN)) -#define __ADC2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC2LPEN)) -#define __ADC3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC3LPEN)) -#define __SPI5_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI5LPEN)) -#define __SPI6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI6LPEN)) -#define __SAI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SAI1LPEN)) +#define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM8LPEN)) +#define __HAL_RCC_ADC2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC2LPEN)) +#define __HAL_RCC_ADC3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC3LPEN)) +#define __HAL_RCC_SPI5_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI5LPEN)) +#define __HAL_RCC_SPI6_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI6LPEN)) +#define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SAI1LPEN)) + +#define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM8LPEN)) +#define __HAL_RCC_ADC2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC2LPEN)) +#define __HAL_RCC_ADC3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC3LPEN)) +#define __HAL_RCC_SPI5_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI5LPEN)) +#define __HAL_RCC_SPI6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI6LPEN)) +#define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SAI1LPEN)) #if defined(STM32F429xx)|| defined(STM32F439xx) -#define __LTDC_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_LTDCLPEN)) +#define __HAL_RCC_LTDC_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_LTDCLPEN)) -#define __LTDC_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_LTDCLPEN)) +#define __HAL_RCC_LTDC_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_LTDCLPEN)) #endif /* STM32F429xx || STM32F439xx */ + #endif /* STM32F427xx || STM32F437xx || STM32F429xx|| STM32F439xx */ /*---------------------------------------------------------------------------------------------*/ @@ -671,43 +1102,97 @@ typedef struct * is disabled and the application software has to enable this clock before * using it. */ -#define __GPIOI_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOIEN)) -#define __GPIOF_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOFEN)) -#define __GPIOG_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_GPIOGEN)) -#define __USB_OTG_HS_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_OTGHSEN)) -#define __USB_OTG_HS_ULPI_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_OTGHSULPIEN)) - -#define __GPIOF_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN)) -#define __GPIOG_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN)) -#define __GPIOI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOIEN)) -#define __USB_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSEN)) -#define __USB_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSULPIEN)) +#define __HAL_RCC_GPIOI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOIEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOF_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USB_OTG_HS_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN)) +#define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN)) +#define __HAL_RCC_GPIOI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOIEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSULPIEN)) #if defined(STM32F407xx)|| defined(STM32F417xx) /** * @brief Enable ETHERNET clock. */ -#define __ETHMAC_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACEN)) -#define __ETHMACTX_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACTXEN)) -#define __ETHMACRX_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACRXEN)) -#define __ETHMACPTP_CLK_ENABLE() (RCC->AHB1ENR |= (RCC_AHB1ENR_ETHMACPTPEN)) -#define __ETH_CLK_ENABLE() do { \ - __ETHMAC_CLK_ENABLE(); \ - __ETHMACTX_CLK_ENABLE(); \ - __ETHMACRX_CLK_ENABLE(); \ - } while(0) +#define __HAL_RCC_ETHMAC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMACTX_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACTXEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACTXEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMACRX_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACRXEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACRXEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETHMACPTP_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACPTPEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACPTPEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ETH_CLK_ENABLE() do { \ + __HAL_RCC_ETHMAC_CLK_ENABLE(); \ + __HAL_RCC_ETHMACTX_CLK_ENABLE(); \ + __HAL_RCC_ETHMACRX_CLK_ENABLE(); \ + } while(0) /** * @brief Disable ETHERNET clock. */ -#define __ETHMAC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACEN)) -#define __ETHMACTX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACTXEN)) -#define __ETHMACRX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACRXEN)) -#define __ETHMACPTP_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACPTPEN)) -#define __ETH_CLK_DISABLE() do { \ - __ETHMACTX_CLK_DISABLE(); \ - __ETHMACRX_CLK_DISABLE(); \ - __ETHMAC_CLK_DISABLE(); \ +#define __HAL_RCC_ETHMAC_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACEN)) +#define __HAL_RCC_ETHMACTX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACTXEN)) +#define __HAL_RCC_ETHMACRX_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACRXEN)) +#define __HAL_RCC_ETHMACPTP_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACPTPEN)) +#define __HAL_RCC_ETH_CLK_DISABLE() do { \ + __HAL_RCC_ETHMACTX_CLK_DISABLE(); \ + __HAL_RCC_ETHMACRX_CLK_DISABLE(); \ + __HAL_RCC_ETHMAC_CLK_DISABLE(); \ } while(0) #endif /* STM32F407xx || STM32F417xx */ @@ -717,16 +1202,33 @@ typedef struct * using it. */ #if defined(STM32F407xx)|| defined(STM32F417xx) -#define __DCMI_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_DCMIEN)) -#define __DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_DCMIEN)) +#define __HAL_RCC_DCMI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_DCMIEN)) #endif /* STM32F407xx || STM32F417xx */ #if defined(STM32F415xx) || defined(STM32F417xx) -#define __CRYP_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_CRYPEN)) -#define __HASH_CLK_ENABLE() (RCC->AHB2ENR |= (RCC_AHB2ENR_HASHEN)) - -#define __CRYP_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_CRYPEN)) -#define __HASH_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_HASHEN)) +#define __HAL_RCC_CRYP_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_HASH_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CRYP_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_CRYPEN)) +#define __HAL_RCC_HASH_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_HASHEN)) #endif /* STM32F415xx || STM32F417xx */ /** @brief Enables or disables the AHB3 peripheral clock. @@ -734,118 +1236,206 @@ typedef struct * is disabled and the application software has to enable this clock before * using it. */ -#define __FSMC_CLK_ENABLE() (RCC->AHB3ENR |= (RCC_AHB3ENR_FSMCEN)) -#define __FSMC_CLK_DISABLE() (RCC->AHB3ENR &= ~(RCC_AHB3ENR_FSMCEN)) +#define __HAL_RCC_FSMC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_FSMC_CLK_DISABLE() (RCC->AHB3ENR &= ~(RCC_AHB3ENR_FSMCEN)) /** @brief Enable or disable the Low Speed APB (APB1) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. */ -#define __TIM6_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM6EN)) -#define __TIM7_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM7EN)) -#define __TIM12_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM12EN)) -#define __TIM13_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM13EN)) -#define __TIM14_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_TIM14EN)) -#define __WWDG_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_WWDGEN)) -#define __USART3_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_USART3EN)) -#define __UART4_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_UART4EN)) -#define __UART5_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_UART5EN)) -#define __CAN1_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_CAN1EN)) -#define __CAN2_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_CAN2EN)) -#define __DAC_CLK_ENABLE() (RCC->APB1ENR |= (RCC_APB1ENR_DACEN)) - -#define __TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN)) -#define __TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN)) -#define __TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN)) -#define __TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN)) -#define __TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN)) -#define __WWDG_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_WWDGEN)) -#define __USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN)) -#define __UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN)) -#define __UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN)) -#define __CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN)) -#define __CAN2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN)) -#define __DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN)) +#define __HAL_RCC_TIM6_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM7_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM12_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM13_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM14_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USART3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CAN1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CAN2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DAC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN)) +#define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN)) +#define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN)) +#define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN)) +#define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN)) +#define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN)) +#define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN)) +#define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN)) +#define __HAL_RCC_CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN)) +#define __HAL_RCC_CAN2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN)) +#define __HAL_RCC_DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN)) /** @brief Enable or disable the High Speed APB (APB2) peripheral clock. * @note After reset, the peripheral clock (used for registers read/write access) * is disabled and the application software has to enable this clock before * using it. */ -#define __TIM8_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_TIM8EN)) -#define __ADC2_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_ADC2EN)) -#define __ADC3_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_ADC3EN)) - -#define __TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN)) -#define __ADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN)) -#define __ADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN)) +#define __HAL_RCC_TIM8_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN)) +#define __HAL_RCC_ADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN)) +#define __HAL_RCC_ADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN)) /** @brief Force or release AHB1 peripheral reset. */ -#define __GPIOF_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOFRST)) -#define __GPIOG_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOGRST)) -#define __GPIOI_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOIRST)) -#define __ETHMAC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETHMACRST)) -#define __OTGHS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_OTGHRST)) - -#define __GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) -#define __GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) -#define __GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST)) -#define __ETHMAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_ETHMACRST)) -#define __OTGHS_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_OTGHRST)) +#define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_GPIOI_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOIRST)) +#define __HAL_RCC_ETHMAC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETHMACRST)) +#define __HAL_RCC_USB_OTG_HS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_OTGHRST)) + +#define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST)) +#define __HAL_RCC_ETHMAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_ETHMACRST)) +#define __HAL_RCC_USB_OTG_HS_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_OTGHRST)) /** @brief Force or release AHB2 peripheral reset. */ #if defined(STM32F407xx)|| defined(STM32F417xx) -#define __DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST)) -#define __DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_DCMIRST)) +#define __HAL_RCC_DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST)) +#define __HAL_RCC_DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_DCMIRST)) #endif /* STM32F407xx || STM32F417xx */ #if defined(STM32F415xx) || defined(STM32F417xx) -#define __CRYP_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST)) -#define __HASH_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST)) +#define __HAL_RCC_CRYP_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST)) +#define __HAL_RCC_HASH_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST)) -#define __CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_CRYPRST)) -#define __HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_HASHRST)) +#define __HAL_RCC_CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_CRYPRST)) +#define __HAL_RCC_HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_HASHRST)) #endif /* STM32F415xx || STM32F417xx */ /** @brief Force or release AHB3 peripheral reset */ -#define __FSMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FSMCRST)) -#define __FSMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_FSMCRST)) +#define __HAL_RCC_FSMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FSMCRST)) +#define __HAL_RCC_FSMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_FSMCRST)) /** @brief Force or release APB1 peripheral reset. */ -#define __TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST)) -#define __TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST)) -#define __TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST)) -#define __TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST)) -#define __TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST)) -#define __USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST)) -#define __UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST)) -#define __UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST)) -#define __CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST)) -#define __CAN2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST)) -#define __DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST)) - -#define __TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST)) -#define __TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST)) -#define __TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST)) -#define __TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST)) -#define __TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST)) -#define __USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST)) -#define __UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST)) -#define __UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST)) -#define __CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST)) -#define __CAN2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST)) -#define __DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST)) +#define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST)) +#define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST)) +#define __HAL_RCC_CAN2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST)) +#define __HAL_RCC_DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST)) + +#define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST)) +#define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST)) +#define __HAL_RCC_CAN2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST)) +#define __HAL_RCC_DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST)) /** @brief Force or release APB2 peripheral reset. */ -#define __TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST)) -#define __TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST)) +#define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST)) +#define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST)) /** @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -853,27 +1443,27 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOFLPEN)) -#define __GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOGLPEN)) -#define __GPIOI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOILPEN)) -#define __SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM2LPEN)) -#define __ETHMAC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACLPEN)) -#define __ETHMACTX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACTXLPEN)) -#define __ETHMACRX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACRXLPEN)) -#define __ETHMACPTP_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACPTPLPEN)) -#define __OTGHS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSLPEN)) -#define __OTGHSULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSULPILPEN)) - -#define __GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOFLPEN)) -#define __GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOGLPEN)) -#define __GPIOI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOILPEN)) -#define __SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM2LPEN)) -#define __ETHMAC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACLPEN)) -#define __ETHMACTX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACTXLPEN)) -#define __ETHMACRX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACRXLPEN)) -#define __ETHMACPTP_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACPTPLPEN)) -#define __OTGHS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSLPEN)) -#define __OTGHSULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSULPILPEN)) +#define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOFLPEN)) +#define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOGLPEN)) +#define __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOILPEN)) +#define __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM2LPEN)) +#define __HAL_RCC_ETHMAC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACLPEN)) +#define __HAL_RCC_ETHMACTX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACTXLPEN)) +#define __HAL_RCC_ETHMACRX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACRXLPEN)) +#define __HAL_RCC_ETHMACPTP_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACPTPLPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSLPEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSULPILPEN)) + +#define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOFLPEN)) +#define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOGLPEN)) +#define __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOILPEN)) +#define __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM2LPEN)) +#define __HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACLPEN)) +#define __HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACTXLPEN)) +#define __HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACRXLPEN)) +#define __HAL_RCC_ETHMACPTP_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACPTPLPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSLPEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSULPILPEN)) /** @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -882,16 +1472,16 @@ typedef struct * @note By default, all peripheral clocks are enabled during SLEEP mode. */ #if defined(STM32F407xx)|| defined(STM32F417xx) -#define __DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN)) -#define __DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_DCMILPEN)) +#define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN)) +#define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_DCMILPEN)) #endif /* STM32F407xx || STM32F417xx */ #if defined(STM32F415xx) || defined(STM32F417xx) -#define __CRYP_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN)) -#define __HASH_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN)) +#define __HAL_RCC_CRYP_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN)) +#define __HAL_RCC_HASH_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN)) -#define __CRYP_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_CRYPLPEN)) -#define __HASH_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_HASHLPEN)) +#define __HAL_RCC_CRYP_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_CRYPLPEN)) +#define __HAL_RCC_HASH_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_HASHLPEN)) #endif /* STM32F415xx || STM32F417xx */ /** @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode. @@ -900,8 +1490,8 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __FSMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FSMCLPEN)) -#define __FSMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_FSMCLPEN)) +#define __HAL_RCC_FSMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FSMCLPEN)) +#define __HAL_RCC_FSMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_FSMCLPEN)) /** @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -909,29 +1499,29 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM6LPEN)) -#define __TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM7LPEN)) -#define __TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM12LPEN)) -#define __TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM13LPEN)) -#define __TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM14LPEN)) -#define __USART3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART3LPEN)) -#define __UART4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN)) -#define __UART5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN)) -#define __CAN1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN1LPEN)) -#define __CAN2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN2LPEN)) -#define __DAC_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_DACLPEN)) - -#define __TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM6LPEN)) -#define __TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM7LPEN)) -#define __TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM12LPEN)) -#define __TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM13LPEN)) -#define __TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM14LPEN)) -#define __USART3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART3LPEN)) -#define __UART4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN)) -#define __UART5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN)) -#define __CAN1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN1LPEN)) -#define __CAN2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN2LPEN)) -#define __DAC_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_DACLPEN)) +#define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM6LPEN)) +#define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM7LPEN)) +#define __HAL_RCC_TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM12LPEN)) +#define __HAL_RCC_TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM13LPEN)) +#define __HAL_RCC_TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM14LPEN)) +#define __HAL_RCC_USART3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART3LPEN)) +#define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN)) +#define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN)) +#define __HAL_RCC_CAN1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN1LPEN)) +#define __HAL_RCC_CAN2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN2LPEN)) +#define __HAL_RCC_DAC_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_DACLPEN)) + +#define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM6LPEN)) +#define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM7LPEN)) +#define __HAL_RCC_TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM12LPEN)) +#define __HAL_RCC_TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM13LPEN)) +#define __HAL_RCC_TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM14LPEN)) +#define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART3LPEN)) +#define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN)) +#define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN)) +#define __HAL_RCC_CAN1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN1LPEN)) +#define __HAL_RCC_CAN2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN2LPEN)) +#define __HAL_RCC_DAC_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_DACLPEN)) /** @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. * @note Peripheral clock gating in SLEEP mode can be used to further reduce @@ -939,13 +1529,13 @@ typedef struct * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. * @note By default, all peripheral clocks are enabled during SLEEP mode. */ -#define __TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM8LPEN)) -#define __ADC2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC2LPEN)) -#define __ADC3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC3LPEN)) +#define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM8LPEN)) +#define __HAL_RCC_ADC2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC2LPEN)) +#define __HAL_RCC_ADC3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC3LPEN)) -#define __TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM8LPEN)) -#define __ADC2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC2LPEN)) -#define __ADC3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC3LPEN)) +#define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM8LPEN)) +#define __HAL_RCC_ADC2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC2LPEN)) +#define __HAL_RCC_ADC3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC3LPEN)) #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ /*---------------------------------------------------------------------------------------------*/ @@ -953,93 +1543,595 @@ typedef struct #if defined(STM32F411xE) /** @brief Enable or disable the High Speed APB (APB2) peripheral clock. */ -#define __SPI5_CLK_ENABLE() (RCC->APB2ENR |= (RCC_APB2ENR_SPI5EN)) -#define __SPI5_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI5EN)) +#define __HAL_RCC_SPI5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPI5_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI5EN)) /** @brief Force or release APB2 peripheral reset. */ -#define __SPI5_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI5RST)) -#define __SPI5_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI5RST)) +#define __HAL_RCC_SPI5_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI5RST)) +#define __HAL_RCC_SPI5_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI5RST)) /** @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. */ -#define __SPI5_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI5LPEN)) -#define __SPI5_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI5LPEN)) +#define __HAL_RCC_SPI5_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI5LPEN)) +#define __HAL_RCC_SPI5_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI5LPEN)) #endif /* STM32F411xE */ /*---------------------------------------------------------------------------------------------*/ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ - defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) - -/** @brief Macro to configure the Timers clocks prescalers - * @note This feature is only available with STM32F429x/439x Devices. - * @param __PRESC__ : specifies the Timers clocks prescalers selection - * This parameter can be one of the following values: - * @arg RCC_TIMPRES_DESACTIVATED: The Timers kernels clocks prescaler is - * equal to HPRE if PPREx is corresponding to division by 1 or 2, - * else it is equal to [(HPRE * PPREx) / 2] if PPREx is corresponding to - * division by 4 or more. - * @arg RCC_TIMPRES_ACTIVATED: The Timers kernels clocks prescaler is - * equal to HPRE if PPREx is corresponding to division by 1, 2 or 4, - * else it is equal to [(HPRE * PPREx) / 4] if PPREx is corresponding - * to division by 8 or more. - */ -#define __HAL_RCC_TIMCLKPRESCALER(__PRESC__) (*(__IO uint32_t *) DCKCFGR_TIMPRE_BB = (__PRESC__)) +/*----------------------------------------- STM32F446xx ---------------------------------------*/ +#if defined(STM32F446xx) +/** @brief Enables or disables the AHB1 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + */ +#define __HAL_RCC_GPIOF_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_GPIOG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USB_OTG_HS_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN)) +#define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSULPIEN)) + +/** @brief Enable or disable the AHB2 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + */ +#define __HAL_RCC_DCMI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_DCMIEN)) -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx) || STM32F401xC || STM32F401xE || STM32F411xE */ +/** @brief Enables or disables the AHB3 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + */ +#define __HAL_RCC_FMC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_QSPI_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_FMC_CLK_DISABLE() (RCC->AHB3ENR &= ~(RCC_AHB3ENR_FMCEN)) +#define __HAL_RCC_QSPI_CLK_DISABLE() (RCC->AHB3ENR &= ~(RCC_AHB3ENR_QSPIEN)) -#if defined(STM32F411xE) - -/** @brief Macro to configure the PLLI2S clock multiplication and division factors . - * @note This macro must be used only when the PLLI2S is disabled. - * @note This macro must be used only when the PLLI2S is disabled. - * @note PLLI2S clock source is common with the main PLL (configured in - * HAL_RCC_ClockConfig() API). - * @param __PLLI2SM__: specifies the division factor for PLLI2S VCO input clock - * This parameter must be a number between Min_Data = 2 and Max_Data = 63. - * @note You have to set the PLLI2SM parameter correctly to ensure that the VCO input - * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency - * of 2 MHz to limit PLLI2S jitter. - * @param __PLLI2SN__: specifies the multiplication factor for PLLI2S VCO output clock - * This parameter must be a number between Min_Data = 192 and Max_Data = 432. - * @note You have to set the PLLI2SN parameter correctly to ensure that the VCO - * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. - * @param __PLLI2SR__: specifies the division factor for I2S clock - * This parameter must be a number between Min_Data = 2 and Max_Data = 7. - * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz - * on the I2S clock frequency. +/** @brief Enable or disable the Low Speed APB (APB1) peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. */ -#define __HAL_RCC_PLLI2S_I2SCLK_CONFIG(__PLLI2SM__, __PLLI2SN__, __PLLI2SR__) (RCC->PLLI2SCFGR = ((__PLLI2SN__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SN)) |\ - ((__PLLI2SR__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)) | (__PLLI2SM__)) -#endif /* STM32F411xE */ +#define __HAL_RCC_TIM6_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM7_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM12_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM13_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_TIM14_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SPDIFRX_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPDIFRXEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPDIFRXEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_USART3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_UART5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_FMPI2C1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_FMPI2C1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_FMPI2C1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CAN1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CAN2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_CEC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_DAC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN)) +#define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN)) +#define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN)) +#define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN)) +#define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN)) +#define __HAL_RCC_SPDIFRX_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPDIFRXEN)) +#define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN)) +#define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN)) +#define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN)) +#define __HAL_RCC_FMPI2C1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_FMPI2C1EN)) +#define __HAL_RCC_CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN)) +#define __HAL_RCC_CAN2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN)) +#define __HAL_RCC_CEC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CECEN)) +#define __HAL_RCC_DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN)) + +/** @brief Enable or disable the High Speed APB (APB2) peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + */ +#define __HAL_RCC_TIM8_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_ADC3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SAI1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\ + UNUSED(tmpreg); \ + } while(0) +#define __HAL_RCC_SAI2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\ + UNUSED(tmpreg); \ + } while(0) + +#define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN)) +#define __HAL_RCC_ADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN)) +#define __HAL_RCC_ADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN)) +#define __HAL_RCC_SAI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SAI1EN)) +#define __HAL_RCC_SAI2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SAI2EN)) +/** @brief Force or release AHB1 peripheral reset. + */ +#define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_USB_OTG_HS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_OTGHRST)) -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - -/** @brief Macros to Enable or Disable the PLLISAI. - * @note The PLLSAI is only available with STM32F429x/439x Devices. - * @note The PLLSAI is disabled by hardware when entering STOP and STANDBY modes. +#define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST)) +#define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST)) +#define __HAL_RCC_USB_OTG_HS_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_OTGHRST)) + +/** @brief Force or release AHB2 peripheral reset. */ -#define __HAL_RCC_PLLSAI_ENABLE() (*(__IO uint32_t *) CR_PLLSAION_BB = ENABLE) -#define __HAL_RCC_PLLSAI_DISABLE() (*(__IO uint32_t *) CR_PLLSAION_BB = DISABLE) +#define __HAL_RCC_DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST)) +#define __HAL_RCC_DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_DCMIRST)) -/** @brief Macro to configure the PLLSAI clock multiplication and division factors. - * @note The PLLSAI is only available with STM32F429x/439x Devices. - * @note This function must be used only when the PLLSAI is disabled. - * @note PLLSAI clock source is common with the main PLL (configured in - * RCC_PLLConfig function ) - * @param __PLLSAIN__: specifies the multiplication factor for PLLSAI VCO output clock. +/** @brief Force or release AHB3 peripheral reset + */ +#define __HAL_RCC_FMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FMCRST)) +#define __HAL_RCC_QSPI_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_QSPIRST)) + +#define __HAL_RCC_FMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_FMCRST)) +#define __HAL_RCC_QSPI_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_QSPIRST)) + +/** @brief Force or release APB1 peripheral reset. + */ +#define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST)) +#define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_SPDIFRX_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPDIFRXRST)) +#define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_FMPI2C1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_FMPI2C1RST)) +#define __HAL_RCC_CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST)) +#define __HAL_RCC_CAN2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST)) +#define __HAL_RCC_CEC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CECRST)) +#define __HAL_RCC_DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST)) + +#define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST)) +#define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_SPDIFRX_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPDIFRXRST)) +#define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_FMPI2C1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_FMPI2C1RST)) +#define __HAL_RCC_CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST)) +#define __HAL_RCC_CAN2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST)) +#define __HAL_RCC_CEC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CECRST)) +#define __HAL_RCC_DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST)) + +/** @brief Force or release APB2 peripheral reset. + */ +#define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST)) +#define __HAL_RCC_SAI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SAI1RST)) +#define __HAL_RCC_SAI2_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SAI2RST)) + +#define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST)) +#define __HAL_RCC_SAI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SAI1RST)) +#define __HAL_RCC_SAI2_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SAI2RST)) + +/** @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode. + * @note Peripheral clock gating in SLEEP mode can be used to further reduce + * power consumption. + * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note By default, all peripheral clocks are enabled during SLEEP mode. + */ +#define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOFLPEN)) +#define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOGLPEN)) +#define __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM2LPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSLPEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSULPILPEN)) + +#define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOFLPEN)) +#define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOGLPEN)) +#define __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM2LPEN)) +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSLPEN)) +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSULPILPEN)) +/** @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode. + * @note Peripheral clock gating in SLEEP mode can be used to further reduce + * power consumption. + * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note By default, all peripheral clocks are enabled during SLEEP mode. + */ +#define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN)) +#define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_DCMILPEN)) + +/** @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode. + * @note Peripheral clock gating in SLEEP mode can be used to further reduce + * power consumption. + * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note By default, all peripheral clocks are enabled during SLEEP mode. + */ +#define __HAL_RCC_FMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN)) +#define __HAL_RCC_QSPI_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN)) + +#define __HAL_RCC_FMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_FMCLPEN)) +#define __HAL_RCC_QSPI_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_QSPILPEN)) + +/** @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode. + * @note Peripheral clock gating in SLEEP mode can be used to further reduce + * power consumption. + * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note By default, all peripheral clocks are enabled during SLEEP mode. + */ +#define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM6LPEN)) +#define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM7LPEN)) +#define __HAL_RCC_TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM12LPEN)) +#define __HAL_RCC_TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM13LPEN)) +#define __HAL_RCC_TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM14LPEN)) +#define __HAL_RCC_SPDIFRX_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPDIFRXLPEN)) +#define __HAL_RCC_USART3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_USART3LPEN)) +#define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN)) +#define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN)) +#define __HAL_RCC_FMPI2C1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_FMPI2C1LPEN)) +#define __HAL_RCC_CAN1_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN1LPEN)) +#define __HAL_RCC_CAN2_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN2LPEN)) +#define __HAL_RCC_CEC_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_CECLPEN)) +#define __HAL_RCC_DAC_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_DACLPEN)) + +#define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM6LPEN)) +#define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM7LPEN)) +#define __HAL_RCC_TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM12LPEN)) +#define __HAL_RCC_TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM13LPEN)) +#define __HAL_RCC_TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM14LPEN)) +#define __HAL_RCC_SPDIFRX_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPDIFRXLPEN)) +#define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART3LPEN)) +#define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN)) +#define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN)) +#define __HAL_RCC_FMPI2C1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_FMPI2C1LPEN)) +#define __HAL_RCC_CAN1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN1LPEN)) +#define __HAL_RCC_CAN2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN2LPEN)) +#define __HAL_RCC_CEC_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CECLPEN)) +#define __HAL_RCC_DAC_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_DACLPEN)) + +/** @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode. + * @note Peripheral clock gating in SLEEP mode can be used to further reduce + * power consumption. + * @note After wakeup from SLEEP mode, the peripheral clock is enabled again. + * @note By default, all peripheral clocks are enabled during SLEEP mode. + */ +#define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM8LPEN)) +#define __HAL_RCC_ADC2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC2LPEN)) +#define __HAL_RCC_ADC3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC3LPEN)) +#define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SAI1LPEN)) +#define __HAL_RCC_SAI2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SAI2LPEN)) + +#define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM8LPEN)) +#define __HAL_RCC_ADC2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC2LPEN)) +#define __HAL_RCC_ADC3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC3LPEN)) +#define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SAI1LPEN)) +#define __HAL_RCC_SAI2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SAI2LPEN)) + +#endif /* STM32F446xx */ +/*------------------------------------------------------------------------------------------------------------*/ + +/*------------------------------------------------- PLL Configuration ----------------------------------------*/ +#if defined(STM32F446xx) +/** @brief Macro to configure the main PLL clock source, multiplication and division factors. + * @note This function must be used only when the main PLL is disabled. + * @param __RCC_PLLSource__: specifies the PLL entry clock source. + * This parameter can be one of the following values: + * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry + * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry + * @note This clock source (RCC_PLLSource) is common for the main PLL and PLLI2S. + * @param __PLLM__: specifies the division factor for PLL VCO input clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 63. + * @note You have to set the PLLM parameter correctly to ensure that the VCO input + * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency + * of 2 MHz to limit PLL jitter. + * @param __PLLN__: specifies the multiplication factor for PLL VCO output clock * This parameter must be a number between Min_Data = 192 and Max_Data = 432. - * @note You have to set the PLLSAIN parameter correctly to ensure that the VCO + * @note You have to set the PLLN parameter correctly to ensure that the VCO + * output frequency is between 192 and 432 MHz. + * + * @param __PLLP__: specifies the division factor for main system clock (SYSCLK) + * This parameter must be a number in the range {2, 4, 6, or 8}. + * + * @param __PLLQ__: specifies the division factor for OTG FS, SDIO and RNG clocks + * This parameter must be a number between Min_Data = 2 and Max_Data = 15. + * @note If the USB OTG FS is used in your application, you have to set the + * PLLQ parameter correctly to have 48 MHz clock for the USB. However, + * the SDIO and RNG need a frequency lower than or equal to 48 MHz to work + * correctly. + * + * @param __PLLR__: PLL division factor for I2S, SAI, SYSTEM, SPDIFRX clocks. + * This parameter must be a number between Min_Data = 2 and Max_Data = 7. + * @note This parameter is only available in STM32F446xx devices. + * + */ +#define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__,__PLLR__) \ + (RCC->PLLCFGR = ((__RCC_PLLSource__) | (__PLLM__) | \ + ((__PLLN__) << POSITION_VAL(RCC_PLLCFGR_PLLN)) | \ + ((((__PLLP__) >> 1) -1) << POSITION_VAL(RCC_PLLCFGR_PLLP)) | \ + ((__PLLQ__) << POSITION_VAL(RCC_PLLCFGR_PLLQ)) | \ + ((__PLLR__) << POSITION_VAL(RCC_PLLCFGR_PLLR)))) +#else +/** @brief Macro to configure the main PLL clock source, multiplication and division factors. + * @note This function must be used only when the main PLL is disabled. + * @param __RCC_PLLSource__: specifies the PLL entry clock source. + * This parameter can be one of the following values: + * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry + * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry + * @note This clock source (RCC_PLLSource) is common for the main PLL and PLLI2S. + * @param __PLLM__: specifies the division factor for PLL VCO input clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 63. + * @note You have to set the PLLM parameter correctly to ensure that the VCO input + * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency + * of 2 MHz to limit PLL jitter. + * @param __PLLN__: specifies the multiplication factor for PLL VCO output clock + * This parameter must be a number between Min_Data = 192 and Max_Data = 432. + * @note You have to set the PLLN parameter correctly to ensure that the VCO + * output frequency is between 192 and 432 MHz. + * + * @param __PLLP__: specifies the division factor for main system clock (SYSCLK) + * This parameter must be a number in the range {2, 4, 6, or 8}. + * + * @param __PLLQ__: specifies the division factor for OTG FS, SDIO and RNG clocks + * This parameter must be a number between Min_Data = 2 and Max_Data = 15. + * @note If the USB OTG FS is used in your application, you have to set the + * PLLQ parameter correctly to have 48 MHz clock for the USB. However, + * the SDIO and RNG need a frequency lower than or equal to 48 MHz to work + * correctly. + * + */ +#define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__) \ + (RCC->PLLCFGR = (0x20000000 | (__RCC_PLLSource__) | (__PLLM__)| \ + ((__PLLN__) << POSITION_VAL(RCC_PLLCFGR_PLLN)) | \ + ((((__PLLP__) >> 1) -1) << POSITION_VAL(RCC_PLLCFGR_PLLP)) | \ + ((__PLLQ__) << POSITION_VAL(RCC_PLLCFGR_PLLQ)))) + #endif /* STM32F446xx */ +/*-------------------------------------------------------------------------------------------------------*/ + +/*------------------------------------------- PLLI2S Configuration --------------------------------------*/ +#if defined(STM32F446xx) +/** @brief Macro to configure the PLLI2S clock multiplication and division factors . + * @note This macro must be used only when the PLLI2S is disabled. + * @note PLLI2S clock source is common with the main PLL (configured in + * HAL_RCC_ClockConfig() API). + * @param __PLLI2SM__: specifies the division factor for PLLI2S VCO input clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 63. + * @note You have to set the PLLI2SM parameter correctly to ensure that the VCO input + * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency + * of 1 MHz to limit PLLI2S jitter. + * @note The PLLI2SM parameter is only used with STM32F411xE and STM32F446xx Devices + * + * @param __PLLI2SN__: specifies the multiplication factor for PLLI2S VCO output clock + * This parameter must be a number between Min_Data = 192 and Max_Data = 432. + * @note You have to set the PLLI2SN parameter correctly to ensure that the VCO * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. - * @param __PLLSAIQ__: specifies the division factor for SAI1 clock + * + * @param __PLLI2SP__: specifies division factor for SPDIFRX Clock. + * This parameter must be a number in the range {2, 4, 6, or 8}. + * @note the PLLI2SP parameter is only available with STM32F446xx Devices + * + * @param __PLLI2SR__: specifies the division factor for I2S clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 7. + * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz + * on the I2S clock frequency. + * + * @param __PLLI2SQ__: specifies the division factor for SAI clock * This parameter must be a number between Min_Data = 2 and Max_Data = 15. - * @param __PLLSAIR__: specifies the division factor for LTDC clock + * @note the PLLI2SQ parameter is only available with STM32F427/437/429x/439xx Devices + * + */ +#define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SM__, __PLLI2SN__, __PLLI2SP__, __PLLI2SQ__, __PLLI2SR__) \ + (RCC->PLLI2SCFGR = ((__PLLI2SM__) |\ + ((__PLLI2SN__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SN)) |\ + ((((__PLLI2SP__) >> 1) -1) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SP)) |\ + ((__PLLI2SQ__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SQ)) |\ + ((__PLLI2SR__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)))) +#else +/** @brief Macro to configure the PLLI2S clock multiplication and division factors . + * @note This macro must be used only when the PLLI2S is disabled. + * @note PLLI2S clock source is common with the main PLL (configured in + * HAL_RCC_ClockConfig() API). + * @param __PLLI2SN__: specifies the multiplication factor for PLLI2S VCO output clock + * This parameter must be a number between Min_Data = 192 and Max_Data = 432. + * @note You have to set the PLLI2SN parameter correctly to ensure that the VCO + * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. + * @param __PLLI2SR__: specifies the division factor for I2S clock * This parameter must be a number between Min_Data = 2 and Max_Data = 7. - */ -#define __HAL_RCC_PLLSAI_CONFIG(__PLLSAIN__, __PLLSAIQ__, __PLLSAIR__) (RCC->PLLSAICFGR = ((__PLLSAIN__) << 6) | ((__PLLSAIQ__) << 24) | ((__PLLSAIR__) << 28)) + * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz + * on the I2S clock frequency. + * + */ +#define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SN__, __PLLI2SR__) \ + (RCC->PLLI2SCFGR = (((__PLLI2SN__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SN)) | \ + ((__PLLI2SR__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)))) +#endif /* STM32F446xx */ +#if defined(STM32F411xE) + +/** @brief Macro to configure the PLLI2S clock multiplication and division factors . + * @note This macro must be used only when the PLLI2S is disabled. + * @note This macro must be used only when the PLLI2S is disabled. + * @note PLLI2S clock source is common with the main PLL (configured in + * HAL_RCC_ClockConfig() API). + * @param __PLLI2SM__: specifies the division factor for PLLI2S VCO input clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 63. + * @note The PLLI2SM parameter is only used with STM32F411xE Devices + * @note You have to set the PLLI2SM parameter correctly to ensure that the VCO input + * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency + * of 2 MHz to limit PLLI2S jitter. + * @param __PLLI2SN__: specifies the multiplication factor for PLLI2S VCO output clock + * This parameter must be a number between Min_Data = 192 and Max_Data = 432. + * @note You have to set the PLLI2SN parameter correctly to ensure that the VCO + * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. + * @param __PLLI2SR__: specifies the division factor for I2S clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 7. + * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz + * on the I2S clock frequency. + */ +#define __HAL_RCC_PLLI2S_I2SCLK_CONFIG(__PLLI2SM__, __PLLI2SN__, __PLLI2SR__) (RCC->PLLI2SCFGR = ((__PLLI2SM__) |\ + ((__PLLI2SN__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SN)) |\ + ((__PLLI2SR__) << POSITION_VAL(RCC_PLLI2SCFGR_PLLI2SR)))) +#endif /* STM32F411xE */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) /** @brief Macro used by the SAI HAL driver to configure the PLLI2S clock multiplication and division factors. * @note This macro must be used only when the PLLI2S is disabled. * @note PLLI2S clock source is common with the main PLL (configured in @@ -1050,17 +2142,88 @@ typedef struct * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. * @param __PLLI2SQ__: specifies the division factor for SAI1 clock. * This parameter must be a number between Min_Data = 2 and Max_Data = 15. - * @note the PLLI2SQ parameter is only available with STM32F429x/439x Devices + * @note the PLLI2SQ parameter is only available with STM32F427xx/437xx/429xx/439xx Devices * and can be configured using the __HAL_RCC_PLLI2S_PLLSAICLK_CONFIG() macro * @param __PLLI2SR__: specifies the division factor for I2S clock * This parameter must be a number between Min_Data = 2 and Max_Data = 7. * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz * on the I2S clock frequency. */ -#define __HAL_RCC_PLLI2S_SAICLK_CONFIG(__PLLI2SN__, __PLLI2SQ__, __PLLI2SR__) (RCC->PLLI2SCFGR = ((__PLLI2SN__) << 6) | ((__PLLI2SQ__) << 24) | ((__PLLI2SR__) << 28)) - -/** @brief Macro to configure the SAI clock Divider coming from PLLI2S. - * @note The SAI peripheral is only available with STM32F429x/439x Devices. +#define __HAL_RCC_PLLI2S_SAICLK_CONFIG(__PLLI2SN__, __PLLI2SQ__, __PLLI2SR__) (RCC->PLLI2SCFGR = ((__PLLI2SN__) << 6) |\ + ((__PLLI2SQ__) << 24) |\ + ((__PLLI2SR__) << 28)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/*----------------------------------------------------------------------------------------------------------------*/ + +/*--------------------------------------------------- PLLSAI Configuration ---------------------------------------*/ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +/** @brief Macros to Enable or Disable the PLLISAI. + * @note The PLLSAI is only available with STM32F429x/439x Devices. + * @note The PLLSAI is disabled by hardware when entering STOP and STANDBY modes. + */ +#define __HAL_RCC_PLLSAI_ENABLE() (*(__IO uint32_t *) RCC_CR_PLLSAION_BB = ENABLE) +#define __HAL_RCC_PLLSAI_DISABLE() (*(__IO uint32_t *) RCC_CR_PLLSAION_BB = DISABLE) + +#if defined(STM32F446xx) +/** @brief Macro to configure the PLLSAI clock multiplication and division factors. + * + * @param __PLLSAIM__: specifies the division factor for PLLSAI VCO input clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 63. + * @note You have to set the PLLSAIM parameter correctly to ensure that the VCO input + * frequency ranges from 1 to 2 MHz. It is recommended to select a frequency + * of 1 MHz to limit PLLI2S jitter. + * @note The PLLSAIM parameter is only used with STM32F446xx Devices + * + * @param __PLLSAIN__: specifies the multiplication factor for PLLSAI VCO output clock. + * This parameter must be a number between Min_Data = 192 and Max_Data = 432. + * @note You have to set the PLLSAIN parameter correctly to ensure that the VCO + * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. + * + * @param __PLLSAIP__: specifies division factor for OTG FS, SDIO and RNG clocks. + * This parameter must be a number in the range {2, 4, 6, or 8}. + * @note the PLLSAIP parameter is only available with STM32F446xx Devices + * + * @param __PLLSAIQ__: specifies the division factor for SAI clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 15. + * + * @param __PLLSAIR__: specifies the division factor for LTDC clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 7. + * @note the PLLI2SR parameter is only available with STM32F427/437/429/439xx Devices + */ +#define __HAL_RCC_PLLSAI_CONFIG(__PLLSAIM__, __PLLSAIN__, __PLLSAIP__, __PLLSAIQ__, __PLLSAIR__) \ + (RCC->PLLSAICFGR = ((__PLLSAIM__) | \ + ((__PLLSAIN__) << POSITION_VAL(RCC_PLLSAICFGR_PLLSAIN)) | \ + ((((__PLLSAIP__) >> 1) -1) << POSITION_VAL(RCC_PLLSAICFGR_PLLSAIP)) | \ + ((__PLLSAIQ__) << POSITION_VAL(RCC_PLLSAICFGR_PLLSAIQ)))) +#endif /* STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @brief Macro to configure the PLLSAI clock multiplication and division factors. + * + * @param __PLLSAIN__: specifies the multiplication factor for PLLSAI VCO output clock. + * This parameter must be a number between Min_Data = 192 and Max_Data = 432. + * @note You have to set the PLLSAIN parameter correctly to ensure that the VCO + * output frequency is between Min_Data = 192 and Max_Data = 432 MHz. + * + * @param __PLLSAIQ__: specifies the division factor for SAI clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 15. + * + * @param __PLLSAIR__: specifies the division factor for LTDC clock + * This parameter must be a number between Min_Data = 2 and Max_Data = 7. + * @note the PLLI2SR parameter is only available with STM32F427/437/429/439xx Devices + */ +#define __HAL_RCC_PLLSAI_CONFIG(__PLLSAIN__, __PLLSAIQ__, __PLLSAIR__) \ + (RCC->PLLSAICFGR = (((__PLLSAIN__) << POSITION_VAL(RCC_PLLSAICFGR_PLLSAIN)) | \ + ((__PLLSAIQ__) << POSITION_VAL(RCC_PLLSAICFGR_PLLSAIQ)) | \ + ((__PLLSAIR__) << POSITION_VAL(RCC_PLLSAICFGR_PLLSAIR)))) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +/*----------------------------------------------------------------------------------------------------------------------*/ + +/*----------------------------------------- PLLSAI/PLLI2S Dividers Configuration ---------------------------------------*/ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +/** @brief Macro to configure the SAI clock Divider coming from PLLI2S. * @note This function must be called before enabling the PLLI2S. * @param __PLLI2SDivQ__: specifies the PLLI2S division factor for SAI1 clock . * This parameter must be a number between 1 and 32. @@ -1069,26 +2232,46 @@ typedef struct #define __HAL_RCC_PLLI2S_PLLSAICLKDIVQ_CONFIG(__PLLI2SDivQ__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_PLLI2SDIVQ, (__PLLI2SDivQ__)-1)) /** @brief Macro to configure the SAI clock Divider coming from PLLSAI. - * @note The SAI peripheral is only available with STM32F429x/439x Devices. * @note This function must be called before enabling the PLLSAI. * @param __PLLSAIDivQ__: specifies the PLLSAI division factor for SAI1 clock . * This parameter must be a number between Min_Data = 1 and Max_Data = 32. * SAI1 clock frequency = f(PLLSAIQ) / __PLLSAIDivQ__ */ #define __HAL_RCC_PLLSAI_PLLSAICLKDIVQ_CONFIG(__PLLSAIDivQ__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_PLLSAIDIVQ, ((__PLLSAIDivQ__)-1)<<8)) - +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) /** @brief Macro to configure the LTDC clock Divider coming from PLLSAI. * - * @note The LTDC peripheral is only available with STM32F429x/439x Devices. + * @note The LTDC peripheral is only available with STM32F427/437/429/439xx Devices. * @note This function must be called before enabling the PLLSAI. * @param __PLLSAIDivR__: specifies the PLLSAI division factor for LTDC clock . * This parameter must be a number between Min_Data = 2 and Max_Data = 16. * LTDC clock frequency = f(PLLSAIR) / __PLLSAIDivR__ */ #define __HAL_RCC_PLLSAI_PLLSAICLKDIVR_CONFIG(__PLLSAIDivR__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_PLLSAIDIVR, (__PLLSAIDivR__))) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/*-----------------------------------------------------------------------------------------------------------------------------------*/ +/*-------------------------------------------------- Peripheral Clock selection -----------------------------------------------------*/ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +/** @brief Macro to configure the I2S clock source (I2SCLK). + * @note This function must be called before enabling the I2S APB clock. + * @param __SOURCE__: specifies the I2S clock source. + * This parameter can be one of the following values: + * @arg RCC_I2SCLKSOURCE_PLLI2S: PLLI2S clock used as I2S clock source. + * @arg RCC_I2SCLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin + * used as I2S clock source. + */ +#define __HAL_RCC_I2S_CONFIG(__SOURCE__) (*(__IO uint32_t *) RCC_CFGR_I2SSRC_BB = (__SOURCE__)) +#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /** @brief Macro to configure SAI1BlockA clock source selection. - * @note The SAI peripheral is only available with STM32F429x/439x Devices. + * @note The SAI peripheral is only available with STM32F427/437/429/439xx Devices. * @note This function must be called before enabling PLLSAI, PLLI2S and * the SAI clock. * @param __SOURCE__: specifies the SAI Block A clock source. @@ -1103,7 +2286,7 @@ typedef struct #define __HAL_RCC_SAI_BLOCKACLKSOURCE_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_SAI1ASRC, (__SOURCE__))) /** @brief Macro to configure SAI1BlockB clock source selection. - * @note The SAI peripheral is only available with STM32F429x/439x Devices. + * @note The SAI peripheral is only available with STM32F427/437/429/439xx Devices. * @note This function must be called before enabling PLLSAI, PLLI2S and * the SAI clock. * @param __SOURCE__: specifies the SAI Block B clock source. @@ -1116,7 +2299,200 @@ typedef struct * used as SAI1 Block B clock. */ #define __HAL_RCC_SAI_BLOCKBCLKSOURCE_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_SAI1BSRC, (__SOURCE__))) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#if defined(STM32F446xx) +/** @brief Macro to configure SAI1 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @note This function must be called before enabling PLL, PLLSAI, PLLI2S and + * the SAI clock. + * @param __SOURCE__: specifies the SAI1 clock source. + * This parameter can be one of the following values: + * @arg RCC_SAI1CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used as SAI1 clock. + * @arg RCC_SAI1CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used as SAI1 clock. + * @arg RCC_SAI1CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI1 clock. + * @arg RCC_SAI1CLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as SAI1 clock. + */ +#define __HAL_RCC_SAI1_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_SAI1SRC, (__SOURCE__))) + +/** @brief Macro to Get SAI1 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @retval The clock source can be one of the following values: + * @arg RCC_SAI1CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used as SAI1 clock. + * @arg RCC_SAI1CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used as SAI1 clock. + * @arg RCC_SAI1CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI1 clock. + * @arg RCC_SAI1CLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as SAI1 clock. + */ +#define __HAL_RCC_GET_SAI1_SOURCE() (READ_BIT(RCC->DCKCFGR, RCC_DCKCFGR_SAI1SRC)) + +/** @brief Macro to configure SAI2 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @note This function must be called before enabling PLL, PLLSAI, PLLI2S and + * the SAI clock. + * @param __SOURCE__: specifies the SAI2 clock source. + * This parameter can be one of the following values: + * @arg RCC_SAI2CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used as SAI2 clock. + * @arg RCC_SAI2CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used as SAI2 clock. + * @arg RCC_SAI2CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI2 clock. + * @arg RCC_SAI2CLKSOURCE_PLLSRC: HSI or HSE depending from PLL Source clock used as SAI2 clock. + */ +#define __HAL_RCC_SAI2_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_SAI2SRC, (__SOURCE__))) + +/** @brief Macro to Get SAI2 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @retval The clock source can be one of the following values: + * @arg RCC_SAI2CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used as SAI2 clock. + * @arg RCC_SAI2CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used as SAI2 clock. + * @arg RCC_SAI2CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI2 clock. + * @arg RCC_SAI2CLKSOURCE_PLLSRC: HSI or HSE depending from PLL Source clock used as SAI2 clock. + */ +#define __HAL_RCC_GET_SAI2_SOURCE() (READ_BIT(RCC->DCKCFGR, RCC_DCKCFGR_SAI2SRC)) + +/** @brief Macro to configure I2S APB1 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @note This function must be called before enabling PLL, PLLI2S and the I2S clock. + * @param __SOURCE__: specifies the I2S APB1 clock source. + * This parameter can be one of the following values: + * @arg RCC_I2SAPB1CLKSOURCE_PLLI2S: PLLI2S VCO output clock divided by PLLI2SR used as I2S clock. + * @arg RCC_I2SAPB1CLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as SAI1 clock. + * @arg RCC_I2SAPB1CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI1 clock. + * @arg RCC_I2SAPB1CLKSOURCE_PLLSRC: HSI or HSE depending from PLL source Clock. + */ +#define __HAL_RCC_I2S_APB1_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_I2S1SRC, (__SOURCE__))) + +/** @brief Macro to Get I2S APB1 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @retval The clock source can be one of the following values: + * @arg RCC_I2SAPB1CLKSOURCE_PLLI2S: PLLI2S VCO output clock divided by PLLI2SR used as I2S clock. + * @arg RCC_I2SAPB1CLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as SAI1 clock. + * @arg RCC_I2SAPB1CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI1 clock. + * @arg RCC_I2SAPB1CLKSOURCE_PLLSRC: HSI or HSE depending from PLL source Clock. + */ +#define __HAL_RCC_GET_I2S_APB1_SOURCE() (READ_BIT(RCC->DCKCFGR, RCC_DCKCFGR_I2S1SRC)) + +/** @brief Macro to configure I2S APB2 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @note This function must be called before enabling PLL, PLLI2S and the I2S clock. + * @param __SOURCE__: specifies the SAI Block A clock source. + * This parameter can be one of the following values: + * @arg RCC_I2SAPB2CLKSOURCE_PLLI2S: PLLI2S VCO output clock divided by PLLI2SR used as I2S clock. + * @arg RCC_I2SAPB2CLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as SAI1 clock. + * @arg RCC_I2SAPB2CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI1 clock. + * @arg RCC_I2SAPB2CLKSOURCE_PLLSRC: HSI or HSE depending from PLL source Clock. + */ +#define __HAL_RCC_I2S_APB2_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR, RCC_DCKCFGR_I2S2SRC, (__SOURCE__))) + +/** @brief Macro to Get I2S APB2 clock source selection. + * @note This configuration is only available with STM32F446xx Devices. + * @retval The clock source can be one of the following values: + * @arg RCC_I2SAPB2CLKSOURCE_PLLI2S: PLLI2S VCO output clock divided by PLLI2SR used as I2S clock. + * @arg RCC_I2SAPB2CLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as SAI1 clock. + * @arg RCC_I2SAPB2CLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SAI1 clock. + * @arg RCC_I2SAPB2CLKSOURCE_PLLSRC: HSI or HSE depending from PLL source Clock. + */ +#define __HAL_RCC_GET_I2S_APB2_SOURCE() (READ_BIT(RCC->DCKCFGR, RCC_DCKCFGR_I2S2SRC)) + +/** @brief Macro to configure the CEC clock. + * @param __SOURCE__: specifies the CEC clock source. + * This parameter can be one of the following values: + * @arg RCC_CECCLKSOURCE_HSI: HSI selected as CEC clock + * @arg RCC_CECCLKSOURCE_LSE: LSE selected as CEC clock + */ +#define __HAL_RCC_CEC_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CECSEL, (uint32_t)(__SOURCE__))) + +/** @brief Macro to Get the CEC clock. + * @retval The clock source can be one of the following values: + * @arg RCC_CECCLKSOURCE_HSI488: HSI selected as CEC clock + * @arg RCC_CECCLKSOURCE_LSE: LSE selected as CEC clock + */ +#define __HAL_RCC_GET_CEC_SOURCE() (READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_CECSEL)) + +/** @brief Macro to configure the FMPI2C1 clock. + * @param __SOURCE__: specifies the FMPI2C1 clock source. + * This parameter can be one of the following values: + * @arg RCC_FMPI2C1CLKSOURCE_APB: APB selected as CEC clock + * @arg RCC_FMPI2C1CLKSOURCE_SYSCLK: SYS clock selected as CEC clock + * @arg RCC_FMPI2C1CLKSOURCE_HSI: HSI selected as CEC clock + */ +#define __HAL_RCC_FMPI2C1_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_FMPI2C1SEL, (uint32_t)(__SOURCE__))) + +/** @brief Macro to Get the FMPI2C1 clock. + * @retval The clock source can be one of the following values: + * @arg RCC_FMPI2C1CLKSOURCE_APB: APB selected as CEC clock + * @arg RCC_FMPI2C1CLKSOURCE_SYSCLK: SYS clock selected as CEC clock + * @arg RCC_FMPI2C1CLKSOURCE_HSI: HSI selected as CEC clock + */ +#define __HAL_RCC_GET_FMPI2C1_SOURCE() (READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_FMPI2C1SEL)) + +/** @brief Macro to configure the CLK48 clock. + * @param __SOURCE__: specifies the CK48 clock source. + * This parameter can be one of the following values: + * @arg RCC_CK48CLKSOURCE_PLLQ: PLL VCO Output divided by PLLQ used as CK48 clock. + * @arg RCC_CK48CLKSOURCE_PLLSAIP: PLLSAI VCO Output divided by PLLSAIP used as CK48 clock. + */ +#define __HAL_RCC_CLK48_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL, (uint32_t)(__SOURCE__))) + +/** @brief Macro to Get the CLK48 clock. + * @retval The clock source can be one of the following values: + * @arg RCC_CK48CLKSOURCE_PLLQ: PLL VCO Output divided by PLLQ used as CK48 clock. + * @arg RCC_CK48CLKSOURCE_PLLSAIP: PLLSAI VCO Output divided by PLLSAIP used as CK48 clock. + */ +#define __HAL_RCC_GET_CLK48_SOURCE() (READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL)) + +/** @brief Macro to configure the SDIO clock. + * @param __SOURCE__: specifies the SDIO clock source. + * This parameter can be one of the following values: + * @arg RCC_SDIOCLKSOURCE_CK48: CK48 output used as SDIO clock. + * @arg RCC_SDIOCLKSOURCE_SYSCLK: System clock output used as SDIO clock. + */ +#define __HAL_RCC_SDIO_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_SDIOSEL, (uint32_t)(__SOURCE__))) + +/** @brief Macro to Get the SDIO clock. + * @retval The clock source can be one of the following values: + * @arg RCC_SDIOCLKSOURCE_CK48: CK48 output used as SDIO clock. + * @arg RCC_SDIOCLKSOURCE_SYSCLK: System clock output used as SDIO clock. + */ +#define __HAL_RCC_GET_SDIO_SOURCE() (READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_SDIOSEL)) + +/** @brief Macro to configure the SPDIFRX clock. + * @param __SOURCE__: specifies the SPDIFRX clock source. + * This parameter can be one of the following values: + * @arg RCC_SPDIFRXCLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SPDIFRX clock. + * @arg RCC_SPDIFRXCLKSOURCE_PLLI2SP: PLLI2S VCO Output divided by PLLI2SP used as SPDIFRX clock. + */ +#define __HAL_RCC_SPDIFRX_CONFIG(__SOURCE__) (MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_SPDIFRXSEL, (uint32_t)(__SOURCE__))) + +/** @brief Macro to Get the SPDIFRX clock. + * @retval The clock source can be one of the following values: + * @arg RCC_SPDIFRXCLKSOURCE_PLLR: PLL VCO Output divided by PLLR used as SPDIFRX clock. + * @arg RCC_SPDIFRXCLKSOURCE_PLLI2SP: PLLI2S VCO Output divided by PLLI2SP used as SPDIFRX clock. + */ +#define __HAL_RCC_GET_SPDIFRX_SOURCE() (READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_SPDIFRXSEL)) +#endif /* STM32F446xx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) + +/** @brief Macro to configure the Timers clocks prescalers + * @note This feature is only available with STM32F429x/439x Devices. + * @param __PRESC__ : specifies the Timers clocks prescalers selection + * This parameter can be one of the following values: + * @arg RCC_TIMPRES_DESACTIVATED: The Timers kernels clocks prescaler is + * equal to HPRE if PPREx is corresponding to division by 1 or 2, + * else it is equal to [(HPRE * PPREx) / 2] if PPREx is corresponding to + * division by 4 or more. + * @arg RCC_TIMPRES_ACTIVATED: The Timers kernels clocks prescaler is + * equal to HPRE if PPREx is corresponding to division by 1, 2 or 4, + * else it is equal to [(HPRE * PPREx) / 4] if PPREx is corresponding + * to division by 8 or more. + */ +#define __HAL_RCC_TIMCLKPRESCALER(__PRESC__) (*(__IO uint32_t *) RCC_DCKCFGR_TIMPRE_BB = (__PRESC__)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx) || STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx */ + +/*-------------------------------------------------------------------------------------------------------------------*/ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /** @brief Enable PLLSAI_RDY interrupt. */ #define __HAL_RCC_PLLSAI_ENABLE_IT() (RCC->CIR |= (RCC_CIR_PLLSAIRDYIE)) @@ -1139,15 +2515,30 @@ typedef struct */ #define __HAL_RCC_PLLSAI_GET_FLAG() ((RCC->CR & (RCC_CR_PLLSAIRDY)) == (RCC_CR_PLLSAIRDY)) -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup RCCEx_Exported_Functions + * @{ + */ + +/** @addtogroup RCCEx_Exported_Functions_Group1 + * @{ + */ HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit); void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit); -#if defined(STM32F411xE) +#if defined(STM32F446xx) +uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk); +#endif /* STM32F446xx */ + +#if defined(STM32F411xE) || defined(STM32F446xx) void HAL_RCCEx_SelectLSEMode(uint8_t Mode); -#endif /* STM32F411xE */ +#endif /* STM32F411xE || STM32F446xx */ /** * @} */ @@ -1155,7 +2546,158 @@ void HAL_RCCEx_SelectLSEMode(uint8_t Mode); /** * @} */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup RCCEx_Private_Constants RCCEx Private Constants + * @{ + */ + +/** @defgroup RCCEx_BitAddress_AliasRegion RCC BitAddress AliasRegion + * @brief RCC registers bit address in the alias region + * @{ + */ +/* --- CR Register ---*/ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +/* Alias word address of PLLSAION bit */ +#define RCC_PLLSAION_BIT_NUMBER 0x1C +#define RCC_CR_PLLSAION_BB (PERIPH_BB_BASE + (RCC_CR_OFFSET * 32) + (RCC_PLLSAION_BIT_NUMBER * 4)) + +/* --- DCKCFGR Register ---*/ +/* Alias word address of TIMPRE bit */ +#define RCC_DCKCFGR_OFFSET (RCC_OFFSET + 0x8C) +#define RCC_TIMPRE_BIT_NUMBER 0x18 +#define RCC_DCKCFGR_TIMPRE_BB (PERIPH_BB_BASE + (RCC_DCKCFGR_OFFSET * 32) + (RCC_TIMPRE_BIT_NUMBER * 4)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ + +#define PLL_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */ + +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @addtogroup RCCEx_Private_Macros RCCEx Private Macros + * @{ + */ +/** @defgroup RCCEx_IS_RCC_Definitions RCC Private macros to check input parameters + * @{ + */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((1 <= (SELECTION)) && ((SELECTION) <= 0x0000002F)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) ||\ + defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((1 <= (SELECTION)) && ((SELECTION) <= 0x00000003)) +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F411xE */ + +#if defined(STM32F446xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((1 <= (SELECTION)) && ((SELECTION) <= 0x000007FF)) +#endif /* STM32F446xx */ + +#define IS_RCC_PLLI2SN_VALUE(VALUE) ((192 <= (VALUE)) && ((VALUE) <= 432)) +#define IS_RCC_PLLI2SR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7)) + + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) || defined(STM32F446xx) +#define IS_RCC_PLLI2SQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15)) + +#define IS_RCC_PLLSAIN_VALUE(VALUE) ((49 <= (VALUE)) && ((VALUE) <= 432)) + +#define IS_RCC_PLLSAIQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15)) + +#define IS_RCC_PLLSAIR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7)) + +#define IS_RCC_PLLSAI_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32)) + +#define IS_RCC_PLLI2S_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32)) + +#define IS_RCC_PLLSAI_DIVR_VALUE(VALUE) (((VALUE) == RCC_PLLSAIDIVR_2) ||\ + ((VALUE) == RCC_PLLSAIDIVR_4) ||\ + ((VALUE) == RCC_PLLSAIDIVR_8) ||\ + ((VALUE) == RCC_PLLSAIDIVR_16)) +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + +#if defined(STM32F446xx) || defined(STM32F411xE) +#define IS_RCC_PLLI2SM_VALUE(VALUE) ((VALUE) <= 63) + +#define IS_RCC_LSE_MODE(MODE) (((MODE) == RCC_LSE_LOWPOWER_MODE) ||\ + ((MODE) == RCC_LSE_HIGHDRIVE_MODE)) +#endif /* STM32F446xx || STM32F411xE */ + +#if defined(STM32F446xx) +#define IS_RCC_PLLR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7)) + +#define IS_RCC_PLLI2SP_VALUE(VALUE) (((VALUE) == RCC_PLLI2SP_DIV2) ||\ + ((VALUE) == RCC_PLLI2SP_DIV4) ||\ + ((VALUE) == RCC_PLLI2SP_DIV6) ||\ + ((VALUE) == RCC_PLLI2SP_DIV8)) + +#define IS_RCC_PLLSAIM_VALUE(VALUE) ((VALUE) <= 63) +#define IS_RCC_PLLSAIP_VALUE(VALUE) (((VALUE) == RCC_PLLSAIP_DIV2) ||\ + ((VALUE) == RCC_PLLSAIP_DIV4) ||\ + ((VALUE) == RCC_PLLSAIP_DIV6) ||\ + ((VALUE) == RCC_PLLSAIP_DIV8)) + +#define IS_RCC_SAI1CLKSOURCE(SOURCE) (((SOURCE) == RCC_SAI1CLKSOURCE_PLLSAI) ||\ + ((SOURCE) == RCC_SAI1CLKSOURCE_PLLI2S) ||\ + ((SOURCE) == RCC_SAI1CLKSOURCE_PLLR) ||\ + ((SOURCE) == RCC_SAI1CLKSOURCE_EXT)) + +#define IS_RCC_SAI2CLKSOURCE(SOURCE) (((SOURCE) == RCC_SAI2CLKSOURCE_PLLSAI) ||\ + ((SOURCE) == RCC_SAI2CLKSOURCE_PLLI2S) ||\ + ((SOURCE) == RCC_SAI2CLKSOURCE_PLLR) ||\ + ((SOURCE) == RCC_SAI2CLKSOURCE_PLLSRC)) + +#define IS_RCC_I2SAPB1CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2SAPB1CLKSOURCE_PLLI2S) ||\ + ((SOURCE) == RCC_I2SAPB1CLKSOURCE_EXT) ||\ + ((SOURCE) == RCC_I2SAPB1CLKSOURCE_PLLR) ||\ + ((SOURCE) == RCC_I2SAPB1CLKSOURCE_PLLSRC)) + + #define IS_RCC_I2SAPB2CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2SAPB2CLKSOURCE_PLLI2S) ||\ + ((SOURCE) == RCC_I2SAPB2CLKSOURCE_EXT) ||\ + ((SOURCE) == RCC_I2SAPB2CLKSOURCE_PLLR) ||\ + ((SOURCE) == RCC_I2SAPB2CLKSOURCE_PLLSRC)) + +#define IS_RCC_FMPI2C1CLKSOURCE(SOURCE) (((SOURCE) == RCC_FMPI2C1CLKSOURCE_APB) ||\ + ((SOURCE) == RCC_FMPI2C1CLKSOURCE_SYSCLK) ||\ + ((SOURCE) == RCC_FMPI2C1CLKSOURCE_HSI)) + +#define IS_RCC_CECCLKSOURCE(SOURCE) (((SOURCE) == RCC_CECCLKSOURCE_HSI) ||\ + ((SOURCE) == RCC_CECCLKSOURCE_LSE)) + +#define IS_RCC_CK48CLKSOURCE(SOURCE) (((SOURCE) == RCC_CK48CLKSOURCE_PLLQ) ||\ + ((SOURCE) == RCC_CK48CLKSOURCE_PLLSAIP)) + +#define IS_RCC_SDIOCLKSOURCE(SOURCE) (((SOURCE) == RCC_SDIOCLKSOURCE_CK48) ||\ + ((SOURCE) == RCC_SDIOCLKSOURCE_SYSCLK)) + +#define IS_RCC_SPDIFRXCLKSOURCE(SOURCE) (((SOURCE) == RCC_SPDIFRXCLKSOURCE_PLLR) ||\ + ((SOURCE) == RCC_SPDIFRXCLKSOURCE_PLLI2SP)) +#endif /* STM32F446xx */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.c index a98fff66647..7e9364094d8 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_rng.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief RNG HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Random Number Generator (RNG) peripheral: @@ -15,20 +15,21 @@ ============================================================================== ##### How to use this driver ##### ============================================================================== - [..] + [..] The RNG HAL driver can be used as follows: - (#) Enable the RNG controller clock using __RNG_CLK_ENABLE() macro. - (#) Activate the RNG peripheral using __HAL_RNG_ENABLE() macro. - (#) Wait until the 32 bit Random Number Generator contains a valid - random data using (polling/interrupt) mode. - (#) Get the 32 bit random number using HAL_RNG_GetRandomNumber() function. + (#) Enable the RNG controller clock using __HAL_RCC_RNG_CLK_ENABLE() macro + in HAL_RNG_MspInit(). + (#) Activate the RNG peripheral using HAL_RNG_Init() function. + (#) Wait until the 32 bit Random Number Generator contains a valid + random data using (polling/interrupt) mode. + (#) Get the 32 bit random number using HAL_RNG_GenerateRandomNumber() function. @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -62,8 +63,7 @@ * @{ */ -/** @defgroup RNG - * @brief RNG HAL module driver. +/** @addtogroup RNG * @{ */ @@ -72,22 +72,31 @@ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -#define RNG_TIMEOUT_VALUE 1000 -/* Private macro -------------------------------------------------------------*/ + +/* Private types -------------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @addtogroup RNG_Private_Constants + * @{ + */ +#define RNG_TIMEOUT_VALUE 2 +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ +/* Private functions prototypes ----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ -/** @defgroup RNG_Private_Functions +/** @addtogroup RNG_Exported_Functions * @{ */ -/** @defgroup RNG_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions. +/** @addtogroup RNG_Exported_Functions_Group1 + * @brief Initialization and de-initialization functions * -@verbatim +@verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== @@ -97,14 +106,13 @@ (+) DeInitialize the RNG peripheral (+) Initialize the RNG MSP (+) DeInitialize RNG MSP - + @endverbatim * @{ */ - + /** - * @brief Initializes the RNG according to the specified - * parameters in the RNG_InitTypeDef and creates the associated handle. + * @brief Initializes the RNG peripheral and creates the associated handle. * @param hrng: pointer to a RNG_HandleTypeDef structure that contains * the configuration information for RNG. * @retval HAL status @@ -116,12 +124,17 @@ HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng) { return HAL_ERROR; } - + + __HAL_LOCK(hrng); + if(hrng->State == HAL_RNG_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hrng->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_RNG_MspInit(hrng); } + /* Change RNG peripheral state */ hrng->State = HAL_RNG_STATE_BUSY; @@ -130,7 +143,9 @@ HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng) /* Initialize the RNG state */ hrng->State = HAL_RNG_STATE_READY; - + + __HAL_UNLOCK(hrng); + /* Return function status */ return HAL_OK; } @@ -143,22 +158,16 @@ HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng) */ HAL_StatusTypeDef HAL_RNG_DeInit(RNG_HandleTypeDef *hrng) { - /* Check the RNG peripheral state */ - if(hrng->State == HAL_RNG_STATE_BUSY) + /* Check the RNG handle allocation */ + if(hrng == HAL_NULL) { - return HAL_BUSY; + return HAL_ERROR; } - - /* Update the RNG state */ - hrng->State = HAL_RNG_STATE_BUSY; - /* Disable the RNG Peripheral */ - __HAL_RNG_DISABLE(hrng); + CLEAR_BIT(hrng->Instance->CR, RNG_CR_IE | RNG_CR_RNGEN); - /* Set the RNG registers to their reset values */ - hrng->Instance->CR &= 0xFFFFFFF3; - hrng->Instance->SR &= 0xFFFFFF98; - hrng->Instance->DR &= 0x0; + /* Clear RNG interrupt status flags */ + CLEAR_BIT(hrng->Instance->SR, RNG_SR_CEIS | RNG_SR_SEIS); /* DeInit the low level hardware */ HAL_RNG_MspDeInit(hrng); @@ -181,8 +190,8 @@ HAL_StatusTypeDef HAL_RNG_DeInit(RNG_HandleTypeDef *hrng) */ __weak void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng) { - /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RNG_MspInit could be implemented in the user file + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_RNG_MspInit must be implemented in the user file. */ } @@ -194,8 +203,8 @@ __weak void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng) */ __weak void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng) { - /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RNG_MspDeInit could be implemented in the user file + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_RNG_MspDeInit must be implemented in the user file. */ } @@ -203,8 +212,8 @@ __weak void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng) * @} */ -/** @defgroup RNG_Group2 Peripheral Control functions - * @brief management functions. +/** @addtogroup RNG_Exported_Functions_Group2 + * @brief Peripheral Control functions * @verbatim =============================================================================== @@ -215,73 +224,102 @@ __weak void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng) (+) Get the 32 bit Random number with interrupt enabled (+) Handle RNG interrupt request - @endverbatim * @{ */ - + /** - * @brief Returns a 32-bit random number. + * @brief Generates a 32-bit random number. * @note Each time the random number data is read the RNG_FLAG_DRDY flag * is automatically cleared. * @param hrng: pointer to a RNG_HandleTypeDef structure that contains * the configuration information for RNG. - * @retval 32-bit random number + * @param random32bit: pointer to generated random number variable if successful. + * @retval HAL status */ -uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng) + +HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t *random32bit) { - uint32_t random32bit = 0; uint32_t tickstart = 0; - + HAL_StatusTypeDef status = HAL_OK; + /* Process Locked */ __HAL_LOCK(hrng); - /* Get tick */ - tickstart = HAL_GetTick(); + /* Check RNG peripheral state */ + if(hrng->State == HAL_RNG_STATE_READY) + { + /* Change RNG peripheral state */ + hrng->State = HAL_RNG_STATE_BUSY; + + /* Get tick */ + tickstart = HAL_GetTick(); - /* Check if data register contains valid random data */ - while(__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_DRDY) == RESET) + /* Check if data register contains valid random data */ + while(__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_DRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > RNG_TIMEOUT_VALUE) + { + hrng->State = HAL_RNG_STATE_ERROR; + + /* Process Unlocked */ + __HAL_UNLOCK(hrng); + + return HAL_TIMEOUT; + } + } + + /* Get a 32bit Random number */ + hrng->RandomNumber = hrng->Instance->DR; + *random32bit = hrng->RandomNumber; + + hrng->State = HAL_RNG_STATE_READY; + } + else { - if((HAL_GetTick() - tickstart ) > RNG_TIMEOUT_VALUE) - { - return HAL_TIMEOUT; - } + status = HAL_ERROR; } - /* Get a 32bit Random number */ - random32bit = hrng->Instance->DR; - /* Process Unlocked */ __HAL_UNLOCK(hrng); - /* Return the 32 bit random number */ - return random32bit; + return status; } /** - * @brief Returns a 32-bit random number with interrupt enabled. + * @brief Generates a 32-bit random number in interrupt mode. * @param hrng: pointer to a RNG_HandleTypeDef structure that contains * the configuration information for RNG. - * @retval 32-bit random number + * @retval HAL status */ -uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng) +HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT(RNG_HandleTypeDef *hrng) { - uint32_t random32bit = 0; + HAL_StatusTypeDef status = HAL_OK; /* Process Locked */ __HAL_LOCK(hrng); - /* Change RNG peripheral state */ - hrng->State = HAL_RNG_STATE_BUSY; - - /* Get a 32bit Random number */ - random32bit = hrng->Instance->DR; + /* Check RNG peripheral state */ + if(hrng->State == HAL_RNG_STATE_READY) + { + /* Change RNG peripheral state */ + hrng->State = HAL_RNG_STATE_BUSY; - /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */ - __HAL_RNG_ENABLE_IT(hrng); + /* Process Unlocked */ + __HAL_UNLOCK(hrng); + + /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */ + __HAL_RNG_ENABLE_IT(hrng); + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hrng); + + status = HAL_ERROR; + } - /* Return the 32 bit random number */ - return random32bit; + return status; } /** @@ -289,15 +327,17 @@ uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng) * @note In the case of a clock error, the RNG is no more able to generate * random numbers because the PLL48CLK clock is not correct. User has * to check that the clock controller is correctly configured to provide - * the RNG clock and clear the CEIS bit using __HAL_RNG_CLEAR_FLAG(). + * the RNG clock and clear the CEIS bit using __HAL_RNG_CLEAR_IT(). * The clock error has no impact on the previously generated * random numbers, and the RNG_DR register contents can be used. * @note In the case of a seed error, the generation of random numbers is * interrupted as long as the SECS bit is '1'. If a number is * available in the RNG_DR register, it must not be used because it may * not have enough entropy. In this case, it is recommended to clear the - * SEIS bit using __HAL_RNG_CLEAR_FLAG(), then disable and enable + * SEIS bit using __HAL_RNG_CLEAR_IT(), then disable and enable * the RNG peripheral to reinitialize and restart the RNG. + * @note User-written HAL_RNG_ErrorCallback() API is called once whether SEIS + * or CEIS are set. * @param hrng: pointer to a RNG_HandleTypeDef structure that contains * the configuration information for RNG. * @retval None @@ -306,63 +346,106 @@ uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng) void HAL_RNG_IRQHandler(RNG_HandleTypeDef *hrng) { /* RNG clock error interrupt occurred */ - if(__HAL_RNG_GET_FLAG(hrng, RNG_IT_CEI) != RESET) + if((__HAL_RNG_GET_IT(hrng, RNG_IT_CEI) != RESET) || (__HAL_RNG_GET_IT(hrng, RNG_IT_SEI) != RESET)) { - HAL_RNG_ErrorCallback(hrng); - - /* Clear the clock error flag */ - __HAL_RNG_CLEAR_FLAG(hrng, RNG_IT_CEI); - /* Change RNG peripheral state */ hrng->State = HAL_RNG_STATE_ERROR; - - /* Process Unlocked */ - __HAL_UNLOCK(hrng); - } - /* RNG seed error interrupt occurred */ - if(__HAL_RNG_GET_FLAG(hrng, RNG_IT_SEI) != RESET) - { HAL_RNG_ErrorCallback(hrng); - /* Clear the seed error flag */ - __HAL_RNG_CLEAR_FLAG(hrng, RNG_IT_SEI); + /* Clear the clock error flag */ + __HAL_RNG_CLEAR_IT(hrng, RNG_IT_CEI|RNG_IT_SEI); - /* Change RNG peripheral state */ - hrng->State = HAL_RNG_STATE_ERROR; - - /* Process Unlocked */ - __HAL_UNLOCK(hrng); } - /* Check RNG data ready flag */ - if(__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_DRDY) != RESET) + /* Check RNG data ready interrupt occurred */ + if(__HAL_RNG_GET_IT(hrng, RNG_IT_DRDY) != RESET) { - /* Data Ready callback */ - HAL_RNG_ReadyCallback(hrng); + /* Generate random number once, so disable the IT */ + __HAL_RNG_DISABLE_IT(hrng); - /* Change RNG peripheral state */ - hrng->State = HAL_RNG_STATE_READY; - - /* Clear the RNG Data Ready flag */ - __HAL_RNG_CLEAR_FLAG(hrng, RNG_FLAG_DRDY); + /* Get the 32bit Random number (DRDY flag automatically cleared) */ + hrng->RandomNumber = hrng->Instance->DR; - /* Process Unlocked */ - __HAL_UNLOCK(hrng); + if(hrng->State != HAL_RNG_STATE_ERROR) + { + /* Change RNG peripheral state */ + hrng->State = HAL_RNG_STATE_READY; + + /* Data Ready callback */ + HAL_RNG_ReadyDataCallback(hrng, hrng->RandomNumber); + } } } +/** + * @brief Returns generated random number in polling mode (Obsolete) + * Use HAL_RNG_GenerateRandomNumber() API instead. + * @param hrng: pointer to a RNG_HandleTypeDef structure that contains + * the configuration information for RNG. + * @retval Random value + */ +uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng) +{ + if(HAL_RNG_GenerateRandomNumber(hrng, &(hrng->RandomNumber)) == HAL_OK) + { + return hrng->RandomNumber; + } + else + { + return 0; + } +} + +/** + * @brief Returns a 32-bit random number with interrupt enabled (Obsolete), + * Use HAL_RNG_GenerateRandomNumber_IT() API instead. + * @param hrng: pointer to a RNG_HandleTypeDef structure that contains + * the configuration information for RNG. + * @retval 32-bit random number + */ +uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng) +{ + uint32_t random32bit = 0; + + /* Process locked */ + __HAL_LOCK(hrng); + + /* Change RNG peripheral state */ + hrng->State = HAL_RNG_STATE_BUSY; + + /* Get a 32bit Random number */ + random32bit = hrng->Instance->DR; + + /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */ + __HAL_RNG_ENABLE_IT(hrng); + + /* Return the 32 bit random number */ + return random32bit; +} + +/** + * @brief Read latest generated random number. + * @param hrng: pointer to a RNG_HandleTypeDef structure that contains + * the configuration information for RNG. + * @retval random value + */ +uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng) +{ + return(hrng->RandomNumber); +} + /** * @brief Data Ready callback in non-blocking mode. * @param hrng: pointer to a RNG_HandleTypeDef structure that contains * the configuration information for RNG. + * @param random32bit: generated random number. * @retval None */ - -__weak void HAL_RNG_ReadyCallback(RNG_HandleTypeDef* hrng) +__weak void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef *hrng, uint32_t random32bit) { - /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RNG_ReadyCallback could be implemented in the user file + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_RNG_ReadyDataCallback must be implemented in the user file. */ } @@ -374,17 +457,17 @@ __weak void HAL_RNG_ReadyCallback(RNG_HandleTypeDef* hrng) */ __weak void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng) { - /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RNG_ErrorCallback could be implemented in the user file - */ + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_RNG_ErrorCallback must be implemented in the user file. + */ } - /** * @} - */ + */ -/** @defgroup RNG_Group3 Peripheral State functions - * @brief Peripheral State functions. + +/** @addtogroup RNG_Exported_Functions_Group3 + * @brief Peripheral State functions * @verbatim =============================================================================== @@ -397,7 +480,7 @@ __weak void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng) @endverbatim * @{ */ - + /** * @brief Returns the RNG state. * @param hrng: pointer to a RNG_HandleTypeDef structure that contains @@ -412,7 +495,7 @@ HAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng) /** * @} */ - + /** * @} */ @@ -420,6 +503,7 @@ HAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng) #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #endif /* HAL_RNG_MODULE_ENABLED */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.h index 10b5ae82344..c523ed5b37e 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rng.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_rng.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of RNG HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -33,7 +33,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** - */ + */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_RNG_H @@ -45,6 +45,7 @@ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" @@ -52,15 +53,20 @@ * @{ */ -/** @addtogroup RNG +/** @defgroup RNG RNG + * @brief RNG HAL module driver * @{ - */ + */ /* Exported types ------------------------------------------------------------*/ -/** - * @brief RNG HAL State Structure definition - */ +/** @defgroup RNG_Exported_Types RNG Exported Types + * @{ + */ + +/** @defgroup RNG_Exported_Types_Group1 RNG State Structure definition + * @{ + */ typedef enum { HAL_RNG_STATE_RESET = 0x00, /*!< RNG not yet initialized or disabled */ @@ -72,47 +78,55 @@ typedef enum }HAL_RNG_StateTypeDef; /** - * @brief RNG Handle Structure definition + * @} + */ + +/** @defgroup RNG_Exported_Types_Group2 RNG Handle Structure definition + * @{ */ typedef struct { - RNG_TypeDef *Instance; /*!< Register base address */ + RNG_TypeDef *Instance; /*!< Register base address */ - HAL_LockTypeDef Lock; /*!< RNG locking object */ + HAL_LockTypeDef Lock; /*!< RNG locking object */ - __IO HAL_RNG_StateTypeDef State; /*!< RNG communication state */ + __IO HAL_RNG_StateTypeDef State; /*!< RNG communication state */ + + uint32_t RandomNumber; /*!< Last Generated RNG Data */ }RNG_HandleTypeDef; +/** + * @} + */ + +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup RNG_Exported_Constants +/** @defgroup RNG_Exported_Constants RNG Exported Constants * @{ */ -/** @defgroup RNG_Interrupt_definition +/** @defgroup RNG_Exported_Constants_Group1 RNG Interrupt definition * @{ - */ -#define RNG_IT_CEI ((uint32_t)0x20) /*!< Clock error interrupt */ -#define RNG_IT_SEI ((uint32_t)0x40) /*!< Seed error interrupt */ - -#define IS_RNG_IT(IT) (((IT) == RNG_IT_CEI) || \ - ((IT) == RNG_IT_SEI)) + */ +#define RNG_IT_DRDY RNG_SR_DRDY /*!< Data Ready interrupt */ +#define RNG_IT_CEI RNG_SR_CEIS /*!< Clock error interrupt */ +#define RNG_IT_SEI RNG_SR_SEIS /*!< Seed error interrupt */ /** * @} */ - -/** @defgroup RNG_Flag_definition +/** @defgroup RNG_Exported_Constants_Group2 RNG Flag definition * @{ - */ -#define RNG_FLAG_DRDY ((uint32_t)0x0001) /*!< Data ready */ -#define RNG_FLAG_CECS ((uint32_t)0x0002) /*!< Clock error current status */ -#define RNG_FLAG_SECS ((uint32_t)0x0004) /*!< Seed error current status */ + */ +#define RNG_FLAG_DRDY RNG_SR_DRDY /*!< Data ready */ +#define RNG_FLAG_CECS RNG_SR_CECS /*!< Clock error current status */ +#define RNG_FLAG_SECS RNG_SR_SECS /*!< Seed error current status */ -#define IS_RNG_FLAG(FLAG) (((FLAG) == RNG_FLAG_DRDY) || \ - ((FLAG) == RNG_FLAG_CECS) || \ - ((FLAG) == RNG_FLAG_SECS)) /** * @} */ @@ -121,7 +135,11 @@ typedef struct * @} */ -/* Exported macro ------------------------------------------------------------*/ +/* Exported macros -----------------------------------------------------------*/ + +/** @defgroup RNG_Exported_Macros RNG Exported Macros + * @{ + */ /** @brief Reset RNG handle state * @param __HANDLE__: RNG Handle @@ -144,21 +162,29 @@ typedef struct #define __HAL_RNG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~RNG_CR_RNGEN) /** - * @brief Gets the selected RNG's flag status. + * @brief Check the selected RNG flag status. * @param __HANDLE__: RNG Handle * @param __FLAG__: RNG flag - * @retval The new state of RNG_FLAG (SET or RESET). + * This parameter can be one of the following values: + * @arg RNG_FLAG_DRDY: Data ready + * @arg RNG_FLAG_CECS: Clock error current status + * @arg RNG_FLAG_SECS: Seed error current status + * @retval The new state of __FLAG__ (SET or RESET). */ #define __HAL_RNG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) /** - * @brief Clears the RNG's pending flags. - * @param __HANDLE__: RNG Handle - * @param __FLAG__: RNG flag + * @brief Clears the selected RNG flag status. + * @param __HANDLE__: RNG handle + * @param __FLAG__: RNG flag to clear + * @note WARNING: This is a dummy macro for HAL code alignment, + * flags RNG_FLAG_DRDY, RNG_FLAG_CECS and RNG_FLAG_SECS are read-only. * @retval None */ -#define __HAL_RNG_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__)) - +#define __HAL_RNG_CLEAR_FLAG(__HANDLE__, __FLAG__) /* dummy macro */ + + + /** * @brief Enables the RNG interrupts. * @param __HANDLE__: RNG Handle @@ -176,47 +202,163 @@ typedef struct /** * @brief Checks whether the specified RNG interrupt has occurred or not. * @param __HANDLE__: RNG Handle - * @param __INTERRUPT__: specifies the RNG interrupt source to check. + * @param __INTERRUPT__: specifies the RNG interrupt status flag to check. * This parameter can be one of the following values: - * @arg RNG_FLAG_DRDY: Data ready interrupt - * @arg RNG_FLAG_CECS: Clock error interrupt - * @arg RNG_FLAG_SECS: Seed error interrupt - * @retval The new state of RNG_FLAG (SET or RESET). + * @arg RNG_IT_DRDY: Data ready interrupt + * @arg RNG_IT_CEI: Clock error interrupt + * @arg RNG_IT_SEI: Seed error interrupt + * @retval The new state of __INTERRUPT__ (SET or RESET). */ #define __HAL_RNG_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->SR & (__INTERRUPT__)) == (__INTERRUPT__)) +/** + * @brief Clear the RNG interrupt status flags. + * @param __HANDLE__: RNG Handle + * @param __INTERRUPT__: specifies the RNG interrupt status flag to clear. + * This parameter can be one of the following values: + * @arg RNG_IT_CEI: Clock error interrupt + * @arg RNG_IT_SEI: Seed error interrupt + * @note RNG_IT_DRDY flag is read-only, reading RNG_DR register automatically clears RNG_IT_DRDY. + * @retval None + */ +#define __HAL_RNG_CLEAR_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->SR) = ~(__INTERRUPT__)) + +/** + * @} + */ + /* Exported functions --------------------------------------------------------*/ +/** @defgroup RNG_Exported_Functions RNG Exported Functions + * @{ + */ -/* Initialization/de-initialization functions **********************************/ +/** @defgroup RNG_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng); HAL_StatusTypeDef HAL_RNG_DeInit (RNG_HandleTypeDef *hrng); void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng); void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng); -/* Peripheral Control functions ************************************************/ -uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng); -uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng); +/** + * @} + */ + +/** @defgroup RNG_Exported_Functions_Group2 Peripheral Control functions + * @{ + */ +uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng); /* Obsolete, use HAL_RNG_GenerateRandomNumber() instead */ +uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng); /* Obsolete, use HAL_RNG_GenerateRandomNumber_IT() instead */ + +HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t *random32bit); +HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT(RNG_HandleTypeDef *hrng); +uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng); + void HAL_RNG_IRQHandler(RNG_HandleTypeDef *hrng); -void HAL_RNG_ReadyCallback(RNG_HandleTypeDef* hrng); void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng); +void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef* hrng, uint32_t random32bit); + +/** + * @} + */ -/* Peripheral State functions **************************************************/ +/** @defgroup RNG_Exported_Functions_Group3 Peripheral State functions + * @{ + */ HAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng); -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/** @defgroup RNG_Private_Types RNG Private Types + * @{ + */ + +/** + * @} + */ + +/* Private defines -----------------------------------------------------------*/ +/** @defgroup RNG_Private_Defines RNG Private Defines + * @{ + */ /** * @} */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup RNG_Private_Variables RNG Private Variables + * @{ + */ /** * @} */ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup RNG_Private_Constants RNG Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup RNG_Private_Macros RNG Private Macros + * @{ + */ +#define IS_RNG_IT(IT) (((IT) == RNG_IT_CEI) || \ + ((IT) == RNG_IT_SEI)) + +#define IS_RNG_FLAG(FLAG) (((FLAG) == RNG_FLAG_DRDY) || \ + ((FLAG) == RNG_FLAG_CECS) || \ + ((FLAG) == RNG_FLAG_SECS)) + +/** + * @} + */ + +/* Private functions prototypes ----------------------------------------------*/ +/** @defgroup RNG_Private_Functions_Prototypes RNG Private Functions Prototypes + * @{ + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup RNG_Private_Functions RNG Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + #ifdef __cplusplus } #endif + #endif /* __STM32F4xx_HAL_RNG_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.c index dd580785c0f..9d7b949891f 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_rtc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief RTC HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Real Time Clock (RTC) peripheral: @@ -61,7 +61,7 @@ accesses. [..] To enable access to the RTC Domain and RTC registers, proceed as follows: (+) Enable the Power Controller (PWR) APB1 interface clock using the - __PWR_CLK_ENABLE() function. + __HAL_RCC_PWR_CLK_ENABLE() function. (+) Enable access to RTC domain using the HAL_PWR_EnableBkUpAccess() function. (+) Select the RTC clock source using the __HAL_RCC_RTC_CONFIG() function. (+) Enable RTC Clock using the __HAL_RCC_RTC_ENABLE() function. @@ -93,22 +93,22 @@ [..] The MCU can be woken up from a low power mode by an RTC alternate function. [..] The RTC alternate functions are the RTC alarms (Alarm A and Alarm B), - RTC wakeup, RTC tamper event detection and RTC time stamp event detection. + RTC wake-up, RTC tamper event detection and RTC time stamp event detection. These RTC alternate functions can wake up the system from the Stop and Standby low power modes. [..] The system can also wake up from low power modes without depending - on an external interrupt (Auto-wakeup mode), by using the RTC alarm - or the RTC wakeup events. + on an external interrupt (Auto-wake-up mode), by using the RTC alarm + or the RTC wake-up events. [..] The RTC provides a programmable time base for waking up from the Stop or Standby mode at regular intervals. - Wakeup from STOP and STANDBY modes is possible only when the RTC clock source + Wake-up from STOP and STANDBY modes is possible only when the RTC clock source is LSE or LSI. @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -142,7 +142,7 @@ * @{ */ -/** @defgroup RTC +/** @defgroup RTC RTC * @brief RTC HAL module driver * @{ */ @@ -156,11 +156,11 @@ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -/** @defgroup RTC_Private_Functions +/** @defgroup RTC_Exported_Functions RTC Exported Functions * @{ */ -/** @defgroup RTC_Group1 Initialization and de-initialization functions +/** @defgroup RTC_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -183,7 +183,7 @@ and its value can be updated. When the initialization sequence is complete, the calendar restarts counting after 4 RTCCLK cycles. (#) To read the calendar through the shadow registers after Calendar - initialization, calendar update or after wakeup from low power modes + initialization, calendar update or after wake-up from low power modes the software must first clear the RSF flag. The software must then wait until it is set again before reading the calendar, which means that the calendar registers have been correctly copied into the @@ -218,6 +218,8 @@ HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc) if(hrtc->State == HAL_RTC_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hrtc->Lock = HAL_UNLOCKED; /* Initialize RTC MSP */ HAL_RTC_MspInit(hrtc); } @@ -376,7 +378,7 @@ HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc) __weak void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RTC_MspInit could be implenetd in the user file + the HAL_RTC_MspInit could be implemented in the user file */ } @@ -389,7 +391,7 @@ __weak void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc) __weak void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_RTC_MspDeInit could be implenetd in the user file + the HAL_RTC_MspDeInit could be implemented in the user file */ } @@ -397,7 +399,7 @@ __weak void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc) * @} */ -/** @defgroup RTC_Group2 RTC Time and Date functions +/** @defgroup RTC_Exported_Functions_Group2 RTC Time and Date functions * @brief RTC Time and Date functions * @verbatim @@ -418,8 +420,8 @@ __weak void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc) * @param sTime: Pointer to Time structure * @param Format: Specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format) @@ -436,7 +438,7 @@ HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTim hrtc->State = HAL_RTC_STATE_BUSY; - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET) { @@ -543,10 +545,11 @@ HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTim * @param sTime: Pointer to Time structure * @param Format: Specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format - * @note Call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values - * in the higher-order calendar shadow registers. + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format + * @note You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values + * in the higher-order calendar shadow registers to ensure consistency between the time and date values. + * Reading RTC current time locks the values in calendar shadow registers until Current date is read. * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format) @@ -569,7 +572,7 @@ HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTim sTime->TimeFormat = (uint8_t)((tmpreg & (RTC_TR_PM)) >> 16); /* Check the input parameters format */ - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { /* Convert the time structure parameters to Binary format */ sTime->Hours = (uint8_t)RTC_Bcd2ToByte(sTime->Hours); @@ -587,8 +590,8 @@ HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTim * @param sDate: Pointer to date structure * @param Format: specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format) @@ -603,14 +606,14 @@ HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDat hrtc->State = HAL_RTC_STATE_BUSY; - if((Format == FORMAT_BIN) && ((sDate->Month & 0x10) == 0x10)) + if((Format == RTC_FORMAT_BIN) && ((sDate->Month & 0x10) == 0x10)) { sDate->Month = (uint8_t)((sDate->Month & (uint8_t)~(0x10)) + (uint8_t)0x0A); } assert_param(IS_RTC_WEEKDAY(sDate->WeekDay)); - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { assert_param(IS_RTC_YEAR(sDate->Year)); assert_param(IS_RTC_MONTH(sDate->Month)); @@ -696,8 +699,11 @@ HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDat * @param sDate: Pointer to Date structure * @param Format: Specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format + * @note You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values + * in the higher-order calendar shadow registers to ensure consistency between the time and date values. + * Reading RTC current time locks the values in calendar shadow registers until Current date is read. * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format) @@ -717,7 +723,7 @@ HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDat sDate->WeekDay = (uint8_t)((datetmpreg & (RTC_DR_WDU)) >> 13); /* Check the input parameters format */ - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { /* Convert the date structure parameters to Binary format */ sDate->Year = (uint8_t)RTC_Bcd2ToByte(sDate->Year); @@ -731,7 +737,7 @@ HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDat * @} */ -/** @defgroup RTC_Group3 RTC Alarm functions +/** @defgroup RTC_Exported_Functions_Group3 RTC Alarm functions * @brief RTC Alarm functions * @verbatim @@ -751,8 +757,8 @@ HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDat * @param sAlarm: Pointer to Alarm structure * @param Format: Specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format) @@ -762,8 +768,8 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA /* Check the parameters */ assert_param(IS_RTC_FORMAT(Format)); - assert_param(IS_ALARM(sAlarm->Alarm)); - assert_param(IS_ALARM_MASK(sAlarm->AlarmMask)); + assert_param(IS_RTC_ALARM(sAlarm->Alarm)); + assert_param(IS_RTC_ALARM_MASK(sAlarm->AlarmMask)); assert_param(IS_RTC_ALARM_DATE_WEEKDAY_SEL(sAlarm->AlarmDateWeekDaySel)); assert_param(IS_RTC_ALARM_SUB_SECOND_VALUE(sAlarm->AlarmTime.SubSeconds)); assert_param(IS_RTC_ALARM_SUB_SECOND_MASK(sAlarm->AlarmSubSecondMask)); @@ -773,7 +779,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA hrtc->State = HAL_RTC_STATE_BUSY; - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET) { @@ -937,8 +943,8 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA * @param sAlarm: Pointer to Alarm structure * @param Format: Specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format) @@ -948,8 +954,8 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef /* Check the parameters */ assert_param(IS_RTC_FORMAT(Format)); - assert_param(IS_ALARM(sAlarm->Alarm)); - assert_param(IS_ALARM_MASK(sAlarm->AlarmMask)); + assert_param(IS_RTC_ALARM(sAlarm->Alarm)); + assert_param(IS_RTC_ALARM_MASK(sAlarm->AlarmMask)); assert_param(IS_RTC_ALARM_DATE_WEEKDAY_SEL(sAlarm->AlarmDateWeekDaySel)); assert_param(IS_RTC_ALARM_SUB_SECOND_VALUE(sAlarm->AlarmTime.SubSeconds)); assert_param(IS_RTC_ALARM_SUB_SECOND_MASK(sAlarm->AlarmSubSecondMask)); @@ -959,7 +965,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef hrtc->State = HAL_RTC_STATE_BUSY; - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { if((hrtc->Instance->CR & RTC_CR_FMT) != (uint32_t)RESET) { @@ -1106,7 +1112,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef } /* RTC Alarm Interrupt Configuration: EXTI configuration */ - __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_ALARM_EVENT); + __HAL_RTC_ALARM_EXTI_ENABLE_IT(); EXTI->RTSR |= RTC_EXTI_LINE_ALARM_EVENT; @@ -1122,7 +1128,7 @@ HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef } /** - * @brief Deactive the specified RTC Alarm + * @brief Deactivate the specified RTC Alarm * @param hrtc: pointer to a RTC_HandleTypeDef structure that contains * the configuration information for RTC. * @param Alarm: Specifies the Alarm. @@ -1136,7 +1142,7 @@ HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alar uint32_t tickstart = 0; /* Check the parameters */ - assert_param(IS_ALARM(Alarm)); + assert_param(IS_RTC_ALARM(Alarm)); /* Process Locked */ __HAL_LOCK(hrtc); @@ -1224,8 +1230,8 @@ HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alar * @arg RTC_ALARM_B: AlarmB * @param Format: Specifies the format of the entered parameters. * This parameter can be one of the following values: - * @arg FORMAT_BIN: Binary data format - * @arg FORMAT_BCD: BCD data format + * @arg RTC_FORMAT_BIN: Binary data format + * @arg RTC_FORMAT_BCD: BCD data format * @retval HAL status */ HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format) @@ -1234,7 +1240,7 @@ HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA /* Check the parameters */ assert_param(IS_RTC_FORMAT(Format)); - assert_param(IS_ALARM(Alarm)); + assert_param(IS_RTC_ALARM(Alarm)); if(Alarm == RTC_ALARM_A) { @@ -1262,7 +1268,7 @@ HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA sAlarm->AlarmDateWeekDaySel = (uint32_t)(tmpreg & RTC_ALRMAR_WDSEL); sAlarm->AlarmMask = (uint32_t)(tmpreg & RTC_ALARMMASK_ALL); - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { sAlarm->AlarmTime.Hours = RTC_Bcd2ToByte(sAlarm->AlarmTime.Hours); sAlarm->AlarmTime.Minutes = RTC_Bcd2ToByte(sAlarm->AlarmTime.Minutes); @@ -1308,7 +1314,7 @@ void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef* hrtc) } /* Clear the EXTI's line Flag for RTC Alarm */ - __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_ALARM_EVENT); + __HAL_RTC_ALARM_EXTI_CLEAR_FLAG(); /* Change RTC state */ hrtc->State = HAL_RTC_STATE_READY; @@ -1366,7 +1372,7 @@ HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t T * @} */ -/** @defgroup RTC_Group4 Peripheral Control functions +/** @defgroup RTC_Exported_Functions_Group4 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -1387,7 +1393,7 @@ HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t T * @note The RTC Resynchronization mode is write protected, use the * __HAL_RTC_WRITEPROTECTION_DISABLE() before calling this function. * @note To read the calendar through the shadow registers after Calendar - * initialization, calendar update or after wakeup from low power modes + * initialization, calendar update or after wake-up from low power modes * the software must first clear the RSF flag. * The software must then wait until it is set again before reading * the calendar, which means that the calendar registers have been @@ -1418,7 +1424,11 @@ HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc) return HAL_OK; } -/** @defgroup RTC_Group5 Peripheral State functions +/** + * @} + */ + +/** @defgroup RTC_Exported_Functions_Group5 Peripheral State functions * @brief Peripheral State functions * @verbatim diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.h index be5f038cffe..5819af8bb6a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_rtc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of RTC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,7 +54,11 @@ * @{ */ -/* Exported types ------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup RTC_Exported_Types RTC Exported Types + * @{ + */ + /** * @brief HAL State structures definition */ @@ -165,7 +169,7 @@ typedef struct }RTC_AlarmTypeDef; /** - * @brief Time Handle Structure definition + * @brief RTC Handle Structure definition */ typedef struct { @@ -179,165 +183,93 @@ typedef struct }RTC_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup RTC_Exported_Constants +/** @defgroup RTC_Exported_Constants RTC Exported Constants * @{ - */ - -/* Masks Definition */ -#define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) -#define RTC_DR_RESERVED_MASK ((uint32_t)0x00FFFF3F) -#define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) -#define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) -#define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_TSOVF | RTC_FLAG_TSF | RTC_FLAG_WUTF | \ - RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | RTC_FLAG_INITF | \ - RTC_FLAG_RSF | RTC_FLAG_INITS | RTC_FLAG_WUTWF | \ - RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF | RTC_FLAG_TAMP1F | \ - RTC_FLAG_RECALPF | RTC_FLAG_SHPF)) + */ -#define RTC_TIMEOUT_VALUE 1000 - -/** @defgroup RTC_Hour_Formats +/** @defgroup RTC_Hour_Formats RTC Hour Formats * @{ */ #define RTC_HOURFORMAT_24 ((uint32_t)0x00000000) #define RTC_HOURFORMAT_12 ((uint32_t)0x00000040) - -#define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \ - ((FORMAT) == RTC_HOURFORMAT_24)) /** * @} */ -/** @defgroup RTC_Output_selection_Definitions +/** @defgroup RTC_Output_selection_Definitions RTC Output Selection Definitions * @{ */ #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000) #define RTC_OUTPUT_ALARMA ((uint32_t)0x00200000) #define RTC_OUTPUT_ALARMB ((uint32_t)0x00400000) #define RTC_OUTPUT_WAKEUP ((uint32_t)0x00600000) - -#define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ - ((OUTPUT) == RTC_OUTPUT_ALARMA) || \ - ((OUTPUT) == RTC_OUTPUT_ALARMB) || \ - ((OUTPUT) == RTC_OUTPUT_WAKEUP)) /** * @} */ -/** @defgroup RTC_Output_Polarity_Definitions +/** @defgroup RTC_Output_Polarity_Definitions RTC Output Polarity Definitions * @{ */ #define RTC_OUTPUT_POLARITY_HIGH ((uint32_t)0x00000000) #define RTC_OUTPUT_POLARITY_LOW ((uint32_t)0x00100000) - -#define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \ - ((POL) == RTC_OUTPUT_POLARITY_LOW)) /** * @} */ -/** @defgroup RTC_Output_Type_ALARM_OUT +/** @defgroup RTC_Output_Type_ALARM_OUT RTC Output Type ALARM OUT * @{ */ #define RTC_OUTPUT_TYPE_OPENDRAIN ((uint32_t)0x00000000) #define RTC_OUTPUT_TYPE_PUSHPULL ((uint32_t)0x00040000) - -#define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \ - ((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL)) - -/** - * @} - */ - -/** @defgroup RTC_Asynchronous_Predivider - * @{ - */ -#define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7F) -/** - * @} - */ - - -/** @defgroup RTC_Synchronous_Predivider - * @{ - */ -#define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7FFF) -/** - * @} - */ - -/** @defgroup RTC_Time_Definitions - * @{ - */ -#define IS_RTC_HOUR12(HOUR) (((HOUR) > (uint32_t)0) && ((HOUR) <= (uint32_t)12)) -#define IS_RTC_HOUR24(HOUR) ((HOUR) <= (uint32_t)23) -#define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= (uint32_t)59) -#define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= (uint32_t)59) /** * @} */ -/** @defgroup RTC_AM_PM_Definitions +/** @defgroup RTC_AM_PM_Definitions RTC AM PM Definitions * @{ */ #define RTC_HOURFORMAT12_AM ((uint8_t)0x00) #define RTC_HOURFORMAT12_PM ((uint8_t)0x40) - -#define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || ((PM) == RTC_HOURFORMAT12_PM)) /** * @} */ -/** @defgroup RTC_DayLightSaving_Definitions +/** @defgroup RTC_DayLightSaving_Definitions RTC DayLight Saving Definitions * @{ */ #define RTC_DAYLIGHTSAVING_SUB1H ((uint32_t)0x00020000) #define RTC_DAYLIGHTSAVING_ADD1H ((uint32_t)0x00010000) #define RTC_DAYLIGHTSAVING_NONE ((uint32_t)0x00000000) - -#define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \ - ((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \ - ((SAVE) == RTC_DAYLIGHTSAVING_NONE)) /** * @} */ -/** @defgroup RTC_StoreOperation_Definitions +/** @defgroup RTC_StoreOperation_Definitions RTC Store Operation Definitions * @{ */ #define RTC_STOREOPERATION_RESET ((uint32_t)0x00000000) #define RTC_STOREOPERATION_SET ((uint32_t)0x00040000) - -#define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \ - ((OPERATION) == RTC_STOREOPERATION_SET)) /** * @} */ -/** @defgroup RTC_Input_parameter_format_definitions +/** @defgroup RTC_Input_parameter_format_definitions RTC Input Parameter Format Definitions * @{ */ -#define FORMAT_BIN ((uint32_t)0x000000000) -#define FORMAT_BCD ((uint32_t)0x000000001) - -#define IS_RTC_FORMAT(FORMAT) (((FORMAT) == FORMAT_BIN) || ((FORMAT) == FORMAT_BCD)) +#define RTC_FORMAT_BIN ((uint32_t)0x000000000) +#define RTC_FORMAT_BCD ((uint32_t)0x000000001) /** * @} */ -/** @defgroup RTC_Year_Date_Definitions +/** @defgroup RTC_Month_Date_Definitions RTC Month Date Definitions * @{ */ -#define IS_RTC_YEAR(YEAR) ((YEAR) <= (uint32_t)99) -/** - * @} - */ - -/** @defgroup RTC_Month_Date_Definitions - * @{ - */ - /* Coded in BCD format */ #define RTC_MONTH_JANUARY ((uint8_t)0x01) #define RTC_MONTH_FEBRUARY ((uint8_t)0x02) @@ -351,14 +283,11 @@ typedef struct #define RTC_MONTH_OCTOBER ((uint8_t)0x10) #define RTC_MONTH_NOVEMBER ((uint8_t)0x11) #define RTC_MONTH_DECEMBER ((uint8_t)0x12) - -#define IS_RTC_MONTH(MONTH) (((MONTH) >= (uint32_t)1) && ((MONTH) <= (uint32_t)12)) -#define IS_RTC_DATE(DATE) (((DATE) >= (uint32_t)1) && ((DATE) <= (uint32_t)31)) /** * @} */ -/** @defgroup RTC_WeekDay_Definitions +/** @defgroup RTC_WeekDay_Definitions RTC WeekDay Definitions * @{ */ #define RTC_WEEKDAY_MONDAY ((uint8_t)0x01) @@ -368,48 +297,20 @@ typedef struct #define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05) #define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06) #define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07) - -#define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) -/** - * @} - */ - -/** @defgroup RTC_Alarm_Definitions - * @{ - */ -#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) >(uint32_t) 0) && ((DATE) <= (uint32_t)31)) -#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ - ((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) /** * @} */ - -/** @defgroup RTC_AlarmDateWeekDay_Definitions +/** @defgroup RTC_AlarmDateWeekDay_Definitions RTC Alarm Date WeekDay Definitions * @{ */ #define RTC_ALARMDATEWEEKDAYSEL_DATE ((uint32_t)0x00000000) #define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY ((uint32_t)0x40000000) - -#define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \ - ((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY)) /** * @} */ - -/** @defgroup RTC_AlarmMask_Definitions +/** @defgroup RTC_AlarmMask_Definitions RTC Alarm Mask Definitions * @{ */ #define RTC_ALARMMASK_NONE ((uint32_t)0x00000000) @@ -418,32 +319,20 @@ typedef struct #define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2 #define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1 #define RTC_ALARMMASK_ALL ((uint32_t)0x80808080) - -#define IS_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET) /** * @} */ -/** @defgroup RTC_Alarms_Definitions +/** @defgroup RTC_Alarms_Definitions RTC Alarms Definitions * @{ */ #define RTC_ALARM_A RTC_CR_ALRAE #define RTC_ALARM_B RTC_CR_ALRBE - -#define IS_ALARM(ALARM) (((ALARM) == RTC_ALARM_A) || ((ALARM) == RTC_ALARM_B)) /** * @} */ -/** @defgroup RTC_Alarm_Sub_Seconds_Value - * @{ - */ -#define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= (uint32_t)0x00007FFF) -/** - * @} - */ - - /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions +/** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions RTC Alarm Sub Seconds Masks Definitions * @{ */ #define RTC_ALARMSUBSECONDMASK_ALL ((uint32_t)0x00000000) /*!< All Alarm SS fields are masked. @@ -477,30 +366,13 @@ typedef struct comparison. Only SS[12:0] are compared */ #define RTC_ALARMSUBSECONDMASK_SS14 ((uint32_t)0x0E000000) /*!< SS[14] is don't care in Alarm comparison.Only SS[13:0] are compared */ -#define RTC_ALARMSUBSECONDMASK_None ((uint32_t)0x0F000000) /*!< SS[14:0] are compared and must match +#define RTC_ALARMSUBSECONDMASK_NONE ((uint32_t)0x0F000000) /*!< SS[14:0] are compared and must match to activate alarm. */ - -#define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \ - ((MASK) == RTC_ALARMSUBSECONDMASK_None)) /** * @} */ -/** @defgroup RTC_Interrupts_Definitions +/** @defgroup RTC_Interrupts_Definitions RTC Interrupts Definitions * @{ */ #define RTC_IT_TS ((uint32_t)0x00008000) @@ -514,7 +386,7 @@ typedef struct * @} */ -/** @defgroup RTC_Flags_Definitions +/** @defgroup RTC_Flags_Definitions RTC Flags Definitions * @{ */ #define RTC_FLAG_RECALPF ((uint32_t)0x00010000) @@ -541,6 +413,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup RTC_Exported_Macros RTC Exported Macros + * @{ + */ /** @brief Reset RTC handle state * @param __HANDLE__: specifies the RTC handle. @@ -622,18 +497,18 @@ typedef struct /** * @brief Check whether the specified RTC Alarm interrupt has occurred or not. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC Alarm interrupt sources to be enabled or disabled. + * @param __INTERRUPT__: specifies the RTC Alarm interrupt to check. * This parameter can be: * @arg RTC_IT_ALRA: Alarm A interrupt * @arg RTC_IT_ALRB: Alarm B interrupt * @retval None */ -#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __FLAG__) ((((((__HANDLE__)->Instance->ISR)& ((__FLAG__)>> 4)) & 0x0000FFFF) != RESET)? SET : RESET) +#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->ISR)& ((__INTERRUPT__)>> 4)) & 0x0000FFFF) != RESET)? SET : RESET) /** * @brief Get the selected RTC Alarm's flag status. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled. + * @param __FLAG__: specifies the RTC Alarm Flag to check. * This parameter can be: * @arg RTC_FLAG_ALRAF * @arg RTC_FLAG_ALRBF @@ -655,81 +530,133 @@ typedef struct #define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) -#define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)0x00020000) /*!< External interrupt line 17 Connected to the RTC Alarm event */ -#define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)0x00200000) /*!< External interrupt line 21 Connected to the RTC Tamper and Time Stamp events */ -#define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to the RTC Wakeup event */ - /** - * @brief Enable the RTC Exti line. - * @param __EXTILINE__: specifies the RTC Exti sources to be enabled or disabled. + * @brief Check whether the specified RTC Alarm interrupt has been enabled or not. + * @param __HANDLE__: specifies the RTC handle. + * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to check. * This parameter can be: - * @arg RTC_EXTI_LINE_ALARM_EVENT - * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT - * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT + * @arg RTC_IT_ALRA: Alarm A interrupt + * @arg RTC_IT_ALRB: Alarm B interrupt * @retval None */ -#define __HAL_RTC_EXTI_ENABLE_IT(__EXTILINE__) (EXTI->IMR |= (__EXTILINE__)) +#define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) -/* alias define maintained for legacy */ -#define __HAL_RTC_ENABLE_IT __HAL_RTC_EXTI_ENABLE_IT +/** + * @brief Enable interrupt on the RTC Alarm associated Exti line. + * @retval None + */ +#define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_ALARM_EVENT) /** - * @brief Disable the RTC Exti line. - * @param __EXTILINE__: specifies the RTC Exti sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_EXTI_LINE_ALARM_EVENT - * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT - * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT + * @brief Disable interrupt on the RTC Alarm associated Exti line. * @retval None */ -#define __HAL_RTC_EXTI_DISABLE_IT(__EXTILINE__) (EXTI->IMR &= ~(__EXTILINE__)) +#define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) -/* alias define maintained for legacy */ -#define __HAL_RTC_DISABLE_IT __HAL_RTC_EXTI_DISABLE_IT +/** + * @brief Enable event on the RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_ALARM_EVENT) /** - * @brief Generates a Software interrupt on selected EXTI line. - * @param __EXTILINE__: specifies the RTC Exti sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_EXTI_LINE_ALARM_EVENT - * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT - * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT - * @retval None + * @brief Disable event on the RTC Alarm associated Exti line. + * @retval None. */ -#define __HAL_RTC_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__)) +#define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) /** - * @brief Clear the RTC Exti flags. - * @param __FLAG__: specifies the RTC Exti sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_EXTI_LINE_ALARM_EVENT - * @arg RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT - * @arg RTC_EXTI_LINE_WAKEUPTIMER_EVENT - * @retval None + * @brief Enable falling edge trigger on the RTC Alarm associated Exti line. + * @retval None. */ -#define __HAL_RTC_EXTI_CLEAR_FLAG(__FLAG__) (EXTI->PR = (__FLAG__)) +#define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_ALARM_EVENT) -/* alias define maintained for legacy */ -#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG +/** + * @brief Disable falling edge trigger on the RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) +/** + * @brief Enable rising edge trigger on the RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_ALARM_EVENT) + +/** + * @brief Disable rising edge trigger on the RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) + +/** + * @brief Enable rising & falling edge trigger on the RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE(); + +/** + * @brief Disable rising & falling edge trigger on the RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE(); + +/** + * @brief Check whether the RTC Alarm associated Exti line interrupt flag is set or not. + * @retval Line Status. + */ +#define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_ALARM_EVENT) + +/** + * @brief Clear the RTC Alarm associated Exti line flag. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_ALARM_EVENT) + +/** + * @brief Generate a Software interrupt on RTC Alarm associated Exti line. + * @retval None. + */ +#define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_ALARM_EVENT) +/** + * @} + */ /* Include RTC HAL Extension module */ #include "stm32f4xx_hal_rtc_ex.h" /* Exported functions --------------------------------------------------------*/ +/** @addtogroup RTC_Exported_Functions + * @{ + */ +/** @addtogroup RTC_Exported_Functions_Group1 + * @{ + */ /* Initialization and de-initialization functions ****************************/ HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc); void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc); void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc); +/** + * @} + */ +/** @addtogroup RTC_Exported_Functions_Group2 + * @{ + */ /* RTC Time and Date functions ************************************************/ HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); +/** + * @} + */ +/** @addtogroup RTC_Exported_Functions_Group3 + * @{ + */ /* RTC Alarm functions ********************************************************/ HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); @@ -738,16 +665,146 @@ HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sA void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc); +/** + * @} + */ +/** @addtogroup RTC_Exported_Functions_Group4 + * @{ + */ /* Peripheral Control functions ***********************************************/ HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc); +/** + * @} + */ +/** @addtogroup RTC_Exported_Functions_Group5 + * @{ + */ /* Peripheral State functions *************************************************/ HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup RTC_Private_Constants RTC Private Constants + * @{ + */ +/* Masks Definition */ +#define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) +#define RTC_DR_RESERVED_MASK ((uint32_t)0x00FFFF3F) +#define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) +#define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) +#define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_TSOVF | RTC_FLAG_TSF | RTC_FLAG_WUTF | \ + RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | RTC_FLAG_INITF | \ + RTC_FLAG_RSF | RTC_FLAG_INITS | RTC_FLAG_WUTWF | \ + RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF | RTC_FLAG_TAMP1F | \ + RTC_FLAG_RECALPF | RTC_FLAG_SHPF)) + +#define RTC_TIMEOUT_VALUE 1000 + +#define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)EXTI_IMR_MR17) /*!< External interrupt line 17 Connected to the RTC Alarm event */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup RTC_Private_Macros RTC Private Macros + * @{ + */ + +/** @defgroup RTC_IS_RTC_Definitions RTC Private macros to check input parameters + * @{ + */ +#define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \ + ((FORMAT) == RTC_HOURFORMAT_24)) +#define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ + ((OUTPUT) == RTC_OUTPUT_ALARMA) || \ + ((OUTPUT) == RTC_OUTPUT_ALARMB) || \ + ((OUTPUT) == RTC_OUTPUT_WAKEUP)) +#define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \ + ((POL) == RTC_OUTPUT_POLARITY_LOW)) +#define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \ + ((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL)) +#define IS_RTC_HOUR12(HOUR) (((HOUR) > (uint32_t)0) && ((HOUR) <= (uint32_t)12)) +#define IS_RTC_HOUR24(HOUR) ((HOUR) <= (uint32_t)23) +#define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7F) +#define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7FFF) +#define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= (uint32_t)59) +#define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= (uint32_t)59) +#define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || ((PM) == RTC_HOURFORMAT12_PM)) +#define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \ + ((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \ + ((SAVE) == RTC_DAYLIGHTSAVING_NONE)) +#define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \ + ((OPERATION) == RTC_STOREOPERATION_SET)) +#define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_FORMAT_BIN) || ((FORMAT) == RTC_FORMAT_BCD)) +#define IS_RTC_YEAR(YEAR) ((YEAR) <= (uint32_t)99) +#define IS_RTC_MONTH(MONTH) (((MONTH) >= (uint32_t)1) && ((MONTH) <= (uint32_t)12)) +#define IS_RTC_DATE(DATE) (((DATE) >= (uint32_t)1) && ((DATE) <= (uint32_t)31)) +#define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) +#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) >(uint32_t) 0) && ((DATE) <= (uint32_t)31)) +#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ + ((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) +#define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \ + ((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY)) +#define IS_RTC_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET) +#define IS_RTC_ALARM(ALARM) (((ALARM) == RTC_ALARM_A) || ((ALARM) == RTC_ALARM_B)) +#define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= (uint32_t)0x00007FFF) + +#define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \ + ((MASK) == RTC_ALARMSUBSECONDMASK_NONE)) +/** + * @} + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup RTC_Private_Functions RTC Private Functions + * @{ + */ HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc); uint8_t RTC_ByteToBcd2(uint8_t Value); uint8_t RTC_Bcd2ToByte(uint8_t Value); +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.c index e8ea72ab898..5abed477e06 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_rtc_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief RTC HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Real Time Clock (RTC) Extension peripheral: @@ -22,13 +22,13 @@ (+) Configure the RTC Prescaler (Asynchronous and Synchronous) and RTC hour format using the HAL_RTC_Init() function. - *** RTC Wakeup configuration *** + *** RTC Wake-up configuration *** ================================ [..] - (+) To configure the RTC Wakeup Clock source and Counter use the HAL_RTC_SetWakeUpTimer() - function. You can also configure the RTC Wakeup timer in interrupt mode + (+) To configure the RTC Wake-up Clock source and Counter use the HAL_RTC_SetWakeUpTimer() + function. You can also configure the RTC Wake-up timer in interrupt mode using the HAL_RTC_SetWakeUpTimer_IT() function. - (+) To read the RTC WakeUp Counter register, use the HAL_RTC_GetWakeUpTimer() + (+) To read the RTC Wake-up Counter register, use the HAL_RTC_GetWakeUpTimer() function. *** TimeStamp configuration *** @@ -40,7 +40,7 @@ (+) To read the RTC TimeStamp Time and Date register, use the HAL_RTC_GetTimeStamp() function. (+) The TIMESTAMP alternate function can be mapped either to RTC_AF1 (PC13) - or RTC_AF2 (PI8) depending on the value of TSINSEL bit in + or RTC_AF2 (PI8 or PA0 only for STM32F446xx devices) depending on the value of TSINSEL bit in RTC_TAFCR register. The corresponding pin is also selected by HAL_RTC_SetTimeStamp() or HAL_RTC_SetTimeStamp_IT() function. @@ -53,7 +53,7 @@ HAL_RTC_SetTamper() function. You can configure RTC Tamper in interrupt mode using HAL_RTC_SetTamper_IT() function. (+) The TAMPER1 alternate function can be mapped either to RTC_AF1 (PC13) - or RTC_AF2 (PI8) depending on the value of TAMP1INSEL bit in + or RTC_AF2 (PI8 or PA0 only for STM32F446xx devices) depending on the value of TAMP1INSEL bit in RTC_TAFCR register. The corresponding pin is also selected by HAL_RTC_SetTamper() or HAL_RTC_SetTamper_IT() function. @@ -69,7 +69,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,7 @@ * @{ */ -/** @defgroup RTCEx +/** @defgroup RTCEx RTCEx * @brief RTC HAL module driver * @{ */ @@ -117,12 +117,11 @@ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -/** @defgroup RTCEx_Private_Functions +/** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions * @{ - */ - + */ -/** @defgroup RTCEx_Group1 RTC TimeStamp and Tamper functions +/** @defgroup RTCEx_Exported_Functions_Group1 RTC TimeStamp and Tamper functions * @brief RTC TimeStamp and Tamper functions * @verbatim @@ -151,7 +150,8 @@ * @param RTC_TimeStampPin: specifies the RTC TimeStamp Pin. * This parameter can be one of the following values: * @arg RTC_TIMESTAMPPIN_PC13: PC13 is selected as RTC TimeStamp Pin. - * @arg RTC_TIMESTAMPPIN_PI8: PI8 is selected as RTC TimeStamp Pin. + * @arg RTC_TIMESTAMPPIN_PI8: PI8 is selected as RTC TimeStamp Pin. (not applicable in the case of STM32F446xx devices) + * @arg RTC_TIMESTAMPPIN_PA0: PA0 is selected as RTC TimeStamp Pin only for STM32F446xx devices * @retval HAL status */ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin) @@ -210,7 +210,8 @@ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeS * @param RTC_TimeStampPin: Specifies the RTC TimeStamp Pin. * This parameter can be one of the following values: * @arg RTC_TIMESTAMPPIN_PC13: PC13 is selected as RTC TimeStamp Pin. - * @arg RTC_TIMESTAMPPIN_PI8: PI8 is selected as RTC TimeStamp Pin. + * @arg RTC_TIMESTAMPPIN_PI8: PI8 is selected as RTC TimeStamp Pin. (not applicable in the case of STM32F446xx devices) + * @arg RTC_TIMESTAMPPIN_PA0: PA0 is selected as RTC TimeStamp Pin only for STM32F446xx devices * @retval HAL status */ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin) @@ -246,7 +247,7 @@ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t Ti __HAL_RTC_TIMESTAMP_ENABLE_IT(hrtc,RTC_IT_TS); /* RTC timestamp Interrupt Configuration: EXTI configuration */ - __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT); + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT(); EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT; @@ -307,8 +308,8 @@ HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc) * @param sTimeStampDate: Pointer to Date structure * @param Format: specifies the format of the entered parameters. * This parameter can be one of the following values: - * FORMAT_BIN: Binary data format - * FORMAT_BCD: BCD data format + * RTC_FORMAT_BIN: Binary data format + * RTC_FORMAT_BCD: BCD data format * @retval HAL status */ HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef* sTimeStamp, RTC_DateTypeDef* sTimeStampDate, uint32_t Format) @@ -336,7 +337,7 @@ HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDe sTimeStampDate->WeekDay = (uint8_t)((tmpdate & (RTC_DR_WDU)) >> 13); /* Check the input parameters format */ - if(Format == FORMAT_BIN) + if(Format == RTC_FORMAT_BIN) { /* Convert the TimeStamp structure parameters to Binary format */ sTimeStamp->Hours = (uint8_t)RTC_Bcd2ToByte(sTimeStamp->Hours); @@ -368,14 +369,14 @@ HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef uint32_t tmpreg = 0; /* Check the parameters */ - assert_param(IS_TAMPER(sTamper->Tamper)); + assert_param(IS_RTC_TAMPER(sTamper->Tamper)); assert_param(IS_RTC_TAMPER_PIN(sTamper->PinSelection)); - assert_param(IS_TAMPER_TRIGGER(sTamper->Trigger)); - assert_param(IS_TAMPER_FILTER(sTamper->Filter)); - assert_param(IS_TAMPER_SAMPLING_FREQ(sTamper->SamplingFrequency)); - assert_param(IS_TAMPER_PRECHARGE_DURATION(sTamper->PrechargeDuration)); - assert_param(IS_TAMPER_PULLUP_STATE(sTamper->TamperPullUp)); - assert_param(IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(sTamper->TimeStampOnTamperDetection)); + assert_param(IS_RTC_TAMPER_TRIGGER(sTamper->Trigger)); + assert_param(IS_RTC_TAMPER_FILTER(sTamper->Filter)); + assert_param(IS_RTC_TAMPER_SAMPLING_FREQ(sTamper->SamplingFrequency)); + assert_param(IS_RTC_TAMPER_PRECHARGE_DURATION(sTamper->PrechargeDuration)); + assert_param(IS_RTC_TAMPER_PULLUP_STATE(sTamper->TamperPullUp)); + assert_param(IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(sTamper->TimeStampOnTamperDetection)); /* Process Locked */ __HAL_LOCK(hrtc); @@ -418,14 +419,14 @@ HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperType uint32_t tmpreg = 0; /* Check the parameters */ - assert_param(IS_TAMPER(sTamper->Tamper)); + assert_param(IS_RTC_TAMPER(sTamper->Tamper)); assert_param(IS_RTC_TAMPER_PIN(sTamper->PinSelection)); - assert_param(IS_TAMPER_TRIGGER(sTamper->Trigger)); - assert_param(IS_TAMPER_FILTER(sTamper->Filter)); - assert_param(IS_TAMPER_SAMPLING_FREQ(sTamper->SamplingFrequency)); - assert_param(IS_TAMPER_PRECHARGE_DURATION(sTamper->PrechargeDuration)); - assert_param(IS_TAMPER_PULLUP_STATE(sTamper->TamperPullUp)); - assert_param(IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(sTamper->TimeStampOnTamperDetection)); + assert_param(IS_RTC_TAMPER_TRIGGER(sTamper->Trigger)); + assert_param(IS_RTC_TAMPER_FILTER(sTamper->Filter)); + assert_param(IS_RTC_TAMPER_SAMPLING_FREQ(sTamper->SamplingFrequency)); + assert_param(IS_RTC_TAMPER_PRECHARGE_DURATION(sTamper->PrechargeDuration)); + assert_param(IS_RTC_TAMPER_PULLUP_STATE(sTamper->TamperPullUp)); + assert_param(IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(sTamper->TimeStampOnTamperDetection)); /* Process Locked */ __HAL_LOCK(hrtc); @@ -452,7 +453,7 @@ HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperType hrtc->Instance->TAFCR |= (uint32_t)RTC_TAFCR_TAMPIE; /* RTC Tamper Interrupt Configuration: EXTI configuration */ - __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT); + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT(); EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT; @@ -474,7 +475,7 @@ HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperType */ HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper) { - assert_param(IS_TAMPER(Tamper)); + assert_param(IS_RTC_TAMPER(Tamper)); /* Process Locked */ __HAL_LOCK(hrtc); @@ -541,7 +542,7 @@ void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc) } } /* Clear the EXTI's Flag for RTC TimeStamp and Tamper */ - __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT); + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG(); /* Change RTC state */ hrtc->State = HAL_RTC_STATE_READY; @@ -604,7 +605,7 @@ HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint3 { if(__HAL_RTC_TIMESTAMP_GET_FLAG(hrtc, RTC_FLAG_TSOVF) != RESET) { - /* Clear the TIMESTAMP OverRun Flag */ + /* Clear the TIMESTAMP Overrun Flag */ __HAL_RTC_TIMESTAMP_CLEAR_FLAG(hrtc, RTC_FLAG_TSOVF); /* Change TIMESTAMP state */ @@ -705,7 +706,7 @@ HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_ * @} */ -/** @defgroup RTCEx_Group2 RTC Wake-up functions +/** @defgroup RTCEx_Exported_Functions_Group2 RTC Wake-up functions * @brief RTC Wake-up functions * @verbatim @@ -732,8 +733,8 @@ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t Wak uint32_t tickstart = 0; /* Check the parameters */ - assert_param(IS_WAKEUP_CLOCK(WakeUpClock)); - assert_param(IS_WAKEUP_COUNTER(WakeUpCounter)); + assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock)); + assert_param(IS_RTC_WAKEUP_COUNTER(WakeUpCounter)); /* Process Locked */ __HAL_LOCK(hrtc); @@ -765,16 +766,16 @@ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t Wak } } - /* Clear the Wakeup Timer clock source bits in CR register */ + /* Clear the Wake-up Timer clock source bits in CR register */ hrtc->Instance->CR &= (uint32_t)~RTC_CR_WUCKSEL; /* Configure the clock source */ hrtc->Instance->CR |= (uint32_t)WakeUpClock; - /* Configure the Wakeup Timer counter */ + /* Configure the Wake-up Timer counter */ hrtc->Instance->WUTR = (uint32_t)WakeUpCounter; - /* Enable the Wakeup Timer */ + /* Enable the Wake-up Timer */ __HAL_RTC_WAKEUPTIMER_ENABLE(hrtc); /* Enable the write protection for RTC registers */ @@ -801,8 +802,8 @@ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t uint32_t tickstart = 0; /* Check the parameters */ - assert_param(IS_WAKEUP_CLOCK(WakeUpClock)); - assert_param(IS_WAKEUP_COUNTER(WakeUpCounter)); + assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock)); + assert_param(IS_RTC_WAKEUP_COUNTER(WakeUpCounter)); /* Process Locked */ __HAL_LOCK(hrtc); @@ -834,24 +835,24 @@ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t } } - /* Configure the Wakeup Timer counter */ + /* Configure the Wake-up Timer counter */ hrtc->Instance->WUTR = (uint32_t)WakeUpCounter; - /* Clear the Wakeup Timer clock source bits in CR register */ + /* Clear the Wake-up Timer clock source bits in CR register */ hrtc->Instance->CR &= (uint32_t)~RTC_CR_WUCKSEL; /* Configure the clock source */ hrtc->Instance->CR |= (uint32_t)WakeUpClock; /* RTC WakeUpTimer Interrupt Configuration: EXTI configuration */ - __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_WAKEUPTIMER_EVENT); + __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT(); EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT; /* Configure the Interrupt in the RTC_CR register */ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(hrtc,RTC_IT_WUT); - /* Enable the Wakeup Timer */ + /* Enable the Wake-up Timer */ __HAL_RTC_WAKEUPTIMER_ENABLE(hrtc); /* Enable the write protection for RTC registers */ @@ -883,7 +884,7 @@ uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc) /* Disable the write protection for RTC registers */ __HAL_RTC_WRITEPROTECTION_DISABLE(hrtc); - /* Disable the Wakeup Timer */ + /* Disable the Wake-up Timer */ __HAL_RTC_WAKEUPTIMER_DISABLE(hrtc); /* In case of interrupt mode is used, the interrupt source must disabled */ @@ -954,8 +955,8 @@ void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc) } /* Clear the EXTI's line Flag for RTC WakeUpTimer */ - __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_WAKEUPTIMER_EVENT); - + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); + /* Change RTC state */ hrtc->State = HAL_RTC_STATE_READY; } @@ -1014,7 +1015,7 @@ HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uin */ -/** @defgroup RTCEx_Group3 Extension Peripheral Control functions +/** @defgroup RTCEx_Exported_Functions_Group3 Extension Peripheral Control functions * @brief Extension Peripheral Control functions * @verbatim @@ -1213,12 +1214,12 @@ HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef* hrtc) * the configuration information for RTC. * @param SmoothCalibPeriod: Select the Smooth Calibration Period. * This parameter can be can be one of the following values : - * @arg RTC_SMOOTHCALIB_PERIOD_32SEC: The smooth calibration periode is 32s. - * @arg RTC_SMOOTHCALIB_PERIOD_16SEC: The smooth calibration periode is 16s. - * @arg RTC_SMOOTHCALIB_PERIOD_8SEC: The smooth calibartion periode is 8s. + * @arg RTC_SMOOTHCALIB_PERIOD_32SEC: The smooth calibration period is 32s. + * @arg RTC_SMOOTHCALIB_PERIOD_16SEC: The smooth calibration period is 16s. + * @arg RTC_SMOOTHCALIB_PERIOD_8SEC: The smooth calibration period is 8s. * @param SmoothCalibPlusPulses: Select to Set or reset the CALP bit. * This parameter can be one of the following values: - * @arg RTC_SMOOTHCALIB_PLUSPULSES_SET: Add one RTCCLK puls every 2*11 pulses. + * @arg RTC_SMOOTHCALIB_PLUSPULSES_SET: Add one RTCCLK pulse every 2*11 pulses. * @arg RTC_SMOOTHCALIB_PLUSPULSES_RESET: No RTCCLK pulses are added. * @param SmouthCalibMinusPulsesValue: Select the value of CALM[8:0] bits. * This parameter can be one any value from 0 to 0x000001FF. @@ -1625,7 +1626,7 @@ HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef* hrtc) * @} */ - /** @defgroup RTCEx_Group4 Extended features functions + /** @defgroup RTCEx_Exported_Functions_Group4 Extended features functions * @brief Extended features functions * @verbatim @@ -1633,7 +1634,7 @@ HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef* hrtc) ##### Extended features functions ##### =============================================================================== [..] This section provides functions allowing to: - (+) RTC Alram B callback + (+) RTC Alarm B callback (+) RTC Poll for Alarm B request @endverbatim diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.h index 31081019f33..4d5bd9dbe53 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rtc_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_rtc_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of RTC HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,6 +55,9 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup RTCEx_Exported_Types RTCEx Exported Types + * @{ + */ /** * @brief RTC Tamper structure definition @@ -85,13 +88,16 @@ typedef struct uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ }RTC_TamperTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup RTCEx_Exported_Constants +/** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants * @{ */ -/** @defgroup RTCEx_Backup_Registers_Definitions +/** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions * @{ */ #define RTC_BKP_DR0 ((uint32_t)0x00000000) @@ -114,96 +120,66 @@ typedef struct #define RTC_BKP_DR17 ((uint32_t)0x00000011) #define RTC_BKP_DR18 ((uint32_t)0x00000012) #define RTC_BKP_DR19 ((uint32_t)0x00000013) - -#define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \ - ((BKP) == RTC_BKP_DR1) || \ - ((BKP) == RTC_BKP_DR2) || \ - ((BKP) == RTC_BKP_DR3) || \ - ((BKP) == RTC_BKP_DR4) || \ - ((BKP) == RTC_BKP_DR5) || \ - ((BKP) == RTC_BKP_DR6) || \ - ((BKP) == RTC_BKP_DR7) || \ - ((BKP) == RTC_BKP_DR8) || \ - ((BKP) == RTC_BKP_DR9) || \ - ((BKP) == RTC_BKP_DR10) || \ - ((BKP) == RTC_BKP_DR11) || \ - ((BKP) == RTC_BKP_DR12) || \ - ((BKP) == RTC_BKP_DR13) || \ - ((BKP) == RTC_BKP_DR14) || \ - ((BKP) == RTC_BKP_DR15) || \ - ((BKP) == RTC_BKP_DR16) || \ - ((BKP) == RTC_BKP_DR17) || \ - ((BKP) == RTC_BKP_DR18) || \ - ((BKP) == RTC_BKP_DR19)) /** * @} */ -/** @defgroup RTCEx_Time_Stamp_Edges_definitions +/** @defgroup RTCEx_Time_Stamp_Edges_definitions RTC TimeStamp Edges Definitions * @{ */ #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000) #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008) - -#define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ - ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) /** * @} */ -/** @defgroup RTCEx_Tamper_Pins_Definitions +/** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions * @{ */ #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E - -#define IS_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFF6) == 0x00) && ((TAMPER) != (uint32_t)RESET)) /** * @} */ -/** @defgroup RTCEx_Tamper_Pins_Selection +/** @defgroup RTCEx_Tamper_Pins_Selection RTC tamper Pins Selection * @{ */ #define RTC_TAMPERPIN_PC13 ((uint32_t)0x00000000) -#define RTC_TAMPERPIN_PI8 ((uint32_t)0x00010000) - -#define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_PC13) || \ - ((PIN) == RTC_TAMPERPIN_PI8)) +#if defined (STM32F446xx) + #define RTC_TAMPERPIN_PA0 ((uint32_t)0x00010000) +#else + #define RTC_TAMPERPIN_PI8 ((uint32_t)0x00010000) +#endif /* STM32F446xx */ /** * @} */ -/** @defgroup RTCEx_TimeStamp_Pin_Selection +/** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection * @{ */ #define RTC_TIMESTAMPPIN_PC13 ((uint32_t)0x00000000) -#define RTC_TIMESTAMPPIN_PI8 ((uint32_t)0x00020000) - -#define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_PC13) || \ - ((PIN) == RTC_TIMESTAMPPIN_PI8)) +#if defined (STM32F446xx) + #define RTC_TIMESTAMPPIN_PA0 ((uint32_t)0x00020000) +#else + #define RTC_TIMESTAMPPIN_PI8 ((uint32_t)0x00020000) +#endif /* STM32F446xx */ /** * @} */ -/** @defgroup RTCEx_Tamper_Trigger_Definitions +/** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions * @{ */ #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000) #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002) #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE - -#define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ - ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ - ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ - ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) - /** * @} */ -/** @defgroup RTCEx_Tamper_Filter_Definitions +/** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions * @{ */ #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */ @@ -213,17 +189,12 @@ typedef struct #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4 consecutive samples at the active level */ #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8 - consecutive samples at the active leve. */ - -#define IS_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ - ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ - ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ - ((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) + consecutive samples at the active level. */ /** * @} */ -/** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions +/** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions * @{ */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled @@ -242,20 +213,11 @@ typedef struct with a frequency = RTCCLK / 512 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */ - -#define IS_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ - ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) /** * @} */ -/** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions +/** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions * @{ */ #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before @@ -266,40 +228,29 @@ typedef struct sampling during 4 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */ - -#define IS_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ - ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ - ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ - ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) /** * @} */ -/** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions +/** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions * @{ */ #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */ #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */ - -#define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ - ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) /** * @} */ -/** @defgroup RTCEx_Tamper_Pull_UP_Definitions +/** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions * @{ */ #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */ #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */ - -#define IS_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ - ((STATE) == RTC_TAMPER_PULLUP_DISABLE)) /** * @} */ -/** @defgroup RTCEx_Wakeup_Timer_Definitions +/** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wake-up Timer Definitions * @{ */ #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000) @@ -308,51 +259,33 @@ typedef struct #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003) #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004) #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006) - -#define IS_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ - ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ - ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ - ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ - ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ - ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) - -#define IS_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF) /** * @} */ -/** @defgroup RTCEx_Digital_Calibration_Definitions +/** @defgroup RTCEx_Digital_Calibration_Definitions RTC Digital Calib Definitions * @{ */ #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000) #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080) - -#define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \ - ((SIGN) == RTC_CALIBSIGN_NEGATIVE)) - -#define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20) /** * @} */ -/** @defgroup RTCEx_Smooth_calib_period_Definitions +/** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions * @{ */ -#define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation +#define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibration period is 32s, else 2exp20 RTCCLK seconds */ -#define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibation +#define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibration period is 16s, else 2exp19 RTCCLK seconds */ -#define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibation +#define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibration period is 8s, else 2exp18 RTCCLK seconds */ - -#define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ - ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ - ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) /** * @} */ -/** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions +/** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus Pulses Definitions * @{ */ #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added @@ -360,49 +293,25 @@ typedef struct with Y = 512, 256, 128 when X = 32, 16, 8 */ #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited during a 32-second window = CALM[8:0] */ - -#define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ - ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) -/** - * @} - */ - -/** @defgroup RTCEx_Smooth_calib_Minus_pulses_Definitions - * @{ - */ -#define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF) /** * @} */ -/** @defgroup RTCEx_Add_1_Second_Parameter_Definitions +/** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions * @{ */ #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000) #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000) - -#define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ - ((SEL) == RTC_SHIFTADD1S_SET)) /** * @} */ -/** @defgroup RTCEx_Substract_Fraction_Of_Second_Value - * @{ - */ -#define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF) -/** - * @} - */ - /** @defgroup RTCEx_Calib_Output_selection_Definitions + /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions * @{ */ #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000) #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000) - -#define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ - ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) /** * @} */ @@ -412,6 +321,14 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros + * @{ + */ + +/* ---------------------------------WAKEUPTIMER---------------------------------*/ +/** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer + * @{ + */ /** * @brief Enable the RTC WakeUp Timer peripheral. @@ -421,67 +338,174 @@ typedef struct #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) /** - * @brief Enable the RTC TimeStamp peripheral. + * @brief Disable the RTC Wake-up Timer peripheral. * @param __HANDLE__: specifies the RTC handle. * @retval None */ -#define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) +#define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) /** - * @brief Disable the RTC WakeUp Timer peripheral. + * @brief Enable the RTC WakeUpTimer interrupt. * @param __HANDLE__: specifies the RTC handle. + * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. + * This parameter can be: + * @arg RTC_IT_WUT: WakeUpTimer A interrupt * @retval None */ -#define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) +#define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) /** - * @brief Disable the RTC TimeStamp peripheral. + * @brief Disable the RTC WakeUpTimer interrupt. * @param __HANDLE__: specifies the RTC handle. + * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. + * This parameter can be: + * @arg RTC_IT_WUT: WakeUpTimer A interrupt * @retval None */ -#define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) +#define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) /** - * @brief Enable the Coarse calibration process. + * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. * @param __HANDLE__: specifies the RTC handle. + * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check. + * This parameter can be: + * @arg RTC_IT_WUT: WakeUpTimer A interrupt * @retval None */ -#define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE)) +#define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET) /** - * @brief Disable the Coarse calibration process. + * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not. * @param __HANDLE__: specifies the RTC handle. + * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check. + * This parameter can be: + * @arg RTC_IT_WUT: WakeUpTimer interrupt * @retval None */ -#define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE)) +#define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) /** - * @brief Enable the RTC calibration output. + * @brief Get the selected RTC WakeUpTimer's flag status. * @param __HANDLE__: specifies the RTC handle. + * @param __FLAG__: specifies the RTC WakeUpTimer Flag to check. + * This parameter can be: + * @arg RTC_FLAG_WUTF + * @arg RTC_FLAG_WUTWF * @retval None */ -#define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) +#define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) /** - * @brief Disable the calibration output. + * @brief Clear the RTC Wake Up timer's pending flags. * @param __HANDLE__: specifies the RTC handle. + * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. + * This parameter can be: + * @arg RTC_FLAG_WUTF * @retval None */ -#define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) +#define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) /** - * @brief Enable the clock reference detection. + * @brief Enable interrupt on the RTC Wake-up Timer associated Exti line. + * @retval None + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Disable interrupt on the RTC Wake-up Timer associated Exti line. + * @retval None + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) + +/** + * @brief Enable event on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Disable event on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) + +/** + * @brief Enable falling edge trigger on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Disable falling edge trigger on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) + +/** + * @brief Enable rising edge trigger on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Disable rising edge trigger on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) + +/** + * @brief Enable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); + +/** + * @brief Disable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line. + * This parameter can be: + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); + +/** + * @brief Check whether the RTC Wake-up Timer associated Exti line interrupt flag is set or not. + * @retval Line Status. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Clear the RTC Wake-up Timer associated Exti line flag. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Generate a Software interrupt on the RTC Wake-up Timer associated Exti line. + * @retval None. + */ +#define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @} + */ + +/* ---------------------------------TIMESTAMP---------------------------------*/ +/** @defgroup RTCEx_Timestamp RTC Timestamp + * @{ + */ + +/** + * @brief Enable the RTC TimeStamp peripheral. * @param __HANDLE__: specifies the RTC handle. * @retval None */ -#define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) +#define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) /** - * @brief Disable the clock reference detection. + * @brief Disable the RTC TimeStamp peripheral. * @param __HANDLE__: specifies the RTC handle. * @retval None */ -#define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) +#define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) /** * @brief Enable the RTC TimeStamp interrupt. @@ -494,139 +518,298 @@ typedef struct #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) /** - * @brief Enable the RTC WakeUpTimer interrupt. + * @brief Disable the RTC TimeStamp interrupt. * @param __HANDLE__: specifies the RTC handle. - * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. + * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. * This parameter can be: - * @arg RTC_IT_WUT: WakeUpTimer A interrupt + * @arg RTC_IT_TS: TimeStamp interrupt * @retval None */ -#define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) +#define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) /** - * @brief Disable the RTC TimeStamp interrupt. + * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. * @param __HANDLE__: specifies the RTC handle. - * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. + * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt to check. * This parameter can be: * @arg RTC_IT_TS: TimeStamp interrupt * @retval None */ -#define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) +#define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET) /** - * @brief Disable the RTC WakeUpTimer interrupt. + * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not. * @param __HANDLE__: specifies the RTC handle. - * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. + * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check. * This parameter can be: - * @arg RTC_IT_WUT: WakeUpTimer A interrupt + * @arg RTC_IT_TS: TimeStamp interrupt * @retval None */ -#define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) +#define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) /** - * @brief Check whether the specified RTC Tamper interrupt has occurred or not. + * @brief Get the selected RTC TimeStamp's flag status. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled. + * @param __FLAG__: specifies the RTC TimeStamp flag to check. * This parameter can be: - * @arg RTC_IT_TAMP1 + * @arg RTC_FLAG_TSF + * @arg RTC_FLAG_TSOVF * @retval None */ -#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET) +#define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) /** - * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. + * @brief Clear the RTC Time Stamp's pending flags. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_IT_WUT: WakeUpTimer A interrupt + * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled. + * This parameter can be: + * @arg RTC_FLAG_TSF * @retval None */ -#define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET) +#define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) /** - * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. + * @} + */ + +/* ---------------------------------TAMPER------------------------------------*/ +/** @defgroup RTCEx_Tamper RTC Tamper + * @{ + */ + +/** + * @brief Enable the RTC Tamper1 input detection. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_IT_TS: TimeStamp interrupt * @retval None */ -#define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET) +#define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E)) /** - * @brief Get the selected RTC TimeStamp's flag status. + * @brief Disable the RTC Tamper1 input detection. + * @param __HANDLE__: specifies the RTC handle. + * @retval None + */ +#define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E)) + +/** + * @brief Enable the RTC Tamper2 input detection. + * @param __HANDLE__: specifies the RTC handle. + * @retval None + */ +#define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E)) + +/** + * @brief Disable the RTC Tamper2 input detection. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled. + * @retval None + */ +#define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E)) + +/** + * @brief Check whether the specified RTC Tamper interrupt has occurred or not. + * @param __HANDLE__: specifies the RTC handle. + * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check. * This parameter can be: - * @arg RTC_FLAG_TSF - * @arg RTC_FLAG_TSOVF + * @arg RTC_IT_TAMP1 + * @arg RTC_IT_TAMP2 * @retval None */ -#define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) +#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET) /** - * @brief Get the selected RTC WakeUpTimer's flag status. + * @brief Check whether the specified RTC Tamper interrupt has been enabled or not. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_FLAG_WUTF - * @arg RTC_FLAG_WUTWF + * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check. + * This parameter can be: + * @arg RTC_IT_TAMP: Tamper interrupt * @retval None */ -#define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) +#define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET) /** * @brief Get the selected RTC Tamper's flag status. * @param __HANDLE__: specifies the RTC handle. * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. * This parameter can be: - * @arg RTC_FLAG_TAMP1F + * @arg RTC_FLAG_TAMP1F + * @arg RTC_FLAG_TAMP2F * @retval None */ #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) /** - * @brief Get the selected RTC shift operation's flag status. + * @brief Clear the RTC Tamper's pending flags. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC shift operation Flag is pending or not. + * @param __FLAG__: specifies the RTC Tamper Flag to clear. * This parameter can be: - * @arg RTC_FLAG_SHPF + * @arg RTC_FLAG_TAMP1F + * @arg RTC_FLAG_TAMP2F * @retval None */ -#define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) +#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) +/** + * @} + */ + +/* --------------------------TAMPER/TIMESTAMP---------------------------------*/ +/** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI + * @{ + */ /** - * @brief Clear the RTC Time Stamp's pending flags. + * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line. + * @retval None + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) + +/** + * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line. + * @retval None + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) + +/** + * @brief Enable event on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) + +/** + * @brief Disable event on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) + +/** + * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) + +/** + * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) + +/** + * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) + +/** + * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) + +/** + * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); + +/** + * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. + * This parameter can be: + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); + +/** + * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not. + * @retval Line Status. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) + +/** + * @brief Clear the RTC Tamper and Timestamp associated Exti line flag. + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) + +/** + * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line + * @retval None. + */ +#define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) +/** + * @} + */ + +/* ------------------------------Calibration----------------------------------*/ +/** @defgroup RTCEx_Calibration RTC Calibration + * @{ + */ + +/** + * @brief Enable the Coarse calibration process. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_FLAG_TSF * @retval None */ -#define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) +#define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE)) /** - * @brief Clear the RTC Tamper's pending flags. + * @brief Disable the Coarse calibration process. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_FLAG_TAMP1F * @retval None */ -#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) +#define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE)) /** - * @brief Clear the RTC Wake Up timer's pending flags. + * @brief Enable the RTC calibration output. * @param __HANDLE__: specifies the RTC handle. - * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. - * This parameter can be: - * @arg RTC_FLAG_WUTF * @retval None */ -#define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) +#define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) + +/** + * @brief Disable the calibration output. + * @param __HANDLE__: specifies the RTC handle. + * @retval None + */ +#define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) + +/** + * @brief Enable the clock reference detection. + * @param __HANDLE__: specifies the RTC handle. + * @retval None + */ +#define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) + +/** + * @brief Disable the clock reference detection. + * @param __HANDLE__: specifies the RTC handle. + * @retval None + */ +#define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) + +/** + * @brief Get the selected RTC shift operation's flag status. + * @param __HANDLE__: specifies the RTC handle. + * @param __FLAG__: specifies the RTC shift operation Flag is pending or not. + * This parameter can be: + * @arg RTC_FLAG_SHPF + * @retval None + */ +#define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) +/** + * @} + */ + +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions + * @{ + */ +/** @addtogroup RTCEx_Exported_Functions_Group1 + * @{ + */ /* RTC TimeStamp and Tamper functions *****************************************/ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); @@ -636,27 +819,39 @@ HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDe HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); -void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); -void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); -void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); -void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); +/** + * @} + */ +/** @addtogroup RTCEx_Exported_Functions_Group2 + * @{ + */ /* RTC Wake-up functions ******************************************************/ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); -uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); -uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); -void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); -void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); +uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); +uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); +/** + * @} + */ +/** @addtogroup RTCEx_Exported_Functions_Group3 + * @{ + */ /* Extension Control functions ************************************************/ -void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); -uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); +void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); +uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value); HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc); @@ -668,11 +863,140 @@ HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); +/** + * @} + */ +/** @addtogroup RTCEx_Exported_Functions_Group4 + * @{ + */ /* Extension RTC features functions *******************************************/ -void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); +void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup RTCEx_Private_Constants RTCEx Private Constants + * @{ + */ +#define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)EXTI_IMR_MR21) /*!< External interrupt line 21 Connected to the RTC Tamper and Time Stamp events */ +#define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR22) /*!< External interrupt line 22 Connected to the RTC Wake-up event */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup RTCEx_Private_Macros RTCEx Private Macros + * @{ + */ + +/** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters + * @{ + */ +#define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \ + ((BKP) == RTC_BKP_DR1) || \ + ((BKP) == RTC_BKP_DR2) || \ + ((BKP) == RTC_BKP_DR3) || \ + ((BKP) == RTC_BKP_DR4) || \ + ((BKP) == RTC_BKP_DR5) || \ + ((BKP) == RTC_BKP_DR6) || \ + ((BKP) == RTC_BKP_DR7) || \ + ((BKP) == RTC_BKP_DR8) || \ + ((BKP) == RTC_BKP_DR9) || \ + ((BKP) == RTC_BKP_DR10) || \ + ((BKP) == RTC_BKP_DR11) || \ + ((BKP) == RTC_BKP_DR12) || \ + ((BKP) == RTC_BKP_DR13) || \ + ((BKP) == RTC_BKP_DR14) || \ + ((BKP) == RTC_BKP_DR15) || \ + ((BKP) == RTC_BKP_DR16) || \ + ((BKP) == RTC_BKP_DR17) || \ + ((BKP) == RTC_BKP_DR18) || \ + ((BKP) == RTC_BKP_DR19)) +#define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ + ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) +#define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFF6) == 0x00) && ((TAMPER) != (uint32_t)RESET)) + +#if defined (STM32F446xx) +#define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_PC13) || \ + ((PIN) == RTC_TAMPERPIN_PA0)) +#else +#define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_PC13) || \ + ((PIN) == RTC_TAMPERPIN_PI8)) +#endif /* STM32F446xx */ +#if defined (STM32F446xx) +#define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_PC13) || \ + ((PIN) == RTC_TIMESTAMPPIN_PA0)) +#else +#define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_PC13) || \ + ((PIN) == RTC_TIMESTAMPPIN_PI8)) +#endif /* STM32F446xx */ +#define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ + ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ + ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ + ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) +#define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ + ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ + ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ + ((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) +#define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ + ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) +#define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ + ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ + ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ + ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) +#define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ + ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) +#define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ + ((STATE) == RTC_TAMPER_PULLUP_DISABLE)) +#define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ + ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ + ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ + ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ + ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ + ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) + +#define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF) +#define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \ + ((SIGN) == RTC_CALIBSIGN_NEGATIVE)) + +#define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20) + +#define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ + ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ + ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) +#define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ + ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) + + +#define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF) +#define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ + ((SEL) == RTC_SHIFTADD1S_SET)) +#define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF) +#define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ + ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) +/** + * @} + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.c index e27c58c9b8a..6c81400b3f2 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_sai.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SAI HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Serial Audio Interface (SAI) peripheral: @@ -47,7 +47,15 @@ -@- The specific SAI interrupts (FIFO request and Overrun underrun interrupt) will be managed using the macros __SAI_ENABLE_IT() and __SAI_DISABLE_IT() inside the transmit and receive process. - + + [..] + (@) SAI Clock Source configuration is managed differently depending on the selected + STM32F4 devices : + (+@) For STM32F446xx devices, the configuration is managed through RCCEx_PeriphCLKConfig() + function in the HAL RCC drivers + (+@) For STM32F439xx/STM32F437xx/STM32F429xx/STM32F427xx devices, the configuration + is managed within HAL SAI drivers through HAL_SAI_Init() function using + ClockSource field of SAI_InitTypeDef structure. [..] (@) Make sure that either: (+@) I2S PLL is configured or @@ -124,7 +132,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -158,19 +166,38 @@ * @{ */ -/** @defgroup SAI +/** @defgroup SAI SAI * @brief SAI HAL module driver * @{ */ #ifdef HAL_SAI_MODULE_ENABLED -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ +/** @defgroup SAI_Private_Typedefs SAI Private Typedefs + * @{ + */ +typedef enum { + SAI_MODE_DMA, + SAI_MODE_IT +}SAI_ModeTypedef; +/** + * @} + */ /* Private define ------------------------------------------------------------*/ +/** @defgroup SAI_Private_Constants SAI Private Constants + * @{ + */ +#define SAI_FIFO_SIZE 8 +#define SAI_DEFAULT_TIMEOUT 4 +/** + * @} + */ + /* SAI registers Masks */ -#define CR1_CLEAR_MASK ((uint32_t)0xFF07C010) +#define CR1_CLEAR_MASK ((uint32_t)0xFF04C010) #define FRCR_CLEAR_MASK ((uint32_t)0xFFF88000) #define SLOTR_CLEAR_MASK ((uint32_t)0x0000F020) @@ -178,19 +205,32 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +static void SAI_FillFifo(SAI_HandleTypeDef *hsai); +static uint32_t SAI_InterruptFlag(SAI_HandleTypeDef *hsai, uint32_t mode); +static HAL_StatusTypeDef SAI_InitI2S(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot); +static HAL_StatusTypeDef SAI_InitPCM(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot); + +static HAL_StatusTypeDef SAI_Disable(SAI_HandleTypeDef *hsai); +static void SAI_Transmit_IT8Bit(SAI_HandleTypeDef *hsai); +static void SAI_Transmit_IT16Bit(SAI_HandleTypeDef *hsai); +static void SAI_Transmit_IT32Bit(SAI_HandleTypeDef *hsai); +static void SAI_Receive_IT8Bit(SAI_HandleTypeDef *hsai); +static void SAI_Receive_IT16Bit(SAI_HandleTypeDef *hsai); +static void SAI_Receive_IT32Bit(SAI_HandleTypeDef *hsai); + static void SAI_DMATxCplt(DMA_HandleTypeDef *hdma); static void SAI_DMATxHalfCplt(DMA_HandleTypeDef *hdma); static void SAI_DMARxCplt(DMA_HandleTypeDef *hdma); static void SAI_DMARxHalfCplt(DMA_HandleTypeDef *hdma); static void SAI_DMAError(DMA_HandleTypeDef *hdma); -/* Private functions ---------------------------------------------------------*/ +/* Exported functions ---------------------------------------------------------*/ -/** @defgroup SAI_Private_Functions +/** @defgroup SAI_Exported_Functions SAI Exported Functions * @{ */ -/** @defgroup SAI_Group1 Initialization and de-initialization functions +/** @defgroup SAI_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -221,6 +261,50 @@ static void SAI_DMAError(DMA_HandleTypeDef *hdma); * @{ */ +/** + * @brief Initializes the structure FrameInit, SlotInit and the low part of + * Init according to the specified parameters and call the function + * HAL_SAI_Init to initialize the SAI block. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @param protocol : one of the supported protocol @ref SAI_Protocol + * @param datasize : one of the supported datasize @ref SAI_Protocol_DataSize + * the configuration information for SAI module. + * @param nbslot : Number of slot. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SAI_InitProtocol(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_SAI_SUPPORTED_PROTOCOL(protocol)); + assert_param(IS_SAI_PROTOCOL_DATASIZE(datasize)); + + switch(protocol) + { + case SAI_I2S_STANDARD : + case SAI_I2S_MSBJUSTIFIED : + case SAI_I2S_LSBJUSTIFIED : + status = SAI_InitI2S(hsai, protocol, datasize, nbslot); + break; + case SAI_PCM_LONG : + case SAI_PCM_SHORT : + status = SAI_InitPCM(hsai, protocol, datasize, nbslot); + break; + default : + status = HAL_ERROR; + break; + } + + if(status == HAL_OK) + { + status = HAL_SAI_Init(hsai); + } + + return status; +} + /** * @brief Initializes the SAI according to the specified parameters * in the SAI_InitTypeDef and create the associated handle. @@ -230,12 +314,10 @@ static void SAI_DMAError(DMA_HandleTypeDef *hdma); */ HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai) { - uint32_t tmpreg = 0; - uint32_t tmpclock = 0, tmp2clock = 0; - /* This variable used to store the VCO Input (value in Hz) */ - uint32_t vcoinput = 0; + uint32_t tmpclock = 0; + /* This variable used to store the SAI_CK_x (value in Hz) */ - uint32_t saiclocksource = 0; + uint32_t freq = 0; /* Check the SAI handle allocation */ if(hsai == HAL_NULL) @@ -244,8 +326,10 @@ HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai) } /* Check the SAI Block parameters */ + assert_param(IS_SAI_AUDIO_FREQUENCY(hsai->Init.AudioFrequency)); assert_param(IS_SAI_BLOCK_PROTOCOL(hsai->Init.Protocol)); assert_param(IS_SAI_BLOCK_MODE(hsai->Init.AudioMode)); + assert_param(IS_SAI_BLOCK_SYNCEXT(hsai->Init.SynchroExt)); assert_param(IS_SAI_BLOCK_DATASIZE(hsai->Init.DataSize)); assert_param(IS_SAI_BLOCK_FIRST_BIT(hsai->Init.FirstBit)); assert_param(IS_SAI_BLOCK_CLOCK_STROBING(hsai->Init.ClockStrobing)); @@ -253,7 +337,9 @@ HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai) assert_param(IS_SAI_BLOCK_OUTPUT_DRIVE(hsai->Init.OutputDrive)); assert_param(IS_SAI_BLOCK_NODIVIDER(hsai->Init.NoDivider)); assert_param(IS_SAI_BLOCK_FIFO_THRESHOLD(hsai->Init.FIFOThreshold)); - assert_param(IS_SAI_AUDIO_FREQUENCY(hsai->Init.AudioFrequency)); + assert_param(IS_SAI_MONO_STEREO_MODE(hsai->Init.MonoStereoMode)); + assert_param(IS_SAI_BLOCK_COMPANDING_MODE(hsai->Init.CompandingMode)); + assert_param(IS_SAI_BLOCK_TRISTATE_MANAGEMENT(hsai->Init.TriState)); /* Check the SAI Block Frame parameters */ assert_param(IS_SAI_BLOCK_FRAME_LENGTH(hsai->FrameInit.FrameLength)); @@ -270,6 +356,9 @@ HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai) if(hsai->State == HAL_SAI_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hsai->Lock = HAL_UNLOCKED; + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ HAL_SAI_MspInit(hsai); } @@ -277,179 +366,76 @@ HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai) hsai->State = HAL_SAI_STATE_BUSY; /* Disable the selected SAI peripheral */ - __HAL_SAI_DISABLE(hsai); - - /* SAI Block Configuration ------------------------------------------------------------*/ - /* SAI Block_x CR1 Configuration */ - /* Get the SAI Block_x CR1 value */ - tmpreg = hsai->Instance->CR1; - /* Clear MODE, PRTCFG, DS, LSBFIRST, CKSTR, SYNCEN, OUTDRIV, NODIV, and MCKDIV bits */ - tmpreg &= CR1_CLEAR_MASK; - /* Configure SAI_Block_x: Audio Protocol, Data Size, first transmitted bit, Clock strobing - edge, Synchronization mode, Output drive, Master Divider and FIFO level */ - /* Set PRTCFG bits according to Protocol value */ - /* Set DS bits according to DataSize value */ - /* Set LSBFIRST bit according to FirstBit value */ - /* Set CKSTR bit according to ClockStrobing value */ - /* Set SYNCEN bit according to Synchro value */ - /* Set OUTDRIV bit according to OutputDrive value */ - /* Set NODIV bit according to NoDivider value */ - tmpreg |= (uint32_t)(hsai->Init.Protocol | - hsai->Init.AudioMode | - hsai->Init.DataSize | - hsai->Init.FirstBit | - hsai->Init.ClockStrobing | - hsai->Init.Synchro | - hsai->Init.OutputDrive | - hsai->Init.NoDivider); - /* Write to SAI_Block_x CR1 */ - hsai->Instance->CR1 = tmpreg; - - /* SAI Block_x CR2 Configuration */ - /* Get the SAIBlock_x CR2 value */ - tmpreg = hsai->Instance->CR2; - /* Clear FTH bits */ - tmpreg &= ~(SAI_xCR2_FTH); - /* Configure the FIFO Level */ - /* Set FTH bits according to SAI_FIFOThreshold value */ - tmpreg |= (uint32_t)(hsai->Init.FIFOThreshold); - /* Write to SAI_Block_x CR2 */ - hsai->Instance->CR2 = tmpreg; - - /* SAI Block_x Frame Configuration -----------------------------------------*/ - /* Get the SAI Block_x FRCR value */ - tmpreg = hsai->Instance->FRCR; - /* Clear FRL, FSALL, FSDEF, FSPOL, FSOFF bits */ - tmpreg &= FRCR_CLEAR_MASK; - /* Configure SAI_Block_x Frame: Frame Length, Active Frame Length, Frame Synchronization - Definition, Frame Synchronization Polarity and Frame Synchronization Polarity */ - /* Set FRL bits according to SAI_FrameLength value */ - /* Set FSALL bits according to SAI_ActiveFrameLength value */ - /* Set FSDEF bit according to SAI_FSDefinition value */ - /* Set FSPOL bit according to SAI_FSPolarity value */ - /* Set FSOFF bit according to SAI_FSOffset value */ - tmpreg |= (uint32_t)((uint32_t)(hsai->FrameInit.FrameLength - 1) | - hsai->FrameInit.FSOffset | - hsai->FrameInit.FSDefinition | - hsai->FrameInit.FSPolarity | - (uint32_t)((hsai->FrameInit.ActiveFrameLength - 1) << 8)); - - /* Write to SAI_Block_x FRCR */ - hsai->Instance->FRCR = tmpreg; - - /* SAI Block_x SLOT Configuration ------------------------------------------*/ - /* Get the SAI Block_x SLOTR value */ - tmpreg = hsai->Instance->SLOTR; - /* Clear FBOFF, SLOTSZ, NBSLOT, SLOTEN bits */ - tmpreg &= SLOTR_CLEAR_MASK; - /* Configure SAI_Block_x Slot: First bit offset, Slot size, Number of Slot in - audio frame and slots activated in audio frame */ - /* Set FBOFF bits according to SAI_FirstBitOffset value */ - /* Set SLOTSZ bits according to SAI_SlotSize value */ - /* Set NBSLOT bits according to SAI_SlotNumber value */ - /* Set SLOTEN bits according to SAI_SlotActive value */ - tmpreg |= (uint32_t)(hsai->SlotInit.FirstBitOffset | - hsai->SlotInit.SlotSize | - hsai->SlotInit.SlotActive | - (uint32_t)((hsai->SlotInit.SlotNumber - 1) << 8)); - - /* Write to SAI_Block_x SLOTR */ - hsai->Instance->SLOTR = tmpreg; - - /* SAI Block_x Clock Configuration -----------------------------------------*/ - /* Check the Clock parameters */ - assert_param(IS_SAI_CLK_SOURCE(hsai->Init.ClockSource)); - - /* SAI Block clock source selection */ - if(hsai->Instance == SAI1_Block_A) - { - __HAL_RCC_SAI_BLOCKACLKSOURCE_CONFIG(hsai->Init.ClockSource); - } - else - { - __HAL_RCC_SAI_BLOCKBCLKSOURCE_CONFIG((uint32_t)(hsai->Init.ClockSource << 2)); - } + SAI_Disable(hsai); - /* VCO Input Clock value calculation */ - if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI) - { - /* In Case the PLL Source is HSI (Internal Clock) */ - vcoinput = (HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); - } - else - { - /* In Case the PLL Source is HSE (External Clock) */ - vcoinput = ((HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM))); - } - - /* SAI_CLK_x : SAI Block Clock configuration for different clock sources selected */ - if(hsai->Init.ClockSource == SAI_CLKSOURCE_PLLSAI) - { - /* Configure the PLLI2S division factor */ - /* PLLSAI_VCO Input = PLL_SOURCE/PLLM */ - /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN */ - /* SAI_CLK(first level) = PLLSAI_VCO Output/PLLSAIQ */ - tmpreg = (RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> 24; - saiclocksource = (vcoinput * ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIN) >> 6))/(tmpreg); - - /* SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ */ - tmpreg = (((RCC->DCKCFGR & RCC_DCKCFGR_PLLSAIDIVQ) >> 8) + 1); - saiclocksource = saiclocksource/(tmpreg); - - } - else if(hsai->Init.ClockSource == SAI_CLKSOURCE_PLLI2S) - { - /* Configure the PLLI2S division factor */ - /* PLLI2S_VCO Input = PLL_SOURCE/PLLM */ - /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ - /* SAI_CLK(first level) = PLLI2S_VCO Output/PLLI2SQ */ - tmpreg = (RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SQ) >> 24; - saiclocksource = (vcoinput * ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6))/(tmpreg); - - /* SAI_CLK_x = SAI_CLK(first level)/PLLI2SDIVQ */ - tmpreg = ((RCC->DCKCFGR & RCC_DCKCFGR_PLLI2SDIVQ) + 1); - saiclocksource = saiclocksource/(tmpreg); - } - else /* sConfig->ClockSource == SAI_CLKSource_Ext */ - { - /* Enable the External Clock selection */ - __HAL_RCC_I2SCLK(RCC_I2SCLKSOURCE_EXT); + /* SAI Block Synchro Configuration -----------------------------------------*/ + SAI_BlockSynchroConfig(hsai); - saiclocksource = EXTERNAL_CLOCK_VALUE; - } - /* Configure Master Clock using the following formula : MCLK_x = SAI_CK_x / (MCKDIV[3:0] * 2) with MCLK_x = 256 * FS FS = SAI_CK_x / (MCKDIV[3:0] * 2) * 256 MCKDIV[3:0] = SAI_CK_x / FS * 512 */ - if(hsai->Init.NoDivider == SAI_MASTERDIVIDER_ENABLED) + if(hsai->Init.AudioFrequency != SAI_AUDIO_FREQUENCY_MCKDIV) { + /* Get SAI clock source based on Source clock selection from RCC */ + freq = SAI_GetInputClock(hsai); + /* (saiclocksource x 10) to keep Significant digits */ - tmpclock = (((saiclocksource * 10) / ((hsai->Init.AudioFrequency) * 512))); + tmpclock = (((freq * 10) / ((hsai->Init.AudioFrequency) * 512))); - /* Get the result of modulo division */ - tmp2clock = (tmpclock % 10); + hsai->Init.Mckdiv = tmpclock / 10; - /* Round result to the nearest integer*/ - if (tmp2clock > 8) - { - tmpclock = ((tmpclock / 10) + 1); - } - else + /* Round result to the nearest integer */ + if((tmpclock % 10) > 8) { - tmpclock = (tmpclock / 10); + hsai->Init.Mckdiv+= 1; } - /*Set MCKDIV value in CR1 register*/ - hsai->Instance->CR1 |= (tmpclock << 20); - } + /* SAI Block Configuration ------------------------------------------------------------*/ + /* SAI CR1 Configuration */ + hsai->Instance->CR1&=~(SAI_xCR1_MODE | SAI_xCR1_PRTCFG | SAI_xCR1_DS | \ + SAI_xCR1_LSBFIRST | SAI_xCR1_CKSTR | SAI_xCR1_SYNCEN |\ + SAI_xCR1_MONO | SAI_xCR1_OUTDRIV | SAI_xCR1_DMAEN | \ + SAI_xCR1_NODIV | SAI_xCR1_MCKDIV); + + hsai->Instance->CR1|= (hsai->Init.AudioMode | hsai->Init.Protocol | \ + hsai->Init.DataSize | hsai->Init.FirstBit | \ + hsai->Init.ClockStrobing | hsai->Init.Synchro | \ + hsai->Init.MonoStereoMode | hsai->Init.OutputDrive | \ + hsai->Init.NoDivider | (hsai->Init.Mckdiv << 20) | hsai->Init.CompandingMode); + + /* SAI CR2 Configuration */ + hsai->Instance->CR2&= ~(SAI_xCR2_FTH | SAI_xCR2_FFLUSH | SAI_xCR2_COMP); + hsai->Instance->CR2|= (hsai->Init.FIFOThreshold | hsai->Init.CompandingMode | hsai->Init.TriState); + + + /* SAI Frame Configuration -----------------------------------------*/ + hsai->Instance->FRCR&=(~(SAI_xFRCR_FRL | SAI_xFRCR_FSALL | SAI_xFRCR_FSDEF | \ + SAI_xFRCR_FSPO | SAI_xFRCR_FSOFF)); + hsai->Instance->FRCR|=((hsai->FrameInit.FrameLength - 1) | + hsai->FrameInit.FSOffset | + hsai->FrameInit.FSDefinition | + hsai->FrameInit.FSPolarity | + ((hsai->FrameInit.ActiveFrameLength - 1) << 8)); + + /* SAI Block_x SLOT Configuration ------------------------------------------*/ + /* This register has no meaning in AC’97 and SPDIF audio protocol */ + hsai->Instance->SLOTR&= (~(SAI_xSLOTR_FBOFF | SAI_xSLOTR_SLOTSZ | \ + SAI_xSLOTR_NBSLOT | SAI_xSLOTR_SLOTEN )); + + hsai->Instance->SLOTR|= hsai->SlotInit.FirstBitOffset | hsai->SlotInit.SlotSize + | hsai->SlotInit.SlotActive | ((hsai->SlotInit.SlotNumber - 1) << 8); + /* Initialise the error code */ hsai->ErrorCode = HAL_SAI_ERROR_NONE; - + /* Initialize the SAI state */ hsai->State= HAL_SAI_STATE_READY; - + + /* Release Lock */ + __HAL_UNLOCK(hsai); + return HAL_OK; } @@ -469,6 +455,16 @@ HAL_StatusTypeDef HAL_SAI_DeInit(SAI_HandleTypeDef *hsai) hsai->State = HAL_SAI_STATE_BUSY; + /* Disabled All interrupt and clear all the flag */ + hsai->Instance->IMR = 0; + hsai->Instance->CLRFR = 0xFFFFFFFF; + + /* Disable the SAI */ + SAI_Disable(hsai); + + /* Flush the fifo */ + SET_BIT(hsai->Instance->CR2, SAI_xCR2_FFLUSH); + /* DeInit the low level hardware: GPIO, CLOCK, NVIC and DMA */ HAL_SAI_MspDeInit(hsai); @@ -514,7 +510,7 @@ __weak void HAL_SAI_MspDeInit(SAI_HandleTypeDef *hsai) * @} */ -/** @defgroup SAI_Group2 IO operation functions +/** @defgroup SAI_Exported_Functions_Group2 IO operation functions * @brief Data transfers functions * @verbatim @@ -568,7 +564,7 @@ __weak void HAL_SAI_MspDeInit(SAI_HandleTypeDef *hsai) * @param Timeout: Timeout duration * @retval HAL status */ -HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint16_t* pData, uint16_t Size, uint32_t Timeout) +HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint8_t* pData, uint16_t Size, uint32_t Timeout) { uint32_t tickstart = 0; @@ -583,22 +579,45 @@ HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint16_t* pData, uin __HAL_LOCK(hsai); hsai->State = HAL_SAI_STATE_BUSY_TX; - + hsai->ErrorCode = HAL_SAI_ERROR_NONE; + hsai->XferSize = Size; + hsai->XferCount = Size; + hsai->pBuffPtr = pData; + /* Check if the SAI is already enabled */ if((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != SAI_xCR1_SAIEN) { + /* fill the fifo with data before to enabled the SAI */ + SAI_FillFifo(hsai); /* Enable SAI peripheral */ __HAL_SAI_ENABLE(hsai); } - while(Size > 0) + while(hsai->XferCount > 0) { - /* Get tick */ - tickstart = HAL_GetTick(); - - /* Wait the FIFO to be empty */ - while(__HAL_SAI_GET_FLAG(hsai, SAI_xSR_FREQ) == RESET) + /* Write data if the FIFO is not full */ + if((hsai->Instance->SR & SAI_xSR_FLVL) != SAI_FIFOSTATUS_FULL) + { + if((hsai->Init.DataSize == SAI_DATASIZE_8) && (hsai->Init.CompandingMode == SAI_NOCOMPANDING)) + { + hsai->Instance->DR = (*hsai->pBuffPtr++); + } + else if(hsai->Init.DataSize <= SAI_DATASIZE_16) + { + hsai->Instance->DR = *((uint16_t *)hsai->pBuffPtr); + hsai->pBuffPtr+= 2; + } + else + { + hsai->Instance->DR = *((uint32_t *)hsai->pBuffPtr); + hsai->pBuffPtr+= 4; + } + hsai->XferCount--; + } + else { + /* Get tick */ + tickstart = HAL_GetTick(); /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) { @@ -616,11 +635,9 @@ HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint16_t* pData, uin return HAL_TIMEOUT; } } - } - hsai->Instance->DR = (*pData++); - Size--; + } } - + hsai->State = HAL_SAI_STATE_READY; /* Process Unlocked */ @@ -643,10 +660,10 @@ HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint16_t* pData, uin * @param Timeout: Timeout duration * @retval HAL status */ -HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size, uint32_t Timeout) +HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size, uint32_t Timeout) { uint32_t tickstart = 0; - + if((pData == HAL_NULL ) || (Size == 0)) { return HAL_ERROR; @@ -658,23 +675,44 @@ HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint16_t *pData, uint __HAL_LOCK(hsai); hsai->State = HAL_SAI_STATE_BUSY_RX; - + hsai->ErrorCode = HAL_SAI_ERROR_NONE; + hsai->pBuffPtr = pData; + hsai->XferSize = Size; + hsai->XferCount = Size; + /* Check if the SAI is already enabled */ if((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != SAI_xCR1_SAIEN) { /* Enable SAI peripheral */ __HAL_SAI_ENABLE(hsai); } - + /* Receive data */ - while(Size > 0) + while(hsai->XferCount > 0) { - /* Get tick */ - tickstart = HAL_GetTick(); - - /* Wait until RXNE flag is set */ - while(__HAL_SAI_GET_FLAG(hsai, SAI_xSR_FREQ) == RESET) + + if((hsai->Instance->SR & SAI_xSR_FLVL) != SAI_FIFOSTATUS_EMPTY) { + if((hsai->Init.DataSize == SAI_DATASIZE_8) && (hsai->Init.CompandingMode == SAI_NOCOMPANDING)) + { + (*hsai->pBuffPtr++) = hsai->Instance->DR; + } + else if(hsai->Init.DataSize <= SAI_DATASIZE_16) + { + *((uint16_t*)hsai->pBuffPtr) = hsai->Instance->DR; + hsai->pBuffPtr+= 2; + } + else + { + *((uint32_t*)hsai->pBuffPtr) = hsai->Instance->DR; + hsai->pBuffPtr+= 4; + } + hsai->XferCount--; + } + else + { + /* Get tick */ + tickstart = HAL_GetTick(); /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) { @@ -693,11 +731,8 @@ HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint16_t *pData, uint } } } - - (*pData++) = hsai->Instance->DR; - Size--; } - + hsai->State = HAL_SAI_STATE_READY; /* Process Unlocked */ @@ -719,70 +754,54 @@ HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint16_t *pData, uint * @param Size: Amount of data to be sent * @retval HAL status */ -HAL_StatusTypeDef HAL_SAI_Transmit_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size) -{ - if(hsai->State == HAL_SAI_STATE_READY) +HAL_StatusTypeDef HAL_SAI_Transmit_IT(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) +{ + if(hsai->State == HAL_SAI_STATE_READY) { if((pData == HAL_NULL) || (Size == 0)) { return HAL_ERROR; } - hsai->pTxBuffPtr = pData; - hsai->TxXferSize = Size; - hsai->TxXferCount = Size; + hsai->pBuffPtr = pData; + hsai->XferSize = Size; + hsai->XferCount = Size; /* Process Locked */ __HAL_LOCK(hsai); hsai->State = HAL_SAI_STATE_BUSY_TX; - /* Transmit data */ - hsai->Instance->DR = (*hsai->pTxBuffPtr++); - hsai->TxXferCount--; - - /* Process Unlocked */ - __HAL_UNLOCK(hsai); + if((hsai->Init.DataSize == SAI_DATASIZE_8) && (hsai->Init.CompandingMode == SAI_NOCOMPANDING)) + { + hsai->InterruptServiceRoutine = SAI_Transmit_IT8Bit; + } + else if(hsai->Init.DataSize <= SAI_DATASIZE_16) + { + hsai->InterruptServiceRoutine = SAI_Transmit_IT16Bit; + } + else + { + hsai->InterruptServiceRoutine = SAI_Transmit_IT32Bit; + } /* Enable FRQ and OVRUDR interrupts */ - __HAL_SAI_ENABLE_IT(hsai, (SAI_IT_FREQ | SAI_IT_OVRUDR)); - + __HAL_SAI_ENABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + /* Check if the SAI is already enabled */ if((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != SAI_xCR1_SAIEN) { + /* Fill the fifo before starting the communication */ + SAI_FillFifo(hsai); + /* Enable SAI peripheral */ __HAL_SAI_ENABLE(hsai); } - - - return HAL_OK; - } - else if(hsai->State == HAL_SAI_STATE_BUSY_TX) - { - /* Process Locked */ - __HAL_LOCK(hsai); - - /* Transmit data */ - hsai->Instance->DR = (*hsai->pTxBuffPtr++); - - hsai->TxXferCount--; - - if(hsai->TxXferCount == 0) - { - /* Disable FREQ and OVRUDR interrupts */ - __HAL_SAI_DISABLE_IT(hsai, (SAI_IT_FREQ | SAI_IT_OVRUDR)); - - hsai->State = HAL_SAI_STATE_READY; - - HAL_SAI_TxCpltCallback(hsai); - } - /* Process Unlocked */ __HAL_UNLOCK(hsai); return HAL_OK; } - else { return HAL_BUSY; @@ -797,8 +816,9 @@ HAL_StatusTypeDef HAL_SAI_Transmit_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, * @param Size: Amount of data to be received * @retval HAL status */ -HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size) +HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) { + if(hsai->State == HAL_SAI_STATE_READY) { if((pData == HAL_NULL) || (Size == 0)) @@ -806,17 +826,29 @@ HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, u return HAL_ERROR; } - hsai->pRxBuffPtr = pData; - hsai->RxXferSize = Size; - hsai->RxXferCount = Size; + hsai->pBuffPtr = pData; + hsai->XferSize = Size; + hsai->XferCount = Size; /* Process Locked */ __HAL_LOCK(hsai); hsai->State = HAL_SAI_STATE_BUSY_RX; - + + if((hsai->Init.DataSize == SAI_DATASIZE_8) && (hsai->Init.CompandingMode == SAI_NOCOMPANDING)) + { + hsai->InterruptServiceRoutine = SAI_Receive_IT8Bit; + } + else if(hsai->Init.DataSize <= SAI_DATASIZE_16) + { + hsai->InterruptServiceRoutine = SAI_Receive_IT16Bit; + } + else + { + hsai->InterruptServiceRoutine = SAI_Receive_IT32Bit; + } /* Enable TXE and OVRUDR interrupts */ - __HAL_SAI_ENABLE_IT(hsai, (SAI_IT_FREQ | SAI_IT_OVRUDR)); + __HAL_SAI_ENABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); /* Check if the SAI is already enabled */ if((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != SAI_xCR1_SAIEN) @@ -830,31 +862,6 @@ HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, u return HAL_OK; } - else if(hsai->State == HAL_SAI_STATE_BUSY_RX) - { - /* Process Locked */ - __HAL_LOCK(hsai); - - /* Receive data */ - (*hsai->pRxBuffPtr++) = hsai->Instance->DR; - - hsai->RxXferCount--; - - if(hsai->RxXferCount == 0) - { - /* Disable TXE and OVRUDR interrupts */ - __HAL_SAI_DISABLE_IT(hsai, (SAI_IT_FREQ | SAI_IT_OVRUDR)); - - hsai->State = HAL_SAI_STATE_READY; - HAL_SAI_RxCpltCallback(hsai); - } - - /* Process Unlocked */ - __HAL_UNLOCK(hsai); - - return HAL_OK; - } - else { return HAL_BUSY; @@ -875,7 +882,6 @@ HAL_StatusTypeDef HAL_SAI_DMAPause(SAI_HandleTypeDef *hsai) /* Pause the audio file playing by disabling the SAI DMA requests */ hsai->Instance->CR1 &= ~SAI_xCR1_DMAEN; - /* Process Unlocked */ __HAL_UNLOCK(hsai); @@ -896,9 +902,8 @@ HAL_StatusTypeDef HAL_SAI_DMAResume(SAI_HandleTypeDef *hsai) /* Enable the SAI DMA requests */ hsai->Instance->CR1 |= SAI_xCR1_DMAEN; - /* If the SAI peripheral is still not enabled, enable it */ - if ((hsai->Instance->CR1 & SAI_xCR1_SAIEN) == 0) + if ((hsai->Instance->CR1 & SAI_xCR1_SAIEN) == RESET) { /* Enable SAI peripheral */ __HAL_SAI_ENABLE(hsai); @@ -912,7 +917,7 @@ HAL_StatusTypeDef HAL_SAI_DMAResume(SAI_HandleTypeDef *hsai) /** * @brief Stops the audio stream playing from the Media. - * @param hsai: pointer to a SAI_HandleTypeDef structure that contains + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains * the configuration information for SAI module. * @retval HAL status */ @@ -936,7 +941,47 @@ HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai) } /* Disable SAI peripheral */ - __HAL_SAI_DISABLE(hsai); + SAI_Disable(hsai); + + hsai->State = HAL_SAI_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hsai); + + return HAL_OK; +} + +/** + * @brief Abort the current transfer and disbaled the SAI. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SAI_Abort(SAI_HandleTypeDef *hsai) +{ + /* Disable the SAI DMA request */ + hsai->Instance->CR1 &= ~SAI_xCR1_DMAEN; + + /* Abort the SAI DMA Tx Stream */ + if(hsai->hdmatx != HAL_NULL) + { + HAL_DMA_Abort(hsai->hdmatx); + } + /* Abort the SAI DMA Rx Stream */ + if(hsai->hdmarx != HAL_NULL) + { + HAL_DMA_Abort(hsai->hdmarx); + } + + /* Disabled All interrupt and clear all the flag */ + hsai->Instance->IMR = 0; + hsai->Instance->CLRFR = 0xFFFFFFFF; + + /* Disable SAI peripheral */ + SAI_Disable(hsai); + + /* Flush the fifo */ + SET_BIT(hsai->Instance->CR2, SAI_xCR2_FFLUSH); hsai->State = HAL_SAI_STATE_READY; @@ -945,6 +990,7 @@ HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai) return HAL_OK; } + /** * @brief Transmits an amount of data in no-blocking mode with DMA. * @param hsai: pointer to a SAI_HandleTypeDef structure that contains @@ -953,52 +999,55 @@ HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai) * @param Size: Amount of data to be sent * @retval HAL status */ -HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size) +HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) { uint32_t *tmp; - + if((pData == HAL_NULL) || (Size == 0)) { return HAL_ERROR; } - + if(hsai->State == HAL_SAI_STATE_READY) { - hsai->pTxBuffPtr = pData; - hsai->TxXferSize = Size; - hsai->TxXferCount = Size; - + hsai->pBuffPtr = pData; + hsai->XferSize = Size; + hsai->XferCount = Size; + /* Process Locked */ __HAL_LOCK(hsai); - + hsai->State = HAL_SAI_STATE_BUSY_TX; - - /* Set the SAI Tx DMA Half transfert complete callback */ + + /* Set the SAI Tx DMA Half transfer complete callback */ hsai->hdmatx->XferHalfCpltCallback = SAI_DMATxHalfCplt; - + /* Set the SAI TxDMA transfer complete callback */ hsai->hdmatx->XferCpltCallback = SAI_DMATxCplt; - + /* Set the DMA error callback */ hsai->hdmatx->XferErrorCallback = SAI_DMAError; - + /* Enable the Tx DMA Stream */ tmp = (uint32_t*)&pData; - HAL_DMA_Start_IT(hsai->hdmatx, *(uint32_t*)tmp, (uint32_t)&hsai->Instance->DR, hsai->TxXferSize); - + HAL_DMA_Start_IT(hsai->hdmatx, *(uint32_t*)tmp, (uint32_t)&hsai->Instance->DR, hsai->XferSize); + /* Check if the SAI is already enabled */ if((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != SAI_xCR1_SAIEN) { /* Enable SAI peripheral */ __HAL_SAI_ENABLE(hsai); } - + + /* Enable the interrupts for error handling */ + __HAL_SAI_ENABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_DMA)); + /* Enable SAI Tx DMA Request */ hsai->Instance->CR1 |= SAI_xCR1_DMAEN; - + /* Process Unlocked */ __HAL_UNLOCK(hsai); - + return HAL_OK; } else @@ -1015,7 +1064,7 @@ HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, * @param Size: Amount of data to be received * @retval HAL status */ -HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size) +HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) { uint32_t *tmp; @@ -1023,44 +1072,47 @@ HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, { return HAL_ERROR; } - + if(hsai->State == HAL_SAI_STATE_READY) { - hsai->pRxBuffPtr = pData; - hsai->RxXferSize = Size; - hsai->RxXferCount = Size; - + hsai->pBuffPtr = pData; + hsai->XferSize = Size; + hsai->XferCount = Size; + /* Process Locked */ __HAL_LOCK(hsai); hsai->State = HAL_SAI_STATE_BUSY_RX; - - /* Set the SAI Rx DMA Half transfert complete callback */ + + /* Set the SAI Rx DMA Half transfer complete callback */ hsai->hdmarx->XferHalfCpltCallback = SAI_DMARxHalfCplt; - - /* Set the SAI Rx DMA transfert complete callback */ + + /* Set the SAI Rx DMA transfer complete callback */ hsai->hdmarx->XferCpltCallback = SAI_DMARxCplt; - + /* Set the DMA error callback */ hsai->hdmarx->XferErrorCallback = SAI_DMAError; - + /* Enable the Rx DMA Stream */ tmp = (uint32_t*)&pData; - HAL_DMA_Start_IT(hsai->hdmarx, (uint32_t)&hsai->Instance->DR, *(uint32_t*)tmp, hsai->RxXferSize); - + HAL_DMA_Start_IT(hsai->hdmarx, (uint32_t)&hsai->Instance->DR, *(uint32_t*)tmp, hsai->XferSize); + /* Check if the SAI is already enabled */ if((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != SAI_xCR1_SAIEN) { /* Enable SAI peripheral */ __HAL_SAI_ENABLE(hsai); } - + + /* Enable the interrupts for error handling */ + __HAL_SAI_ENABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_DMA)); + /* Enable SAI Rx DMA Request */ hsai->Instance->CR1 |= SAI_xCR1_DMAEN; - + /* Process Unlocked */ __HAL_UNLOCK(hsai); - + return HAL_OK; } else @@ -1070,66 +1122,158 @@ HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, } /** - * @brief This function handles SAI interrupt request. - * @param hsai: pointer to a SAI_HandleTypeDef structure that contains + * @brief Enable the tx mute mode. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains * the configuration information for SAI module. + * @param val : value sent during the mute @ref SAI_Block_Mute_Value * @retval HAL status */ -void HAL_SAI_IRQHandler(SAI_HandleTypeDef *hsai) +HAL_StatusTypeDef HAL_SAI_EnableTxMuteMode(SAI_HandleTypeDef *hsai, uint16_t val) { - uint32_t tmp1 = 0, tmp2 = 0; + assert_param(IS_SAI_BLOCK_MUTE_VALUE(val)); - if(hsai->State == HAL_SAI_STATE_BUSY_RX) + if(hsai->State != HAL_SAI_STATE_RESET) { - tmp1 = __HAL_SAI_GET_FLAG(hsai, SAI_xSR_FREQ); - tmp2 = __HAL_SAI_GET_IT_SOURCE(hsai, SAI_IT_FREQ); - /* SAI in mode Receiver --------------------------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - HAL_SAI_Receive_IT(hsai, HAL_NULL, 0); - } - - tmp1 = __HAL_SAI_GET_FLAG(hsai, SAI_FLAG_OVRUDR); - tmp2 = __HAL_SAI_GET_IT_SOURCE(hsai, SAI_IT_OVRUDR); - /* SAI Overrun error interrupt occurred ----------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - /* Change the SAI error code */ - hsai->ErrorCode = HAL_SAI_ERROR_OVR; + CLEAR_BIT(hsai->Instance->CR2, SAI_xCR2_MUTEVAL | SAI_xCR2_MUTE); + SET_BIT(hsai->Instance->CR2, SAI_xCR2_MUTE | val); + return HAL_OK; + } + return HAL_ERROR; +} - /* Clear the SAI Overrun flag */ - __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_OVRUDR); - /* Set the SAI state ready to be able to start again the process */ - hsai->State = HAL_SAI_STATE_READY; - HAL_SAI_ErrorCallback(hsai); - } +/** + * @brief Disable the tx mute mode. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SAI_DisableTxMuteMode(SAI_HandleTypeDef *hsai) +{ + if(hsai->State != HAL_SAI_STATE_RESET) + { + CLEAR_BIT(hsai->Instance->CR2, SAI_xCR2_MUTEVAL | SAI_xCR2_MUTE); + return HAL_OK; } + return HAL_ERROR; +} + +/** + * @brief Enable the rx mute detection. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @param callback : function called when the mute is detected + * @param counter : number a data before mute detection max 63. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SAI_EnableRxMuteMode(SAI_HandleTypeDef *hsai, SAIcallback callback, uint16_t counter) +{ + assert_param(IS_SAI_BLOCK_MUTE_COUNTER(counter)); - if(hsai->State == HAL_SAI_STATE_BUSY_TX) - { - tmp1 = __HAL_SAI_GET_FLAG(hsai, SAI_xSR_FREQ); - tmp2 = __HAL_SAI_GET_IT_SOURCE(hsai, SAI_IT_FREQ); - /* SAI in mode Transmitter -----------------------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) - { - HAL_SAI_Transmit_IT(hsai, HAL_NULL, 0); - } + if(hsai->State != HAL_SAI_STATE_RESET) + { + /* set the mute counter */ + CLEAR_BIT(hsai->Instance->CR2, SAI_xCR2_MUTECNT); + SET_BIT(hsai->Instance->CR2, (uint32_t)((uint32_t)counter << 6)); + hsai->mutecallback = callback; + /* enable the IT interrupt */ + __HAL_SAI_ENABLE_IT(hsai, SAI_IT_MUTEDET); + return HAL_OK; + } + return HAL_ERROR; +} + +/** + * @brief Disable the rx mute detection. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SAI_DisableRxMuteMode(SAI_HandleTypeDef *hsai) +{ + if(hsai->State != HAL_SAI_STATE_RESET) + { + /* set the mutecallback to NULL */ + hsai->mutecallback = (SAIcallback)NULL; + /* enable the IT interrupt */ + __HAL_SAI_DISABLE_IT(hsai, SAI_IT_MUTEDET); + return HAL_OK; + } + return HAL_ERROR; +} + +/** + * @brief This function handles SAI interrupt request. + * @param hsai: pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval HAL status + */ +void HAL_SAI_IRQHandler(SAI_HandleTypeDef *hsai) +{ + if(hsai->State != HAL_SAI_STATE_RESET) + { + uint32_t tmpFlag = hsai->Instance->SR; + uint32_t tmpItSource = hsai->Instance->IMR; - tmp1 = __HAL_SAI_GET_FLAG(hsai, SAI_FLAG_OVRUDR); - tmp2 = __HAL_SAI_GET_IT_SOURCE(hsai, SAI_IT_OVRUDR); - /* SAI Underrun error interrupt occurred ---------------------------------*/ - if((tmp1 != RESET) && (tmp2 != RESET)) + if(((tmpFlag & SAI_xSR_FREQ) == SAI_xSR_FREQ) && ((tmpItSource & SAI_IT_FREQ) == SAI_IT_FREQ)) { - /* Change the SAI error code */ - hsai->ErrorCode = HAL_SAI_ERROR_UDR; + hsai->InterruptServiceRoutine(hsai); + } + + /* check the flag only if one of them is set */ + if(tmpFlag != 0x00000000) + { + /* SAI Overrun error interrupt occurred ----------------------------------*/ + if(((tmpFlag & SAI_FLAG_OVRUDR) == SAI_FLAG_OVRUDR) && ((tmpItSource & SAI_IT_OVRUDR) == SAI_IT_OVRUDR)) + { + /* Clear the SAI Overrun flag */ + __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_OVRUDR); + /* Change the SAI error code */ + hsai->ErrorCode = ((hsai->State == HAL_SAI_STATE_BUSY_RX) ? HAL_SAI_ERROR_OVR : HAL_SAI_ERROR_UDR); + /* the transfer is not stopped, we will forward the information to the user and we let the user decide what needs to be done */ + HAL_SAI_ErrorCallback(hsai); + } + + /* SAI mutedet interrupt occurred ----------------------------------*/ + if(((tmpFlag & SAI_FLAG_MUTEDET) == SAI_FLAG_MUTEDET) && ((tmpItSource & SAI_IT_MUTEDET) == SAI_IT_MUTEDET)) + { + /* Clear the SAI mutedet flag */ + __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_MUTEDET); + /* call the call back function */ + if(hsai->mutecallback != (SAIcallback)NULL) + { + /* inform the user that an RX mute event has been detected */ + hsai->mutecallback(); + } + } + + /* SAI AFSDET interrupt occurred ----------------------------------*/ + if(((tmpFlag & SAI_FLAG_AFSDET) == SAI_FLAG_AFSDET) && ((tmpItSource & SAI_IT_AFSDET) == SAI_IT_AFSDET)) + { + /* Change the SAI error code */ + hsai->ErrorCode = HAL_SAI_ERROR_AFSDET; + HAL_SAI_Abort(hsai); + HAL_SAI_ErrorCallback(hsai); + } + + /* SAI LFSDET interrupt occurred ----------------------------------*/ + if(((tmpFlag & SAI_FLAG_LFSDET) == SAI_FLAG_LFSDET) && ((tmpItSource & SAI_IT_LFSDET) == SAI_IT_LFSDET)) + { + /* Change the SAI error code */ + hsai->ErrorCode = HAL_SAI_ERROR_LFSDET; + HAL_SAI_Abort(hsai); + HAL_SAI_ErrorCallback(hsai); + } - /* Clear the SAI Underrun flag */ - __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_OVRUDR); - /* Set the SAI state ready to be able to start again the process */ - hsai->State = HAL_SAI_STATE_READY; - HAL_SAI_ErrorCallback(hsai); + /* SAI WCKCFG interrupt occurred ----------------------------------*/ + if(((tmpFlag & SAI_FLAG_WCKCFG) == SAI_FLAG_WCKCFG) && ((tmpItSource & SAI_IT_WCKCFG) == SAI_IT_WCKCFG)) + { + /* Change the SAI error code */ + hsai->ErrorCode = HAL_SAI_ERROR_WCKCFG; + HAL_SAI_Abort(hsai); + HAL_SAI_ErrorCallback(hsai); + } } - } + } } /** @@ -1154,7 +1298,7 @@ void HAL_SAI_IRQHandler(SAI_HandleTypeDef *hsai) __weak void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SAI_TxHalfCpltCallback could be implenetd in the user file + the HAL_SAI_TxHalfCpltCallback could be implemented in the user file */ } @@ -1180,7 +1324,7 @@ __weak void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai) __weak void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SAI_RxCpltCallback could be implenetd in the user file + the HAL_SAI_RxCpltCallback could be implemented in the user file */ } @@ -1202,7 +1346,7 @@ __weak void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai) */ -/** @defgroup SAI_Group3 Peripheral State functions +/** @defgroup SAI_Exported_Functions_Group3 Peripheral State functions * @brief Peripheral State functions * @verbatim @@ -1242,6 +1386,398 @@ uint32_t HAL_SAI_GetError(SAI_HandleTypeDef *hsai) * @} */ +/** + * @brief Initializes the SAI I2S protocol according to the specified parameters + * in the SAI_InitTypeDef and create the associated handle. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @param protocol : one of the supported protocol + * @param datasize : one of the supported datasize @ref SAI_Protocol_DataSize + * the configuration information for SAI module. + * @param nbslot : number of slot minimum value is 2 and max is 16. + * the value must be a multiple of 2. + * @retval HAL status + */ +static HAL_StatusTypeDef SAI_InitI2S(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot) +{ + /* Check the parameters */ + assert_param(IS_SAI_SUPPORTED_PROTOCOL(protocol)); + assert_param(IS_SAI_PROTOCOL_DATASIZE(datasize)); + + hsai->Init.Protocol = SAI_FREE_PROTOCOL; + hsai->Init.FirstBit = SAI_FIRSTBIT_MSB; + hsai->Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE; + hsai->FrameInit.FSDefinition = SAI_FS_CHANNEL_IDENTIFICATION; + hsai->SlotInit.SlotActive = SAI_SLOTACTIVE_ALL; + hsai->SlotInit.FirstBitOffset = 0; + hsai->SlotInit.SlotNumber = nbslot; + + /* in IS2 the number of slot must be even */ + if((nbslot & 0x1) != 0 ) + { + return HAL_ERROR; + } + + switch(protocol) + { + case SAI_I2S_STANDARD : + hsai->FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW; + hsai->FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT; + break; + case SAI_I2S_MSBJUSTIFIED : + case SAI_I2S_LSBJUSTIFIED : + hsai->FrameInit.FSPolarity = SAI_FS_ACTIVE_HIGH; + hsai->FrameInit.FSOffset = SAI_FS_FIRSTBIT; + break; + default : + return HAL_ERROR; + } + + /* Frame definition */ + hsai->Init.DataSize = 0xFFFFFFFF; + switch(datasize) + { + case SAI_PROTOCOL_DATASIZE_16BIT: + hsai->Init.DataSize = SAI_DATASIZE_16; + hsai->FrameInit.FrameLength = 32*(nbslot/2); + hsai->FrameInit.ActiveFrameLength = 16*(nbslot/2); + hsai->SlotInit.SlotSize = SAI_SLOTSIZE_16B; + break; + case SAI_PROTOCOL_DATASIZE_16BITEXTENDED : + if(hsai->Init.DataSize == 0xFFFFFFFF) + { + hsai->Init.DataSize = SAI_DATASIZE_16; + } + break; + case SAI_PROTOCOL_DATASIZE_24BIT: + if(hsai->Init.DataSize == 0xFFFFFFFF) + { + hsai->Init.DataSize = SAI_DATASIZE_24; + } + break; + case SAI_PROTOCOL_DATASIZE_32BIT: + if(hsai->Init.DataSize == 0xFFFFFFFF) + { + hsai->Init.DataSize = SAI_DATASIZE_32; + } + hsai->FrameInit.FrameLength = 64*(nbslot/2); + hsai->FrameInit.ActiveFrameLength = 32*(nbslot/2); + hsai->SlotInit.SlotSize = SAI_SLOTSIZE_32B; + if(protocol == SAI_I2S_LSBJUSTIFIED) + { + if (datasize == SAI_PROTOCOL_DATASIZE_16BITEXTENDED) + { + hsai->SlotInit.FirstBitOffset = 16; + } + if (datasize == SAI_PROTOCOL_DATASIZE_24BIT) + { + hsai->SlotInit.FirstBitOffset = 8; + } + } + break; + default : + return HAL_ERROR; + } + + return HAL_OK; +} + +/** + * @brief Initializes the SAI PCM protocol according to the specified parameters + * in the SAI_InitTypeDef and create the associated handle. + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @param protocol : one of the supported protocol + * @param datasize : one of the supported datasize @ref SAI_Protocol_DataSize + * @param nbslot : number of slot minimum value is 1 and the max is 16. + * @retval HAL status + */ +static HAL_StatusTypeDef SAI_InitPCM(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot) +{ + /* Check the parameters */ + assert_param(IS_SAI_SUPPORTED_PROTOCOL(protocol)); + assert_param(IS_SAI_PROTOCOL_DATASIZE(datasize)); + + hsai->Init.Protocol = SAI_FREE_PROTOCOL; + hsai->Init.FirstBit = SAI_FIRSTBIT_MSB; + hsai->Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE; + hsai->FrameInit.FSDefinition = SAI_FS_STARTFRAME; + hsai->FrameInit.FSPolarity = SAI_FS_ACTIVE_HIGH; + hsai->FrameInit.FSOffset = SAI_FS_BEFOREFIRSTBIT; + hsai->SlotInit.FirstBitOffset = 0; + hsai->SlotInit.SlotNumber = nbslot; + hsai->SlotInit.SlotActive = SAI_SLOTACTIVE_ALL; + + switch(protocol) + { + case SAI_PCM_SHORT : + hsai->FrameInit.ActiveFrameLength = 1; + break; + case SAI_PCM_LONG : + hsai->FrameInit.ActiveFrameLength = 13; + break; + default : + return HAL_ERROR; + } + + switch(datasize) + { + case SAI_PROTOCOL_DATASIZE_16BIT: + hsai->Init.DataSize = SAI_DATASIZE_16; + hsai->FrameInit.FrameLength = 16 * nbslot; + hsai->SlotInit.SlotSize = SAI_SLOTSIZE_16B; + break; + case SAI_PROTOCOL_DATASIZE_16BITEXTENDED : + hsai->Init.DataSize = SAI_DATASIZE_16; + hsai->FrameInit.FrameLength = 32 * nbslot; + hsai->SlotInit.SlotSize = SAI_SLOTSIZE_32B; + break; + + case SAI_PROTOCOL_DATASIZE_32BIT: + hsai->Init.DataSize = SAI_DATASIZE_32; + hsai->FrameInit.FrameLength = 32 * nbslot; + hsai->SlotInit.SlotSize = SAI_SLOTSIZE_32B; + break; + default : + return HAL_ERROR; + } + + return HAL_OK; +} + +/** + * @brief Fill the fifo + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_FillFifo(SAI_HandleTypeDef *hsai) +{ + /* fill the fifo with data before to enabled the SAI */ + while((hsai->Instance->SR & SAI_xSR_FLVL) != SAI_FIFOSTATUS_FULL) + { + if((hsai->Init.DataSize == SAI_DATASIZE_8) && (hsai->Init.CompandingMode == SAI_NOCOMPANDING)) + { + hsai->Instance->DR = (*hsai->pBuffPtr++); + } + else if(hsai->Init.DataSize <= SAI_DATASIZE_16) + { + hsai->Instance->DR = *((uint32_t *)hsai->pBuffPtr); + hsai->pBuffPtr+= 2; + } + else + { + hsai->Instance->DR = *((uint32_t *)hsai->pBuffPtr); + hsai->pBuffPtr+= 4; + } + hsai->XferCount--; + } +} + +/** + * @brief return the interrupt flag to set according the SAI setup + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @param mode : SAI_MODE_DMA or SAI_MODE_IT + * @retval the list of the IT flag to enable + */ +static uint32_t SAI_InterruptFlag(SAI_HandleTypeDef *hsai, uint32_t mode) +{ + uint32_t tmpIT = SAI_IT_OVRUDR; + + if(mode == SAI_MODE_IT) + { + tmpIT|= SAI_IT_FREQ; + } + + if((hsai->Init.AudioMode == SAI_MODESLAVE_RX) || (hsai->Init.AudioMode == SAI_MODESLAVE_TX)) + { + tmpIT|= SAI_IT_AFSDET | SAI_IT_LFSDET; + } + else + { + /* hsai has been configured in master mode */ + tmpIT|= SAI_IT_WCKCFG; + } + return tmpIT; +} + +/** + * @brief disabled the SAI and wait the disabling + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static HAL_StatusTypeDef SAI_Disable(SAI_HandleTypeDef *hsai) +{ + uint32_t tickstart = HAL_GetTick(); + HAL_StatusTypeDef status = HAL_OK; + + __HAL_SAI_DISABLE(hsai); + while((hsai->Instance->CR1 & SAI_xCR1_SAIEN) != RESET) + { + /* Check for the Timeout */ + if((HAL_GetTick() - tickstart ) > SAI_TIMEOUT_VALUE) + { + /* Update error code */ + hsai->ErrorCode |= HAL_SAI_ERROR_TIMEOUT; + + status = HAL_TIMEOUT; + + /* Change the SAI state */ + HAL_SAI_ErrorCallback(hsai); + } + } + return status; +} + +/** + * @brief Tx Handler for Transmit in Interrupt mode 8Bit transfer + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_Transmit_IT8Bit(SAI_HandleTypeDef *hsai) +{ + /* Write data on DR register */ + hsai->Instance->DR = (*hsai->pBuffPtr++); + hsai->XferCount--; + + /* Handle the end of the transmission */ + if(hsai->XferCount == 0) + { + /* Disable FREQ and OVRUDR interrupts */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + hsai->State = HAL_SAI_STATE_READY; + HAL_SAI_TxCpltCallback(hsai); + } +} + +/** + * @brief Tx Handler for Transmit in Interrupt mode for 16Bit transfer + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_Transmit_IT16Bit(SAI_HandleTypeDef *hsai) +{ + /* Write data on DR register */ + hsai->Instance->DR = *(uint16_t *)hsai->pBuffPtr; + hsai->pBuffPtr+=2; + hsai->XferCount--; + + /* Handle the end of the transmission */ + if(hsai->XferCount == 0) + { + /* Disable FREQ and OVRUDR interrupts */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + hsai->State = HAL_SAI_STATE_READY; + HAL_SAI_TxCpltCallback(hsai); + } +} + +/** + * @brief Tx Handler for Transmit in Interrupt mode for 32Bit transfer + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_Transmit_IT32Bit(SAI_HandleTypeDef *hsai) +{ + /* Write data on DR register */ + hsai->Instance->DR = *(uint32_t *)hsai->pBuffPtr; + hsai->pBuffPtr+=4; + hsai->XferCount--; + + /* Handle the end of the transmission */ + if(hsai->XferCount == 0) + { + /* Disable FREQ and OVRUDR interrupts */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + hsai->State = HAL_SAI_STATE_READY; + HAL_SAI_TxCpltCallback(hsai); + } +} + +/** + * @brief Rx Handler for Receive in Interrupt mode 8Bit transfer + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_Receive_IT8Bit(SAI_HandleTypeDef *hsai) +{ + /* Receive data */ + (*hsai->pBuffPtr++) = hsai->Instance->DR; + hsai->XferCount--; + + /* Check end of the transfer */ + if(hsai->XferCount == 0) + { + /* Disable TXE and OVRUDR interrupts */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + + /* Clear the SAI Overrun flag */ + __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_OVRUDR); + + hsai->State = HAL_SAI_STATE_READY; + HAL_SAI_RxCpltCallback(hsai); + } +} + +/** + * @brief Rx Handler for Receive in Interrupt mode for 16Bit transfer + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_Receive_IT16Bit(SAI_HandleTypeDef *hsai) +{ + /* Receive data */ + *(uint16_t*)hsai->pBuffPtr = hsai->Instance->DR; + hsai->pBuffPtr+=2; + hsai->XferCount--; + + /* Check end of the transfer */ + if(hsai->XferCount == 0) + { + /* Disable TXE and OVRUDR interrupts */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + + /* Clear the SAI Overrun flag */ + __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_OVRUDR); + + hsai->State = HAL_SAI_STATE_READY; + HAL_SAI_RxCpltCallback(hsai); + } +} +/** + * @brief Rx Handler for Receive in Interrupt mode for 32Bit transfer + * @param hsai : pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval None. + */ +static void SAI_Receive_IT32Bit(SAI_HandleTypeDef *hsai) +{ + /* Receive data */ + *(uint32_t*)hsai->pBuffPtr = hsai->Instance->DR; + hsai->pBuffPtr+=4; + hsai->XferCount--; + + /* Check end of the transfer */ + if(hsai->XferCount == 0) + { + /* Disable TXE and OVRUDR interrupts */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_IT)); + + /* Clear the SAI Overrun flag */ + __HAL_SAI_CLEAR_FLAG(hsai, SAI_FLAG_OVRUDR); + + hsai->State = HAL_SAI_STATE_READY; + HAL_SAI_RxCpltCallback(hsai); + } +} + /** * @brief DMA SAI transmit process complete callback. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains @@ -1253,18 +1789,17 @@ static void SAI_DMATxCplt(DMA_HandleTypeDef *hdma) uint32_t tickstart = 0; SAI_HandleTypeDef* hsai = (SAI_HandleTypeDef*)((DMA_HandleTypeDef* )hdma)->Parent; - + if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) { - hsai->TxXferCount = 0; - hsai->RxXferCount = 0; + hsai->XferCount = 0; /* Disable SAI Tx DMA Request */ hsai->Instance->CR1 &= (uint32_t)(~SAI_xCR1_DMAEN); - + /* Get tick */ tickstart = HAL_GetTick(); - + /* Set timeout: 10 is the max delay to send the remaining data in the SAI FIFO */ /* Wait until FIFO is empty */ while(__HAL_SAI_GET_FLAG(hsai, SAI_xSR_FLVL) != RESET) @@ -1280,6 +1815,9 @@ static void SAI_DMATxCplt(DMA_HandleTypeDef *hdma) } } + /* Stop the interrupts error handling */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_DMA)); + hsai->State= HAL_SAI_STATE_READY; } HAL_SAI_TxCpltCallback(hsai); @@ -1311,7 +1849,10 @@ static void SAI_DMARxCplt(DMA_HandleTypeDef *hdma) { /* Disable Rx DMA Request */ hsai->Instance->CR1 &= (uint32_t)(~SAI_xCR1_DMAEN); - hsai->RxXferCount = 0; + hsai->XferCount = 0; + + /* Stop the interrupts error handling */ + __HAL_SAI_DISABLE_IT(hsai, SAI_InterruptFlag(hsai, SAI_MODE_DMA)); hsai->State = HAL_SAI_STATE_READY; } @@ -1339,19 +1880,22 @@ static void SAI_DMARxHalfCplt(DMA_HandleTypeDef *hdma) static void SAI_DMAError(DMA_HandleTypeDef *hdma) { SAI_HandleTypeDef* hsai = ( SAI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Stop the DMA transfer */ + HAL_SAI_DMAStop(hsai); + /* Set the SAI state ready to be able to start again the process */ hsai->State= HAL_SAI_STATE_READY; HAL_SAI_ErrorCallback(hsai); - hsai->TxXferCount = 0; - hsai->RxXferCount = 0; + hsai->XferCount = 0; } /** * @} */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ #endif /* HAL_SAI_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.h index 5880687fc13..50e1340895b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_sai.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SAI HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,69 +43,107 @@ extern "C" { #endif -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" /** @addtogroup STM32F4xx_HAL_Driver * @{ */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /** @addtogroup SAI * @{ */ - + /* Exported types ------------------------------------------------------------*/ +/** @defgroup SAI_Exported_Types SAI Exported Types + * @{ + */ + +/** + * @brief HAL State structures definition + */ +typedef enum +{ + HAL_SAI_STATE_RESET = 0x00, /*!< SAI not yet initialized or disabled */ + HAL_SAI_STATE_READY = 0x01, /*!< SAI initialized and ready for use */ + HAL_SAI_STATE_BUSY = 0x02, /*!< SAI internal process is ongoing */ + HAL_SAI_STATE_BUSY_TX = 0x12, /*!< Data transmission process is ongoing */ + HAL_SAI_STATE_BUSY_RX = 0x22, /*!< Data reception process is ongoing */ + HAL_SAI_STATE_TIMEOUT = 0x03, /*!< SAI timeout state */ + HAL_SAI_STATE_ERROR = 0x04 /*!< SAI error state */ +}HAL_SAI_StateTypeDef; + +/** + * @brief SAI Callback prototype + */ +typedef void (*SAIcallback)(void); /** * @brief SAI Init Structure definition */ typedef struct { - uint32_t Protocol; /*!< Specifies the SAI Block protocol. - This parameter can be a value of @ref SAI_Block_Protocol */ - - uint32_t AudioMode; /*!< Specifies the SAI Block audio Mode. - This parameter can be a value of @ref SAI_Block_Mode */ + uint32_t AudioMode; /*!< Specifies the SAI Block audio Mode. + This parameter can be a value of @ref SAI_Block_Mode */ + + uint32_t Synchro; /*!< Specifies SAI Block synchronization + This parameter can be a value of @ref SAI_Block_Synchronization */ + + uint32_t SynchroExt; /*!< Specifies SAI Block synchronization, this setup is common + for BLOCKA and BLOCKB + This parameter can be a value of @ref SAI_Block_SyncExt */ + + uint32_t OutputDrive; /*!< Specifies when SAI Block outputs are driven. + This parameter can be a value of @ref SAI_Block_Output_Drive + @note this value has to be set before enabling the audio block + but after the audio block configuration. */ + + uint32_t NoDivider; /*!< Specifies whether master clock will be divided or not. + This parameter can be a value of @ref SAI_Block_NoDivider + @note: If bit NODIV in the SAI_xCR1 register is cleared, the frame length + should be aligned to a number equal to a power of 2, from 8 to 256. + If bit NODIV in the SAI_xCR1 register is set, the frame length can + take any of the values without constraint since the input clock of + the audio block should be equal to the bit clock. + There is no MCLK_x clock which can be output. */ + + uint32_t FIFOThreshold; /*!< Specifies SAI Block FIFO threshold. + This parameter can be a value of @ref SAI_Block_Fifo_Threshold */ + + uint32_t ClockSource; /*!< Specifies the SAI Block x Clock source. + This parameter is not used for STM32F446xx devices. */ + + uint32_t AudioFrequency; /*!< Specifies the audio frequency sampling. + This parameter can be a value of @ref SAI_Audio_Frequency */ + + uint32_t Mckdiv; /*!< Specifies the master clock divider, the parameter will be used if for + AudioFrequency the user choice + This parameter must be a number between Min_Data = 0 and Max_Data = 15 */ + uint32_t MonoStereoMode; /*!< Specifies if the mono or stereo mode is selected. + This parameter can be a value of @ref SAI_Mono_Stereo_Mode */ + + uint32_t CompandingMode; /*!< Specifies the companding mode type. + This parameter can be a value of @ref SAI_Block_Companding_Mode */ + + uint32_t TriState; /*!< Specifies the companding mode type. + This parameter can be a value of @ref SAI_TRIState_Management */ + + /* This part of the structure is automatically filled if your are using the high level intialisation + function HAL_SAI_InitProtocol */ + + uint32_t Protocol; /*!< Specifies the SAI Block protocol. + This parameter can be a value of @ref SAI_Block_Protocol */ + uint32_t DataSize; /*!< Specifies the SAI Block data size. - This parameter can be a value of @ref SAI_Block_Data_Size */ + This parameter can be a value of @ref SAI_Block_Data_Size */ uint32_t FirstBit; /*!< Specifies whether data transfers start from MSB or LSB bit. - This parameter can be a value of @ref SAI_Block_MSB_LSB_transmission */ + This parameter can be a value of @ref SAI_Block_MSB_LSB_transmission */ uint32_t ClockStrobing; /*!< Specifies the SAI Block clock strobing edge sensitivity. - This parameter can be a value of @ref SAI_Block_Clock_Strobing */ - - uint32_t Synchro; /*!< Specifies SAI Block synchronization - This parameter can be a value of @ref SAI_Block_Synchronization */ - - uint32_t OutputDrive; /*!< Specifies when SAI Block outputs are driven. - This parameter can be a value of @ref SAI_Block_Output_Drive - @note this value has to be set before enabling the audio block - but after the audio block configuration. */ - - uint32_t NoDivider; /*!< Specifies whether master clock will be divided or not. - This parameter can be a value of @ref SAI_Block_NoDivider - @note: If bit NODIV in the SAI_xCR1 register is cleared, the frame length - should be aligned to a number equal to a power of 2, from 8 to 256. - If bit NODIV in the SAI_xCR1 register is set, the frame length can - take any of the values without constraint since the input clock of - the audio block should be equal to the bit clock. - There is no MCLK_x clock which can be output. */ - - uint32_t FIFOThreshold; /*!< Specifies SAI Block FIFO threshold. - This parameter can be a value of @ref SAI_Block_Fifo_Threshold */ - - uint32_t ClockSource; /*!< Specifies the SAI Block x Clock source. - This parameter can be a value of @ref SAI_Clock_Source - @note: If ClockSource is equal to SAI_CLKSource_Ext, the PLLI2S - and PLLSAI divisions factors will be ignored. */ - - uint32_t AudioFrequency; /*!< Specifies the audio frequency sampling. - This parameter can be a value of @ref SAI_Audio_Frequency */ - + This parameter can be a value of @ref SAI_Block_Clock_Strobing */ }SAI_InitTypeDef; /** @@ -156,25 +194,10 @@ typedef struct This parameter can be a value of @ref SAI_Block_Slot_Active */ }SAI_SlotInitTypeDef; -/** - * @brief HAL State structures definition - */ -typedef enum -{ - HAL_SAI_STATE_RESET = 0x00, /*!< SAI not yet initialized or disabled */ - HAL_SAI_STATE_READY = 0x01, /*!< SAI initialized and ready for use */ - HAL_SAI_STATE_BUSY = 0x02, /*!< SAI internal process is ongoing */ - HAL_SAI_STATE_BUSY_TX = 0x12, /*!< Data transmission process is ongoing */ - HAL_SAI_STATE_BUSY_RX = 0x22, /*!< Data reception process is ongoing */ - HAL_SAI_STATE_TIMEOUT = 0x03, /*!< SAI timeout state */ - HAL_SAI_STATE_ERROR = 0x04 /*!< SAI error state */ - -}HAL_SAI_StateTypeDef; - /** * @brief SAI handle Structure definition */ -typedef struct +typedef struct __SAI_HandleTypeDef { SAI_Block_TypeDef *Instance; /*!< SAI Blockx registers base address */ @@ -184,22 +207,20 @@ typedef struct SAI_SlotInitTypeDef SlotInit; /*!< SAI Slot configuration parameters */ - uint16_t *pTxBuffPtr; /*!< Pointer to SAI Tx transfer Buffer */ + uint8_t *pBuffPtr; /*!< Pointer to SAI transfer Buffer */ - uint16_t TxXferSize; /*!< SAI Tx transfer size */ + uint16_t XferSize; /*!< SAI transfer size */ - uint16_t TxXferCount; /*!< SAI Tx transfer counter */ - - uint16_t *pRxBuffPtr; /*!< Pointer to SAI Rx transfer buffer */ - - uint16_t RxXferSize; /*!< SAI Rx transfer size */ - - uint16_t RxXferCount; /*!< SAI Rx transfer counter */ + uint16_t XferCount; /*!< SAI transfer counter */ DMA_HandleTypeDef *hdmatx; /*!< SAI Tx DMA handle parameters */ DMA_HandleTypeDef *hdmarx; /*!< SAI Rx DMA handle parameters */ + SAIcallback mutecallback;/*!< SAI mute callback */ + + void (*InterruptServiceRoutine)(struct __SAI_HandleTypeDef *hsai); /* function pointer for IRQ handler */ + HAL_LockTypeDef Lock; /*!< SAI locking object */ __IO HAL_SAI_StateTypeDef State; /*!< SAI communication state */ @@ -207,37 +228,77 @@ typedef struct __IO uint32_t ErrorCode; /*!< SAI Error code */ }SAI_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup SAI_Exported_Constants +/** @defgroup SAI_Exported_Constants SAI Exported Constants * @{ */ -/** @defgroup SAI Error Code + +/** @defgroup SAI_Error_Code SAI Error Code * @{ - */ -#define HAL_SAI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ -#define HAL_SAI_ERROR_OVR ((uint32_t)0x00000001) /*!< Overrun Error */ -#define HAL_SAI_ERROR_UDR ((uint32_t)0x00000002) /*!< Underrun error */ -#define HAL_SAI_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */ + */ +#define HAL_SAI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_SAI_ERROR_OVR ((uint32_t)0x00000001) /*!< Overrun Error */ +#define HAL_SAI_ERROR_UDR ((uint32_t)0x00000002) /*!< Underrun error */ +#define HAL_SAI_ERROR_AFSDET ((uint32_t)0x00000004) /*!< Anticipated Frame synchronisation detection */ +#define HAL_SAI_ERROR_LFSDET ((uint32_t)0x00000008) /*!< Late Frame synchronisation detection */ +#define HAL_SAI_ERROR_CNREADY ((uint32_t)0x00000010) /*!< codec not ready */ +#define HAL_SAI_ERROR_WCKCFG ((uint32_t)0x00000020) /*!< Wrong clock configuration */ +#define HAL_SAI_ERROR_TIMEOUT ((uint32_t)0x00000040) /*!< Timeout error */ /** * @} */ -/** @defgroup SAI_Clock_Source +/** @defgroup SAI_Block_SyncExt SAI External synchronisation * @{ */ -#define SAI_CLKSOURCE_PLLSAI ((uint32_t)RCC_SAIACLKSOURCE_PLLSAI) -#define SAI_CLKSOURCE_PLLI2S ((uint32_t)RCC_SAIACLKSOURCE_PLLI2S) -#define SAI_CLKSOURCE_EXT ((uint32_t)RCC_SAIACLKSOURCE_EXT) +#define SAI_SYNCEXT_DISABLE ((uint32_t)0x00000000) +#define SAI_SYNCEXT_IN_ENABLE ((uint32_t)0x00000001) +#define SAI_SYNCEXT_OUTBLOCKA_ENABLE ((uint32_t)0x00000002) +#define SAI_SYNCEXT_OUTBLOCKB_ENABLE ((uint32_t)0x00000004) +/** + * @} + */ -#define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\ - ((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\ - ((SOURCE) == SAI_CLKSOURCE_EXT)) +/** @defgroup SAI_Protocol SAI Supported protocol + * @{ + */ +#define SAI_I2S_STANDARD ((uint32_t)0x00000000) +#define SAI_I2S_MSBJUSTIFIED ((uint32_t)0x00000001) +#define SAI_I2S_LSBJUSTIFIED ((uint32_t)0x00000002) +#define SAI_PCM_LONG ((uint32_t)0x00000004) +#define SAI_PCM_SHORT ((uint32_t)0x00000008) +/** + * @} + */ + +/** @defgroup SAI_Protocol_DataSize SAI protocol data size + * @{ + */ +#define SAI_PROTOCOL_DATASIZE_16BIT ((uint32_t)0x00000000) +#define SAI_PROTOCOL_DATASIZE_16BITEXTENDED ((uint32_t)0x00000001) +#define SAI_PROTOCOL_DATASIZE_24BIT ((uint32_t)0x00000002) +#define SAI_PROTOCOL_DATASIZE_32BIT ((uint32_t)0x00000004) +/** + * @} + */ + +/** @defgroup SAI_Clock_Source SAI Clock Source + * @{ + */ +#define SAI_CLKSOURCE_PLLSAI ((uint32_t)0x00000000) +#define SAI_CLKSOURCE_PLLI2S ((uint32_t)0x00100000) +#define SAI_CLKSOURCE_EXT ((uint32_t)0x00200000) +#define SAI_CLKSOURCE_NA ((uint32_t)0x00400000) /*!< No applicable for STM32F446xx */ /** * @} */ -/** @defgroup SAI_Audio_Frequency +/** @defgroup SAI_Audio_Frequency SAI Audio Frequency * @{ */ #define SAI_AUDIO_FREQUENCY_192K ((uint32_t)192000) @@ -248,217 +309,144 @@ typedef struct #define SAI_AUDIO_FREQUENCY_22K ((uint32_t)22050) #define SAI_AUDIO_FREQUENCY_16K ((uint32_t)16000) #define SAI_AUDIO_FREQUENCY_11K ((uint32_t)11025) -#define SAI_AUDIO_FREQUENCY_8K ((uint32_t)8000) +#define SAI_AUDIO_FREQUENCY_8K ((uint32_t)8000) +#define SAI_AUDIO_FREQUENCY_MCKDIV ((uint32_t)0) -#define IS_SAI_AUDIO_FREQUENCY(AUDIO) (((AUDIO) == SAI_AUDIO_FREQUENCY_192K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_96K) || \ - ((AUDIO) == SAI_AUDIO_FREQUENCY_48K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_44K) || \ - ((AUDIO) == SAI_AUDIO_FREQUENCY_32K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_22K) || \ - ((AUDIO) == SAI_AUDIO_FREQUENCY_16K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_11K) || \ - ((AUDIO) == SAI_AUDIO_FREQUENCY_8K)) /** * @} */ -/** @defgroup SAI_Block_Mode +/** @defgroup SAI_Block_Mode SAI Block Mode * @{ */ #define SAI_MODEMASTER_TX ((uint32_t)0x00000000) -#define SAI_MODEMASTER_RX ((uint32_t)0x00000001) -#define SAI_MODESLAVE_TX ((uint32_t)0x00000002) -#define SAI_MODESLAVE_RX ((uint32_t)0x00000003) -#define IS_SAI_BLOCK_MODE(MODE) (((MODE) == SAI_MODEMASTER_TX) || \ - ((MODE) == SAI_MODEMASTER_RX) || \ - ((MODE) == SAI_MODESLAVE_TX) || \ - ((MODE) == SAI_MODESLAVE_RX)) +#define SAI_MODEMASTER_RX ((uint32_t)SAI_xCR1_MODE_0) +#define SAI_MODESLAVE_TX ((uint32_t)SAI_xCR1_MODE_1) +#define SAI_MODESLAVE_RX ((uint32_t)(SAI_xCR1_MODE_1 | SAI_xCR1_MODE_0)) + /** * @} */ -/** @defgroup SAI_Block_Protocol +/** @defgroup SAI_Block_Protocol SAI Block Protocol * @{ */ - #define SAI_FREE_PROTOCOL ((uint32_t)0x00000000) +#define SAI_SPDIF_PROTOCOL ((uint32_t)SAI_xCR1_PRTCFG_0) #define SAI_AC97_PROTOCOL ((uint32_t)SAI_xCR1_PRTCFG_1) -#define IS_SAI_BLOCK_PROTOCOL(PROTOCOL) (((PROTOCOL) == SAI_FREE_PROTOCOL) || \ - ((PROTOCOL) == SAI_AC97_PROTOCOL)) /** * @} */ -/** @defgroup SAI_Block_Data_Size +/** @defgroup SAI_Block_Data_Size SAI Block Data Size * @{ */ -#define SAI_DATASIZE_8 ((uint32_t)0x00000040) -#define SAI_DATASIZE_10 ((uint32_t)0x00000060) -#define SAI_DATASIZE_16 ((uint32_t)0x00000080) -#define SAI_DATASIZE_20 ((uint32_t)0x000000A0) -#define SAI_DATASIZE_24 ((uint32_t)0x000000C0) -#define SAI_DATASIZE_32 ((uint32_t)0x000000E0) +#define SAI_DATASIZE_8 ((uint32_t)SAI_xCR1_DS_1) +#define SAI_DATASIZE_10 ((uint32_t)(SAI_xCR1_DS_1 | SAI_xCR1_DS_0)) +#define SAI_DATASIZE_16 ((uint32_t)SAI_xCR1_DS_2) +#define SAI_DATASIZE_20 ((uint32_t)(SAI_xCR1_DS_2 | SAI_xCR1_DS_0)) +#define SAI_DATASIZE_24 ((uint32_t)(SAI_xCR1_DS_2 | SAI_xCR1_DS_1)) +#define SAI_DATASIZE_32 ((uint32_t)(SAI_xCR1_DS_2 | SAI_xCR1_DS_1 | SAI_xCR1_DS_0)) -#define IS_SAI_BLOCK_DATASIZE(DATASIZE) (((DATASIZE) == SAI_DATASIZE_8) || \ - ((DATASIZE) == SAI_DATASIZE_10) || \ - ((DATASIZE) == SAI_DATASIZE_16) || \ - ((DATASIZE) == SAI_DATASIZE_20) || \ - ((DATASIZE) == SAI_DATASIZE_24) || \ - ((DATASIZE) == SAI_DATASIZE_32)) /** * @} */ -/** @defgroup SAI_Block_MSB_LSB_transmission +/** @defgroup SAI_Block_MSB_LSB_transmission SAI Block MSB LSB transmission * @{ */ - #define SAI_FIRSTBIT_MSB ((uint32_t)0x00000000) #define SAI_FIRSTBIT_LSB ((uint32_t)SAI_xCR1_LSBFIRST) -#define IS_SAI_BLOCK_FIRST_BIT(BIT) (((BIT) == SAI_FIRSTBIT_MSB) || \ - ((BIT) == SAI_FIRSTBIT_LSB)) /** * @} */ -/** @defgroup SAI_Block_Clock_Strobing +/** @defgroup SAI_Block_Clock_Strobing SAI Block Clock Strobing * @{ */ #define SAI_CLOCKSTROBING_FALLINGEDGE ((uint32_t)0x00000000) #define SAI_CLOCKSTROBING_RISINGEDGE ((uint32_t)SAI_xCR1_CKSTR) -#define IS_SAI_BLOCK_CLOCK_STROBING(CLOCK) (((CLOCK) == SAI_CLOCKSTROBING_FALLINGEDGE) || \ - ((CLOCK) == SAI_CLOCKSTROBING_RISINGEDGE)) /** * @} */ -/** @defgroup SAI_Block_Synchronization +/** @defgroup SAI_Block_Synchronization SAI Block Synchronization * @{ */ #define SAI_ASYNCHRONOUS ((uint32_t)0x00000000) #define SAI_SYNCHRONOUS ((uint32_t)SAI_xCR1_SYNCEN_0) +#define SAI_SYNCHRONOUS_EXT ((uint32_t)SAI_xCR1_SYNCEN_1) -#define IS_SAI_BLOCK_SYNCHRO(SYNCHRO) (((SYNCHRO) == SAI_ASYNCHRONOUS) || \ - ((SYNCHRO) == SAI_SYNCHRONOUS)) /** * @} */ -/** @defgroup SAI_Block_Output_Drive +/** @defgroup SAI_Block_Output_Drive SAI Block Output Drive * @{ */ -#define SAI_OUTPUTDRIVE_DISABLED ((uint32_t)0x00000000) -#define SAI_OUTPUTDRIVE_ENABLED ((uint32_t)SAI_xCR1_OUTDRIV) +#define SAI_OUTPUTDRIVE_DISABLE ((uint32_t)0x00000000) +#define SAI_OUTPUTDRIVE_ENABLE ((uint32_t)SAI_xCR1_OUTDRIV) -#define IS_SAI_BLOCK_OUTPUT_DRIVE(DRIVE) (((DRIVE) == SAI_OUTPUTDRIVE_DISABLED) || \ - ((DRIVE) == SAI_OUTPUTDRIVE_ENABLED)) /** * @} */ -/** @defgroup SAI_Block_NoDivider +/** @defgroup SAI_Block_NoDivider SAI Block NoDivider * @{ */ -#define SAI_MASTERDIVIDER_ENABLED ((uint32_t)0x00000000) -#define SAI_MASTERDIVIDER_DISABLED ((uint32_t)SAI_xCR1_NODIV) +#define SAI_MASTERDIVIDER_ENABLE ((uint32_t)0x00000000) +#define SAI_MASTERDIVIDER_DISABLE ((uint32_t)SAI_xCR1_NODIV) -#define IS_SAI_BLOCK_NODIVIDER(NODIVIDER) (((NODIVIDER) == SAI_MASTERDIVIDER_ENABLED) || \ - ((NODIVIDER) == SAI_MASTERDIVIDER_DISABLED)) /** * @} */ -/** @defgroup SAI_Block_Master_Divider - * @{ - */ -#define IS_SAI_BLOCK_MASTER_DIVIDER(DIVIDER) ((DIVIDER) <= 15) -/** - * @} - */ - -/** @defgroup SAI_Block_Frame_Length - * @{ - */ -#define IS_SAI_BLOCK_FRAME_LENGTH(LENGTH) ((8 <= (LENGTH)) && ((LENGTH) <= 256)) -/** - * @} - */ - -/** @defgroup SAI_Block_Active_FrameLength - * @{ - */ -#define IS_SAI_BLOCK_ACTIVE_FRAME(LENGTH) ((1 <= (LENGTH)) && ((LENGTH) <= 128)) -/** - * @} - */ -/** @defgroup SAI_Block_FS_Definition +/** @defgroup SAI_Block_FS_Definition SAI Block FS Definition * @{ */ #define SAI_FS_STARTFRAME ((uint32_t)0x00000000) #define SAI_FS_CHANNEL_IDENTIFICATION ((uint32_t)SAI_xFRCR_FSDEF) -#define IS_SAI_BLOCK_FS_DEFINITION(DEFINITION) (((DEFINITION) == SAI_FS_STARTFRAME) || \ - ((DEFINITION) == SAI_FS_CHANNEL_IDENTIFICATION)) /** * @} */ -/** @defgroup SAI_Block_FS_Polarity +/** @defgroup SAI_Block_FS_Polarity SAI Block FS Polarity * @{ */ #define SAI_FS_ACTIVE_LOW ((uint32_t)0x00000000) #define SAI_FS_ACTIVE_HIGH ((uint32_t)SAI_xFRCR_FSPO) -#define IS_SAI_BLOCK_FS_POLARITY(POLARITY) (((POLARITY) == SAI_FS_ACTIVE_LOW) || \ - ((POLARITY) == SAI_FS_ACTIVE_HIGH)) /** * @} */ -/** @defgroup SAI_Block_FS_Offset +/** @defgroup SAI_Block_FS_Offset SAI Block FS Offset * @{ */ #define SAI_FS_FIRSTBIT ((uint32_t)0x00000000) #define SAI_FS_BEFOREFIRSTBIT ((uint32_t)SAI_xFRCR_FSOFF) -#define IS_SAI_BLOCK_FS_OFFSET(OFFSET) (((OFFSET) == SAI_FS_FIRSTBIT) || \ - ((OFFSET) == SAI_FS_BEFOREFIRSTBIT)) /** * @} */ -/** @defgroup SAI_Block_Slot_FirstBit_Offset - * @{ - */ -#define IS_SAI_BLOCK_FIRSTBIT_OFFSET(OFFSET) ((OFFSET) <= 24) -/** - * @} - */ - /** @defgroup SAI_Block_Slot_Size + /** @defgroup SAI_Block_Slot_Size SAI Block Slot Size * @{ */ #define SAI_SLOTSIZE_DATASIZE ((uint32_t)0x00000000) #define SAI_SLOTSIZE_16B ((uint32_t)SAI_xSLOTR_SLOTSZ_0) #define SAI_SLOTSIZE_32B ((uint32_t)SAI_xSLOTR_SLOTSZ_1) - -#define IS_SAI_BLOCK_SLOT_SIZE(SIZE) (((SIZE) == SAI_SLOTSIZE_DATASIZE) || \ - ((SIZE) == SAI_SLOTSIZE_16B) || \ - ((SIZE) == SAI_SLOTSIZE_32B)) -/** - * @} - */ - -/** @defgroup SAI_Block_Slot_Number - * @{ - */ -#define IS_SAI_BLOCK_SLOT_NUMBER(NUMBER) ((1 <= (NUMBER)) && ((NUMBER) <= 16)) /** * @} */ -/** @defgroup SAI_Block_Slot_Active +/** @defgroup SAI_Block_Slot_Active SAI Block Slot Active * @{ */ #define SAI_SLOT_NOTACTIVE ((uint32_t)0x00000000) @@ -480,93 +468,68 @@ typedef struct #define SAI_SLOTACTIVE_15 ((uint32_t)0x80000000) #define SAI_SLOTACTIVE_ALL ((uint32_t)0xFFFF0000) -#define IS_SAI_SLOT_ACTIVE(ACTIVE) ((ACTIVE) != 0) - /** * @} */ -/** @defgroup SAI_Mono_Stereo_Mode +/** @defgroup SAI_Mono_Stereo_Mode SAI Mono Stereo Mode * @{ */ +#define SAI_STEREOMODE ((uint32_t)0x00000000) #define SAI_MONOMODE ((uint32_t)SAI_xCR1_MONO) -#define SAI_STREOMODE ((uint32_t)0x00000000) -#define IS_SAI_BLOCK_MONO_STREO_MODE(MODE) (((MODE) == SAI_MONOMODE) ||\ - ((MODE) == SAI_STREOMODE)) /** * @} */ -/** @defgroup SAI_TRIState_Management +/** @defgroup SAI_TRIState_Management SAI TRIState Management * @{ */ #define SAI_OUTPUT_NOTRELEASED ((uint32_t)0x00000000) #define SAI_OUTPUT_RELEASED ((uint32_t)SAI_xCR2_TRIS) -#define IS_SAI_BLOCK_TRISTATE_MANAGEMENT(STATE) (((STATE) == SAI_OUTPUT_NOTRELEASED) ||\ - ((STATE) == SAI_OUTPUT_RELEASED)) /** * @} */ -/** @defgroup SAI_Block_Fifo_Threshold +/** @defgroup SAI_Block_Fifo_Threshold SAI Block Fifo Threshold * @{ */ #define SAI_FIFOTHRESHOLD_EMPTY ((uint32_t)0x00000000) -#define SAI_FIFOTHRESHOLD_1QF ((uint32_t)0x00000001) -#define SAI_FIFOTHRESHOLD_HF ((uint32_t)0x00000002) -#define SAI_FIFOTHRESHOLD_3QF ((uint32_t)0x00000003) -#define SAI_FIFOTHRESHOLD_FULL ((uint32_t)0x00000004) +#define SAI_FIFOTHRESHOLD_1QF ((uint32_t)SAI_xCR2_FTH_0) +#define SAI_FIFOTHRESHOLD_HF ((uint32_t)SAI_xCR2_FTH_1) +#define SAI_FIFOTHRESHOLD_3QF ((uint32_t)(SAI_xCR2_FTH_1 | SAI_xCR2_FTH_0)) +#define SAI_FIFOTHRESHOLD_FULL ((uint32_t)SAI_xCR2_FTH_2) -#define IS_SAI_BLOCK_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == SAI_FIFOTHRESHOLD_EMPTY) || \ - ((THRESHOLD) == SAI_FIFOTHRESHOLD_1QF) || \ - ((THRESHOLD) == SAI_FIFOTHRESHOLD_HF) || \ - ((THRESHOLD) == SAI_FIFOTHRESHOLD_3QF) || \ - ((THRESHOLD) == SAI_FIFOTHRESHOLD_FULL)) /** * @} */ -/** @defgroup SAI_Block_Companding_Mode +/** @defgroup SAI_Block_Companding_Mode SAI Block Companding Mode * @{ */ #define SAI_NOCOMPANDING ((uint32_t)0x00000000) -#define SAI_ULAW_1CPL_COMPANDING ((uint32_t)0x00008000) -#define SAI_ALAW_1CPL_COMPANDING ((uint32_t)0x0000C000) -#define SAI_ULAW_2CPL_COMPANDING ((uint32_t)0x0000A000) -#define SAI_ALAW_2CPL_COMPANDING ((uint32_t)0x0000E000) +#define SAI_ULAW_1CPL_COMPANDING ((uint32_t)SAI_xCR2_COMP_1) +#define SAI_ALAW_1CPL_COMPANDING ((uint32_t)(SAI_xCR2_COMP_1 | SAI_xCR2_COMP_0)) +#define SAI_ULAW_2CPL_COMPANDING ((uint32_t)(SAI_xCR2_COMP_1 | SAI_xCR2_CPL)) +#define SAI_ALAW_2CPL_COMPANDING ((uint32_t)(SAI_xCR2_COMP_1 | SAI_xCR2_COMP_0 | SAI_xCR2_CPL)) -#define IS_SAI_BLOCK_COMPANDING_MODE(MODE) (((MODE) == SAI_NOCOMPANDING) || \ - ((MODE) == SAI_ULAW_1CPL_COMPANDING) || \ - ((MODE) == SAI_ALAW_1CPL_COMPANDING) || \ - ((MODE) == SAI_ULAW_2CPL_COMPANDING) || \ - ((MODE) == SAI_ALAW_2CPL_COMPANDING)) /** * @} */ -/** @defgroup SAI_Block_Mute_Value +/** @defgroup SAI_Block_Mute_Value SAI Block Mute Value * @{ */ #define SAI_ZERO_VALUE ((uint32_t)0x00000000) #define SAI_LAST_SENT_VALUE ((uint32_t)SAI_xCR2_MUTEVAL) -#define IS_SAI_BLOCK_MUTE_VALUE(VALUE) (((VALUE) == SAI_ZERO_VALUE) || \ - ((VALUE) == SAI_LAST_SENT_VALUE)) /** * @} */ -/** @defgroup SAI_Block_Mute_Frame_Counter - * @{ - */ -#define IS_SAI_BLOCK_MUTE_COUNTER(COUNTER) ((COUNTER) <= 63) -/** - * @} - */ -/** @defgroup SAI_Block_Interrupts_Definition +/** @defgroup SAI_Block_Interrupts_Definition SAI Block Interrupts Definition * @{ */ #define SAI_IT_OVRUDR ((uint32_t)SAI_xIMR_OVRUDRIE) @@ -577,18 +540,11 @@ typedef struct #define SAI_IT_AFSDET ((uint32_t)SAI_xIMR_AFSDETIE) #define SAI_IT_LFSDET ((uint32_t)SAI_xIMR_LFSDETIE) -#define IS_SAI_BLOCK_CONFIG_IT(IT) (((IT) == SAI_IT_OVRUDR) || \ - ((IT) == SAI_IT_MUTEDET) || \ - ((IT) == SAI_IT_WCKCFG) || \ - ((IT) == SAI_IT_FREQ) || \ - ((IT) == SAI_IT_CNRDY) || \ - ((IT) == SAI_IT_AFSDET) || \ - ((IT) == SAI_IT_LFSDET)) /** * @} */ -/** @defgroup SAI_Block_Flags_Definition +/** @defgroup SAI_Block_Flags_Definition SAI Block Flags Definition * @{ */ #define SAI_FLAG_OVRUDR ((uint32_t)SAI_xSR_OVRUDR) @@ -599,51 +555,35 @@ typedef struct #define SAI_FLAG_AFSDET ((uint32_t)SAI_xSR_AFSDET) #define SAI_FLAG_LFSDET ((uint32_t)SAI_xSR_LFSDET) -#define IS_SAI_BLOCK_GET_FLAG(FLAG) (((FLAG) == SAI_FLAG_OVRUDR) || \ - ((FLAG) == SAI_FLAG_MUTEDET) || \ - ((FLAG) == SAI_FLAG_WCKCFG) || \ - ((FLAG) == SAI_FLAG_FREQ) || \ - ((FLAG) == SAI_FLAG_CNRDY) || \ - ((FLAG) == SAI_FLAG_AFSDET) || \ - ((FLAG) == SAI_FLAG_LFSDET)) - -#define IS_SAI_BLOCK_CLEAR_FLAG(FLAG) (((FLAG) == SAI_FLAG_OVRUDR) || \ - ((FLAG) == SAI_FLAG_MUTEDET) || \ - ((FLAG) == SAI_FLAG_WCKCFG) || \ - ((FLAG) == SAI_FLAG_FREQ) || \ - ((FLAG) == SAI_FLAG_CNRDY) || \ - ((FLAG) == SAI_FLAG_AFSDET) || \ - ((FLAG) == SAI_FLAG_LFSDET)) /** * @} */ -/** @defgroup SAI_Block_Fifo_Status_Level +/** @defgroup SAI_Block_Fifo_Status_Level SAI Block Fifo Status Level * @{ */ -#define SAI_FIFOStatus_Empty ((uint32_t)0x00000000) -#define SAI_FIFOStatus_Less1QuarterFull ((uint32_t)0x00010000) -#define SAI_FIFOStatus_1QuarterFull ((uint32_t)0x00020000) -#define SAI_FIFOStatus_HalfFull ((uint32_t)0x00030000) -#define SAI_FIFOStatus_3QuartersFull ((uint32_t)0x00040000) -#define SAI_FIFOStatus_Full ((uint32_t)0x00050000) +#define SAI_FIFOSTATUS_EMPTY ((uint32_t)0x00000000) +#define SAI_FIFOSTATUS_LESS1QUARTERFULL ((uint32_t)0x00010000) +#define SAI_FIFOSTATUS_1QUARTERFULL ((uint32_t)0x00020000) +#define SAI_FIFOSTATUS_HALFFULL ((uint32_t)0x00030000) +#define SAI_FIFOSTATUS_3QUARTERFULL ((uint32_t)0x00040000) +#define SAI_FIFOSTATUS_FULL ((uint32_t)0x00050000) -#define IS_SAI_BLOCK_FIFO_STATUS(STATUS) (((STATUS) == SAI_FIFOStatus_Less1QuarterFull ) || \ - ((STATUS) == SAI_FIFOStatus_HalfFull) || \ - ((STATUS) == SAI_FIFOStatus_1QuarterFull) || \ - ((STATUS) == SAI_FIFOStatus_3QuartersFull) || \ - ((STATUS) == SAI_FIFOStatus_Full) || \ - ((STATUS) == SAI_FIFOStatus_Empty)) /** * @} */ - /** * @} */ /* Exported macro ------------------------------------------------------------*/ + +/** @defgroup SAI_Exported_Macros SAI Exported Macros + * @brief macros to handle interrupts and specific configurations + * @{ + */ + /** @brief Reset SAI handle state * @param __HANDLE__: specifies the SAI Handle. * @retval None @@ -712,31 +652,62 @@ typedef struct #define __HAL_SAI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= SAI_xCR1_SAIEN) #define __HAL_SAI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~SAI_xCR1_SAIEN) - + + /** + * @} + */ + +/* Include RCC SAI Extension module */ +#include "stm32f4xx_hal_sai_ex.h" + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup SAI_Exported_Functions + * @{ + */ + /* Initialization/de-initialization functions **********************************/ +/** @addtogroup SAI_Exported_Functions_Group1 + * @{ + */ +HAL_StatusTypeDef HAL_SAI_InitProtocol(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot); HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai); HAL_StatusTypeDef HAL_SAI_DeInit (SAI_HandleTypeDef *hsai); void HAL_SAI_MspInit(SAI_HandleTypeDef *hsai); void HAL_SAI_MspDeInit(SAI_HandleTypeDef *hsai); +/** + * @} + */ + /* I/O operation functions *****************************************************/ +/** @addtogroup SAI_Exported_Functions_Group2 + * @{ + */ /* Blocking mode: Polling */ -HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size, uint32_t Timeout); -HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size, uint32_t Timeout); /* Non-Blocking mode: Interrupt */ -HAL_StatusTypeDef HAL_SAI_Transmit_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size); -HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_SAI_Transmit_IT(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size); /* Non-Blocking mode: DMA */ -HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size); -HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size); HAL_StatusTypeDef HAL_SAI_DMAPause(SAI_HandleTypeDef *hsai); HAL_StatusTypeDef HAL_SAI_DMAResume(SAI_HandleTypeDef *hsai); HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai); +/* Abort function */ +HAL_StatusTypeDef HAL_SAI_Abort(SAI_HandleTypeDef *hsai); + +/* Mute management */ +HAL_StatusTypeDef HAL_SAI_EnableTxMuteMode(SAI_HandleTypeDef *hsai, uint16_t val); +HAL_StatusTypeDef HAL_SAI_DisableTxMuteMode(SAI_HandleTypeDef *hsai); +HAL_StatusTypeDef HAL_SAI_EnableRxMuteMode(SAI_HandleTypeDef *hsai, SAIcallback callback, uint16_t counter); +HAL_StatusTypeDef HAL_SAI_DisableRxMuteMode(SAI_HandleTypeDef *hsai); + /* SAI IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */ void HAL_SAI_IRQHandler(SAI_HandleTypeDef *hsai); void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai); @@ -744,12 +715,182 @@ void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai); void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai); void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai); void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai); +/** + * @} + */ +/** @addtogroup SAI_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions **************************************************/ HAL_SAI_StateTypeDef HAL_SAI_GetState(SAI_HandleTypeDef *hsai); uint32_t HAL_SAI_GetError(SAI_HandleTypeDef *hsai); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/** @defgroup SAI_Private_Types SAI Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup SAI_Private_Variables SAI Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup SAI_Private_Constants SAI Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @addtogroup SAI_Private_Macros + * @{ + */ +#define IS_SAI_BLOCK_SYNCEXT(STATE) (((STATE) == SAI_SYNCEXT_DISABLE) ||\ + ((STATE) == SAI_SYNCEXT_IN_ENABLE) ||\ + ((STATE) == SAI_SYNCEXT_OUTBLOCKA_ENABLE) ||\ + ((STATE) == SAI_SYNCEXT_OUTBLOCKB_ENABLE)) + +#define IS_SAI_SUPPORTED_PROTOCOL(PROTOCOL) (((PROTOCOL) == SAI_I2S_STANDARD) ||\ + ((PROTOCOL) == SAI_I2S_MSBJUSTIFIED) ||\ + ((PROTOCOL) == SAI_I2S_LSBJUSTIFIED) ||\ + ((PROTOCOL) == SAI_PCM_LONG) ||\ + ((PROTOCOL) == SAI_PCM_SHORT)) + +#define IS_SAI_PROTOCOL_DATASIZE(DATASIZE) (((DATASIZE) == SAI_PROTOCOL_DATASIZE_16BIT) ||\ + ((DATASIZE) == SAI_PROTOCOL_DATASIZE_16BITEXTENDED) ||\ + ((DATASIZE) == SAI_PROTOCOL_DATASIZE_24BIT) ||\ + ((DATASIZE) == SAI_PROTOCOL_DATASIZE_32BIT)) + +#define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\ + ((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\ + ((SOURCE) == SAI_CLKSOURCE_EXT)) + +#define IS_SAI_AUDIO_FREQUENCY(AUDIO) (((AUDIO) == SAI_AUDIO_FREQUENCY_192K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_96K) || \ + ((AUDIO) == SAI_AUDIO_FREQUENCY_48K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_44K) || \ + ((AUDIO) == SAI_AUDIO_FREQUENCY_32K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_22K) || \ + ((AUDIO) == SAI_AUDIO_FREQUENCY_16K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_11K) || \ + ((AUDIO) == SAI_AUDIO_FREQUENCY_8K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_MCKDIV)) -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#define IS_SAI_BLOCK_MODE(MODE) (((MODE) == SAI_MODEMASTER_TX) || \ + ((MODE) == SAI_MODEMASTER_RX) || \ + ((MODE) == SAI_MODESLAVE_TX) || \ + ((MODE) == SAI_MODESLAVE_RX)) + +#define IS_SAI_BLOCK_PROTOCOL(PROTOCOL) (((PROTOCOL) == SAI_FREE_PROTOCOL) || \ + ((PROTOCOL) == SAI_AC97_PROTOCOL) || \ + ((PROTOCOL) == SAI_SPDIF_PROTOCOL)) + +#define IS_SAI_BLOCK_DATASIZE(DATASIZE) (((DATASIZE) == SAI_DATASIZE_8) || \ + ((DATASIZE) == SAI_DATASIZE_10) || \ + ((DATASIZE) == SAI_DATASIZE_16) || \ + ((DATASIZE) == SAI_DATASIZE_20) || \ + ((DATASIZE) == SAI_DATASIZE_24) || \ + ((DATASIZE) == SAI_DATASIZE_32)) + +#define IS_SAI_BLOCK_FIRST_BIT(BIT) (((BIT) == SAI_FIRSTBIT_MSB) || \ + ((BIT) == SAI_FIRSTBIT_LSB)) + +#define IS_SAI_BLOCK_CLOCK_STROBING(CLOCK) (((CLOCK) == SAI_CLOCKSTROBING_FALLINGEDGE) || \ + ((CLOCK) == SAI_CLOCKSTROBING_RISINGEDGE)) + +#define IS_SAI_BLOCK_SYNCHRO(SYNCHRO) (((SYNCHRO) == SAI_ASYNCHRONOUS) || \ + ((SYNCHRO) == SAI_SYNCHRONOUS) || \ + ((SYNCHRO) == SAI_SYNCHRONOUS_EXT)) + +#define IS_SAI_BLOCK_OUTPUT_DRIVE(DRIVE) (((DRIVE) == SAI_OUTPUTDRIVE_DISABLE) || \ + ((DRIVE) == SAI_OUTPUTDRIVE_ENABLE)) + +#define IS_SAI_BLOCK_NODIVIDER(NODIVIDER) (((NODIVIDER) == SAI_MASTERDIVIDER_ENABLE) || \ + ((NODIVIDER) == SAI_MASTERDIVIDER_DISABLE)) + +#define IS_SAI_BLOCK_FIFO_STATUS(STATUS) (((STATUS) == SAI_FIFOSTATUS_LESS1QUARTERFULL ) || \ + ((STATUS) == SAI_FIFOSTATUS_HALFFULL) || \ + ((STATUS) == SAI_FIFOSTATUS_1QUARTERFULL) || \ + ((STATUS) == SAI_FIFOSTATUS_3QUARTERFULL) || \ + ((STATUS) == SAI_FIFOSTATUS_FULL) || \ + ((STATUS) == SAI_FIFOSTATUS_EMPTY)) + +#define IS_SAI_BLOCK_MUTE_COUNTER(COUNTER) ((COUNTER) <= 63) + +#define IS_SAI_BLOCK_MUTE_VALUE(VALUE) (((VALUE) == SAI_ZERO_VALUE) || \ + ((VALUE) == SAI_LAST_SENT_VALUE)) + +#define IS_SAI_BLOCK_COMPANDING_MODE(MODE) (((MODE) == SAI_NOCOMPANDING) || \ + ((MODE) == SAI_ULAW_1CPL_COMPANDING) || \ + ((MODE) == SAI_ALAW_1CPL_COMPANDING) || \ + ((MODE) == SAI_ULAW_2CPL_COMPANDING) || \ + ((MODE) == SAI_ALAW_2CPL_COMPANDING)) + +#define IS_SAI_BLOCK_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == SAI_FIFOTHRESHOLD_EMPTY) || \ + ((THRESHOLD) == SAI_FIFOTHRESHOLD_1QF) || \ + ((THRESHOLD) == SAI_FIFOTHRESHOLD_HF) || \ + ((THRESHOLD) == SAI_FIFOTHRESHOLD_3QF) || \ + ((THRESHOLD) == SAI_FIFOTHRESHOLD_FULL)) + +#define IS_SAI_BLOCK_TRISTATE_MANAGEMENT(STATE) (((STATE) == SAI_OUTPUT_NOTRELEASED) ||\ + ((STATE) == SAI_OUTPUT_RELEASED)) + +#define IS_SAI_MONO_STEREO_MODE(MODE) (((MODE) == SAI_MONOMODE) ||\ + ((MODE) == SAI_STEREOMODE)) + +#define IS_SAI_SLOT_ACTIVE(ACTIVE) ((((ACTIVE) >> 16 ) > 0) && (((ACTIVE) >> 16 ) <= (SAI_SLOTACTIVE_ALL >> 16))) + +#define IS_SAI_BLOCK_SLOT_NUMBER(NUMBER) ((1 <= (NUMBER)) && ((NUMBER) <= 16)) + +#define IS_SAI_BLOCK_SLOT_SIZE(SIZE) (((SIZE) == SAI_SLOTSIZE_DATASIZE) || \ + ((SIZE) == SAI_SLOTSIZE_16B) || \ + ((SIZE) == SAI_SLOTSIZE_32B)) + +#define IS_SAI_BLOCK_FIRSTBIT_OFFSET(OFFSET) ((OFFSET) <= 24) + +#define IS_SAI_BLOCK_FS_OFFSET(OFFSET) (((OFFSET) == SAI_FS_FIRSTBIT) || \ + ((OFFSET) == SAI_FS_BEFOREFIRSTBIT)) + +#define IS_SAI_BLOCK_FS_POLARITY(POLARITY) (((POLARITY) == SAI_FS_ACTIVE_LOW) || \ + ((POLARITY) == SAI_FS_ACTIVE_HIGH)) + +#define IS_SAI_BLOCK_FS_DEFINITION(DEFINITION) (((DEFINITION) == SAI_FS_STARTFRAME) || \ + ((DEFINITION) == SAI_FS_CHANNEL_IDENTIFICATION)) + +#define IS_SAI_BLOCK_MASTER_DIVIDER(DIVIDER) ((DIVIDER) <= 15) + +#define IS_SAI_BLOCK_FRAME_LENGTH(LENGTH) ((8 <= (LENGTH)) && ((LENGTH) <= 256)) + +#define IS_SAI_BLOCK_ACTIVE_FRAME(LENGTH) ((1 <= (LENGTH)) && ((LENGTH) <= 128)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup SAI_Private_Functions SAI Private Functions + * @{ + */ + +/** + * @} + */ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.c new file mode 100644 index 00000000000..6ffe22a5a73 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.c @@ -0,0 +1,269 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_sai_ex.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief SAI Extension HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of SAI extension peripheral: + * + Extension features functions + * + @verbatim + ============================================================================== + ##### SAI peripheral extension features ##### + ============================================================================== + + [..] Comparing to other previous devices, the SAI interface for STM32F446xx + devices contains the following additional features : + + (+) Possibility to be clocked from PLLR + + ##### How to use this driver ##### + ============================================================================== + [..] This driver provides functions to manage several sources to clock SAI + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @defgroup SAIEx SAIEx + * @brief SAI Extension HAL module driver + * @{ + */ + +#ifdef HAL_SAI_MODULE_ENABLED + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* SAI registers Masks */ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/** @defgroup SAI_Private_Functions SAI Private Functions + * @{ + */ + /** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup SAIEx_Exported_Functions SAI Extended Exported Functions + * @{ + */ + +/** @defgroup SAIEx_Exported_Functions_Group1 Extension features functions + * @brief Extension features functions + * +@verbatim + =============================================================================== + ##### Extension features Functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to manage the possible + SAI clock sources. + +@endverbatim + * @{ + */ + +/** + * @brief Configure SAI Block synchronization mode + * @param hsai: pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval SAI Clock Input + */ +void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai) +{ + uint32_t tmpregisterGCR = 0; + +#if defined(STM32F446xx) + /* This setting must be done with both audio block (A & B) disabled */ + switch(hsai->Init.SynchroExt) + { + case SAI_SYNCEXT_DISABLE : + tmpregisterGCR = 0; + break; + case SAI_SYNCEXT_IN_ENABLE : + tmpregisterGCR = SAI_GCR_SYNCIN_0; + break; + case SAI_SYNCEXT_OUTBLOCKA_ENABLE : + tmpregisterGCR = SAI_GCR_SYNCOUT_0; + break; + case SAI_SYNCEXT_OUTBLOCKB_ENABLE : + tmpregisterGCR = SAI_GCR_SYNCOUT_1; + break; + } + + if((hsai->Instance == SAI1_Block_A) || (hsai->Instance == SAI1_Block_B)) + { + SAI1->GCR = tmpregisterGCR; + } + else + { + SAI2->GCR = tmpregisterGCR; + } +#endif /* STM32F446xx */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /* This setting must be done with both audio block (A & B) disabled */ + switch(hsai->Init.SynchroExt) + { + case SAI_SYNCEXT_DISABLE : + tmpregisterGCR = 0; + break; + case SAI_SYNCEXT_OUTBLOCKA_ENABLE : + tmpregisterGCR = SAI_GCR_SYNCOUT_0; + break; + case SAI_SYNCEXT_OUTBLOCKB_ENABLE : + tmpregisterGCR = SAI_GCR_SYNCOUT_1; + break; + } + SAI1->GCR = tmpregisterGCR; +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +} + /** + * @brief Get SAI Input Clock based on SAI source clock selection + * @param hsai: pointer to a SAI_HandleTypeDef structure that contains + * the configuration information for SAI module. + * @retval SAI Clock Input + */ +uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai) +{ + /* This variable used to store the SAI_CK_x (value in Hz) */ + uint32_t saiclocksource = 0; + +#if defined(STM32F446xx) + if ((hsai->Instance == SAI1_Block_A) || (hsai->Instance == SAI1_Block_B)) + { + saiclocksource = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SAI1); + } + else /* SAI2_Block_A || SAI2_Block_B*/ + { + saiclocksource = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SAI2); + } +#endif /* STM32F446xx */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + uint32_t vcoinput = 0, tmpreg = 0; + + /* Check the SAI Block parameters */ + assert_param(IS_SAI_CLK_SOURCE(hsai->Init.ClockSource)); + + /* SAI Block clock source selection */ + if(hsai->Instance == SAI1_Block_A) + { + __HAL_RCC_SAI_BLOCKACLKSOURCE_CONFIG(hsai->Init.ClockSource); + } + else + { + __HAL_RCC_SAI_BLOCKBCLKSOURCE_CONFIG((uint32_t)(hsai->Init.ClockSource << 2)); + } + + /* VCO Input Clock value calculation */ + if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI) + { + /* In Case the PLL Source is HSI (Internal Clock) */ + vcoinput = (HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)); + } + else + { + /* In Case the PLL Source is HSE (External Clock) */ + vcoinput = ((HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM))); + } + + /* SAI_CLK_x : SAI Block Clock configuration for different clock sources selected */ + if(hsai->Init.ClockSource == SAI_CLKSOURCE_PLLSAI) + { + /* Configure the PLLI2S division factor */ + /* PLLSAI_VCO Input = PLL_SOURCE/PLLM */ + /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN */ + /* SAI_CLK(first level) = PLLSAI_VCO Output/PLLSAIQ */ + tmpreg = (RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIQ) >> 24; + saiclocksource = (vcoinput * ((RCC->PLLSAICFGR & RCC_PLLSAICFGR_PLLSAIN) >> 6))/(tmpreg); + + /* SAI_CLK_x = SAI_CLK(first level)/PLLSAIDIVQ */ + tmpreg = (((RCC->DCKCFGR & RCC_DCKCFGR_PLLSAIDIVQ) >> 8) + 1); + saiclocksource = saiclocksource/(tmpreg); + + } + else if(hsai->Init.ClockSource == SAI_CLKSOURCE_PLLI2S) + { + /* Configure the PLLI2S division factor */ + /* PLLI2S_VCO Input = PLL_SOURCE/PLLM */ + /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */ + /* SAI_CLK(first level) = PLLI2S_VCO Output/PLLI2SQ */ + tmpreg = (RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SQ) >> 24; + saiclocksource = (vcoinput * ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6))/(tmpreg); + + /* SAI_CLK_x = SAI_CLK(first level)/PLLI2SDIVQ */ + tmpreg = ((RCC->DCKCFGR & RCC_DCKCFGR_PLLI2SDIVQ) + 1); + saiclocksource = saiclocksource/(tmpreg); + } + else /* sConfig->ClockSource == SAI_CLKSource_Ext */ + { + /* Enable the External Clock selection */ + __HAL_RCC_I2S_CONFIG(RCC_I2SCLKSOURCE_EXT); + + saiclocksource = EXTERNAL_CLOCK_VALUE; + } +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ + /* the return result is the value of SAI clock */ + return saiclocksource; +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +#endif /* HAL_SAI_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.h new file mode 100644 index 00000000000..50058b8e34e --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sai_ex.h @@ -0,0 +1,101 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_sai_ex.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of SAI Extension HAL module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_SAI_EX_H +#define __STM32F4xx_HAL_SAI_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup SAIEx + * @{ + */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup SAIEx_Exported_Functions + * @{ + */ + +/** @addtogroup SAIEx_Exported_Functions_Group1 + * @{ + */ + +/* Extended features functions ************************************************/ +void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai); +uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_SAI_EX_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.c index d87da33e297..0dd32586b60 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_sd.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SD card HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Secure Digital (SD) peripheral: @@ -30,14 +30,14 @@ It is used as follows: (#)Initialize the SDIO low level resources by implement the HAL_SD_MspInit() API: - (##) Enable the SDIO interface clock using __SDIO_CLK_ENABLE(); + (##) Enable the SDIO interface clock using __HAL_RCC_SDIO_CLK_ENABLE(); (##) SDIO pins configuration for SD card - (+++) Enable the clock for the SDIO GPIOs using the functions __GPIOx_CLK_ENABLE(); + (+++) Enable the clock for the SDIO GPIOs using the functions __HAL_RCC_GPIOx_CLK_ENABLE(); (+++) Configure these SDIO pins as alternate function pull-up using HAL_GPIO_Init() and according to your pin assignment; (##) DMA Configuration if you need to use DMA process (HAL_SD_ReadBlocks_DMA() and HAL_SD_WriteBlocks_DMA() APIs). - (+++) Enable the DMAx interface clock using __DMAx_CLK_ENABLE(); + (+++) Enable the DMAx interface clock using __HAL_RCC_DMAx_CLK_ENABLE(); (+++) Configure the DMA using the function HAL_DMA_Init() with predeclared and filled. (##) NVIC configuration if you need to use interrupt process when using DMA transfer. (+++) Configure the SDIO and DMA interrupt priorities using functions @@ -54,7 +54,7 @@ ================================================ [..] To initialize the SD Card, use the HAL_SD_Init() function. It Initializes - the SD Card and put it into StandBy State (Ready for data transfer). + the SD Card and put it into Standby State (Ready for data transfer). This function provide the following operations: (#) Apply the SD Card initialization process at 400KHz and check the SD Card @@ -90,14 +90,14 @@ ============================== [..] (+) You can read from SD card in polling mode by using function HAL_SD_ReadBlocks(). - This function support only 512-byte block length (the block size should be - chosen as 512 byte). + This function support only 512-bytes block length (the block size should be + chosen as 512 bytes). You can choose either one block read operation or multiple block read operation by adjusting the "NumberOfBlocks" parameter. (+) You can read from SD card in DMA mode by using function HAL_SD_ReadBlocks_DMA(). - This function support only 512-byte block length (the block size should be - chosen as 512 byte). + This function support only 512-bytes block length (the block size should be + chosen as 512 bytes). You can choose either one block read operation or multiple block read operation by adjusting the "NumberOfBlocks" parameter. After this, you have to call the function HAL_SD_CheckReadOperation(), to insure @@ -107,13 +107,13 @@ =============================== [..] (+) You can write to SD card in polling mode by using function HAL_SD_WriteBlocks(). - This function support only 512-byte block length (the block size should be - chosen as 512 byte). + This function support only 512-bytes block length (the block size should be + chosen as 512 bytes). You can choose either one block read operation or multiple block read operation by adjusting the "NumberOfBlocks" parameter. (+) You can write to SD card in DMA mode by using function HAL_SD_WriteBlocks_DMA(). - This function support only 512-byte block length (the block size should be + This function support only 512-bytes block length (the block size should be chosen as 512 byte). You can choose either one block read operation or multiple block read operation by adjusting the "NumberOfBlocks" parameter. @@ -133,7 +133,7 @@ ================================== [..] Below the list of most used macros in SD HAL driver. - + (+) __HAL_SD_SDIO_ENABLE : Enable the SD device (+) __HAL_SD_SDIO_DISABLE : Disable the SD device (+) __HAL_SD_SDIO_DMA_ENABLE: Enable the SDIO DMA transfer @@ -149,7 +149,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -179,25 +179,27 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" +#ifdef HAL_SD_MODULE_ENABLED + /** @addtogroup STM32F4xx_HAL_Driver * @{ */ -/** @defgroup SD - * @brief SD HAL module driver +/** @addtogroup SD * @{ */ -#ifdef HAL_SD_MODULE_ENABLED - /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ -/** @defgroup SD_Private_Define +/** @addtogroup SD_Private_Defines * @{ */ - /** - * @brief SDIO Static flags, TimeOut, FIFO Address + * @brief SDIO Data block size + */ +#define DATA_BLOCK_SIZE ((uint32_t)(9 << 4)) +/** + * @brief SDIO Static flags, Timeout, FIFO Address */ #define SDIO_STATIC_FLAGS ((uint32_t)(SDIO_FLAG_CCRCFAIL | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_CTIMEOUT |\ SDIO_FLAG_DTIMEOUT | SDIO_FLAG_TXUNDERR | SDIO_FLAG_RXOVERR |\ @@ -223,7 +225,7 @@ #define SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000) #define SD_OCR_STREAM_READ_UNDERRUN ((uint32_t)0x00040000) #define SD_OCR_STREAM_WRITE_OVERRUN ((uint32_t)0x00020000) -#define SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000) +#define SD_OCR_CID_CSD_OVERWRITE ((uint32_t)0x00010000) #define SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000) #define SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000) #define SD_OCR_ERASE_RESET ((uint32_t)0x00002000) @@ -271,6 +273,7 @@ * SDIO_APP_CMD should be sent before sending these commands. */ #define SD_SDIO_SEND_IF_COND ((uint32_t)SD_CMD_HS_SEND_EXT_CSD) + /** * @} */ @@ -278,8 +281,7 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ -/** @defgroup SD_Private_Functions SD Private Functions +/** @addtogroup SD_Private_Functions_Prototypes * @{ */ static HAL_SD_ErrorTypedef SD_Initialize_Cards(SD_HandleTypeDef *hsd); @@ -305,15 +307,15 @@ static void SD_DMA_TxError(DMA_HandleTypeDef *hdma); /** * @} */ - -/** @defgroup SD_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup SD_Exported_Functions * @{ */ -/** @defgroup SD_Group1 Initialization and de-initialization functions - * @brief Initialization and Configuration functions +/** @addtogroup SD_Exported_Functions_Group1 + * @brief Initialization and de-initialization functions * -@verbatim +@verbatim ============================================================================== ##### Initialization and de-initialization functions ##### ============================================================================== @@ -338,6 +340,8 @@ HAL_SD_ErrorTypedef HAL_SD_Init(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *S __IO HAL_SD_ErrorTypedef errorstate = SD_OK; SD_InitTypeDef tmpinit; + /* Allocate lock resource and initialize it */ + hsd->Lock = HAL_UNLOCKED; /* Initialize the low level hardware (MSP) */ HAL_SD_MspInit(hsd); @@ -429,7 +433,7 @@ __weak void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) * @} */ -/** @defgroup SD_Group2 IO operation functions +/** @addtogroup SD_Exported_Functions_Group2 * @brief Data transfer functions * @verbatim @@ -451,7 +455,7 @@ __weak void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) * @param pReadBuffer: pointer to the buffer that will contain the received data * @param ReadAddr: Address from where data is to be read * @param BlockSize: SD card Data block size - * This parameter should be 512 + * @note BlockSize must be 512 bytes. * @param NumberOfBlocks: Number of SD blocks to read * @retval SD Card error state */ @@ -490,7 +494,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff /* Configure the SD DPSM (Data Path State Machine) */ sdio_datainitstructure.DataTimeOut = SD_DATATIMEOUT; sdio_datainitstructure.DataLength = NumberOfBlocks * BlockSize; - sdio_datainitstructure.DataBlockSize = (uint32_t)(9 << 4); + sdio_datainitstructure.DataBlockSize = DATA_BLOCK_SIZE; sdio_datainitstructure.TransferDir = SDIO_TRANSFER_DIR_TO_SDIO; sdio_datainitstructure.TransferMode = SDIO_TRANSFER_MODE_BLOCK; sdio_datainitstructure.DPSM = SDIO_DPSM_ENABLE; @@ -522,7 +526,11 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff } /* Poll on SDIO flags */ +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DATAEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR not defined */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DATAEND)) +#endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXFIFOHF)) { @@ -547,7 +555,11 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff } /* In case of single block transfer, no need of stop transfer at all */ +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR not defined */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND)) +#endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXFIFOHF)) { @@ -559,7 +571,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff tempbuff += 8; } - } + } } /* Send stop transmission command in case of multiblock read */ @@ -599,6 +611,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff return errorstate; } +#ifdef SDIO_STA_STBITERR else if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_STBITERR)) { __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_FLAG_STBITERR); @@ -607,6 +620,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff return errorstate; } +#endif /* SDIO_STA_STBITERR */ else { /* No error flag set */ @@ -635,7 +649,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuff * @param pWriteBuffer: pointer to the buffer that will contain the data to transmit * @param WriteAddr: Address from where data is to be written * @param BlockSize: SD card Data block size - * This parameter should be 512. + * @note BlockSize must be 512 bytes. * @param NumberOfBlocks: Number of SD blocks to write * @retval SD Card error state */ @@ -717,7 +731,11 @@ HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBu /* Write block(s) in polling mode */ if(NumberOfBlocks > 1) { +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_TXUNDERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DATAEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR not defined */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_TXUNDERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DATAEND)) +#endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_TXFIFOHE)) { @@ -749,8 +767,12 @@ HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBu } else { - /* In case of single data block transfer no need of stop command at all */ + /* In case of single data block transfer no need of stop command at all */ +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_TXUNDERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR not defined */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_TXUNDERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND)) +#endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_TXFIFOHE)) { @@ -817,6 +839,7 @@ HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBu return errorstate; } +#ifdef SDIO_STA_STBITERR else if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_STBITERR)) { __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_FLAG_STBITERR); @@ -825,6 +848,7 @@ HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBu return errorstate; } +#endif /* SDIO_STA_STBITERR */ else { /* No error flag set */ @@ -853,7 +877,7 @@ HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBu * @param pReadBuffer: Pointer to the buffer that will contain the received data * @param ReadAddr: Address from where data is to be read * @param BlockSize: SD card Data block size - * This paramater should be 512. + * @note BlockSize must be 512 bytes. * @param NumberOfBlocks: Number of blocks to read. * @retval SD Card error state */ @@ -882,11 +906,18 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pRead } /* Enable transfer interrupts */ +#ifdef SDIO_STA_STBITERR __HAL_SD_SDIO_ENABLE_IT(hsd, (SDIO_IT_DCRCFAIL |\ SDIO_IT_DTIMEOUT |\ SDIO_IT_DATAEND |\ SDIO_IT_RXOVERR |\ SDIO_IT_STBITERR)); +#else /* SDIO_STA_STBITERR not defined */ + __HAL_SD_SDIO_ENABLE_IT(hsd, (SDIO_IT_DCRCFAIL |\ + SDIO_IT_DTIMEOUT |\ + SDIO_IT_DATAEND |\ + SDIO_IT_RXOVERR)); +#endif /* SDIO_STA_STBITERR */ /* Enable SDIO DMA transfer */ __HAL_SD_SDIO_DMA_ENABLE(); @@ -896,7 +927,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pRead hsd->hdmarx->XferErrorCallback = SD_DMA_RxError; /* Enable the DMA Stream */ - HAL_DMA_Start_IT(hsd->hdmarx, (uint32_t)&hsd->Instance->FIFO, (uint32_t)pReadBuffer, (uint32_t)(BlockSize * NumberOfBlocks)); + HAL_DMA_Start_IT(hsd->hdmarx, (uint32_t)&hsd->Instance->FIFO, (uint32_t)pReadBuffer, (uint32_t)(BlockSize * NumberOfBlocks)/4); if (hsd->CardType == HIGH_CAPACITY_SD_CARD) { @@ -941,7 +972,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pRead sdio_cmdinitstructure.CmdIndex = SD_CMD_READ_SINGLE_BLOCK; } - sdio_cmdinitstructure.Argument = (uint32_t)ReadAddr; + sdio_cmdinitstructure.Argument = (uint32_t)ReadAddr; SDIO_SendCommand(hsd->Instance, &sdio_cmdinitstructure); /* Check for error conditions */ @@ -970,7 +1001,7 @@ HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pRead * @param pWriteBuffer: pointer to the buffer that will contain the data to transmit * @param WriteAddr: Address from where data is to be read * @param BlockSize: the SD card Data block size - * This parameter should be 512. + * @note BlockSize must be 512 bytes. * @param NumberOfBlocks: Number of blocks to write * @retval SD Card error state */ @@ -999,18 +1030,25 @@ HAL_SD_ErrorTypedef HAL_SD_WriteBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pWri } /* Enable transfer interrupts */ +#ifdef SDIO_STA_STBITERR __HAL_SD_SDIO_ENABLE_IT(hsd, (SDIO_IT_DCRCFAIL |\ SDIO_IT_DTIMEOUT |\ SDIO_IT_DATAEND |\ SDIO_IT_TXUNDERR |\ - SDIO_IT_STBITERR)); + SDIO_IT_STBITERR)); +#else /* SDIO_STA_STBITERR not defined */ + __HAL_SD_SDIO_ENABLE_IT(hsd, (SDIO_IT_DCRCFAIL |\ + SDIO_IT_DTIMEOUT |\ + SDIO_IT_DATAEND |\ + SDIO_IT_TXUNDERR)); +#endif /* SDIO_STA_STBITERR */ /* Configure DMA user callbacks */ hsd->hdmatx->XferCpltCallback = SD_DMA_TxCplt; hsd->hdmatx->XferErrorCallback = SD_DMA_TxError; /* Enable the DMA Stream */ - HAL_DMA_Start_IT(hsd->hdmatx, (uint32_t)pWriteBuffer, (uint32_t)&hsd->Instance->FIFO, (uint32_t)(BlockSize * NumberOfBlocks)); + HAL_DMA_Start_IT(hsd->hdmatx, (uint32_t)pWriteBuffer, (uint32_t)&hsd->Instance->FIFO, (uint32_t)(BlockSize * NumberOfBlocks)/4); /* Enable SDIO DMA transfer */ __HAL_SD_SDIO_DMA_ENABLE(); @@ -1298,7 +1336,7 @@ HAL_SD_ErrorTypedef HAL_SD_Erase(SD_HandleTypeDef *hsd, uint64_t startaddr, uint { } - /* Wait untill the card is in programming state */ + /* Wait until the card is in programming state */ errorstate = SD_IsCardProgramming(hsd, &cardstate); delay = SD_DATATIMEOUT; @@ -1365,6 +1403,7 @@ void HAL_SD_IRQHandler(SD_HandleTypeDef *hsd) HAL_SD_XferErrorCallback(hsd); } +#ifdef SDIO_STA_STBITERR else if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_IT_STBITERR)) { __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_FLAG_STBITERR); @@ -1373,15 +1412,22 @@ void HAL_SD_IRQHandler(SD_HandleTypeDef *hsd) HAL_SD_XferErrorCallback(hsd); } +#endif /* SDIO_STA_STBITERR */ else { /* No error flag set */ - } + } /* Disable all SDIO peripheral interrupt sources */ +#ifdef SDIO_STA_STBITERR + __HAL_SD_SDIO_DISABLE_IT(hsd, SDIO_IT_DCRCFAIL | SDIO_IT_DTIMEOUT | SDIO_IT_DATAEND |\ + SDIO_IT_TXFIFOHE | SDIO_IT_RXFIFOHF | SDIO_IT_TXUNDERR |\ + SDIO_IT_RXOVERR | SDIO_IT_STBITERR); +#else /* SDIO_STA_STBITERR not defined */ __HAL_SD_SDIO_DISABLE_IT(hsd, SDIO_IT_DCRCFAIL | SDIO_IT_DTIMEOUT | SDIO_IT_DATAEND |\ SDIO_IT_TXFIFOHE | SDIO_IT_RXFIFOHF | SDIO_IT_TXUNDERR |\ - SDIO_IT_RXOVERR | SDIO_IT_STBITERR); + SDIO_IT_RXOVERR); +#endif /* SDIO_STA_STBITERR */ } @@ -1465,7 +1511,7 @@ __weak void HAL_SD_DMA_TxErrorCallback(DMA_HandleTypeDef *hdma) * @} */ -/** @defgroup SD_Group3 Peripheral Control functions +/** @addtogroup SD_Exported_Functions_Group3 * @brief management functions * @verbatim @@ -1578,7 +1624,7 @@ HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTy /* Byte 10 */ tmp = (uint8_t)((hsd->CSD[2] & 0x0000FF00) >> 8); - pCardInfo->CardCapacity = ((pCardInfo->SD_csd.DeviceSize + 1)) * 512 * 1024; + pCardInfo->CardCapacity = (uint64_t)((((uint64_t)pCardInfo->SD_csd.DeviceSize + 1)) * 512 * 1024); pCardInfo->CardBlockSize = 512; } else @@ -1586,7 +1632,7 @@ HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTy /* Not supported card type */ errorstate = SD_ERROR; } - + pCardInfo->SD_csd.EraseGrSize = (tmp & 0x40) >> 6; pCardInfo->SD_csd.EraseGrMul = (tmp & 0x3F) << 1; @@ -1848,8 +1894,11 @@ HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd) { return errorstate; } - +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND)) +#endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXFIFOHF)) { @@ -1886,6 +1935,7 @@ HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd) return errorstate; } +#ifdef SDIO_STA_STBITERR else if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_STBITERR)) { __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_FLAG_STBITERR); @@ -1894,11 +1944,12 @@ HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd) return errorstate; } +#endif /* SDIO_STA_STBITERR */ else { /* No error flag set */ } - + count = SD_DATATIMEOUT; while ((__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXDAVL)) && (count > 0)) @@ -1925,7 +1976,7 @@ HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd) * @} */ -/** @defgroup SD_Group4 Peripheral State functions +/** @addtogroup SD_Exported_Functions_Group4 * @brief Peripheral State functions * @verbatim @@ -2000,13 +2051,13 @@ HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstat sdio_datainitstructure.DPSM = SDIO_DPSM_ENABLE; SDIO_DataConfig(hsd->Instance, &sdio_datainitstructure); - /* Send ACMD13 (SD_APP_STAUS) with argument as card's RCA */ + /* Send ACMD13 (SD_APP_STATUS) with argument as card's RCA */ sdio_cmdinitstructure.Argument = 0; - sdio_cmdinitstructure.CmdIndex = SD_CMD_SD_APP_STAUS; + sdio_cmdinitstructure.CmdIndex = SD_CMD_SD_APP_STATUS; SDIO_SendCommand(hsd->Instance, &sdio_cmdinitstructure); /* Check for error conditions */ - errorstate = SD_CmdResp1Error(hsd, SD_CMD_SD_APP_STAUS); + errorstate = SD_CmdResp1Error(hsd, SD_CMD_SD_APP_STATUS); if (errorstate != SD_OK) { @@ -2014,7 +2065,11 @@ HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstat } /* Get status data */ +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR not defined */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND)) +#endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXFIFOHF)) { @@ -2051,6 +2106,7 @@ HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstat return errorstate; } +#ifdef SDIO_STA_STBITERR else if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_STBITERR)) { __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_FLAG_STBITERR); @@ -2059,6 +2115,7 @@ HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstat return errorstate; } +#endif /* SDIO_STA_STBITERR */ else { /* No error flag set */ @@ -2195,7 +2252,8 @@ HAL_SD_ErrorTypedef HAL_SD_GetCardStatus(SD_HandleTypeDef *hsd, HAL_SD_CardStatu /** * @} */ - + +/* Private function ----------------------------------------------------------*/ /** @addtogroup SD_Private_Functions * @{ */ @@ -2218,6 +2276,9 @@ static void SD_DMA_RxCplt(DMA_HandleTypeDef *hdma) { } + /* Disable the DMA channel */ + HAL_DMA_Abort(hdma); + /* Transfer complete user callback */ HAL_SD_DMA_RxCpltCallback(hsd->hdmarx); } @@ -2253,7 +2314,10 @@ static void SD_DMA_TxCplt(DMA_HandleTypeDef *hdma) while(hsd->SdTransferCplt == 0) { } - + + /* Disable the DMA channel */ + HAL_DMA_Abort(hdma); + /* Transfer complete user callback */ HAL_SD_DMA_TxCpltCallback(hsd->hdmatx); } @@ -2384,7 +2448,7 @@ static HAL_SD_ErrorTypedef SD_Initialize_Cards(SD_HandleTypeDef *hsd) } /** - * @brief Selects od Deselects the corresponding card. + * @brief Selects of Deselects the corresponding card. * @param hsd: SD handle * @param addr: Address of the card to be selected * @retval SD Card error state @@ -2429,6 +2493,10 @@ static HAL_SD_ErrorTypedef SD_PowerON(SD_HandleTypeDef *hsd) /* Set Power State to ON */ SDIO_PowerState_ON(hsd->Instance); + /* 1ms: required power up waiting time before starting the SD initialization + sequence */ + HAL_Delay(1); + /* Enable SDIO Clock */ __HAL_SD_SDIO_ENABLE(); @@ -2446,7 +2514,7 @@ static HAL_SD_ErrorTypedef SD_PowerON(SD_HandleTypeDef *hsd) if(errorstate != SD_OK) { - /* CMD Response TimeOut (wait for CMDSENT flag) */ + /* CMD Response Timeout (wait for CMDSENT flag) */ return errorstate; } @@ -2479,7 +2547,7 @@ static HAL_SD_ErrorTypedef SD_PowerON(SD_HandleTypeDef *hsd) /* Check for error conditions */ errorstate = SD_CmdResp1Error(hsd, SD_CMD_APP_CMD); - /* If errorstate is Command TimeOut, it is a MMC card */ + /* If errorstate is Command Timeout, it is a MMC card */ /* If errorstate is SD_OK it is a SD card: SD card 2.0 (voltage range mismatch) or SD card 1.x */ if(errorstate == SD_OK) @@ -2799,7 +2867,7 @@ static HAL_SD_ErrorTypedef SD_CmdResp1Error(SD_HandleTypeDef *hsd, uint8_t SD_CM return(SD_STREAM_WRITE_OVERRUN); } - if((response_r1 & SD_OCR_CID_CSD_OVERWRIETE) == SD_OCR_CID_CSD_OVERWRIETE) + if((response_r1 & SD_OCR_CID_CSD_OVERWRITE) == SD_OCR_CID_CSD_OVERWRITE) { return(SD_CID_CSD_OVERWRITE); } @@ -2887,7 +2955,7 @@ static HAL_SD_ErrorTypedef SD_CmdResp2Error(SD_HandleTypeDef *hsd) else { /* No error flag set */ - } + } /* Clear all the static flags */ __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_STATIC_FLAGS); @@ -2931,7 +2999,7 @@ static HAL_SD_ErrorTypedef SD_CmdResp6Error(SD_HandleTypeDef *hsd, uint8_t SD_CM else { /* No error flag set */ - } + } /* Check response received is of desired command */ if(SDIO_GetCommandResponse(hsd->Instance) != SD_CMD) @@ -3174,8 +3242,11 @@ static HAL_SD_ErrorTypedef SD_FindSCR(SD_HandleTypeDef *hsd, uint32_t *pSCR) { return errorstate; } - +#ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR)) +#else /* SDIO_STA_STBITERR not defined */ + while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND)) +#endif /* SDIO_STA_STBITERR */ { if(__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXDAVL)) { @@ -3208,6 +3279,7 @@ static HAL_SD_ErrorTypedef SD_FindSCR(SD_HandleTypeDef *hsd, uint32_t *pSCR) return errorstate; } +#ifdef SDIO_STA_STBITERR else if(__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_STBITERR)) { __HAL_SD_SDIO_CLEAR_FLAG(hsd, SDIO_FLAG_STBITERR); @@ -3216,6 +3288,7 @@ static HAL_SD_ErrorTypedef SD_FindSCR(SD_HandleTypeDef *hsd, uint32_t *pSCR) return errorstate; } +#endif /* SDIO_STA_STBITERR */ else { /* No error flag set */ @@ -3370,7 +3443,7 @@ static HAL_SD_ErrorTypedef SD_IsCardProgramming(SD_HandleTypeDef *hsd, uint8_t * return(SD_STREAM_WRITE_OVERRUN); } - if((responseR1 & SD_OCR_CID_CSD_OVERWRIETE) == SD_OCR_CID_CSD_OVERWRIETE) + if((responseR1 & SD_OCR_CID_CSD_OVERWRITE) == SD_OCR_CID_CSD_OVERWRITE) { return(SD_CID_CSD_OVERWRITE); } @@ -3403,6 +3476,7 @@ static HAL_SD_ErrorTypedef SD_IsCardProgramming(SD_HandleTypeDef *hsd, uint8_t * */ #endif /* HAL_SD_MODULE_ENABLED */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.h index a0b15332325..51b75417619 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sd.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_sd.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SD HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -50,20 +50,22 @@ * @{ */ -/** @addtogroup SD +/** @defgroup SD SD + * @brief SD HAL module driver * @{ - */ + */ /* Exported types ------------------------------------------------------------*/ -/** @defgroup SD_Exported_Types +/** @defgroup SD_Exported_Types SD Exported Types + * @{ + */ + +/** @defgroup SD_Exported_Types_Group1 SD Handle Structure definition * @{ */ #define SD_InitTypeDef SDIO_InitTypeDef #define SD_TypeDef SDIO_TypeDef -/** - * @brief SDIO Handle Structure definition - */ typedef struct { SD_TypeDef *Instance; /*!< SDIO register base address */ @@ -93,9 +95,12 @@ typedef struct DMA_HandleTypeDef *hdmatx; /*!< SD Tx DMA handle parameters */ }SD_HandleTypeDef; - /** - * @brief Card Specific Data: CSD Register + * @} + */ + +/** @defgroup SD_Exported_Types_Group2 Card Specific Data: CSD Register + * @{ */ typedef struct { @@ -138,10 +143,13 @@ typedef struct __IO uint8_t Reserved4; /*!< Always 1 */ }HAL_SD_CSDTypedef; - /** - * @brief Card Identification Data: CID Register + * @} */ + +/** @defgroup SD_Exported_Types_Group3 Card Identification Data: CID Register + * @{ + */ typedef struct { __IO uint8_t ManufacturerID; /*!< Manufacturer ID */ @@ -156,10 +164,13 @@ typedef struct __IO uint8_t Reserved2; /*!< Always 1 */ }HAL_SD_CIDTypedef; - /** - * @brief SD Card Status returned by ACMD13 + * @} */ + +/** @defgroup SD_Exported_Types_Group4 SD Card Status returned by ACMD13 + * @{ + */ typedef struct { __IO uint8_t DAT_BUS_WIDTH; /*!< Shows the currently defined data bus width */ @@ -174,10 +185,13 @@ typedef struct __IO uint8_t ERASE_OFFSET; /*!< Carries information about the erase offset */ }HAL_SD_CardStatusTypedef; - /** - * @brief SD Card information structure + * @} */ + +/** @defgroup SD_Exported_Types_Group5 SD Card information structure + * @{ + */ typedef struct { HAL_SD_CSDTypedef SD_csd; /*!< SD card specific data register */ @@ -188,10 +202,13 @@ typedef struct uint8_t CardType; /*!< SD card type */ }HAL_SD_CardInfoTypedef; - /** - * @brief SD Error status enumeration Structure definition + * @} */ + +/** @defgroup SD_Exported_Types_Group6 SD Error status enumeration Structure definition + * @{ + */ typedef enum { /** @@ -245,10 +262,13 @@ typedef enum SD_OK = (0) }HAL_SD_ErrorTypedef; - /** - * @brief SD Transfer state enumeration structure - */ + * @} + */ + +/** @defgroup SD_Exported_Types_Group7 SD Transfer state enumeration structure + * @{ + */ typedef enum { SD_TRANSFER_OK = 0, /*!< Transfer success */ @@ -256,10 +276,13 @@ typedef enum SD_TRANSFER_ERROR = 2 /*!< Transfer failed */ }HAL_SD_TransferStateTypedef; - /** - * @brief SD Card State enumeration structure - */ + * @} + */ + +/** @defgroup SD_Exported_Types_Group8 SD Card State enumeration structure + * @{ + */ typedef enum { SD_CARD_READY = ((uint32_t)0x00000001), /*!< Card state is ready */ @@ -273,10 +296,13 @@ typedef enum SD_CARD_ERROR = ((uint32_t)0x000000FF) /*!< Card is in error state */ }HAL_SD_CardStateTypedef; - /** - * @brief SD Operation enumeration structure - */ + * @} + */ + +/** @defgroup SD_Exported_Types_Group9 SD Operation enumeration structure + * @{ + */ typedef enum { SD_READ_SINGLE_BLOCK = 0, /*!< Read single block operation */ @@ -285,10 +311,16 @@ typedef enum SD_WRITE_MULTIPLE_BLOCK = 3 /*!< Write multiple blocks operation */ }HAL_SD_OperationTypedef; +/** + * @} + */ +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup SD_Exported_Constants +/** @defgroup SD_Exported_Constants SD Exported Constants * @{ */ @@ -354,7 +386,7 @@ typedef enum */ #define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) /*!< (ACMD6) Defines the data bus width to be used for data transfer. The allowed data bus widths are given in SCR register. */ -#define SD_CMD_SD_APP_STAUS ((uint8_t)13) /*!< (ACMD13) Sends the SD status. */ +#define SD_CMD_SD_APP_STATUS ((uint8_t)13) /*!< (ACMD13) Sends the SD status. */ #define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22) /*!< (ACMD22) Sends the number of the written (without errors) write blocks. Responds with 32bit+CRC data block. */ #define SD_CMD_SD_APP_OP_COND ((uint8_t)41) /*!< (ACMD41) Sends host capacity support information (HCS) and asks the accessed card to @@ -396,11 +428,10 @@ typedef enum */ /* Exported macro ------------------------------------------------------------*/ - -/** @defgroup SD_Exported_macros - * @brief macros to handle interrupts and specific clock configurations - * @{ - */ +/** @defgroup SD_Exported_macros SD Exported Macros + * @brief macros to handle interrupts and specific clock configurations + * @{ + */ /** * @brief Enable the SD device. @@ -609,12 +640,11 @@ typedef enum */ /* Exported functions --------------------------------------------------------*/ -/** @addtogroup SD_Exported_Functions +/** @defgroup SD_Exported_Functions SD Exported Functions * @{ */ - -/* Initialization/de-initialization functions ********************************/ -/** @addtogroup SD_Group1 + +/** @defgroup SD_Exported_Functions_Group1 Initialization and de-initialization functions * @{ */ HAL_SD_ErrorTypedef HAL_SD_Init(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *SDCardInfo); @@ -624,9 +654,8 @@ void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd); /** * @} */ - -/* I/O operation functions ***************************************************/ -/** @addtogroup SD_Group2 + +/** @defgroup SD_Exported_Functions_Group2 I/O operation functions * @{ */ /* Blocking mode: Polling */ @@ -653,9 +682,8 @@ HAL_SD_ErrorTypedef HAL_SD_CheckReadOperation(SD_HandleTypeDef *hsd, uint32_t Ti /** * @} */ - -/* Peripheral Control functions **********************************************/ -/** @addtogroup SD_Group3 + +/** @defgroup SD_Exported_Functions_Group3 Peripheral Control functions * @{ */ HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *pCardInfo); @@ -667,7 +695,7 @@ HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd); */ /* Peripheral State functions ************************************************/ -/** @addtogroup SD_Group4 +/** @defgroup SD_Exported_Functions_Group4 Peripheral State functions * @{ */ HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstatus); @@ -681,19 +709,81 @@ HAL_SD_TransferStateTypedef HAL_SD_GetStatus(SD_HandleTypeDef *hsd); * @} */ +/* Private types -------------------------------------------------------------*/ +/** @defgroup SD_Private_Types SD Private Types + * @{ + */ + /** * @} */ +/* Private defines -----------------------------------------------------------*/ +/** @defgroup SD_Private_Defines SD Private Defines + * @{ + */ + /** * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup SD_Private_Variables SD Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup SD_Private_Constants SD Private Constants + * @{ */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup SD_Private_Macros SD Private Macros + * @{ + */ + +/** + * @} + */ + +/* Private functions prototypes ----------------------------------------------*/ +/** @defgroup SD_Private_Functions_Prototypes SD Private Functions Prototypes + * @{ + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup SD_Private_Functions SD Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + #ifdef __cplusplus } #endif - -#endif /* __STM32F4xx_HAL_SD_H */ +#endif /* __STM32F4xx_HAL_SD_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.c index ad57f2e9a92..ff0032f84c4 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_sdram.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SDRAM HAL module driver. * This file provides a generic firmware to drive SDRAM memories mounted * as external device. @@ -63,7 +63,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -97,26 +97,24 @@ * @{ */ -/** @defgroup SDRAM +/** @defgroup SDRAM SDRAM * @brief SDRAM driver modules * @{ */ #ifdef HAL_SDRAM_MODULE_ENABLED -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ - /* Private functions ---------------------------------------------------------*/ - -/** @defgroup SDRAM_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup SDRAM_Exported_Functions SDRAM Exported Functions * @{ */ - -/** @defgroup SDRAM_Group1 Initialization and de-initialization functions + +/** @defgroup SDRAM_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -148,6 +146,8 @@ HAL_StatusTypeDef HAL_SDRAM_Init(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_TimingTy if(hsdram->State == HAL_SDRAM_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hsdram->Lock = HAL_UNLOCKED; /* Initialize the low level hardware (MSP) */ HAL_SDRAM_MspInit(hsdram); } @@ -272,12 +272,11 @@ __weak void HAL_SDRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma) the HAL_SDRAM_DMA_XferErrorCallback could be implemented in the user file */ } - /** * @} */ -/** @defgroup SDRAM_Group2 Input and Output functions +/** @defgroup SDRAM_Exported_Functions_Group2 Input and Output functions * @brief Input Output and memory control functions * @verbatim @@ -330,8 +329,7 @@ HAL_StatusTypeDef HAL_SDRAM_Read_8b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddr return HAL_OK; } - - + /** * @brief Writes 8-bit data buffer to SDRAM memory. * @param hsdram: pointer to a SDRAM_HandleTypeDef structure that contains @@ -375,7 +373,6 @@ HAL_StatusTypeDef HAL_SDRAM_Write_8b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAdd return HAL_OK; } - /** * @brief Reads 16-bit data buffer from the SDRAM memory. * @param hsdram: pointer to a SDRAM_HandleTypeDef structure that contains @@ -623,12 +620,11 @@ HAL_StatusTypeDef HAL_SDRAM_Write_DMA(SDRAM_HandleTypeDef *hsdram, uint32_t *pAd return HAL_OK; } - /** * @} */ -/** @defgroup SDRAM_Group3 Control functions +/** @defgroup SDRAM_Exported_Functions_Group3 Control functions * @brief management functions * @verbatim @@ -717,7 +713,7 @@ HAL_StatusTypeDef HAL_SDRAM_SendCommand(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_C /* Send SDRAM command */ FMC_SDRAM_SendCommand(hsdram->Instance, Command, Timeout); - /* Update the SDRAM controller state state */ + /* Update the SDRAM controller state */ if(Command->CommandMode == FMC_SDRAM_CMD_PALL) { hsdram->State = HAL_SDRAM_STATE_PRECHARGED; @@ -800,7 +796,7 @@ uint32_t HAL_SDRAM_GetModeStatus(SDRAM_HandleTypeDef *hsdram) * @} */ -/** @defgroup SDRAM_Group4 State functions +/** @defgroup SDRAM_Exported_Functions_Group4 State functions * @brief Peripheral State functions * @verbatim @@ -833,7 +829,7 @@ HAL_SDRAM_StateTypeDef HAL_SDRAM_GetState(SDRAM_HandleTypeDef *hsdram) /** * @} */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ #endif /* HAL_SDRAM_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.h index c0ad94e6987..131824788f9 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sdram.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_sdram.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SDRAM HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,7 @@ extern "C" { #endif -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_ll_fmc.h" @@ -57,6 +57,9 @@ */ /* Exported typedef ----------------------------------------------------------*/ +/** @defgroup SDRAM_Exported_Types SDRAM Exported Types + * @{ + */ /** * @brief HAL SDRAM State structure definition @@ -88,19 +91,35 @@ typedef struct DMA_HandleTypeDef *hdma; /*!< Pointer DMA handler */ }SDRAM_HandleTypeDef; - -/* Exported types ------------------------------------------------------------*/ +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup SDRAM_Exported_Macros SDRAM Exported Macros + * @{ + */ /** @brief Reset SDRAM handle state * @param __HANDLE__: specifies the SDRAM handle. * @retval None */ #define __HAL_SDRAM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SDRAM_STATE_RESET) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup SDRAM_Exported_Functions SDRAM Exported Functions + * @{ + */ + +/** @addtogroup SDRAM_Exported_Functions_Group1 + * @{ + */ -/* Initialization/de-initialization functions **********************************/ +/* Initialization/de-initialization functions *********************************/ HAL_StatusTypeDef HAL_SDRAM_Init(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_TimingTypeDef *Timing); HAL_StatusTypeDef HAL_SDRAM_DeInit(SDRAM_HandleTypeDef *hsdram); void HAL_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram); @@ -110,8 +129,14 @@ void HAL_SDRAM_IRQHandler(SDRAM_HandleTypeDef *hsdram); void HAL_SDRAM_RefreshErrorCallback(SDRAM_HandleTypeDef *hsdram); void HAL_SDRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma); void HAL_SDRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma); +/** + * @} + */ -/* I/O operation functions *****************************************************/ +/** @addtogroup SDRAM_Exported_Functions_Group2 + * @{ + */ +/* I/O operation functions ****************************************************/ HAL_StatusTypeDef HAL_SDRAM_Read_8b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize); HAL_StatusTypeDef HAL_SDRAM_Write_8b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize); HAL_StatusTypeDef HAL_SDRAM_Read_16b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint16_t *pDstBuffer, uint32_t BufferSize); @@ -121,7 +146,13 @@ HAL_StatusTypeDef HAL_SDRAM_Write_32b(SDRAM_HandleTypeDef *hsdram, uint32_t *pAd HAL_StatusTypeDef HAL_SDRAM_Read_DMA(SDRAM_HandleTypeDef *hsdram, uint32_t * pAddress, uint32_t *pDstBuffer, uint32_t BufferSize); HAL_StatusTypeDef HAL_SDRAM_Write_DMA(SDRAM_HandleTypeDef *hsdram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize); - +/** + * @} + */ + +/** @addtogroup SDRAM_Exported_Functions_Group3 + * @{ + */ /* SDRAM Control functions *****************************************************/ HAL_StatusTypeDef HAL_SDRAM_WriteProtection_Enable(SDRAM_HandleTypeDef *hsdram); HAL_StatusTypeDef HAL_SDRAM_WriteProtection_Disable(SDRAM_HandleTypeDef *hsdram); @@ -129,14 +160,28 @@ HAL_StatusTypeDef HAL_SDRAM_SendCommand(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_C HAL_StatusTypeDef HAL_SDRAM_ProgramRefreshRate(SDRAM_HandleTypeDef *hsdram, uint32_t RefreshRate); HAL_StatusTypeDef HAL_SDRAM_SetAutoRefreshNumber(SDRAM_HandleTypeDef *hsdram, uint32_t AutoRefreshNumber); uint32_t HAL_SDRAM_GetModeStatus(SDRAM_HandleTypeDef *hsdram); +/** + * @} + */ +/** @addtogroup SDRAM_Exported_Functions_Group4 + * @{ + */ /* SDRAM State functions ********************************************************/ HAL_SDRAM_StateTypeDef HAL_SDRAM_GetState(SDRAM_HandleTypeDef *hsdram); +/** + * @} + */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ /** * @} - */ + */ + +/** + * @} + */ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.c index 372c19cf86d..0864988dcc7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_smartcard.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SMARTCARD HAL module driver. * This file provides firmware functions to manage the following * functionalities of the SMARTCARD peripheral: @@ -34,7 +34,7 @@ (+++) Enable the DMAx interface clock. (+++) Configure the declared DMA handle structure with the required Tx/Rx parameters. (+++) Configure the DMA Tx/Rx Stream. - (+++) Associate the initilalized DMA handle to the SMARTCARD DMA Tx/Rx handle. + (+++) Associate the initialized DMA handle to the SMARTCARD DMA Tx/Rx handle. (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx/Rx Stream. (#) Program the Baud Rate, Word Length , Stop Bit, Parity, Hardware @@ -42,11 +42,11 @@ (#) Initialize the SMARTCARD registers by calling the HAL_SMARTCARD_Init() API: (++) These APIs configure also the low level Hardware GPIO, CLOCK, CORTEX...etc) - by calling the customed HAL_SMARTCARD_MspInit() API. + by calling the customized HAL_SMARTCARD_MspInit() API. [..] (@) The specific SMARTCARD interrupts (Transmission complete interrupt, RXNE interrupt and Error Interrupts) will be managed using the macros - __SMARTCARD_ENABLE_IT() and __SMARTCARD_DISABLE_IT() inside the transmit and receive process. + __HAL_SMARTCARD_ENABLE_IT() and __HAL_SMARTCARD_DISABLE_IT() inside the transmit and receive process. [..] Three operation modes are available within this driver : @@ -100,7 +100,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -134,63 +134,77 @@ * @{ */ -/** @defgroup SMARTCARD +/** @defgroup SMARTCARD SMARTCARD * @brief HAL USART SMARTCARD module driver * @{ */ #ifdef HAL_SMARTCARD_MODULE_ENABLED /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup SMARTCARD_Private_Constants + * @{ + */ #define SMARTCARD_TIMEOUT_VALUE 22000 +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup SMARTCARD_Private_Functions + * @{ + */ static void SMARTCARD_SetConfig (SMARTCARD_HandleTypeDef *hsc); static HAL_StatusTypeDef SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsc); +static HAL_StatusTypeDef SMARTCARD_EndTransmit_IT(SMARTCARD_HandleTypeDef *hsmartcard); static HAL_StatusTypeDef SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsc); static void SMARTCARD_DMATransmitCplt(DMA_HandleTypeDef *hdma); static void SMARTCARD_DMAReceiveCplt(DMA_HandleTypeDef *hdma); static void SMARTCARD_DMAError(DMA_HandleTypeDef *hdma); static HAL_StatusTypeDef SMARTCARD_WaitOnFlagUntilTimeout(SMARTCARD_HandleTypeDef *hsc, uint32_t Flag, FlagStatus Status, uint32_t Timeout); -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup SMARTCARD_Private_Functions +/** + * @} + */ +/* Exported functions --------------------------------------------------------*/ +/** @defgroup SMARTCARD_Exported_Functions SMARTCARD Exported Functions * @{ */ -/** @defgroup SMARTCARD_Group1 SmartCard Initialization and de-initialization functions +/** @defgroup SMARTCARD_Exported_Functions_Group1 SmartCard Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim - =============================================================================== - ##### Initialization and Configuration functions ##### - =============================================================================== - [..] - This subsection provides a set of functions allowing to initialize the USART - in Smartcard mode. - [..] - The Smartcard interface is designed to support asynchronous protocol Smartcards as - defined in the ISO 7816-3 standard. - [..] - The USART can provide a clock to the smartcard through the SCLK output. - In smartcard mode, SCLK is not associated to the communication but is simply derived - from the internal peripheral input clock through a 5-bit prescaler. - [..] - (+) For the asynchronous mode only these parameters can be configured: - (++) Baud Rate - (++) Word Length - (++) Stop Bit - (++) Parity: If the parity is enabled, then the MSB bit of the data written - in the data register is transmitted but is changed by the parity bit. - Depending on the frame length defined by the M bit (8-bits or 9-bits), - please refer to Reference manual for possible SMARTDARD frame formats. - (++) USART polarity - (++) USART phase - (++) USART LastBit - (++) Receiver/transmitter modes - (++) Prescaler - (++) GuardTime - (++) NACKState: The Smartcard NACK state + ============================================================================== + ##### Initialization and Configuration functions ##### + ============================================================================== + [..] + This subsection provides a set of functions allowing to initialize the USART + in Smartcard mode. + [..] + The Smartcard interface is designed to support asynchronous protocol Smartcards as + defined in the ISO 7816-3 standard. + [..] + The USART can provide a clock to the smartcard through the SCLK output. + In smartcard mode, SCLK is not associated to the communication but is simply derived + from the internal peripheral input clock through a 5-bit prescaler. + [..] + (+) For the Smartcard mode only these parameters can be configured: + (++) Baud Rate + (++) Word Length => Should be 9 bits (8 bits + parity) + (++) Stop Bit + (++) Parity: => Should be enabled + +-------------------------------------------------------------+ + | M bit | PCE bit | SMARTCARD frame | + |---------------------|---------------------------------------| + | 1 | 1 | | SB | 8 bit data | PB | STB | | + +-------------------------------------------------------------+ + (++) USART polarity + (++) USART phase + (++) USART LastBit + (++) Receiver/transmitter modes + (++) Prescaler + (++) GuardTime + (++) NACKState: The Smartcard NACK state (+) Recommended SmartCard interface configuration to get the Answer to Reset from the Card: (++) Word Length = 9 Bits @@ -198,13 +212,13 @@ static HAL_StatusTypeDef SMARTCARD_WaitOnFlagUntilTimeout(SMARTCARD_HandleTypeDe (++) Even parity (++) BaudRate = 12096 baud (++) Tx and Rx enabled - [..] - Please refer to the ISO 7816-3 specification for more details. + [..] + Please refer to the ISO 7816-3 specification for more details. - -@- It is also possible to choose 0.5 stop bit for receiving but it is recommended - to use 1.5 stop bits for both transmitting and receiving to avoid switching - between the two configurations. - [..] + -@- It is also possible to choose 0.5 stop bit for receiving but it is recommended + to use 1.5 stop bits for both transmitting and receiving to avoid switching + between the two configurations. + [..] The HAL_SMARTCARD_Init() function follows the USART SmartCard configuration procedure (details for the procedure are available in reference manual (RM0329)). @@ -233,6 +247,8 @@ HAL_StatusTypeDef HAL_SMARTCARD_Init(SMARTCARD_HandleTypeDef *hsc) if(hsc->State == HAL_SMARTCARD_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hsc->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ HAL_SMARTCARD_MspInit(hsc); } @@ -255,13 +271,13 @@ HAL_StatusTypeDef HAL_SMARTCARD_Init(SMARTCARD_HandleTypeDef *hsc) hsc->Instance->CR3 &= ~(USART_CR3_IREN | USART_CR3_HDSEL); /* Enable the SMARTCARD Parity Error Interrupt */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_PE); + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_PE); /* Enable the SMARTCARD Framing Error Interrupt */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_ERR); + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_ERR); - /* Enable the Peripharal */ - __SMARTCARD_ENABLE(hsc); + /* Enable the Peripheral */ + __HAL_SMARTCARD_ENABLE(hsc); /* Configure the Smartcard NACK state */ MODIFY_REG(hsc->Instance->CR3, USART_CR3_NACK, hsc->Init.NACKState); @@ -295,6 +311,9 @@ HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc) hsc->State = HAL_SMARTCARD_STATE_BUSY; + /* Disable the Peripheral */ + __HAL_SMARTCARD_DISABLE(hsc); + /* DeInit the low level hardware */ HAL_SMARTCARD_MspDeInit(hsc); @@ -316,7 +335,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc) __weak void HAL_SMARTCARD_MspInit(SMARTCARD_HandleTypeDef *hsc) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SMARTCARD_MspInit could be implenetd in the user file + the HAL_SMARTCARD_MspInit could be implemented in the user file */ } @@ -329,7 +348,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc) __weak void HAL_SMARTCARD_MspDeInit(SMARTCARD_HandleTypeDef *hsc) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SMARTCARD_MspDeInit could be implenetd in the user file + the HAL_SMARTCARD_MspDeInit could be implemented in the user file */ } @@ -337,7 +356,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc) * @} */ -/** @defgroup SMARTCARD_Group2 IO operation functions +/** @defgroup SMARTCARD_Exported_Functions_Group2 IO operation functions * @brief SMARTCARD Transmit and Receive functions * @verbatim @@ -346,11 +365,11 @@ HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc) =============================================================================== This subsection provides a set of functions allowing to manage the SMARTCARD data transfers. [..] - IrDA is a half duplex communication protocol. If the Transmitter is busy, any data - on the IrDA receive line will be ignored by the IrDA decoder and if the Receiver - is busy, data on the TX from the USART to IrDA will not be encoded by IrDA. - While receiving data, transmission should be avoided as the data to be transmitted - could be corrupted. + Smartcard is a single wire half duplex communication protocol. + The Smartcard interface is designed to support asynchronous protocol Smartcards as + defined in the ISO 7816-3 standard. The USART should be configured as: + (+) 8 bits plus parity: where M=1 and PCE=1 in the USART_CR1 register + (+) 1.5 stop bits when transmitting and receiving: where STOP=11 in the USART_CR2 register. (#) There are two modes of transfer: (++) Blocking mode: The communication is performed in polling mode. @@ -362,7 +381,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc) dedicated SMARTCARD IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_SMARTCARD_TxCpltCallback(), HAL_SMARTCARD_RxCpltCallback() user callbacks - will be executed respectivelly at the end of the Transmit or Receive process + will be executed respectively at the end of the Transmit or Receive process The HAL_SMARTCARD_ErrorCallback() user callback will be executed when a communication error is detected (#) Blocking mode APIs are : @@ -427,34 +446,16 @@ HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsc, uint8_t * hsc->TxXferCount = Size; while(hsc->TxXferCount > 0) { - hsc->TxXferCount--; - if(hsc->Init.WordLength == SMARTCARD_WORDLENGTH_9B) + hsc->TxXferCount--; + if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_TXE, RESET, Timeout) != HAL_OK) { - if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_TXE, RESET, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; - } - tmp = (uint16_t*) pData; - hsc->Instance->DR = (*tmp & (uint16_t)0x01FF); - if(hsc->Init.Parity == SMARTCARD_PARITY_NONE) - { - pData +=2; - } - else - { - pData +=1; - } - } - else - { - if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_TXE, RESET, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; - } - hsc->Instance->DR = (*pData++ & (uint8_t)0xFF); + return HAL_TIMEOUT; } + tmp = (uint16_t*) pData; + hsc->Instance->DR = (*tmp & (uint16_t)0x01FF); + pData +=1; } - + if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_TC, RESET, Timeout) != HAL_OK) { return HAL_TIMEOUT; @@ -519,43 +520,18 @@ HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsc, uint8_t *p hsc->RxXferSize = Size; hsc->RxXferCount = Size; + /* Check the remain data to be received */ while(hsc->RxXferCount > 0) { hsc->RxXferCount--; - if(hsc->Init.WordLength == SMARTCARD_WORDLENGTH_9B) + if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_RXNE, RESET, Timeout) != HAL_OK) { - if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_RXNE, RESET, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; - } - tmp = (uint16_t*) pData; - if(hsc->Init.Parity == SMARTCARD_PARITY_NONE) - { - *tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x01FF); - pData +=2; - } - else - { - *tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x00FF); - pData +=1; - } - } - else - { - if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_RXNE, RESET, Timeout) != HAL_OK) - { - return HAL_TIMEOUT; - } - if(hsc->Init.Parity == SMARTCARD_PARITY_NONE) - { - *pData++ = (uint8_t)(hsc->Instance->DR & (uint8_t)0x00FF); - } - else - { - *pData++ = (uint8_t)(hsc->Instance->DR & (uint8_t)0x007F); - } + return HAL_TIMEOUT; } + tmp = (uint16_t*) pData; + *tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x00FF); + pData +=1; } /* Check if a non-blocking transmit process is ongoing or not */ @@ -617,17 +593,17 @@ HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsc, uint8_ hsc->State = HAL_SMARTCARD_STATE_BUSY_TX; } - /* Enable the SMARTCARD Parity Error Interrupt */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_PE); - - /* Enable the SMARTCARD Error Interrupt: (Frame error, noise error, overrun error) */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_ERR); - /* Process Unlocked */ __HAL_UNLOCK(hsc); + + /* Enable the SMARTCARD Parity Error Interrupt */ + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_PE); + + /* Disable the SMARTCARD Error Interrupt: (Frame error, noise error, overrun error) */ + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_ERR); /* Enable the SMARTCARD Transmit data register empty Interrupt */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_TXE); + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_TXE); return HAL_OK; } @@ -674,18 +650,17 @@ HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsc, uint8_t { hsc->State = HAL_SMARTCARD_STATE_BUSY_RX; } - + /* Process Unlocked */ + __HAL_UNLOCK(hsc); + /* Enable the SMARTCARD Data Register not empty Interrupt */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_RXNE); + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_RXNE); /* Enable the SMARTCARD Parity Error Interrupt */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_PE); + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_PE); /* Enable the SMARTCARD Error Interrupt: (Frame error, noise error, overrun error) */ - __SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_ERR); - - /* Process Unlocked */ - __HAL_UNLOCK(hsc); + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_ERR); return HAL_OK; } @@ -734,7 +709,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsc, uint8 hsc->State = HAL_SMARTCARD_STATE_BUSY_TX; } - /* Set the SMARTCARD DMA transfert complete callback */ + /* Set the SMARTCARD DMA transfer complete callback */ hsc->hdmatx->XferCpltCallback = SMARTCARD_DMATransmitCplt; /* Set the DMA error callback */ @@ -744,6 +719,9 @@ HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsc, uint8 tmp = (uint32_t*)&pData; HAL_DMA_Start_IT(hsc->hdmatx, *(uint32_t*)tmp, (uint32_t)&hsc->Instance->DR, Size); + /* Clear the TC flag in the SR register by writing 0 to it */ + __HAL_SMARTCARD_CLEAR_FLAG(hsc, SMARTCARD_FLAG_TC); + /* Enable the DMA transfer for transmit request by setting the DMAT bit in the SMARTCARD CR3 register */ hsc->Instance->CR3 |= USART_CR3_DMAT; @@ -798,7 +776,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA(SMARTCARD_HandleTypeDef *hsc, uint8_ hsc->State = HAL_SMARTCARD_STATE_BUSY_RX; } - /* Set the SMARTCARD DMA transfert complete callback */ + /* Set the SMARTCARD DMA transfer complete callback */ hsc->hdmarx->XferCpltCallback = SMARTCARD_DMAReceiveCplt; /* Set the DMA error callback */ @@ -836,7 +814,7 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc) tmp1 = hsc->Instance->SR; tmp2 = __HAL_SMARTCARD_GET_IT_SOURCE(hsc, SMARTCARD_IT_PE); - /* SMARTCARD parity error interrupt occured --------------------------------*/ + /* SMARTCARD parity error interrupt occurred --------------------------------*/ if(((tmp1 & SMARTCARD_FLAG_PE) != RESET) && (tmp2 != RESET)) { __HAL_SMARTCARD_CLEAR_PEFLAG(hsc); @@ -844,7 +822,7 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc) } tmp2 = __HAL_SMARTCARD_GET_IT_SOURCE(hsc, SMARTCARD_IT_ERR); - /* SMARTCARD frame error interrupt occured ---------------------------------*/ + /* SMARTCARD frame error interrupt occurred ---------------------------------*/ if(((tmp1 & SMARTCARD_FLAG_FE) != RESET) && (tmp2 != RESET)) { __HAL_SMARTCARD_CLEAR_FEFLAG(hsc); @@ -852,7 +830,7 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc) } tmp2 = __HAL_SMARTCARD_GET_IT_SOURCE(hsc, SMARTCARD_IT_ERR); - /* SMARTCARD noise error interrupt occured ---------------------------------*/ + /* SMARTCARD noise error interrupt occurred ---------------------------------*/ if(((tmp1 & SMARTCARD_FLAG_NE) != RESET) && (tmp2 != RESET)) { __HAL_SMARTCARD_CLEAR_NEFLAG(hsc); @@ -860,7 +838,7 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc) } tmp2 = __HAL_SMARTCARD_GET_IT_SOURCE(hsc, SMARTCARD_IT_ERR); - /* SMARTCARD Over-Run interrupt occured ------------------------------------*/ + /* SMARTCARD Over-Run interrupt occurred ------------------------------------*/ if(((tmp1 & SMARTCARD_FLAG_ORE) != RESET) && (tmp2 != RESET)) { __HAL_SMARTCARD_CLEAR_OREFLAG(hsc); @@ -880,6 +858,13 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc) { SMARTCARD_Transmit_IT(hsc); } + + tmp2 = __HAL_SMARTCARD_GET_IT_SOURCE(hsc, SMARTCARD_IT_TC); + /* SMARTCARD in mode Transmitter (transmission end) ------------------------*/ + if(((tmp1 & SMARTCARD_FLAG_TC) != RESET) && (tmp2 != RESET)) + { + SMARTCARD_EndTransmit_IT(hsc); + } /* Call the Error call Back in case of Errors */ if(hsc->ErrorCode != HAL_SMARTCARD_ERROR_NONE) @@ -933,7 +918,7 @@ __weak void HAL_SMARTCARD_RxCpltCallback(SMARTCARD_HandleTypeDef *hsc) * @} */ -/** @defgroup SMARTCARD_Group3 Peripheral State and Errors functions +/** @defgroup SMARTCARD_Exported_Functions_Group3 Peripheral State and Errors functions * @brief SMARTCARD State and Errors functions * @verbatim @@ -943,7 +928,7 @@ __weak void HAL_SMARTCARD_RxCpltCallback(SMARTCARD_HandleTypeDef *hsc) [..] This subsection provides a set of functions allowing to control the SmartCard. (+) HAL_SMARTCARD_GetState() API can be helpful to check in run-time the state of the SmartCard peripheral. - (+) HAL_SMARTCARD_GetError() check in run-time errors that could be occured durung communication. + (+) HAL_SMARTCARD_GetError() check in run-time errors that could be occurred during communication. @endverbatim * @{ */ @@ -990,27 +975,8 @@ static void SMARTCARD_DMATransmitCplt(DMA_HandleTypeDef *hdma) in the USART CR3 register */ hsc->Instance->CR3 &= (uint32_t)~((uint32_t)USART_CR3_DMAT); - /* Wait for SMARTCARD TC Flag */ - if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_TC, RESET, SMARTCARD_TIMEOUT_VALUE) != HAL_OK) - { - /* Timeout Occured */ - hsc->State = HAL_SMARTCARD_STATE_TIMEOUT; - HAL_SMARTCARD_ErrorCallback(hsc); - } - else - { - /* No Timeout */ - /* Check if a non-blocking receive process is ongoing or not */ - if(hsc->State == HAL_SMARTCARD_STATE_BUSY_TX_RX) - { - hsc->State = HAL_SMARTCARD_STATE_BUSY_RX; - } - else - { - hsc->State = HAL_SMARTCARD_STATE_READY; - } - HAL_SMARTCARD_TxCpltCallback(hsc); - } + /* Enable the SMARTCARD Transmit Complete Interrupt */ + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_TC); } /** @@ -1086,8 +1052,8 @@ static HAL_StatusTypeDef SMARTCARD_WaitOnFlagUntilTimeout(SMARTCARD_HandleTypeDe if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) { /* Disable TXE and RXNE interrupts for the interrupt process */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_TXE); - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_RXNE); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_TXE); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_RXNE); hsc->State= HAL_SMARTCARD_STATE_READY; @@ -1109,8 +1075,8 @@ static HAL_StatusTypeDef SMARTCARD_WaitOnFlagUntilTimeout(SMARTCARD_HandleTypeDe if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) { /* Disable TXE and RXNE interrupts for the interrupt process */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_TXE); - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_RXNE); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_TXE); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_RXNE); hsc->State= HAL_SMARTCARD_STATE_READY; @@ -1139,63 +1105,56 @@ static HAL_StatusTypeDef SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsc) tmp1 = hsc->State; if((tmp1 == HAL_SMARTCARD_STATE_BUSY_TX) || (tmp1 == HAL_SMARTCARD_STATE_BUSY_TX_RX)) { - if(hsc->Init.WordLength == SMARTCARD_WORDLENGTH_9B) - { - tmp = (uint16_t*) hsc->pTxBuffPtr; - hsc->Instance->DR = (uint16_t)(*tmp & (uint16_t)0x01FF); - if(hsc->Init.Parity == SMARTCARD_PARITY_NONE) - { - hsc->pTxBuffPtr += 2; - } - else - { - hsc->pTxBuffPtr += 1; - } - } - else - { - hsc->Instance->DR = (uint8_t)(*hsc->pTxBuffPtr++ & (uint8_t)0x00FF); - } + tmp = (uint16_t*) hsc->pTxBuffPtr; + hsc->Instance->DR = (uint16_t)(*tmp & (uint16_t)0x01FF); + hsc->pTxBuffPtr += 1; if(--hsc->TxXferCount == 0) { /* Disable the SMARTCARD Transmit data register empty Interrupt */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_TXE); - - /* Disable the SMARTCARD Parity Error Interrupt */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_PE); - - /* Disable the SMARTCARD Error Interrupt: (Frame error, noise error, overrun error) */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_ERR); - - if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_TC, RESET, SMARTCARD_TIMEOUT_VALUE) != HAL_OK) - { - return HAL_TIMEOUT; - } - - /* Check if a non-blocking receive process is ongoing or not */ - if(hsc->State == HAL_SMARTCARD_STATE_BUSY_TX_RX) - { - hsc->State = HAL_SMARTCARD_STATE_BUSY_RX; - } - else - { - hsc->State = HAL_SMARTCARD_STATE_READY; - } - - HAL_SMARTCARD_TxCpltCallback(hsc); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_TXE); - return HAL_OK; + /* Enable the SMARTCARD Transmit Complete Interrupt */ + __HAL_SMARTCARD_ENABLE_IT(hsc, SMARTCARD_IT_TC); } return HAL_OK; } else { - return HAL_BUSY; + return HAL_BUSY; } } +/** + * @brief Wraps up transmission in non blocking mode. + * @param hsmartcard: pointer to a SMARTCARD_HandleTypeDef structure that contains + * the configuration information for the specified SMARTCARD module. + * @retval HAL status + */ +static HAL_StatusTypeDef SMARTCARD_EndTransmit_IT(SMARTCARD_HandleTypeDef *hsmartcard) +{ + /* Disable the SMARTCARD Transmit Complete Interrupt */ + __HAL_SMARTCARD_DISABLE_IT(hsmartcard, SMARTCARD_IT_TC); + + /* Check if a receive process is ongoing or not */ + if(hsmartcard->State == HAL_SMARTCARD_STATE_BUSY_TX_RX) + { + hsmartcard->State = HAL_SMARTCARD_STATE_BUSY_RX; + } + else + { + /* Disable the SMARTCARD Error Interrupt: (Frame error, noise error, overrun error) */ + __HAL_SMARTCARD_DISABLE_IT(hsmartcard, SMARTCARD_IT_ERR); + + hsmartcard->State = HAL_SMARTCARD_STATE_READY; + } + + HAL_SMARTCARD_TxCpltCallback(hsmartcard); + + return HAL_OK; +} + /** * @brief Receive an amount of data in non blocking mode * @param hsc: pointer to a SMARTCARD_HandleTypeDef structure that contains @@ -1210,41 +1169,19 @@ static HAL_StatusTypeDef SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsc) tmp1 = hsc->State; if((tmp1 == HAL_SMARTCARD_STATE_BUSY_RX) || (tmp1 == HAL_SMARTCARD_STATE_BUSY_TX_RX)) { - if(hsc->Init.WordLength == SMARTCARD_WORDLENGTH_9B) - { - tmp = (uint16_t*) hsc->pRxBuffPtr; - if(hsc->Init.Parity == SMARTCARD_PARITY_NONE) - { - *tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x01FF); - hsc->pRxBuffPtr += 2; - } - else - { - *tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x00FF); - hsc->pRxBuffPtr += 1; - } - } - else - { - if(hsc->Init.Parity == SMARTCARD_PARITY_NONE) - { - *hsc->pRxBuffPtr++ = (uint8_t)(hsc->Instance->DR & (uint8_t)0x00FF); - } - else - { - *hsc->pRxBuffPtr++ = (uint8_t)(hsc->Instance->DR & (uint8_t)0x007F); - } - } + tmp = (uint16_t*) hsc->pRxBuffPtr; + *tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x00FF); + hsc->pRxBuffPtr += 1; if(--hsc->RxXferCount == 0) { - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_RXNE); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_RXNE); /* Disable the SMARTCARD Parity Error Interrupt */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_PE); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_PE); /* Disable the SMARTCARD Error Interrupt: (Frame error, noise error, overrun error) */ - __SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_ERR); + __HAL_SMARTCARD_DISABLE_IT(hsc, SMARTCARD_IT_ERR); /* Check if a non-blocking transmit process is ongoing or not */ if(hsc->State == HAL_SMARTCARD_STATE_BUSY_TX_RX) @@ -1342,11 +1279,11 @@ static void SMARTCARD_SetConfig(SMARTCARD_HandleTypeDef *hsc) /*-------------------------- USART BRR Configuration -----------------------*/ if((hsc->Instance == USART1) || (hsc->Instance == USART6)) { - hsc->Instance->BRR = __SMARTCARD_BRR(HAL_RCC_GetPCLK2Freq(), hsc->Init.BaudRate); + hsc->Instance->BRR = SMARTCARD_BRR(HAL_RCC_GetPCLK2Freq(), hsc->Init.BaudRate); } else { - hsc->Instance->BRR = __SMARTCARD_BRR(HAL_RCC_GetPCLK1Freq(), hsc->Init.BaudRate); + hsc->Instance->BRR = SMARTCARD_BRR(HAL_RCC_GetPCLK1Freq(), hsc->Init.BaudRate); } } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.h index 0ba94214e0d..4c46967f0bd 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_smartcard.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_smartcard.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SMARTCARD HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,7 +54,11 @@ * @{ */ -/* Exported types ------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup SMARTCARD_Exported_Types SMARTCARD Exported Types + * @{ + */ + /** * @brief SMARTCARD Init Structure definition */ @@ -78,7 +82,7 @@ typedef struct the word length is set to 9 data bits; 8th bit when the word length is set to 8 data bits).*/ - uint32_t Mode; /*!< Specifies wether the Receive or Transmit mode is enabled or disabled. + uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled. This parameter can be a value of @ref SMARTCARD_Mode */ uint32_t CLKPolarity; /*!< Specifies the steady state of the serial clock. @@ -91,11 +95,13 @@ typedef struct data bit (MSB) has to be output on the SCLK pin in synchronous mode. This parameter can be a value of @ref SMARTCARD_Last_Bit */ - uint32_t Prescaler; /*!< Specifies the SmartCard Prescaler. - This parameter must be a number between Min_Data = 0 and Max_Data = 255 */ - - uint32_t GuardTime; /*!< Specifies the SmartCard Guard Time. - This parameter must be a number between Min_Data = 0 and Max_Data = 255 */ + uint32_t Prescaler; /*!< Specifies the SmartCard Prescaler value used for dividing the system clock + to provide the smartcard clock + This parameter can be a value of @ref SMARTCARD_Prescaler */ + + uint32_t GuardTime; /*!< Specifies the SmartCard Guard Time value in terms of number of baud clocks + The value given in the register (5 significant bits) is multiplied by 2 + to give the division factor of the source clock frequency */ uint32_t NACKState; /*!< Specifies the SmartCard NACK Transmission state. This parameter can be a value of @ref SmartCard_NACK_State */ @@ -116,19 +122,6 @@ typedef enum HAL_SMARTCARD_STATE_ERROR = 0x04 /*!< Error */ }HAL_SMARTCARD_StateTypeDef; -/** - * @brief HAL SMARTCARD Error Code structure definition - */ -typedef enum -{ - HAL_SMARTCARD_ERROR_NONE = 0x00, /*!< No error */ - HAL_SMARTCARD_ERROR_PE = 0x01, /*!< Parity error */ - HAL_SMARTCARD_ERROR_NE = 0x02, /*!< Noise error */ - HAL_SMARTCARD_ERROR_FE = 0x04, /*!< frame error */ - HAL_SMARTCARD_ERROR_ORE = 0x08, /*!< Overrun error */ - HAL_SMARTCARD_ERROR_DMA = 0x10 /*!< DMA transfer error */ -}HAL_SMARTCARD_ErrorTypeDef; - /** * @brief SMARTCARD handle Structure definition */ @@ -136,7 +129,7 @@ typedef struct { USART_TypeDef *Instance; /* USART registers base address */ - SMARTCARD_InitTypeDef Init; /* SmartCard communication parameters */ + SMARTCARD_InitTypeDef Init; /* SmartCard communication parameters */ uint8_t *pTxBuffPtr; /* Pointer to SmartCard Tx transfer Buffer */ @@ -154,127 +147,160 @@ typedef struct DMA_HandleTypeDef *hdmarx; /* SmartCard Rx DMA Handle parameters */ - HAL_LockTypeDef Lock; /* Locking object */ + HAL_LockTypeDef Lock; /* Locking object */ - __IO HAL_SMARTCARD_StateTypeDef State; /* SmartCard communication state */ + __IO HAL_SMARTCARD_StateTypeDef State; /* SmartCard communication state */ + + __IO uint32_t ErrorCode; /* SmartCard Error code */ - __IO HAL_SMARTCARD_ErrorTypeDef ErrorCode; /* SMARTCARD Error code */ }SMARTCARD_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup SMARTCARD_Exported_Constants +/** @defgroup SMARTCARD_Exported_Constants SMARTCARD Exported constants + * @{ + */ +/** @defgroup SMARTCARD_Error_Code SMARTCARD Error Code + * @brief SMARTCARD Error Code * @{ + */ +#define HAL_SMARTCARD_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_SMARTCARD_ERROR_PE ((uint32_t)0x00000001) /*!< Parity error */ +#define HAL_SMARTCARD_ERROR_NE ((uint32_t)0x00000002) /*!< Noise error */ +#define HAL_SMARTCARD_ERROR_FE ((uint32_t)0x00000004) /*!< Frame error */ +#define HAL_SMARTCARD_ERROR_ORE ((uint32_t)0x00000008) /*!< Overrun error */ +#define HAL_SMARTCARD_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ +/** + * @} */ -/** @defgroup SMARTCARD_Word_Length +/** @defgroup SMARTCARD_Word_Length SMARTCARD Word Length * @{ */ -#define SMARTCARD_WORDLENGTH_8B ((uint32_t)0x00000000) #define SMARTCARD_WORDLENGTH_9B ((uint32_t)USART_CR1_M) -#define IS_SMARTCARD_WORD_LENGTH(LENGTH) (((LENGTH) == SMARTCARD_WORDLENGTH_8B) || \ - ((LENGTH) == SMARTCARD_WORDLENGTH_9B)) /** * @} */ -/** @defgroup SMARTCARD_Stop_Bits +/** @defgroup SMARTCARD_Stop_Bits SMARTCARD Number of Stop Bits * @{ */ -#define SMARTCARD_STOPBITS_1 ((uint32_t)0x00000000) #define SMARTCARD_STOPBITS_0_5 ((uint32_t)USART_CR2_STOP_0) -#define SMARTCARD_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) #define SMARTCARD_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1)) -#define IS_SMARTCARD_STOPBITS(STOPBITS) (((STOPBITS) == SMARTCARD_STOPBITS_1) || \ - ((STOPBITS) == SMARTCARD_STOPBITS_0_5) || \ - ((STOPBITS) == SMARTCARD_STOPBITS_1_5) || \ - ((STOPBITS) == SMARTCARD_STOPBITS_2)) /** * @} */ -/** @defgroup SMARTCARD_Parity +/** @defgroup SMARTCARD_Parity SMARTCARD Parity * @{ */ -#define SMARTCARD_PARITY_NONE ((uint32_t)0x00000000) #define SMARTCARD_PARITY_EVEN ((uint32_t)USART_CR1_PCE) #define SMARTCARD_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) -#define IS_SMARTCARD_PARITY(PARITY) (((PARITY) == SMARTCARD_PARITY_NONE) || \ - ((PARITY) == SMARTCARD_PARITY_EVEN) || \ - ((PARITY) == SMARTCARD_PARITY_ODD)) /** * @} */ -/** @defgroup SMARTCARD_Mode +/** @defgroup SMARTCARD_Mode SMARTCARD Mode * @{ */ #define SMARTCARD_MODE_RX ((uint32_t)USART_CR1_RE) #define SMARTCARD_MODE_TX ((uint32_t)USART_CR1_TE) #define SMARTCARD_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE)) -#define IS_SMARTCARD_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) /** * @} */ -/** @defgroup SMARTCARD_Clock_Polarity +/** @defgroup SMARTCARD_Clock_Polarity SMARTCARD Clock Polarity * @{ */ #define SMARTCARD_POLARITY_LOW ((uint32_t)0x00000000) #define SMARTCARD_POLARITY_HIGH ((uint32_t)USART_CR2_CPOL) -#define IS_SMARTCARD_POLARITY(CPOL) (((CPOL) == SMARTCARD_POLARITY_LOW) || ((CPOL) == SMARTCARD_POLARITY_HIGH)) /** * @} */ -/** @defgroup SMARTCARD_Clock_Phase +/** @defgroup SMARTCARD_Clock_Phase SMARTCARD Clock Phase * @{ */ #define SMARTCARD_PHASE_1EDGE ((uint32_t)0x00000000) #define SMARTCARD_PHASE_2EDGE ((uint32_t)USART_CR2_CPHA) -#define IS_SMARTCARD_PHASE(CPHA) (((CPHA) == SMARTCARD_PHASE_1EDGE) || ((CPHA) == SMARTCARD_PHASE_2EDGE)) /** * @} */ -/** @defgroup SMARTCARD_Last_Bit +/** @defgroup SMARTCARD_Last_Bit SMARTCARD Last Bit * @{ */ #define SMARTCARD_LASTBIT_DISABLE ((uint32_t)0x00000000) #define SMARTCARD_LASTBIT_ENABLE ((uint32_t)USART_CR2_LBCL) -#define IS_SMARTCARD_LASTBIT(LASTBIT) (((LASTBIT) == SMARTCARD_LASTBIT_DISABLE) || \ - ((LASTBIT) == SMARTCARD_LASTBIT_ENABLE)) /** * @} */ -/** @defgroup SmartCard_NACK_State +/** @defgroup SmartCard_NACK_State SMARTCARD NACK State * @{ */ -#define SMARTCARD_NACK_ENABLED ((uint32_t)USART_CR3_NACK) -#define SMARTCARD_NACK_DISABLED ((uint32_t)0x00000000) -#define IS_SMARTCARD_NACK_STATE(NACK) (((NACK) == SMARTCARD_NACK_ENABLED) || \ - ((NACK) == SMARTCARD_NACK_DISABLED)) +#define SMARTCARD_NACK_ENABLE ((uint32_t)USART_CR3_NACK) +#define SMARTCARD_NACK_DISABLE ((uint32_t)0x00000000) /** * @} */ -/** @defgroup SmartCard_DMA_Requests +/** @defgroup SmartCard_DMA_Requests SMARTCARD DMA requests * @{ */ - #define SMARTCARD_DMAREQ_TX ((uint32_t)USART_CR3_DMAT) #define SMARTCARD_DMAREQ_RX ((uint32_t)USART_CR3_DMAR) +/** + * @} + */ +/** @defgroup SMARTCARD_Prescaler SMARTCARD Prescaler + * @{ + */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV2 ((uint32_t)0x00000001) /*!< SYSCLK divided by 2 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV4 ((uint32_t)0x00000002) /*!< SYSCLK divided by 4 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV6 ((uint32_t)0x00000003) /*!< SYSCLK divided by 6 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV8 ((uint32_t)0x00000004) /*!< SYSCLK divided by 8 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV10 ((uint32_t)0x00000005) /*!< SYSCLK divided by 10 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV12 ((uint32_t)0x00000006) /*!< SYSCLK divided by 12 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV14 ((uint32_t)0x00000007) /*!< SYSCLK divided by 14 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV16 ((uint32_t)0x00000008) /*!< SYSCLK divided by 16 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV18 ((uint32_t)0x00000009) /*!< SYSCLK divided by 18 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV20 ((uint32_t)0x0000000A) /*!< SYSCLK divided by 20 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV22 ((uint32_t)0x0000000B) /*!< SYSCLK divided by 22 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV24 ((uint32_t)0x0000000C) /*!< SYSCLK divided by 24 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV26 ((uint32_t)0x0000000D) /*!< SYSCLK divided by 26 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV28 ((uint32_t)0x0000000E) /*!< SYSCLK divided by 28 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV30 ((uint32_t)0x0000000F) /*!< SYSCLK divided by 30 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV32 ((uint32_t)0x00000010) /*!< SYSCLK divided by 32 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV34 ((uint32_t)0x00000011) /*!< SYSCLK divided by 34 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV36 ((uint32_t)0x00000012) /*!< SYSCLK divided by 36 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV38 ((uint32_t)0x00000013) /*!< SYSCLK divided by 38 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV40 ((uint32_t)0x00000014) /*!< SYSCLK divided by 40 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV42 ((uint32_t)0x00000015) /*!< SYSCLK divided by 42 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV44 ((uint32_t)0x00000016) /*!< SYSCLK divided by 44 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV46 ((uint32_t)0x00000017) /*!< SYSCLK divided by 46 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV48 ((uint32_t)0x00000018) /*!< SYSCLK divided by 48 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV50 ((uint32_t)0x00000019) /*!< SYSCLK divided by 50 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV52 ((uint32_t)0x0000001A) /*!< SYSCLK divided by 52 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV54 ((uint32_t)0x0000001B) /*!< SYSCLK divided by 54 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV56 ((uint32_t)0x0000001C) /*!< SYSCLK divided by 56 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV58 ((uint32_t)0x0000001D) /*!< SYSCLK divided by 58 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV60 ((uint32_t)0x0000001E) /*!< SYSCLK divided by 60 */ +#define SMARTCARD_PRESCALER_SYSCLK_DIV62 ((uint32_t)0x0000001F) /*!< SYSCLK divided by 62 */ /** * @} */ -/** @defgroup SmartCard_Flags +/** @defgroup SmartCard_Flags SMARTCARD Flags * Elements values convention: 0xXXXX * - 0xXXXX : Flag mask in the SR register * @{ */ - #define SMARTCARD_FLAG_TXE ((uint32_t)0x00000080) #define SMARTCARD_FLAG_TC ((uint32_t)0x00000040) #define SMARTCARD_FLAG_RXNE ((uint32_t)0x00000020) @@ -287,23 +313,20 @@ typedef struct * @} */ -/** @defgroup SmartCard_Interrupt_definition +/** @defgroup SmartCard_Interrupt_definition SMARTCARD Interrupts Definition * Elements values convention: 0xY000XXXX * - XXXX : Interrupt mask in the XX register * - Y : Interrupt source register (2bits) * - 01: CR1 register * - 10: CR3 register - - * * @{ */ -#define SMARTCARD_IT_PE ((uint32_t)0x10000100) -#define SMARTCARD_IT_TXE ((uint32_t)0x10000080) -#define SMARTCARD_IT_TC ((uint32_t)0x10000040) -#define SMARTCARD_IT_RXNE ((uint32_t)0x10000020) -#define SMARTCARD_IT_IDLE ((uint32_t)0x10000010) -#define SMARTCARD_IT_ERR ((uint32_t)0x20000001) - +#define SMARTCARD_IT_PE ((uint32_t)(SMARTCARD_CR1_REG_INDEX << 28 | USART_CR1_PEIE)) +#define SMARTCARD_IT_TXE ((uint32_t)(SMARTCARD_CR1_REG_INDEX << 28 | USART_CR1_TXEIE)) +#define SMARTCARD_IT_TC ((uint32_t)(SMARTCARD_CR1_REG_INDEX << 28 | USART_CR1_TCIE)) +#define SMARTCARD_IT_RXNE ((uint32_t)(SMARTCARD_CR1_REG_INDEX << 28 | USART_CR1_RXNEIE)) +#define SMARTCARD_IT_IDLE ((uint32_t)(SMARTCARD_CR1_REG_INDEX << 28 | USART_CR1_IDLEIE)) +#define SMARTCARD_IT_ERR ((uint32_t)(SMARTCARD_CR3_REG_INDEX << 28 | USART_CR3_EIE)) /** * @} */ @@ -313,6 +336,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup SMARTCARD_Exported_Macros SMARTCARD Exported Macros + * @{ + */ /** @brief Reset SMARTCARD handle state * @param __HANDLE__: specifies the SMARTCARD Handle. @@ -333,7 +359,7 @@ typedef struct * @arg SMARTCARD_FLAG_TC: Transmission Complete flag * @arg SMARTCARD_FLAG_RXNE: Receive data register not empty flag * @arg SMARTCARD_FLAG_IDLE: Idle Line detection flag - * @arg SMARTCARD_FLAG_ORE: OverRun Error flag + * @arg SMARTCARD_FLAG_ORE: Overrun Error flag * @arg SMARTCARD_FLAG_NE: Noise Error flag * @arg SMARTCARD_FLAG_FE: Framing Error flag * @arg SMARTCARD_FLAG_PE: Parity Error flag @@ -348,7 +374,7 @@ typedef struct * @arg SMARTCARD_FLAG_TC: Transmission Complete flag. * @arg SMARTCARD_FLAG_RXNE: Receive data register not empty flag. * - * @note PE (Parity error), FE (Framing error), NE (Noise error) and ORE (OverRun + * @note PE (Parity error), FE (Framing error), NE (Noise error) and ORE (Overrun * error) flags are cleared by software sequence: a read operation to * USART_SR register followed by a read operation to USART_DR register. * @note RXNE flag can be also cleared by a read to the USART_DR register. @@ -364,8 +390,14 @@ typedef struct * UART peripheral. * @retval None */ -#define __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR;\ - (__HANDLE__)->Instance->DR;}while(0) +#define __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + tmpreg = (__HANDLE__)->Instance->DR; \ + UNUSED(tmpreg); \ + } while(0) + /** @brief Clear the SMARTCARD FE pending flag. * @param __HANDLE__: specifies the USART Handle. * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or @@ -410,11 +442,10 @@ typedef struct * @arg SMARTCARD_IT_PE: Parity Error interrupt * @arg SMARTCARD_IT_ERR: Error interrupt(Frame error, noise error, overrun error) */ -#define SMARTCARD_IT_MASK ((uint32_t)0x0000FFFF) -#define __SMARTCARD_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & SMARTCARD_IT_MASK)): \ - ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & SMARTCARD_IT_MASK))) -#define __SMARTCARD_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & SMARTCARD_IT_MASK)): \ - ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & SMARTCARD_IT_MASK))) +#define __HAL_SMARTCARD_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & SMARTCARD_IT_MASK)): \ + ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & SMARTCARD_IT_MASK))) +#define __HAL_SMARTCARD_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & SMARTCARD_IT_MASK)): \ + ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & SMARTCARD_IT_MASK))) /** @brief Checks whether the specified SmartCard interrupt has occurred or not. * @param __HANDLE__: specifies the SmartCard Handle. @@ -430,11 +461,31 @@ typedef struct */ #define __HAL_SMARTCARD_GET_IT_SOURCE(__HANDLE__, __IT__) (((((__IT__) >> 28) == 1)? (__HANDLE__)->Instance->CR1: (__HANDLE__)->Instance->CR3) & (((uint32_t)(__IT__)) & SMARTCARD_IT_MASK)) -/** @brief Macros to enable or disable the SmartCard interface. - * @param __HANDLE__: specifies the SmartCard Handle. +/** @brief Macro to enable the SMARTCARD's one bit sample method + * @param __HANDLE__: specifies the SMARTCARD Handle. + * @retval None + */ +#define __HAL_SMARTCARD_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) + +/** @brief Macro to disable the SMARTCARD's one bit sample method + * @param __HANDLE__: specifies the SMARTCARD Handle. + * @retval None + */ +#define __HAL_SMARTCARD_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT)) + +/** @brief Enable the USART associated to the SMARTCARD Handle + * @param __HANDLE__: specifies the SMARTCARD Handle. + * SMARTCARD Handle selects the USARTx peripheral (USART availability and x value depending on device). + * @retval None */ -#define __SMARTCARD_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) -#define __SMARTCARD_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) +#define __HAL_SMARTCARD_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) + +/** @brief Disable the USART associated to the SMARTCARD Handle + * @param __HANDLE__: specifies the SMARTCARD Handle. + * SMARTCARD Handle selects the USARTx peripheral (USART availability and x value depending on device). + * @retval None + */ +#define __HAL_SMARTCARD_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) /** @brief Macros to enable or disable the SmartCard DMA request. * @param __HANDLE__: specifies the SmartCard Handle. @@ -443,23 +494,34 @@ typedef struct * @arg SMARTCARD_DMAREQ_TX: SmartCard DMA transmit request * @arg SMARTCARD_DMAREQ_RX: SmartCard DMA receive request */ -#define __SMARTCARD_DMA_REQUEST_ENABLE(__HANDLE__, __REQUEST__) ((__HANDLE__)->Instance->CR3 |= (__REQUEST__)) -#define __SMARTCARD_DMA_REQUEST_DISABLE(__HANDLE__, __REQUEST__) ((__HANDLE__)->Instance->CR3 &= ~(__REQUEST__)) +#define __HAL_SMARTCARD_DMA_REQUEST_ENABLE(__HANDLE__, __REQUEST__) ((__HANDLE__)->Instance->CR3 |= (__REQUEST__)) +#define __HAL_SMARTCARD_DMA_REQUEST_DISABLE(__HANDLE__, __REQUEST__) ((__HANDLE__)->Instance->CR3 &= ~(__REQUEST__)) -#define __DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) -#define __DIVMANT(_PCLK_, _BAUD_) (__DIV((_PCLK_), (_BAUD_))/100) -#define __DIVFRAQ(_PCLK_, _BAUD_) (((__DIV((_PCLK_), (_BAUD_)) - (__DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) -#define __SMARTCARD_BRR(_PCLK_, _BAUD_) ((__DIVMANT((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) - -#define IS_SMARTCARD_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup SMARTCARD_Exported_Functions + * @{ + */ + +/** @addtogroup SMARTCARD_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_SMARTCARD_Init(SMARTCARD_HandleTypeDef *hsc); HAL_StatusTypeDef HAL_SMARTCARD_ReInit(SMARTCARD_HandleTypeDef *hsc); HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc); void HAL_SMARTCARD_MspInit(SMARTCARD_HandleTypeDef *hsc); void HAL_SMARTCARD_MspDeInit(SMARTCARD_HandleTypeDef *hsc); +/** + * @} + */ + +/** @addtogroup SMARTCARD_Exported_Functions_Group2 + * @{ + */ /* IO operation functions *******************************************************/ HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size, uint32_t Timeout); @@ -471,19 +533,84 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc); void HAL_SMARTCARD_TxCpltCallback(SMARTCARD_HandleTypeDef *hsc); void HAL_SMARTCARD_RxCpltCallback(SMARTCARD_HandleTypeDef *hsc); void HAL_SMARTCARD_ErrorCallback(SMARTCARD_HandleTypeDef *hsc); +/** + * @} + */ +/** @addtogroup SMARTCARD_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions **************************************************/ HAL_SMARTCARD_StateTypeDef HAL_SMARTCARD_GetState(SMARTCARD_HandleTypeDef *hsc); -uint32_t HAL_SMARTCARD_GetError(SMARTCARD_HandleTypeDef *hsc); +uint32_t HAL_SMARTCARD_GetError(SMARTCARD_HandleTypeDef *hsc); /** * @} */ +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup SMARTCARD_Private_Constants SMARTCARD Private Constants + * @{ + */ + +/** @brief SMARTCARD interruptions flag mask + * + */ +#define SMARTCARD_IT_MASK ((uint32_t) USART_CR1_PEIE | USART_CR1_TXEIE | USART_CR1_TCIE | USART_CR1_RXNEIE | \ + USART_CR1_IDLEIE | USART_CR3_EIE ) +#define SMARTCARD_DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) +#define SMARTCARD_DIVMANT(_PCLK_, _BAUD_) (SMARTCARD_DIV((_PCLK_), (_BAUD_))/100) +#define SMARTCARD_DIVFRAQ(_PCLK_, _BAUD_) (((SMARTCARD_DIV((_PCLK_), (_BAUD_)) - (SMARTCARD_DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) +#define SMARTCARD_BRR(_PCLK_, _BAUD_) ((SMARTCARD_DIVMANT((_PCLK_), (_BAUD_)) << 4)|(SMARTCARD_DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) + +#define SMARTCARD_CR1_REG_INDEX 1 +#define SMARTCARD_CR3_REG_INDEX 3 +/** + * @} + */ + +/* Private macros --------------------------------------------------------*/ +/** @defgroup SMARTCARD_Private_Macros SMARTCARD Private Macros + * @{ + */ +#define IS_SMARTCARD_WORD_LENGTH(LENGTH) ((LENGTH) == SMARTCARD_WORDLENGTH_9B) +#define IS_SMARTCARD_STOPBITS(STOPBITS) (((STOPBITS) == SMARTCARD_STOPBITS_0_5) || \ + ((STOPBITS) == SMARTCARD_STOPBITS_1_5)) +#define IS_SMARTCARD_PARITY(PARITY) (((PARITY) == SMARTCARD_PARITY_EVEN) || \ + ((PARITY) == SMARTCARD_PARITY_ODD)) +#define IS_SMARTCARD_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) +#define IS_SMARTCARD_POLARITY(CPOL) (((CPOL) == SMARTCARD_POLARITY_LOW) || ((CPOL) == SMARTCARD_POLARITY_HIGH)) +#define IS_SMARTCARD_PHASE(CPHA) (((CPHA) == SMARTCARD_PHASE_1EDGE) || ((CPHA) == SMARTCARD_PHASE_2EDGE)) +#define IS_SMARTCARD_LASTBIT(LASTBIT) (((LASTBIT) == SMARTCARD_LASTBIT_DISABLE) || \ + ((LASTBIT) == SMARTCARD_LASTBIT_ENABLE)) +#define IS_SMARTCARD_NACK_STATE(NACK) (((NACK) == SMARTCARD_NACK_ENABLE) || \ + ((NACK) == SMARTCARD_NACK_DISABLE)) +#define IS_SMARTCARD_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup SMARTCARD_Private_Functions SMARTCARD Private Functions + * @{ + */ + /** * @} */ +/** + * @} + */ + +/** + * @} + */ #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.c new file mode 100644 index 00000000000..578bc58543f --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.c @@ -0,0 +1,1210 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_spdifrx.c + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief This file provides firmware functions to manage the following + * functionalities of the SPDIFRX audio interface: + * + Initialization and Configuration + * + Data transfers functions + * + DMA transfers management + * + Interrupts and flags management + @verbatim + =============================================================================== + ##### How to use this driver ##### + =============================================================================== + [..] + The SPDIFRX HAL driver can be used as follow: + + (#) Declare SPDIFRX_HandleTypeDef handle structure. + (#) Initialize the SPDIFRX low level resources by implement the HAL_SPDIFRX_MspInit() API: + (##) Enable the SPDIFRX interface clock. + (##) SPDIFRX pins configuration: + (+++) Enable the clock for the SPDIFRX GPIOs. + (+++) Configure these SPDIFRX pins as alternate function pull-up. + (##) NVIC configuration if you need to use interrupt process (HAL_SPDIFRX_ReceiveControlFlow_IT() and HAL_SPDIFRX_ReceiveDataFlow_IT() API's). + (+++) Configure the SPDIFRX interrupt priority. + (+++) Enable the NVIC SPDIFRX IRQ handle. + (##) DMA Configuration if you need to use DMA process (HAL_SPDIFRX_ReceiveDataFlow_DMA() and HAL_SPDIFRX_ReceiveControlFlow_DMA() API's). + (+++) Declare a DMA handle structure for the reception of the Data Flow channel. + (+++) Declare a DMA handle structure for the reception of the Control Flow channel. + (+++) Enable the DMAx interface clock. + (+++) Configure the declared DMA handle structure CtrlRx/DataRx with the required parameters. + (+++) Configure the DMA Channel. + (+++) Associate the initialized DMA handle to the SPDIFRX DMA CtrlRx/DataRx handle. + (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the + DMA CtrlRx/DataRx channel. + + (#) Program the input selection, re-tries number, wait for activity, channel status selection, data format, stereo mode and masking of user bits + using HAL_SPDIFRX_Init() function. + + -@- The specific SPDIFRX interrupts (RXNE/CSRNE and Error Interrupts) will be managed using the macros + __SPDIFRX_ENABLE_IT() and __SPDIFRX_DISABLE_IT() inside the receive process. + -@- Make sure that ck_spdif clock is configured. + + (#) Three operation modes are available within this driver : + + *** Polling mode for reception operation (for debug purpose) *** + ================================================================ + [..] + (+) Receive data flow in blocking mode using HAL_SPDIFRX_ReceiveDataFlow() + (+) Receive control flow of data in blocking mode using HAL_SPDIFRX_ReceiveControlFlow() + + *** Interrupt mode for reception operation *** + ========================================= + [..] + (+) Receive an amount of data (Data Flow) in non blocking mode using HAL_SPDIFRX_ReceiveDataFlow_IT() + (+) Receive an amount of data (Control Flow) in non blocking mode using HAL_SPDIFRX_ReceiveControlFlow_IT() + (+) At reception end of half transfer HAL_SPDIFRX_RxHalfCpltCallback is executed and user can + add his own code by customization of function pointer HAL_SPDIFRX_RxHalfCpltCallback + (+) At reception end of transfer HAL_SPDIFRX_RxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_SPDIFRX_RxCpltCallback + (+) In case of transfer Error, HAL_SPDIFRX_ErrorCallback() function is executed and user can + add his own code by customization of function pointer HAL_SPDIFRX_ErrorCallback + + *** DMA mode for reception operation *** + ======================================== + [..] + (+) Receive an amount of data (Data Flow) in non blocking mode (DMA) using HAL_SPDIFRX_ReceiveDataFlow_DMA() + (+) Receive an amount of data (Control Flow) in non blocking mode (DMA) using HAL_SPDIFRX_ReceiveControlFlow_DMA() + (+) At reception end of half transfer HAL_SPDIFRX_RxHalfCpltCallback is executed and user can + add his own code by customization of function pointer HAL_SPDIFRX_RxHalfCpltCallback + (+) At reception end of transfer HAL_SPDIFRX_RxCpltCallback is executed and user can + add his own code by customization of function pointer HAL_SPDIFRX_RxCpltCallback + (+) In case of transfer Error, HAL_SPDIFRX_ErrorCallback() function is executed and user can + add his own code by customization of function pointer HAL_SPDIFRX_ErrorCallback + (+) Stop the DMA Transfer using HAL_SPDIFRX_DMAStop() + + *** SPDIFRX HAL driver macros list *** + ============================================= + [..] + Below the list of most used macros in USART HAL driver. + (+) __HAL_SPDIFRX_IDLE: Disable the specified SPDIFRX peripheral (IDEL State) + (+) __HAL_SPDIFRX_SYNC: Enable the synchronization state of the specified SPDIFRX peripheral (SYNC State) + (+) __HAL_SPDIFRX_RCV: Enable the receive state of the specified SPDIFRX peripheral (RCV State) + (+) __HAL_SPDIFRX_ENABLE_IT : Enable the specified SPDIFRX interrupts + (+) __HAL_SPDIFRX_DISABLE_IT : Disable the specified SPDIFRX interrupts + (+) __HAL_SPDIFRX_GET_FLAG: Check whether the specified SPDIFRX flag is set or not. + + [..] + (@) You can refer to the SPDIFRX HAL driver header file for more useful macros + + @endverbatim + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ +/** @defgroup SPDIFRX SPDIFRX + * @brief SPDIFRX HAL module driver + * @{ + */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + +#if defined(STM32F446xx) + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +#define SPDIFRX_TIMEOUT_VALUE 0xFFFF + +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @addtogroup SPDIFRX_Private_Functions + * @{ + */ +static void SPDIFRX_DMARxCplt(DMA_HandleTypeDef *hdma); +static void SPDIFRX_DMARxHalfCplt(DMA_HandleTypeDef *hdma); +static void SPDIFRX_DMACxCplt(DMA_HandleTypeDef *hdma); +static void SPDIFRX_DMACxHalfCplt(DMA_HandleTypeDef *hdma); +static void SPDIFRX_DMAError(DMA_HandleTypeDef *hdma); +static void SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif); +static void SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif); +static HAL_StatusTypeDef SPDIFRX_WaitOnFlagUntilTimeout(SPDIFRX_HandleTypeDef *hspdif, uint32_t Flag, FlagStatus Status, uint32_t Timeout); +/** + * @} + */ +/* Exported functions ---------------------------------------------------------*/ + +/** @defgroup SPDIFRX_Exported_Functions SPDIFRX Exported Functions + * @{ + */ + +/** @defgroup SPDIFRX_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * + @verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] This subsection provides a set of functions allowing to initialize and + de-initialize the SPDIFRX peripheral: + + (+) User must Implement HAL_SPDIFRX_MspInit() function in which he configures + all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ). + + (+) Call the function HAL_SPDIFRX_Init() to configure the SPDIFRX peripheral with + the selected configuration: + (++) Input Selection (IN0, IN1,...) + (++) Maximum allowed re-tries during synchronization phase + (++) Wait for activity on SPDIF selected input + (++) Channel status selection (from channel A or B) + (++) Data format (LSB, MSB, ...) + (++) Stereo mode + (++) User bits masking (PT,C,U,V,...) + + (+) Call the function HAL_SPDIFRX_DeInit() to restore the default configuration + of the selected SPDIFRXx peripheral. + @endverbatim + * @{ + */ + +/** + * @brief Initializes the SPDIFRX according to the specified parameters + * in the SPDIFRX_InitTypeDef and create the associated handle. + * @param hspdif: SPDIFRX handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_Init(SPDIFRX_HandleTypeDef *hspdif) +{ + uint32_t tmpreg = 0; + + /* Check the SPDIFRX handle allocation */ + if(hspdif == NULL) + { + return HAL_ERROR; + } + + /* Check the SPDIFRX parameters */ + assert_param(IS_STEREO_MODE(hspdif->Init.StereoMode)); + assert_param(IS_SPDIFRX_INPUT_SELECT(hspdif->Init.InputSelection)); + assert_param(IS_SPDIFRX_MAX_RETRIES(hspdif->Init.Retries)); + assert_param(IS_SPDIFRX_WAIT_FOR_ACTIVITY(hspdif->Init.WaitForActivity)); + assert_param(IS_SPDIFRX_CHANNEL(hspdif->Init.ChannelSelection)); + assert_param(IS_SPDIFRX_DATA_FORMAT(hspdif->Init.DataFormat)); + assert_param(IS_PREAMBLE_TYPE_MASK(hspdif->Init.PreambleTypeMask)); + assert_param(IS_CHANNEL_STATUS_MASK(hspdif->Init.ChannelStatusMask)); + assert_param(IS_VALIDITY_MASK(hspdif->Init.ValidityBitMask)); + assert_param(IS_PARITY_ERROR_MASK(hspdif->Init.ParityErrorMask)); + + if(hspdif->State == HAL_SPDIFRX_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hspdif->Lock = HAL_UNLOCKED; + /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ + HAL_SPDIFRX_MspInit(hspdif); + } + + /* SPDIFRX peripheral state is BUSY*/ + hspdif->State = HAL_SPDIFRX_STATE_BUSY; + + /* Disable SPDIFRX interface (IDLE State) */ + __HAL_SPDIFRX_IDLE(hspdif); + + /* Reset the old SPDIFRX CR configuration */ + tmpreg = hspdif->Instance->CR; + + tmpreg &= ~((uint16_t) SPDIFRX_CR_RXSTEO | SPDIFRX_CR_DRFMT | SPDIFRX_CR_PMSK | + SPDIFRX_CR_VMSK | SPDIFRX_CR_CUMSK | SPDIFRX_CR_PTMSK | + SPDIFRX_CR_CHSEL | SPDIFRX_CR_NBTR | SPDIFRX_CR_WFA | + SPDIFRX_CR_INSEL); + + /* Sets the new configuration of the SPDIFRX peripheral */ + tmpreg |= ((uint16_t) hspdif->Init.StereoMode | + hspdif->Init.InputSelection | + hspdif->Init.Retries | + hspdif->Init.WaitForActivity | + hspdif->Init.ChannelSelection | + hspdif->Init.DataFormat | + hspdif->Init.PreambleTypeMask | + hspdif->Init.ChannelStatusMask | + hspdif->Init.ValidityBitMask | + hspdif->Init.ParityErrorMask); + + hspdif->Instance->CR = tmpreg; + + hspdif->ErrorCode = HAL_SPDIFRX_ERROR_NONE; + + /* SPDIFRX peripheral state is READY*/ + hspdif->State = HAL_SPDIFRX_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the SPDIFRX peripheral + * @param hspdif: SPDIFRX handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_DeInit(SPDIFRX_HandleTypeDef *hspdif) +{ + /* Check the SPDIFRX handle allocation */ + if(hspdif == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_SPDIFRX_ALL_INSTANCE(hspdif->Instance)); + + hspdif->State = HAL_SPDIFRX_STATE_BUSY; + + /* Disable SPDIFRX interface (IDLE state) */ + __HAL_SPDIFRX_IDLE(hspdif); + + /* DeInit the low level hardware: GPIO, CLOCK, NVIC... */ + HAL_SPDIFRX_MspDeInit(hspdif); + + hspdif->ErrorCode = HAL_SPDIFRX_ERROR_NONE; + + /* SPDIFRX peripheral state is RESET*/ + hspdif->State = HAL_SPDIFRX_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(hspdif); + + return HAL_OK; +} + +/** + * @brief SPDIFRX MSP Init + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_MspInit(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_MspInit could be implemented in the user file + */ +} + +/** + * @brief SPDIFRX MSP DeInit + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_MspDeInit(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Sets the SPDIFRX dtat format according to the specified parameters + * in the SPDIFRX_InitTypeDef. + * @param hspdif: SPDIFRX handle + * @param sDataFormat: SPDIFRX data format + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_SetDataFormat(SPDIFRX_HandleTypeDef *hspdif, SPDIFRX_SetDataFormatTypeDef sDataFormat) +{ + uint32_t tmpreg = 0; + + /* Check the SPDIFRX handle allocation */ + if(hspdif == NULL) + { + return HAL_ERROR; + } + + /* Check the SPDIFRX parameters */ + assert_param(IS_STEREO_MODE(sDataFormat.StereoMode)); + assert_param(IS_SPDIFRX_DATA_FORMAT(sDataFormat.DataFormat)); + assert_param(IS_PREAMBLE_TYPE_MASK(sDataFormat.PreambleTypeMask)); + assert_param(IS_CHANNEL_STATUS_MASK(sDataFormat.ChannelStatusMask)); + assert_param(IS_VALIDITY_MASK(sDataFormat.ValidityBitMask)); + assert_param(IS_PARITY_ERROR_MASK(sDataFormat.ParityErrorMask)); + + /* Reset the old SPDIFRX CR configuration */ + tmpreg = hspdif->Instance->CR; + + if(((tmpreg & SPDIFRX_STATE_RCV) == SPDIFRX_STATE_RCV) && + (((tmpreg & SPDIFRX_CR_DRFMT) != sDataFormat.DataFormat) || + ((tmpreg & SPDIFRX_CR_RXSTEO) != sDataFormat.StereoMode))) + { + return HAL_ERROR; + } + + tmpreg &= ~((uint16_t) SPDIFRX_CR_RXSTEO | SPDIFRX_CR_DRFMT | SPDIFRX_CR_PMSK | + SPDIFRX_CR_VMSK | SPDIFRX_CR_CUMSK | SPDIFRX_CR_PTMSK); + + /* Sets the new configuration of the SPDIFRX peripheral */ + tmpreg |= ((uint16_t) sDataFormat.StereoMode | + sDataFormat.DataFormat | + sDataFormat.PreambleTypeMask | + sDataFormat.ChannelStatusMask | + sDataFormat.ValidityBitMask | + sDataFormat.ParityErrorMask); + + hspdif->Instance->CR = tmpreg; + + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup SPDIFRX_Exported_Functions_Group2 IO operation functions + * @brief Data transfers functions + * +@verbatim +=============================================================================== +##### IO operation functions ##### +=============================================================================== + [..] + This subsection provides a set of functions allowing to manage the SPDIFRX data + transfers. + + (#) There is two mode of transfer: + (++) Blocking mode : The communication is performed in the polling mode. + The status of all data processing is returned by the same function + after finishing transfer. + (++) No-Blocking mode : The communication is performed using Interrupts + or DMA. These functions return the status of the transfer start-up. + The end of the data processing will be indicated through the + dedicated SPDIFRX IRQ when using Interrupt mode or the DMA IRQ when + using DMA mode. + + (#) Blocking mode functions are : + (++) HAL_SPDIFRX_ReceiveDataFlow() + (++) HAL_SPDIFRX_ReceiveControlFlow() + (+@) Do not use blocking mode to receive both control and data flow at the same time. + + (#) No-Blocking mode functions with Interrupt are : + (++) HAL_SPDIFRX_ReceiveControlFlow_IT() + (++) HAL_SPDIFRX_ReceiveDataFlow_IT() + + (#) No-Blocking mode functions with DMA are : + (++) HAL_SPDIFRX_ReceiveControlFlow_DMA() + (++) HAL_SPDIFRX_ReceiveDataFlow_DMA() + + (#) A set of Transfer Complete Callbacks are provided in No_Blocking mode: + (++) HAL_SPDIFRX_RxCpltCallback() + (++) HAL_SPDIFRX_ErrorCallback() + +@endverbatim + * @{ + */ + +/** + * @brief Receives an amount of data (Data Flow) in blocking mode. + * @param hspdif: pointer to SPDIFRX_HandleTypeDef structure that contains + * the configuration information for SPDIFRX module. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be received + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout) +{ + + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + if(hspdif->State == HAL_SPDIFRX_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hspdif); + + hspdif->State = HAL_SPDIFRX_STATE_BUSY; + + /* Start synchronisation */ + __HAL_SPDIFRX_SYNC(hspdif); + + /* Wait until SYNCD flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_SYNCD, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Start reception */ + __HAL_SPDIFRX_RCV(hspdif); + + /* Receive data flow */ + while(Size > 0) + { + /* Wait until RXNE flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_RXNE, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + (*pData++) = hspdif->Instance->DR; + Size--; + } + + /* SPDIFRX ready */ + hspdif->State = HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receives an amount of data (Control Flow) in blocking mode. + * @param hspdif: pointer to a SPDIFRX_HandleTypeDef structure that contains + * the configuration information for SPDIFRX module. + * @param pData: Pointer to data buffer + * @param Size: Amount of data to be received + * @param Timeout: Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout) +{ + + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + if(hspdif->State == HAL_SPDIFRX_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hspdif); + + hspdif->State = HAL_SPDIFRX_STATE_BUSY; + + /* Start synchronization */ + __HAL_SPDIFRX_SYNC(hspdif); + + /* Wait until SYNCD flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_SYNCD, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Start reception */ + __HAL_SPDIFRX_RCV(hspdif); + + /* Receive control flow */ + while(Size > 0) + { + /* Wait until CSRNE flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_CSRNE, RESET, Timeout) != HAL_OK) + { + return HAL_TIMEOUT; + } + + (*pData++) = hspdif->Instance->CSR; + Size--; + } + + /* SPDIFRX ready */ + hspdif->State = HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @brief Receive an amount of data (Data Flow) in non-blocking mode with Interrupt + * @param hspdif: SPDIFRX handle + * @param pData: a 32-bit pointer to the Receive data buffer. + * @param Size: number of data sample to be received . + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size) +{ + if((hspdif->State == HAL_SPDIFRX_STATE_READY) || (hspdif->State == HAL_SPDIFRX_STATE_BUSY_CX)) + { + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hspdif); + + hspdif->pRxBuffPtr = pData; + hspdif->RxXferSize = Size; + hspdif->RxXferCount = Size; + + hspdif->ErrorCode = HAL_SPDIFRX_ERROR_NONE; + + /* Check if a receive process is ongoing or not */ + hspdif->State = HAL_SPDIFRX_STATE_BUSY_RX; + + + /* Enable the SPDIFRX PE Error Interrupt */ + __HAL_SPDIFRX_ENABLE_IT(hspdif, SPDIFRX_IT_PERRIE); + + /* Enable the SPDIFRX OVR Error Interrupt */ + __HAL_SPDIFRX_ENABLE_IT(hspdif, SPDIFRX_IT_OVRIE); + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + /* Enable the SPDIFRX RXNE interrupt */ + __HAL_SPDIFRX_ENABLE_IT(hspdif, SPDIFRX_IT_RXNE); + + if ((SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != SPDIFRX_STATE_SYNC || (SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != 0x00) + { + /* Start synchronization */ + __HAL_SPDIFRX_SYNC(hspdif); + + /* Wait until SYNCD flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_SYNCD, RESET, SPDIFRX_TIMEOUT_VALUE) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Start reception */ + __HAL_SPDIFRX_RCV(hspdif); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data (Control Flow) with Interrupt + * @param hspdif: SPDIFRX handle + * @param pData: a 32-bit pointer to the Receive data buffer. + * @param Size: number of data sample (Control Flow) to be received : + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size) +{ + if((hspdif->State == HAL_SPDIFRX_STATE_READY) || (hspdif->State == HAL_SPDIFRX_STATE_BUSY_RX)) + { + if((pData == NULL ) || (Size == 0)) + { + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hspdif); + + hspdif->pCsBuffPtr = pData; + hspdif->CsXferSize = Size; + hspdif->CsXferCount = Size; + + hspdif->ErrorCode = HAL_SPDIFRX_ERROR_NONE; + + /* Check if a receive process is ongoing or not */ + hspdif->State = HAL_SPDIFRX_STATE_BUSY_CX; + + + /* Enable the SPDIFRX PE Error Interrupt */ + __HAL_SPDIFRX_ENABLE_IT(hspdif, SPDIFRX_IT_PERRIE); + + /* Enable the SPDIFRX OVR Error Interrupt */ + __HAL_SPDIFRX_ENABLE_IT(hspdif, SPDIFRX_IT_OVRIE); + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + /* Enable the SPDIFRX CSRNE interrupt */ + __HAL_SPDIFRX_ENABLE_IT(hspdif, SPDIFRX_IT_CSRNE); + + if ((SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != SPDIFRX_STATE_SYNC || (SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != 0x00) + { + /* Start synchronization */ + __HAL_SPDIFRX_SYNC(hspdif); + + /* Wait until SYNCD flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_SYNCD, RESET, SPDIFRX_TIMEOUT_VALUE) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Start reception */ + __HAL_SPDIFRX_RCV(hspdif); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data (Data Flow) mode with DMA + * @param hspdif: SPDIFRX handle + * @param pData: a 32-bit pointer to the Receive data buffer. + * @param Size: number of data sample to be received : + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size) +{ + + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if((hspdif->State == HAL_SPDIFRX_STATE_READY) || (hspdif->State == HAL_SPDIFRX_STATE_BUSY_CX)) + { + hspdif->pRxBuffPtr = pData; + hspdif->RxXferSize = Size; + hspdif->RxXferCount = Size; + + /* Process Locked */ + __HAL_LOCK(hspdif); + + hspdif->ErrorCode = HAL_SPDIFRX_ERROR_NONE; + hspdif->State = HAL_SPDIFRX_STATE_BUSY_RX; + + /* Set the SPDIFRX Rx DMA Half transfer complete callback */ + hspdif->hdmaDrRx->XferHalfCpltCallback = SPDIFRX_DMARxHalfCplt; + + /* Set the SPDIFRX Rx DMA transfer complete callback */ + hspdif->hdmaDrRx->XferCpltCallback = SPDIFRX_DMARxCplt; + + /* Set the DMA error callback */ + hspdif->hdmaDrRx->XferErrorCallback = SPDIFRX_DMAError; + + /* Enable the DMA request */ + HAL_DMA_Start_IT(hspdif->hdmaDrRx, (uint32_t)&hspdif->Instance->DR, (uint32_t)hspdif->pRxBuffPtr, Size); + + /* Enable RXDMAEN bit in SPDIFRX CR register for data flow reception*/ + hspdif->Instance->CR |= SPDIFRX_CR_RXDMAEN; + + if ((SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != SPDIFRX_STATE_SYNC || (SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != 0x00) + { + /* Start synchronization */ + __HAL_SPDIFRX_SYNC(hspdif); + + /* Wait until SYNCD flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_SYNCD, RESET, SPDIFRX_TIMEOUT_VALUE) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Start reception */ + __HAL_SPDIFRX_RCV(hspdif); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data (Control Flow) with DMA + * @param hspdif: SPDIFRX handle + * @param pData: a 32-bit pointer to the Receive data buffer. + * @param Size: number of data (Control Flow) sample to be received : + * @retval HAL status + */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size) +{ + if((pData == NULL) || (Size == 0)) + { + return HAL_ERROR; + } + + if((hspdif->State == HAL_SPDIFRX_STATE_READY) || (hspdif->State == HAL_SPDIFRX_STATE_BUSY_RX)) + { + hspdif->pCsBuffPtr = pData; + hspdif->CsXferSize = Size; + hspdif->CsXferCount = Size; + + /* Process Locked */ + __HAL_LOCK(hspdif); + + hspdif->ErrorCode = HAL_SPDIFRX_ERROR_NONE; + hspdif->State = HAL_SPDIFRX_STATE_BUSY_CX; + + /* Set the SPDIFRX Rx DMA Half transfer complete callback */ + hspdif->hdmaCsRx->XferHalfCpltCallback = SPDIFRX_DMACxHalfCplt; + + /* Set the SPDIFRX Rx DMA transfer complete callback */ + hspdif->hdmaCsRx->XferCpltCallback = SPDIFRX_DMACxCplt; + + /* Set the DMA error callback */ + hspdif->hdmaCsRx->XferErrorCallback = SPDIFRX_DMAError; + + /* Enable the DMA request */ + HAL_DMA_Start_IT(hspdif->hdmaCsRx, (uint32_t)&hspdif->Instance->CSR, (uint32_t)hspdif->pCsBuffPtr, Size); + + /* Enable CBDMAEN bit in SPDIFRX CR register for control flow reception*/ + hspdif->Instance->CR |= SPDIFRX_CR_CBDMAEN; + + if ((SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != SPDIFRX_STATE_SYNC || (SPDIFRX->CR & SPDIFRX_CR_SPDIFEN) != 0x00) + { + /* Start synchronization */ + __HAL_SPDIFRX_SYNC(hspdif); + + /* Wait until SYNCD flag is set */ + if(SPDIFRX_WaitOnFlagUntilTimeout(hspdif, SPDIFRX_FLAG_SYNCD, RESET, SPDIFRX_TIMEOUT_VALUE) != HAL_OK) + { + return HAL_TIMEOUT; + } + + /* Start reception */ + __HAL_SPDIFRX_RCV(hspdif); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief stop the audio stream receive from the Media. + * @param hspdif: SPDIFRX handle + * @retval None + */ +HAL_StatusTypeDef HAL_SPDIFRX_DMAStop(SPDIFRX_HandleTypeDef *hspdif) +{ + /* Process Locked */ + __HAL_LOCK(hspdif); + + /* Disable the SPDIFRX DMA requests */ + hspdif->Instance->CR &= (uint16_t)(~SPDIFRX_CR_RXDMAEN); + hspdif->Instance->CR &= (uint16_t)(~SPDIFRX_CR_CBDMAEN); + + /* Disable the SPDIFRX DMA channel */ + __HAL_DMA_DISABLE(hspdif->hdmaDrRx); + __HAL_DMA_DISABLE(hspdif->hdmaCsRx); + + /* Disable SPDIFRX peripheral */ + __HAL_SPDIFRX_IDLE(hspdif); + + hspdif->State = HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_OK; +} + +/** + * @brief This function handles SPDIFRX interrupt request. + * @param hspdif: SPDIFRX handle + * @retval HAL status + */ +void HAL_SPDIFRX_IRQHandler(SPDIFRX_HandleTypeDef *hspdif) +{ + /* SPDIFRX in mode Data Flow Reception ------------------------------------------------*/ + if((__HAL_SPDIFRX_GET_FLAG(hspdif, SPDIFRX_FLAG_RXNE) != RESET) && (__HAL_SPDIFRX_GET_IT_SOURCE(hspdif, SPDIFRX_IT_RXNE) != RESET)) + { + __HAL_SPDIFRX_CLEAR_IT(hspdif, SPDIFRX_IT_RXNE); + SPDIFRX_ReceiveDataFlow_IT(hspdif); + } + + /* SPDIFRX in mode Control Flow Reception ------------------------------------------------*/ + if((__HAL_SPDIFRX_GET_FLAG(hspdif, SPDIFRX_FLAG_CSRNE) != RESET) && (__HAL_SPDIFRX_GET_IT_SOURCE(hspdif, SPDIFRX_IT_CSRNE) != RESET)) + { + __HAL_SPDIFRX_CLEAR_IT(hspdif, SPDIFRX_IT_CSRNE); + SPDIFRX_ReceiveControlFlow_IT(hspdif); + } + + /* SPDIFRX Overrun error interrupt occurred ---------------------------------*/ + if((__HAL_SPDIFRX_GET_FLAG(hspdif, SPDIFRX_FLAG_OVR) != RESET) && (__HAL_SPDIFRX_GET_IT_SOURCE(hspdif, SPDIFRX_IT_OVRIE) != RESET)) + { + __HAL_SPDIFRX_CLEAR_IT(hspdif, SPDIFRX_FLAG_OVR); + + /* Change the SPDIFRX error code */ + hspdif->ErrorCode |= HAL_SPDIFRX_ERROR_OVR; + + /* the transfer is not stopped */ + HAL_SPDIFRX_ErrorCallback(hspdif); + } + + /* SPDIFRX Parity error interrupt occurred ---------------------------------*/ + if((__HAL_SPDIFRX_GET_FLAG(hspdif, SPDIFRX_FLAG_PERR) != RESET) && (__HAL_SPDIFRX_GET_IT_SOURCE(hspdif, SPDIFRX_IT_PERRIE) != RESET)) + { + __HAL_SPDIFRX_CLEAR_IT(hspdif, SPDIFRX_FLAG_PERR); + + /* Change the SPDIFRX error code */ + hspdif->ErrorCode |= HAL_SPDIFRX_ERROR_PE; + + /* the transfer is not stopped */ + HAL_SPDIFRX_ErrorCallback(hspdif); + } + +} + +/** + * @brief Rx Transfer (Data flow) half completed callbacks + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_RxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_RxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Rx Transfer (Data flow) completed callbacks + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_RxCpltCallback(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_RxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Rx (Control flow) Transfer half completed callbacks + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_CxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_RxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Rx Transfer (Control flow) completed callbacks + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_CxCpltCallback(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_RxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief SPDIFRX error callbacks + * @param hspdif: SPDIFRX handle + * @retval None + */ +__weak void HAL_SPDIFRX_ErrorCallback(SPDIFRX_HandleTypeDef *hspdif) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SPDIFRX_ErrorCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup SPDIFRX_Exported_Functions_Group3 Peripheral State and Errors functions + * @brief Peripheral State functions + * +@verbatim +=============================================================================== +##### Peripheral State and Errors functions ##### +=============================================================================== +[..] +This subsection permit to get in run-time the status of the peripheral +and the data flow. + +@endverbatim + * @{ + */ + +/** + * @brief Return the SPDIFRX state + * @param hspdif : SPDIFRX handle + * @retval HAL state + */ +HAL_SPDIFRX_StateTypeDef HAL_SPDIFRX_GetState(SPDIFRX_HandleTypeDef *hspdif) +{ + return hspdif->State; +} + +/** + * @brief Return the SPDIFRX error code + * @param hspdif : SPDIFRX handle + * @retval SPDIFRX Error Code + */ +uint32_t HAL_SPDIFRX_GetError(SPDIFRX_HandleTypeDef *hspdif) +{ + return hspdif->ErrorCode; +} + +/** + * @} + */ + +/** + * @brief DMA SPDIFRX receive process (Data flow) complete callback + * @param hdma : DMA handle + * @retval None + */ +static void SPDIFRX_DMARxCplt(DMA_HandleTypeDef *hdma) +{ + SPDIFRX_HandleTypeDef* hspdif = ( SPDIFRX_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Disable Rx DMA Request */ + hspdif->Instance->CR &= (uint16_t)(~SPDIFRX_CR_RXDMAEN); + hspdif->RxXferCount = 0; + + hspdif->State = HAL_SPDIFRX_STATE_READY; + HAL_SPDIFRX_RxCpltCallback(hspdif); +} + +/** + * @brief DMA SPDIFRX receive process (Data flow) half complete callback + * @param hdma : DMA handle + * @retval None + */ +static void SPDIFRX_DMARxHalfCplt(DMA_HandleTypeDef *hdma) +{ + SPDIFRX_HandleTypeDef* hspdif = (SPDIFRX_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + HAL_SPDIFRX_RxHalfCpltCallback(hspdif); +} + + +/** + * @brief DMA SPDIFRX receive process (Control flow) complete callback + * @param hdma : DMA handle + * @retval None + */ +static void SPDIFRX_DMACxCplt(DMA_HandleTypeDef *hdma) +{ + SPDIFRX_HandleTypeDef* hspdif = ( SPDIFRX_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Disable Cb DMA Request */ + hspdif->Instance->CR &= (uint16_t)(~SPDIFRX_CR_CBDMAEN); + hspdif->CsXferCount = 0; + + hspdif->State = HAL_SPDIFRX_STATE_READY; + HAL_SPDIFRX_CxCpltCallback(hspdif); +} + +/** + * @brief DMA SPDIFRX receive process (Control flow) half complete callback + * @param hdma : DMA handle + * @retval None + */ +static void SPDIFRX_DMACxHalfCplt(DMA_HandleTypeDef *hdma) +{ + SPDIFRX_HandleTypeDef* hspdif = (SPDIFRX_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; + + HAL_SPDIFRX_CxHalfCpltCallback(hspdif); +} + +/** + * @brief DMA SPDIFRX communication error callback + * @param hdma : DMA handle + * @retval None + */ +static void SPDIFRX_DMAError(DMA_HandleTypeDef *hdma) +{ + SPDIFRX_HandleTypeDef* hspdif = ( SPDIFRX_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Disable Rx and Cb DMA Request */ + hspdif->Instance->CR &= (uint16_t)(~(SPDIFRX_CR_RXDMAEN | SPDIFRX_CR_CBDMAEN)); + hspdif->RxXferCount = 0; + + hspdif->State= HAL_SPDIFRX_STATE_READY; + + /* Set the error code and execute error callback*/ + hspdif->ErrorCode |= HAL_SPDIFRX_ERROR_DMA; + HAL_SPDIFRX_ErrorCallback(hspdif); +} + + +/** + * @brief Receive an amount of data (Data Flow) with Interrupt + * @param hspdif: SPDIFRX handle + * @retval None + */ +static void SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif) +{ + /* Receive data */ + (*hspdif->pRxBuffPtr++) = hspdif->Instance->DR; + hspdif->RxXferCount--; + + if(hspdif->RxXferCount == 0) + { + /* Disable RXNE/PE and OVR interrupts */ + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_OVRIE | SPDIFRX_IT_PERRIE | SPDIFRX_IT_RXNE); + + hspdif->State = HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + HAL_SPDIFRX_RxCpltCallback(hspdif); + } +} + +/** + * @brief Receive an amount of data (Control Flow) with Interrupt + * @param hspdif: SPDIFRX handle + * @retval None + */ +static void SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif) +{ + /* Receive data */ + (*hspdif->pCsBuffPtr++) = hspdif->Instance->CSR; + hspdif->CsXferCount--; + + if(hspdif->CsXferCount == 0) + { + /* Disable CSRNE interrupt */ + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_CSRNE); + + hspdif->State = HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + HAL_SPDIFRX_CxCpltCallback(hspdif); + } +} + +/** + * @brief This function handles SPDIFRX Communication Timeout. + * @param hspdif: SPDIFRX handle + * @param Flag: Flag checked + * @param Status: Value of the flag expected + * @param Timeout: Duration of the timeout + * @retval HAL status + */ +static HAL_StatusTypeDef SPDIFRX_WaitOnFlagUntilTimeout(SPDIFRX_HandleTypeDef *hspdif, uint32_t Flag, FlagStatus Status, uint32_t Timeout) +{ + uint32_t tickstart = 0; + + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Wait until flag is set */ + if(Status == RESET) + { + while(__HAL_SPDIFRX_GET_FLAG(hspdif, Flag) == RESET) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */ + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_RXNE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_CSRNE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_PERRIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_OVRIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_SBLKIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_SYNCDIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_IFEIE); + + hspdif->State= HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_TIMEOUT; + } + } + } + } + else + { + while(__HAL_SPDIFRX_GET_FLAG(hspdif, Flag) != RESET) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */ + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_RXNE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_CSRNE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_PERRIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_OVRIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_SBLKIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_SYNCDIE); + __HAL_SPDIFRX_DISABLE_IT(hspdif, SPDIFRX_IT_IFEIE); + + hspdif->State= HAL_SPDIFRX_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hspdif); + + return HAL_TIMEOUT; + } + } + } + } + return HAL_OK; +} + +/** + * @} + */ +#endif /* STM32F446xx */ + +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.h new file mode 100644 index 00000000000..03bbbcb0a59 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spdifrx.h @@ -0,0 +1,559 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_spdifrx.h + * @author MCD Application Team + * @version V1.3.0 + * @date 09-March-2015 + * @brief Header file of SPDIFRX HAL module. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_SPDIFRX_H +#define __STM32F4xx_HAL_SPDIFRX_H + +#ifdef __cplusplus + extern "C" { +#endif + +#if defined(STM32F446xx) + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal_def.h" + +/** @addtogroup STM32F4xx_HAL_Driver + * @{ + */ + +/** @addtogroup SPDIFRX + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup SPDIFRX_Exported_Types SPDIFRX Exported Types + * @{ + */ + +/** + * @brief SPDIFRX Init structure definition + */ +typedef struct +{ + uint32_t InputSelection; /*!< Specifies the SPDIF input selection. + This parameter can be a value of @ref SPDIFRX_Input_Selection */ + + uint32_t Retries; /*!< Specifies the Maximum allowed re-tries during synchronization phase. + This parameter can be a value of @ref SPDIFRX_Max_Retries */ + + uint32_t WaitForActivity; /*!< Specifies the wait for activity on SPDIF selected input. + This parameter can be a value of @ref SPDIFRX_Wait_For_Activity. */ + + uint32_t ChannelSelection; /*!< Specifies whether the control flow will take the channel status from channel A or B. + This parameter can be a value of @ref SPDIFRX_Channel_Selection */ + + uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...). + This parameter can be a value of @ref SPDIFRX_Data_Format */ + + uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode. + This parameter can be a value of @ref SPDIFRX_Stereo_Mode */ + + uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_PT_Mask */ + + uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */ + + uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_V_Mask */ + + uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_PE_Mask */ + +}SPDIFRX_InitTypeDef; + +/** + * @brief SPDIFRX SetDataFormat structure definition + */ +typedef struct +{ + uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...). + This parameter can be a value of @ref SPDIFRX_Data_Format */ + + uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode. + This parameter can be a value of @ref SPDIFRX_Stereo_Mode */ + + uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_PT_Mask */ + + uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */ + + uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_V_Mask */ + + uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame. + This parameter can be a value of @ref SPDIFRX_PE_Mask */ + +}SPDIFRX_SetDataFormatTypeDef; + +/** + * @brief HAL State structures definition + */ +typedef enum +{ + HAL_SPDIFRX_STATE_RESET = 0x00, /*!< SPDIFRX not yet initialized or disabled */ + HAL_SPDIFRX_STATE_READY = 0x01, /*!< SPDIFRX initialized and ready for use */ + HAL_SPDIFRX_STATE_BUSY = 0x02, /*!< SPDIFRX internal process is ongoing */ + HAL_SPDIFRX_STATE_BUSY_RX = 0x03, /*!< SPDIFRX internal Data Flow RX process is ongoing */ + HAL_SPDIFRX_STATE_BUSY_CX = 0x04, /*!< SPDIFRX internal Control Flow RX process is ongoing */ + HAL_SPDIFRX_STATE_ERROR = 0x07 /*!< SPDIFRX error state */ +}HAL_SPDIFRX_StateTypeDef; + +/** + * @brief SPDIFRX handle Structure definition + */ +typedef struct +{ + SPDIFRX_TypeDef *Instance; /* SPDIFRX registers base address */ + + SPDIFRX_InitTypeDef Init; /* SPDIFRX communication parameters */ + + uint32_t *pRxBuffPtr; /* Pointer to SPDIFRX Rx transfer buffer */ + + uint32_t *pCsBuffPtr; /* Pointer to SPDIFRX Cx transfer buffer */ + + __IO uint16_t RxXferSize; /* SPDIFRX Rx transfer size */ + + __IO uint16_t RxXferCount; /* SPDIFRX Rx transfer counter + (This field is initialized at the + same value as transfer size at the + beginning of the transfer and + decremented when a sample is received. + NbSamplesReceived = RxBufferSize-RxBufferCount) */ + + __IO uint16_t CsXferSize; /* SPDIFRX Rx transfer size */ + + __IO uint16_t CsXferCount; /* SPDIFRX Rx transfer counter + (This field is initialized at the + same value as transfer size at the + beginning of the transfer and + decremented when a sample is received. + NbSamplesReceived = RxBufferSize-RxBufferCount) */ + + DMA_HandleTypeDef *hdmaCsRx; /* SPDIFRX EC60958_channel_status and user_information DMA handle parameters */ + + DMA_HandleTypeDef *hdmaDrRx; /* SPDIFRX Rx DMA handle parameters */ + + __IO HAL_LockTypeDef Lock; /* SPDIFRX locking object */ + + __IO HAL_SPDIFRX_StateTypeDef State; /* SPDIFRX communication state */ + + __IO uint32_t ErrorCode; /* SPDIFRX Error code */ + +}SPDIFRX_HandleTypeDef; +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup SPDIFRX_Exported_Constants SPDIFRX Exported Constants + * @{ + */ +/** @defgroup SPDIFRX_ErrorCode SPDIFRX Error Code + * @{ + */ +#define HAL_SPDIFRX_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_SPDIFRX_ERROR_TIMEOUT ((uint32_t)0x00000001) /*!< Timeout error */ +#define HAL_SPDIFRX_ERROR_OVR ((uint32_t)0x00000002) /*!< OVR error */ +#define HAL_SPDIFRX_ERROR_PE ((uint32_t)0x00000004) /*!< Parity error */ +#define HAL_SPDIFRX_ERROR_DMA ((uint32_t)0x00000008) /*!< DMA transfer error */ +#define HAL_SPDIFRX_ERROR_UNKNOWN ((uint32_t)0x00000010) /*!< Unknown Error error */ +/** + * @} + */ + +/** @defgroup SPDIFRX_Input_Selection SPDIFRX Input Selection + * @{ + */ +#define SPDIFRX_INPUT_IN0 ((uint32_t)0x00000000) +#define SPDIFRX_INPUT_IN1 ((uint32_t)0x00010000) +#define SPDIFRX_INPUT_IN2 ((uint32_t)0x00020000) +#define SPDIFRX_INPUT_IN3 ((uint32_t)0x00030000) +/** + * @} + */ + +/** @defgroup SPDIFRX_Max_Retries SPDIFRX Maximum Retries + * @{ + */ +#define SPDIFRX_MAXRETRIES_NONE ((uint32_t)0x00000000) +#define SPDIFRX_MAXRETRIES_3 ((uint32_t)0x00001000) +#define SPDIFRX_MAXRETRIES_15 ((uint32_t)0x00002000) +#define SPDIFRX_MAXRETRIES_63 ((uint32_t)0x00003000) +/** + * @} + */ + +/** @defgroup SPDIFRX_Wait_For_Activity SPDIFRX Wait For Activity + * @{ + */ +#define SPDIFRX_WAITFORACTIVITY_OFF ((uint32_t)0x00000000) +#define SPDIFRX_WAITFORACTIVITY_ON ((uint32_t)SPDIFRX_CR_WFA) +/** + * @} + */ + +/** @defgroup SPDIFRX_PT_Mask SPDIFRX Preamble Type Mask +* @{ +*/ +#define SPDIFRX_PREAMBLETYPEMASK_OFF ((uint32_t)0x00000000) +#define SPDIFRX_PREAMBLETYPEMASK_ON ((uint32_t)SPDIFRX_CR_PTMSK) +/** + * @} + */ + +/** @defgroup SPDIFRX_ChannelStatus_Mask SPDIFRX Channel Status Mask +* @{ +*/ +#define SPDIFRX_CHANNELSTATUS_OFF ((uint32_t)0x00000000) /* The channel status and user bits are copied into the SPDIF_DR */ +#define SPDIFRX_CHANNELSTATUS_ON ((uint32_t)SPDIFRX_CR_CUMSK) /* The channel status and user bits are not copied into the SPDIF_DR, zeros are written instead*/ +/** + * @} + */ + +/** @defgroup SPDIFRX_V_Mask SPDIFRX Validity Mask +* @{ +*/ +#define SPDIFRX_VALIDITYMASK_OFF ((uint32_t)0x00000000) +#define SPDIFRX_VALIDITYMASK_ON ((uint32_t)SPDIFRX_CR_VMSK) +/** + * @} + */ + +/** @defgroup SPDIFRX_PE_Mask SPDIFRX Parity Error Mask +* @{ +*/ +#define SPDIFRX_PARITYERRORMASK_OFF ((uint32_t)0x00000000) +#define SPDIFRX_PARITYERRORMASK_ON ((uint32_t)SPDIFRX_CR_PMSK) +/** + * @} + */ + +/** @defgroup SPDIFRX_Channel_Selection SPDIFRX Channel Selection + * @{ + */ +#define SPDIFRX_CHANNEL_A ((uint32_t)0x00000000) +#define SPDIFRX_CHANNEL_B ((uint32_t)SPDIFRX_CR_CHSEL) +/** + * @} + */ + +/** @defgroup SPDIFRX_Data_Format SPDIFRX Data Format + * @{ + */ +#define SPDIFRX_DATAFORMAT_LSB ((uint32_t)0x00000000) +#define SPDIFRX_DATAFORMAT_MSB ((uint32_t)0x00000010) +#define SPDIFRX_DATAFORMAT_32BITS ((uint32_t)0x00000020) +/** + * @} + */ + +/** @defgroup SPDIFRX_Stereo_Mode SPDIFRX Stereo Mode + * @{ + */ +#define SPDIFRX_STEREOMODE_DISABLE ((uint32_t)0x00000000) +#define SPDIFRX_STEREOMODE_ENABLE ((uint32_t)SPDIFRX_CR_RXSTEO) +/** + * @} + */ + +/** @defgroup SPDIFRX_State SPDIFRX State + * @{ + */ + +#define SPDIFRX_STATE_IDLE ((uint32_t)0xFFFFFFFC) +#define SPDIFRX_STATE_SYNC ((uint32_t)0x00000001) +#define SPDIFRX_STATE_RCV ((uint32_t)SPDIFRX_CR_SPDIFEN) +/** + * @} + */ + +/** @defgroup SPDIFRX_Interrupts_Definition SPDIFRX Interrupts Definition + * @{ + */ +#define SPDIFRX_IT_RXNE ((uint32_t)SPDIFRX_IMR_RXNEIE) +#define SPDIFRX_IT_CSRNE ((uint32_t)SPDIFRX_IMR_CSRNEIE) +#define SPDIFRX_IT_PERRIE ((uint32_t)SPDIFRX_IMR_PERRIE) +#define SPDIFRX_IT_OVRIE ((uint32_t)SPDIFRX_IMR_OVRIE) +#define SPDIFRX_IT_SBLKIE ((uint32_t)SPDIFRX_IMR_SBLKIE) +#define SPDIFRX_IT_SYNCDIE ((uint32_t)SPDIFRX_IMR_SYNCDIE) +#define SPDIFRX_IT_IFEIE ((uint32_t)SPDIFRX_IMR_IFEIE ) +/** + * @} + */ + +/** @defgroup SPDIFRX_Flags_Definition SPDIFRX Flags Definition + * @{ + */ +#define SPDIFRX_FLAG_RXNE ((uint32_t)SPDIFRX_SR_RXNE) +#define SPDIFRX_FLAG_CSRNE ((uint32_t)SPDIFRX_SR_CSRNE) +#define SPDIFRX_FLAG_PERR ((uint32_t)SPDIFRX_SR_PERR) +#define SPDIFRX_FLAG_OVR ((uint32_t)SPDIFRX_SR_OVR) +#define SPDIFRX_FLAG_SBD ((uint32_t)SPDIFRX_SR_SBD) +#define SPDIFRX_FLAG_SYNCD ((uint32_t)SPDIFRX_SR_SYNCD) +#define SPDIFRX_FLAG_FERR ((uint32_t)SPDIFRX_SR_FERR) +#define SPDIFRX_FLAG_SERR ((uint32_t)SPDIFRX_SR_SERR) +#define SPDIFRX_FLAG_TERR ((uint32_t)SPDIFRX_SR_TERR) +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup SPDIFRX_Exported_macros SPDIFRX Exported Macros + * @{ + */ + +/** @brief Reset SPDIFRX handle state + * @param __HANDLE__: SPDIFRX handle. + * @retval None + */ +#define __HAL_SPDIFRX_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = (uint16_t)SPDIFRX_CR_SPDIFEN) + +/** @brief Disable the specified SPDIFRX peripheral (IDLE State). + * @param __HANDLE__: specifies the SPDIFRX Handle. + * @retval None + */ +#define __HAL_SPDIFRX_IDLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= SPDIFRX_STATE_IDLE) + +/** @brief Enable the specified SPDIFRX peripheral (SYNC State). + * @param __HANDLE__: specifies the SPDIFRX Handle. + * @retval None + */ +#define __HAL_SPDIFRX_SYNC(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_SYNC) + + +/** @brief Enable the specified SPDIFRX peripheral (RCV State). + * @param __HANDLE__: specifies the SPDIFRX Handle. + * @retval None + */ +#define __HAL_SPDIFRX_RCV(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_RCV) + + +/** @brief Enable or disable the specified SPDIFRX interrupts. + * @param __HANDLE__: specifies the SPDIFRX Handle. + * @param __INTERRUPT__: specifies the interrupt source to enable or disable. + * This parameter can be one of the following values: + * @arg SPDIFRX_IT_RXNE + * @arg SPDIFRX_IT_CSRNE + * @arg SPDIFRX_IT_PERRIE + * @arg SPDIFRX_IT_OVRIE + * @arg SPDIFRX_IT_SBLKIE + * @arg SPDIFRX_IT_SYNCDIE + * @arg SPDIFRX_IT_IFEIE + * @retval None + */ +#define __HAL_SPDIFRX_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__)) +#define __HAL_SPDIFRX_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR &= (uint16_t)(~(__INTERRUPT__))) + +/** @brief Checks if the specified SPDIFRX interrupt source is enabled or disabled. + * @param __HANDLE__: specifies the SPDIFRX Handle. + * @param __INTERRUPT__: specifies the SPDIFRX interrupt source to check. + * This parameter can be one of the following values: + * @arg SPDIFRX_IT_RXNE + * @arg SPDIFRX_IT_CSRNE + * @arg SPDIFRX_IT_PERRIE + * @arg SPDIFRX_IT_OVRIE + * @arg SPDIFRX_IT_SBLKIE + * @arg SPDIFRX_IT_SYNCDIE + * @arg SPDIFRX_IT_IFEIE + * @retval The new state of __IT__ (TRUE or FALSE). + */ +#define __HAL_SPDIFRX_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) + +/** @brief Checks whether the specified SPDIFRX flag is set or not. + * @param __HANDLE__: specifies the SPDIFRX Handle. + * @param __FLAG__: specifies the flag to check. + * This parameter can be one of the following values: + * @arg SPDIFRX_FLAG_RXNE + * @arg SPDIFRX_FLAG_CSRNE + * @arg SPDIFRX_FLAG_PERR + * @arg SPDIFRX_FLAG_OVR + * @arg SPDIFRX_FLAG_SBD + * @arg SPDIFRX_FLAG_SYNCD + * @arg SPDIFRX_FLAG_FERR + * @arg SPDIFRX_FLAG_SERR + * @arg SPDIFRX_FLAG_TERR + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_SPDIFRX_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) + +/** @brief Clears the specified SPDIFRX SR flag, in setting the proper IFCR register bit. + * @param __HANDLE__: specifies the USART Handle. + * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set + * to clear the corresponding interrupt + * This parameter can be one of the following values: + * @arg SPDIFRX_FLAG_PERR + * @arg SPDIFRX_FLAG_OVR + * @arg SPDIFRX_SR_SBD + * @arg SPDIFRX_SR_SYNCD + * @retval None + */ +#define __HAL_SPDIFRX_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->IFCR = (uint32_t)(__IT_CLEAR__)) + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup SPDIFRX_Exported_Functions + * @{ + */ + +/** @addtogroup SPDIFRX_Exported_Functions_Group1 + * @{ + */ +/* Initialization/de-initialization functions **********************************/ +HAL_StatusTypeDef HAL_SPDIFRX_Init(SPDIFRX_HandleTypeDef *hspdif); +HAL_StatusTypeDef HAL_SPDIFRX_DeInit (SPDIFRX_HandleTypeDef *hspdif); +void HAL_SPDIFRX_MspInit(SPDIFRX_HandleTypeDef *hspdif); +void HAL_SPDIFRX_MspDeInit(SPDIFRX_HandleTypeDef *hspdif); +HAL_StatusTypeDef HAL_SPDIFRX_SetDataFormat(SPDIFRX_HandleTypeDef *hspdif, SPDIFRX_SetDataFormatTypeDef sDataFormat); +/** + * @} + */ + +/** @addtogroup SPDIFRX_Exported_Functions_Group2 + * @{ + */ +/* I/O operation functions ***************************************************/ + /* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout); + + /* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); +void HAL_SPDIFRX_IRQHandler(SPDIFRX_HandleTypeDef *hspdif); + +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); + +HAL_StatusTypeDef HAL_SPDIFRX_DMAStop(SPDIFRX_HandleTypeDef *hspdif); + +/* Callbacks used in non blocking modes (Interrupt and DMA) *******************/ +void HAL_SPDIFRX_RxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif); +void HAL_SPDIFRX_RxCpltCallback(SPDIFRX_HandleTypeDef *hspdif); +void HAL_SPDIFRX_ErrorCallback(SPDIFRX_HandleTypeDef *hspdif); +void HAL_SPDIFRX_CxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif); +void HAL_SPDIFRX_CxCpltCallback(SPDIFRX_HandleTypeDef *hspdif); +/** + * @} + */ + +/** @addtogroup SPDIFRX_Exported_Functions_Group3 + * @{ + */ +/* Peripheral Control and State functions ************************************/ +HAL_SPDIFRX_StateTypeDef HAL_SPDIFRX_GetState(SPDIFRX_HandleTypeDef *hspdif); +uint32_t HAL_SPDIFRX_GetError(SPDIFRX_HandleTypeDef *hspdif); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup SPDIFRX_Private_Macros SPDIFRX Private Macros + * @{ + */ +#define IS_SPDIFRX_INPUT_SELECT(INPUT) (((INPUT) == SPDIFRX_INPUT_IN1) || \ + ((INPUT) == SPDIFRX_INPUT_IN2) || \ + ((INPUT) == SPDIFRX_INPUT_IN3) || \ + ((INPUT) == SPDIFRX_INPUT_IN0)) +#define IS_SPDIFRX_MAX_RETRIES(RET) (((RET) == SPDIFRX_MAXRETRIES_NONE) || \ + ((RET) == SPDIFRX_MAXRETRIES_3) || \ + ((RET) == SPDIFRX_MAXRETRIES_15) || \ + ((RET) == SPDIFRX_MAXRETRIES_63)) +#define IS_SPDIFRX_WAIT_FOR_ACTIVITY(VAL) (((VAL) == SPDIFRX_WAITFORACTIVITY_ON) || \ + ((VAL) == SPDIFRX_WAITFORACTIVITY_OFF)) +#define IS_PREAMBLE_TYPE_MASK(VAL) (((VAL) == SPDIFRX_PREAMBLETYPEMASK_ON) || \ + ((VAL) == SPDIFRX_PREAMBLETYPEMASK_OFF)) +#define IS_VALIDITY_MASK(VAL) (((VAL) == SPDIFRX_VALIDITYMASK_OFF) || \ + ((VAL) == SPDIFRX_VALIDITYMASK_ON)) +#define IS_PARITY_ERROR_MASK(VAL) (((VAL) == SPDIFRX_PARITYERRORMASK_OFF) || \ + ((VAL) == SPDIFRX_PARITYERRORMASK_ON)) +#define IS_SPDIFRX_CHANNEL(CHANNEL) (((CHANNEL) == SPDIFRX_CHANNEL_A) || \ + ((CHANNEL) == SPDIFRX_CHANNEL_B)) +#define IS_SPDIFRX_DATA_FORMAT(FORMAT) (((FORMAT) == SPDIFRX_DATAFORMAT_LSB) || \ + ((FORMAT) == SPDIFRX_DATAFORMAT_MSB) || \ + ((FORMAT) == SPDIFRX_DATAFORMAT_32BITS)) +#define IS_STEREO_MODE(MODE) (((MODE) == SPDIFRX_STEREOMODE_DISABLE) || \ + ((MODE) == SPDIFRX_STEREOMODE_ENABLE)) + +#define IS_CHANNEL_STATUS_MASK(VAL) (((VAL) == SPDIFRX_CHANNELSTATUS_ON) || \ + ((VAL) == SPDIFRX_CHANNELSTATUS_OFF)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup SPDIFRX_Private_Functions SPDIFRX Private Functions + * @{ + */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +#endif /* STM32F446xx */ + +#ifdef __cplusplus +} +#endif + + +#endif /* __STM32F4xx_HAL_SPDIFRX_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.c index 8ab5f2e6837..58765e99ec3 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_spi.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SPI HAL module driver. * * This file provides firmware functions to manage the following @@ -35,7 +35,7 @@ (+++) Enable the DMAx interface clock using (+++) Configure the DMA handle parameters (+++) Configure the DMA Tx or Rx Stream - (+++) Associate the initilalized hdma_tx handle to the hspi DMA Tx or Rx handle + (+++) Associate the initialized hdma_tx handle to the hspi DMA Tx or Rx handle (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx or Rx Stream (#) Program the Mode, Direction , Data size, Baudrate Prescaler, NSS @@ -43,7 +43,7 @@ (#) Initialize the SPI registers by calling the HAL_SPI_Init() API: (++) This API configures also the low level Hardware GPIO, CLOCK, CORTEX...etc) - by calling the customed HAL_SPI_MspInit() API. + by calling the customized HAL_SPI_MspInit() API. [..] Circular mode restriction: (#) The DMA circular mode cannot be used when the SPI is configured in these modes: @@ -59,7 +59,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -93,7 +93,7 @@ * @{ */ -/** @defgroup SPI +/** @defgroup SPI SPI * @brief SPI HAL module driver * @{ */ @@ -106,11 +106,15 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup SPI_Private_Functions + * @{ + */ static void SPI_TxCloseIRQHandler(SPI_HandleTypeDef *hspi); static void SPI_TxISR(SPI_HandleTypeDef *hspi); static void SPI_RxCloseIRQHandler(SPI_HandleTypeDef *hspi); static void SPI_2LinesRxISR(SPI_HandleTypeDef *hspi); static void SPI_RxISR(SPI_HandleTypeDef *hspi); +static void SPI_DMAEndTransmitReceive(SPI_HandleTypeDef *hspi); static void SPI_DMATransmitCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma); @@ -119,14 +123,16 @@ static void SPI_DMAHalfReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAHalfTransmitReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAError(DMA_HandleTypeDef *hdma); static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus Status, uint32_t Timeout); - -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup SPI_Private_Functions +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup SPI_Exported_Functions SPI Exported Functions * @{ */ -/** @defgroup SPI_Group1 Initialization and de-initialization functions +/** @defgroup SPI_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -134,7 +140,7 @@ static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uin ##### Initialization and de-initialization functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to initialize and - de-initialiaze the SPIx peripheral: + de-initialize the SPIx peripheral: (+) User must implement HAL_SPI_MspInit() function in which he configures all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ). @@ -153,7 +159,7 @@ static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uin (++) CRC Polynomial if CRC enabled (+) Call the function HAL_SPI_DeInit() to restore the default configuration - of the selected SPIx periperal. + of the selected SPIx peripheral. @endverbatim * @{ @@ -189,13 +195,15 @@ HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi) if(hspi->State == HAL_SPI_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hspi->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC... */ HAL_SPI_MspInit(hspi); } hspi->State = HAL_SPI_STATE_BUSY; - /* Disble the selected SPI peripheral */ + /* Disable the selected SPI peripheral */ __HAL_SPI_DISABLE(hspi); /*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/ @@ -259,7 +267,7 @@ HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_MspInit could be implenetd in the user file + the HAL_SPI_MspInit could be implemented in the user file */ } @@ -272,7 +280,7 @@ HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_MspDeInit could be implenetd in the user file + the HAL_SPI_MspDeInit could be implemented in the user file */ } @@ -280,7 +288,7 @@ HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi) * @} */ -/** @defgroup SPI_Group2 IO operation functions +/** @defgroup SPI_Exported_Functions_Group2 IO operation functions * @brief Data transfers functions * @verbatim @@ -302,30 +310,11 @@ HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi) dedicated SPI IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_SPI_TxCpltCallback(), HAL_SPI_RxCpltCallback() and HAL_SPI_TxRxCpltCallback() user callbacks - will be executed respectivelly at the end of the transmit or Receive process + will be executed respectively at the end of the transmit or Receive process The HAL_SPI_ErrorCallback()user callback will be executed when a communication error is detected - (#) Blocking mode APIs are : - (++) HAL_SPI_Transmit()in 1Line (simplex) and 2Lines (full duplex) mode - (++) HAL_SPI_Receive() in 1Line (simplex) and 2Lines (full duplex) mode - (++) HAL_SPI_TransmitReceive() in full duplex mode - - (#) Non Blocking mode API's with Interrupt are : - (++) HAL_SPI_Transmit_IT()in 1Line (simplex) and 2Lines (full duplex) mode - (++) HAL_SPI_Receive_IT() in 1Line (simplex) and 2Lines (full duplex) mode - (++) HAL_SPI_TransmitReceive_IT()in full duplex mode - (++) HAL_SPI_IRQHandler() - - (#) Non Blocking mode functions with DMA are : - (++) HAL_SPI_Transmit_DMA()in 1Line (simplex) and 2Lines (full duplex) mode - (++) HAL_SPI_Receive_DMA() in 1Line (simplex) and 2Lines (full duplex) mode - (++) HAL_SPI_TransmitReceie_DMA() in full duplex mode - - (#) A set of Transfer Complete Callbacks are provided in non Blocking mode: - (++) HAL_SPI_TxCpltCallback() - (++) HAL_SPI_RxCpltCallback() - (++) HAL_SPI_ErrorCallback() - (++) HAL_SPI_TxRxCpltCallback() + (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA) + exist for 1Line (simplex) and 2Lines (full duplex) modes. @endverbatim * @{ @@ -371,15 +360,15 @@ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint hspi->RxXferCount = 0; /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { /* Configure communication direction : 1Line */ - __HAL_SPI_1LINE_TX(hspi); + SPI_1LINE_TX(hspi); } /* Check if the SPI is already enabled */ @@ -408,7 +397,7 @@ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint hspi->TxXferCount--; } /* Enable CRC Transmission */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -434,7 +423,7 @@ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint hspi->TxXferCount--; } /* Enable CRC Transmission */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -454,7 +443,7 @@ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint return HAL_TIMEOUT; } - /* Clear OVERUN flag in 2 Lines communication mode because received is not read */ + /* Clear OVERRUN flag in 2 Lines communication mode because received is not read */ if(hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); @@ -514,13 +503,13 @@ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint1 /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { - __HAL_SPI_1LINE_RX(hspi); + SPI_1LINE_RX(hspi); } /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } if((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES)) @@ -554,7 +543,7 @@ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint1 hspi->RxXferCount--; } /* Enable CRC Transmission */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -575,7 +564,7 @@ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint1 hspi->RxXferCount--; } /* Enable CRC Transmission */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -601,7 +590,7 @@ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint1 hspi->RxXferCount--; /* Wait until RXNE flag is set: CRC Received */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK) { @@ -611,6 +600,7 @@ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint1 /* Read CRC to Flush RXNE flag */ tmpreg = hspi->Instance->DR; + UNUSED(tmpreg); } if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) @@ -623,12 +613,12 @@ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint1 tmp = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR); /* Check if CRC error occurred */ - if((hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) && (tmp != RESET)) + if((hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) && (tmp != RESET)) { hspi->ErrorCode |= HAL_SPI_ERROR_CRC; /* Reset CRC Calculation */ - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); /* Process Unlocked */ __HAL_UNLOCK(hspi); @@ -698,9 +688,9 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD hspi->TxISR = 0; /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Check if the SPI is already enabled */ @@ -722,7 +712,7 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD if(hspi->TxXferCount == 0) { /* Enable CRC Transmission */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -752,7 +742,7 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD hspi->TxXferCount--; /* Enable CRC Transmission */ - if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED)) + if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -793,7 +783,7 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD if(hspi->TxXferCount == 0) { /* Enable CRC Transmission */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -821,7 +811,7 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD hspi->TxXferCount--; /* Enable CRC Transmission */ - if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED)) + if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } @@ -850,7 +840,7 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD } /* Read CRC from DR to close CRC calculation process */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* Wait until RXNE flag is set */ if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK) @@ -860,6 +850,7 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD } /* Read CRC */ tmpreg = hspi->Instance->DR; + UNUSED(tmpreg); } /* Wait until Busy flag is reset before disabling SPI */ @@ -873,14 +864,14 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxD tmp = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR); /* Check if CRC error occurred */ - if((hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) && (tmp != RESET)) + if((hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) && (tmp != RESET)) { hspi->ErrorCode |= HAL_SPI_ERROR_CRC; /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Process Unlocked */ @@ -940,13 +931,13 @@ HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, u /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { - __HAL_SPI_1LINE_TX(hspi); + SPI_1LINE_TX(hspi); } /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } if (hspi->Init.Direction == SPI_DIRECTION_2LINES) @@ -1012,7 +1003,7 @@ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, ui /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { - __HAL_SPI_1LINE_RX(hspi); + SPI_1LINE_RX(hspi); } else if((hspi->Init.Direction == SPI_DIRECTION_2LINES) && (hspi->Init.Mode == SPI_MODE_MASTER)) { @@ -1024,9 +1015,9 @@ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, ui } /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Enable TXE and ERR interrupt */ @@ -1102,9 +1093,9 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *p hspi->RxXferCount = Size; /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Enable TXE, RXNE and ERR interrupt */ @@ -1168,13 +1159,13 @@ HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { - __HAL_SPI_1LINE_TX(hspi); + SPI_1LINE_TX(hspi); } /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Set the SPI TxDMA Half transfer complete callback */ @@ -1189,9 +1180,6 @@ HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, /* Enable the Tx DMA Stream */ HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->DR, hspi->TxXferCount); - /* Enable Tx DMA Request */ - hspi->Instance->CR2 |= SPI_CR2_TXDMAEN; - /* Process Unlocked */ __HAL_UNLOCK(hspi); @@ -1202,6 +1190,9 @@ HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, __HAL_SPI_ENABLE(hspi); } + /* Enable Tx DMA Request */ + hspi->Instance->CR2 |= SPI_CR2_TXDMAEN; + return HAL_OK; } else @@ -1213,7 +1204,7 @@ HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, /** * @brief Receive an amount of data in no-blocking mode with DMA * @param hspi: pointer to a SPI_HandleTypeDef structure that contains - * the configuration information for SPI module. + * the configuration information for SPI module. * @param pData: pointer to data buffer * @note When the CRC feature is enabled the pData Length must be Size + 1. * @param Size: amount of data to be sent @@ -1248,7 +1239,7 @@ HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, u /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { - __HAL_SPI_1LINE_RX(hspi); + SPI_1LINE_RX(hspi); } else if((hspi->Init.Direction == SPI_DIRECTION_2LINES)&&(hspi->Init.Mode == SPI_MODE_MASTER)) { @@ -1260,9 +1251,9 @@ HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, u } /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Set the SPI RxDMA Half transfer complete callback */ @@ -1277,9 +1268,6 @@ HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, u /* Enable the Rx DMA Stream */ HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t)hspi->pRxBuffPtr, hspi->RxXferCount); - /* Enable Rx DMA Request */ - hspi->Instance->CR2 |= SPI_CR2_RXDMAEN; - /* Process Unlocked */ __HAL_UNLOCK(hspi); @@ -1290,6 +1278,9 @@ HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, u __HAL_SPI_ENABLE(hspi); } + /* Enable Rx DMA Request */ + hspi->Instance->CR2 |= SPI_CR2_RXDMAEN; + return HAL_OK; } else @@ -1348,9 +1339,9 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t * hspi->TxISR = 0; /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } /* Check if we are in Rx only or in Rx/Tx Mode and configure the DMA transfer complete callback */ @@ -1378,16 +1369,26 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t * /* Enable Rx DMA Request */ hspi->Instance->CR2 |= SPI_CR2_RXDMAEN; - /* Set the SPI Tx DMA transfer complete callback as HAL_NULL because the communication closing + /* Set the SPI Tx DMA transfer complete callback as NULL because the communication closing is performed in DMA reception complete callback */ hspi->hdmatx->XferCpltCallback = HAL_NULL; - - /* Set the DMA error callback */ - hspi->hdmatx->XferErrorCallback = SPI_DMAError; - + + if(hspi->State == HAL_SPI_STATE_BUSY_TX_RX) + { + /* Set the DMA error callback */ + hspi->hdmatx->XferErrorCallback = SPI_DMAError; + } + else + { + hspi->hdmatx->XferErrorCallback = HAL_NULL; + } + /* Enable the Tx DMA Stream */ HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->DR, hspi->TxXferCount); + /* Process Unlocked */ + __HAL_UNLOCK(hspi); + /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE) { @@ -1398,8 +1399,6 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t * /* Enable Tx DMA Request */ hspi->Instance->CR2 |= SPI_CR2_TXDMAEN; - /* Process Unlocked */ - __HAL_UNLOCK(hspi); return HAL_OK; } else @@ -1408,7 +1407,6 @@ HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t * } } - /** * @brief Pauses the DMA Transfer. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains @@ -1453,8 +1451,8 @@ HAL_StatusTypeDef HAL_SPI_DMAResume(SPI_HandleTypeDef *hspi) /** * @brief Stops the DMA Transfer. - * @param huart: pointer to a UART_HandleTypeDef structure that contains - * the configuration information for the specified UART module. + * @param hspi: pointer to a SPI_HandleTypeDef structure that contains + * the configuration information for the specified SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_DMAStop(SPI_HandleTypeDef *hspi) @@ -1507,7 +1505,7 @@ void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi) tmp1 = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE); tmp2 = __HAL_SPI_GET_IT_SOURCE(hspi, SPI_IT_TXE); - /* SPI in mode Tramitter ---------------------------------------------------*/ + /* SPI in mode Transmitter ---------------------------------------------------*/ if((tmp1 != RESET) && (tmp2 != RESET)) { hspi->TxISR(hspi); @@ -1564,7 +1562,7 @@ void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_TxCpltCallback could be implenetd in the user file + the HAL_SPI_TxCpltCallback could be implemented in the user file */ } @@ -1577,7 +1575,7 @@ __weak void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_RxCpltCallback() could be implenetd in the user file + the HAL_SPI_RxCpltCallback() could be implemented in the user file */ } @@ -1590,7 +1588,7 @@ __weak void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_TxRxCpltCallback() could be implenetd in the user file + the HAL_SPI_TxRxCpltCallback() could be implemented in the user file */ } @@ -1603,7 +1601,7 @@ __weak void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_TxHalfCpltCallback could be implenetd in the user file + the HAL_SPI_TxHalfCpltCallback could be implemented in the user file */ } @@ -1616,7 +1614,7 @@ __weak void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_RxHalfCpltCallback() could be implenetd in the user file + the HAL_SPI_RxHalfCpltCallback() could be implemented in the user file */ } @@ -1629,7 +1627,7 @@ __weak void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi) { /* NOTE : This function Should not be modified, when the callback is needed, - the HAL_SPI_TxRxHalfCpltCallback() could be implenetd in the user file + the HAL_SPI_TxRxHalfCpltCallback() could be implemented in the user file */ } @@ -1642,7 +1640,7 @@ __weak void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi) __weak void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi) { /* NOTE : - This function Should not be modified, when the callback is needed, - the HAL_SPI_ErrorCallback() could be implenetd in the user file. + the HAL_SPI_ErrorCallback() could be implemented in the user file. - The ErrorCode parameter in the hspi handle is updated by the SPI processes and user can use HAL_SPI_GetError() API to check the latest error occurred. */ @@ -1652,7 +1650,7 @@ __weak void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi) * @} */ -/** @defgroup SPI_Group3 Peripheral State and Errors functions +/** @defgroup SPI_Exported_Functions_Group3 Peripheral State and Errors functions * @brief SPI control functions * @verbatim @@ -1684,7 +1682,7 @@ HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi) * the configuration information for SPI module. * @retval SPI Error Code */ -HAL_SPI_ErrorTypeDef HAL_SPI_GetError(SPI_HandleTypeDef *hspi) +uint32_t HAL_SPI_GetError(SPI_HandleTypeDef *hspi) { return hspi->ErrorCode; } @@ -1721,7 +1719,7 @@ static void SPI_TxCloseIRQHandler(SPI_HandleTypeDef *hspi) hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; } - /* Clear OVERUN flag in 2 Lines communication mode because received is not read */ + /* Clear OVERRUN flag in 2 Lines communication mode because received is not read */ if(hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); @@ -1777,7 +1775,7 @@ static void SPI_TxISR(SPI_HandleTypeDef *hspi) if(hspi->TxXferCount == 0) { - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* calculate and transfer CRC on Tx line */ hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; @@ -1796,7 +1794,7 @@ static void SPI_RxCloseIRQHandler(SPI_HandleTypeDef *hspi) { __IO uint16_t tmpreg; - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* Wait until RXNE flag is set to send data */ if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) @@ -1806,6 +1804,7 @@ static void SPI_RxCloseIRQHandler(SPI_HandleTypeDef *hspi) /* Read CRC to reset RXNE flag */ tmpreg = hspi->Instance->DR; + UNUSED(tmpreg); /* Wait until RXNE flag is set to send data */ if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) != HAL_OK) @@ -1819,7 +1818,7 @@ static void SPI_RxCloseIRQHandler(SPI_HandleTypeDef *hspi) hspi->ErrorCode |= HAL_SPI_ERROR_CRC; /* Reset CRC Calculation */ - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } } @@ -1914,7 +1913,7 @@ static void SPI_RxISR(SPI_HandleTypeDef *hspi) hspi->RxXferCount--; /* Enable CRC Transmission */ - if((hspi->RxXferCount == 1) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED)) + if((hspi->RxXferCount == 1) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { /* Set CRC Next to calculate CRC on Rx side */ hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; @@ -1958,7 +1957,7 @@ static void SPI_DMATransmitCplt(DMA_HandleTypeDef *hdma) hspi->State = HAL_SPI_STATE_READY; } - /* Clear OVERUN flag in 2 Lines communication mode because received is not read */ + /* Clear OVERRUN flag in 2 Lines communication mode because received is not read */ if(hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); @@ -1989,47 +1988,54 @@ static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma) /* DMA Normal mode */ if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) { - if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) + if((hspi->Init.Direction == SPI_DIRECTION_2LINES)&&(hspi->Init.Mode == SPI_MODE_MASTER)) { - /* Disable SPI peripheral */ - __HAL_SPI_DISABLE(hspi); + SPI_DMAEndTransmitReceive(hspi); } - - /* Disable Rx DMA Request */ - hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - /* Disable Tx DMA Request (done by default to handle the case Master RX direction 2 lines) */ - hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); - - hspi->RxXferCount = 0; - hspi->State = HAL_SPI_STATE_READY; - - - /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + /* SPI_DIRECTION_1LINE or SPI_DIRECTION_2LINES_RXONLY */ + else { - /* Wait until RXNE flag is set to send data */ - if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) + if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) { - hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; + /* Disable SPI peripheral */ + __HAL_SPI_DISABLE(hspi); } - /* Read CRC */ - tmpreg = hspi->Instance->DR; + /* Disable Rx DMA Request */ + hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - /* Wait until RXNE flag is set */ - if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) != HAL_OK) - { - hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; - } + hspi->RxXferCount = 0; - /* Check if CRC error occurred */ - if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) + /* Reset CRC Calculation */ + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - hspi->ErrorCode |= HAL_SPI_ERROR_CRC; - __HAL_SPI_CLEAR_CRCERRFLAG(hspi); + /* Wait until RXNE flag is set to send data */ + if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) + { + hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; + } + + /* Read CRC */ + tmpreg = hspi->Instance->DR; + UNUSED(tmpreg); + + /* Wait until RXNE flag is set */ + if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) != HAL_OK) + { + hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; + } + + /* Check if CRC error occurred */ + if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) + { + hspi->ErrorCode |= HAL_SPI_ERROR_CRC; + __HAL_SPI_CLEAR_CRCERRFLAG(hspi); + } } } + hspi->State = HAL_SPI_STATE_READY; + /* Check if Errors has been detected during transfer */ if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { @@ -2047,63 +2053,76 @@ static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma) } /** - * @brief DMA SPI transmit receive process complete callback - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. + * @brief End DMA SPI transmit receive process + * @param hspi: pointer to a SPI_HandleTypeDef structure that contains + * the configuration information for SPI module. * @retval None */ -static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma) +static void SPI_DMAEndTransmitReceive(SPI_HandleTypeDef *hspi) { __IO uint16_t tmpreg; - SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) + /* Reset CRC Calculation */ + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + /* Check if CRC is done on going (RXNE flag set) */ + if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) == HAL_OK) { - /* Check if CRC is done on going (RXNE flag set) */ - if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) == HAL_OK) - { - /* Wait until RXNE flag is set to send data */ - if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) - { - hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; - } - } - /* Read CRC */ - tmpreg = hspi->Instance->DR; - - /* Check if CRC error occurred */ - if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) + /* Wait until RXNE flag is set to send data */ + if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) { - hspi->ErrorCode |= HAL_SPI_ERROR_CRC; - __HAL_SPI_CLEAR_CRCERRFLAG(hspi); + hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; } } - - /* Wait until TXE flag is set to send data */ - if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) - { - hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; - } - /* Disable Tx DMA Request */ - hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + /* Read CRC */ + tmpreg = hspi->Instance->DR; + UNUSED(tmpreg); - /* Wait until Busy flag is reset before disabling SPI */ - if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, SPI_TIMEOUT_VALUE) != HAL_OK) + /* Check if CRC error occurred */ + if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { - hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; + hspi->ErrorCode |= HAL_SPI_ERROR_CRC; + __HAL_SPI_CLEAR_CRCERRFLAG(hspi); } + } + + /* Wait until TXE flag is set to send data */ + if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK) + { + hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; + } + /* Disable Tx DMA Request */ + hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); + + /* Wait until Busy flag is reset before disabling SPI */ + if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, SPI_TIMEOUT_VALUE) != HAL_OK) + { + hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; + } + + /* Disable Rx DMA Request */ + hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); + + hspi->TxXferCount = 0; + hspi->RxXferCount = 0; +} + +/** + * @brief DMA SPI transmit receive process complete callback + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma) +{ + __IO uint16_t tmpreg; + + SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) + { /**/ + SPI_DMAEndTransmitReceive(hspi); - /* Disable Rx DMA Request */ - hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN); - - hspi->TxXferCount = 0; - hspi->RxXferCount = 0; - - hspi->State = HAL_SPI_STATE_READY; - + hspi->State = HAL_SPI_STATE_READY; /* Check if Errors has been detected during transfer */ if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) @@ -2180,6 +2199,9 @@ static void SPI_DMAError(DMA_HandleTypeDef *hdma) * @brief This function handles SPI Communication Timeout. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. + * @param Flag: SPI flag to check + * @param Status: Flag status to check: RESET or set + * @param Timeout: Timeout duration * @retval HAL status */ static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus Status, uint32_t Timeout) @@ -2209,9 +2231,9 @@ static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uin __HAL_SPI_DISABLE(hspi); /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } hspi->State= HAL_SPI_STATE_READY; @@ -2243,9 +2265,9 @@ static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uin __HAL_SPI_DISABLE(hspi); /* Reset CRC Calculation */ - if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLED) + if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { - __HAL_SPI_RESET_CRC(hspi); + SPI_RESET_CRC(hspi); } hspi->State= HAL_SPI_STATE_READY; diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.h index 5270438fbbf..4d5c767ae3c 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_spi.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_spi.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SPI HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,7 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup SPI_Exported_Types SPI Exported Types + * @{ + */ + /** * @brief SPI Configuration Structure definition */ @@ -115,21 +118,6 @@ typedef enum }HAL_SPI_StateTypeDef; -/** - * @brief HAL SPI Error Code structure definition - */ -typedef enum -{ - HAL_SPI_ERROR_NONE = 0x00, /*!< No error */ - HAL_SPI_ERROR_MODF = 0x01, /*!< MODF error */ - HAL_SPI_ERROR_CRC = 0x02, /*!< CRC error */ - HAL_SPI_ERROR_OVR = 0x04, /*!< OVR error */ - HAL_SPI_ERROR_FRE = 0x08, /*!< FRE error */ - HAL_SPI_ERROR_DMA = 0x10, /*!< DMA transfer error */ - HAL_SPI_ERROR_FLAG = 0x20 /*!< Flag: RXNE,TXE, BSY */ - -}HAL_SPI_ErrorTypeDef; - /** * @brief SPI handle Structure definition */ @@ -163,99 +151,90 @@ typedef struct __SPI_HandleTypeDef __IO HAL_SPI_StateTypeDef State; /* SPI communication state */ - __IO HAL_SPI_ErrorTypeDef ErrorCode; /* SPI Error code */ + __IO uint32_t ErrorCode; /* SPI Error code */ }SPI_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ +/** @defgroup SPI_Exported_Constants SPI Exported Constants + * @{ + */ -/** @defgroup SPI_Exported_Constants +/** @defgroup SPI_Error_Code SPI Error Code + * @brief SPI Error Code * @{ + */ +#define HAL_SPI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_SPI_ERROR_MODF ((uint32_t)0x00000001) /*!< MODF error */ +#define HAL_SPI_ERROR_CRC ((uint32_t)0x00000002) /*!< CRC error */ +#define HAL_SPI_ERROR_OVR ((uint32_t)0x00000004) /*!< OVR error */ +#define HAL_SPI_ERROR_FRE ((uint32_t)0x00000008) /*!< FRE error */ +#define HAL_SPI_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ +#define HAL_SPI_ERROR_FLAG ((uint32_t)0x00000010) /*!< Flag: RXNE,TXE, BSY */ +/** + * @} */ -/** @defgroup SPI_mode +/** @defgroup SPI_mode SPI Mode * @{ */ #define SPI_MODE_SLAVE ((uint32_t)0x00000000) #define SPI_MODE_MASTER (SPI_CR1_MSTR | SPI_CR1_SSI) - -#define IS_SPI_MODE(MODE) (((MODE) == SPI_MODE_SLAVE) || \ - ((MODE) == SPI_MODE_MASTER)) /** * @} */ -/** @defgroup SPI_Direction_mode +/** @defgroup SPI_Direction_mode SPI Direction Mode * @{ */ #define SPI_DIRECTION_2LINES ((uint32_t)0x00000000) #define SPI_DIRECTION_2LINES_RXONLY SPI_CR1_RXONLY #define SPI_DIRECTION_1LINE SPI_CR1_BIDIMODE - -#define IS_SPI_DIRECTION_MODE(MODE) (((MODE) == SPI_DIRECTION_2LINES) || \ - ((MODE) == SPI_DIRECTION_2LINES_RXONLY) || \ - ((MODE) == SPI_DIRECTION_1LINE)) - -#define IS_SPI_DIRECTION_2LINES_OR_1LINE(MODE) (((MODE) == SPI_DIRECTION_2LINES) || \ - ((MODE) == SPI_DIRECTION_1LINE)) - -#define IS_SPI_DIRECTION_2LINES(MODE) ((MODE) == SPI_DIRECTION_2LINES) - /** * @} */ -/** @defgroup SPI_data_size +/** @defgroup SPI_data_size SPI Data Size * @{ */ #define SPI_DATASIZE_8BIT ((uint32_t)0x00000000) #define SPI_DATASIZE_16BIT SPI_CR1_DFF - -#define IS_SPI_DATASIZE(DATASIZE) (((DATASIZE) == SPI_DATASIZE_16BIT) || \ - ((DATASIZE) == SPI_DATASIZE_8BIT)) /** * @} */ -/** @defgroup SPI_Clock_Polarity +/** @defgroup SPI_Clock_Polarity SPI Clock Polarity * @{ */ #define SPI_POLARITY_LOW ((uint32_t)0x00000000) #define SPI_POLARITY_HIGH SPI_CR1_CPOL - -#define IS_SPI_CPOL(CPOL) (((CPOL) == SPI_POLARITY_LOW) || \ - ((CPOL) == SPI_POLARITY_HIGH)) /** * @} */ -/** @defgroup SPI_Clock_Phase +/** @defgroup SPI_Clock_Phase SPI Clock Phase * @{ */ #define SPI_PHASE_1EDGE ((uint32_t)0x00000000) #define SPI_PHASE_2EDGE SPI_CR1_CPHA - -#define IS_SPI_CPHA(CPHA) (((CPHA) == SPI_PHASE_1EDGE) || \ - ((CPHA) == SPI_PHASE_2EDGE)) /** * @} */ -/** @defgroup SPI_Slave_Select_management +/** @defgroup SPI_Slave_Select_management SPI Slave Select Management * @{ */ #define SPI_NSS_SOFT SPI_CR1_SSM #define SPI_NSS_HARD_INPUT ((uint32_t)0x00000000) #define SPI_NSS_HARD_OUTPUT ((uint32_t)0x00040000) - -#define IS_SPI_NSS(NSS) (((NSS) == SPI_NSS_SOFT) || \ - ((NSS) == SPI_NSS_HARD_INPUT) || \ - ((NSS) == SPI_NSS_HARD_OUTPUT)) /** * @} */ -/** @defgroup SPI_BaudRate_Prescaler +/** @defgroup SPI_BaudRate_Prescaler SPI BaudRate Prescaler * @{ */ #define SPI_BAUDRATEPRESCALER_2 ((uint32_t)0x00000000) @@ -266,56 +245,38 @@ typedef struct __SPI_HandleTypeDef #define SPI_BAUDRATEPRESCALER_64 ((uint32_t)0x00000028) #define SPI_BAUDRATEPRESCALER_128 ((uint32_t)0x00000030) #define SPI_BAUDRATEPRESCALER_256 ((uint32_t)0x00000038) - -#define IS_SPI_BAUDRATE_PRESCALER(PRESCALER) (((PRESCALER) == SPI_BAUDRATEPRESCALER_2) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_4) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_8) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_16) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_32) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_64) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_128) || \ - ((PRESCALER) == SPI_BAUDRATEPRESCALER_256)) /** * @} */ -/** @defgroup SPI_MSB_LSB_transmission +/** @defgroup SPI_MSB_LSB_transmission SPI MSB LSB Transsmission * @{ */ #define SPI_FIRSTBIT_MSB ((uint32_t)0x00000000) #define SPI_FIRSTBIT_LSB SPI_CR1_LSBFIRST - -#define IS_SPI_FIRST_BIT(BIT) (((BIT) == SPI_FIRSTBIT_MSB) || \ - ((BIT) == SPI_FIRSTBIT_LSB)) /** * @} */ -/** @defgroup SPI_TI_mode +/** @defgroup SPI_TI_mode SPI TI Mode * @{ */ -#define SPI_TIMODE_DISABLED ((uint32_t)0x00000000) -#define SPI_TIMODE_ENABLED SPI_CR2_FRF - -#define IS_SPI_TIMODE(MODE) (((MODE) == SPI_TIMODE_DISABLED) || \ - ((MODE) == SPI_TIMODE_ENABLED)) +#define SPI_TIMODE_DISABLE ((uint32_t)0x00000000) +#define SPI_TIMODE_ENABLE SPI_CR2_FRF /** * @} */ -/** @defgroup SPI_CRC_Calculation +/** @defgroup SPI_CRC_Calculation SPI CRC Calculation * @{ */ -#define SPI_CRCCALCULATION_DISABLED ((uint32_t)0x00000000) -#define SPI_CRCCALCULATION_ENABLED SPI_CR1_CRCEN - -#define IS_SPI_CRC_CALCULATION(CALCULATION) (((CALCULATION) == SPI_CRCCALCULATION_DISABLED) || \ - ((CALCULATION) == SPI_CRCCALCULATION_ENABLED)) +#define SPI_CRCCALCULATION_DISABLE ((uint32_t)0x00000000) +#define SPI_CRCCALCULATION_ENABLE SPI_CR1_CRCEN /** * @} */ -/** @defgroup SPI_Interrupt_configuration_definition +/** @defgroup SPI_Interrupt_definition SPI Interrupt Definition * @{ */ #define SPI_IT_TXE SPI_CR2_TXEIE @@ -325,7 +286,7 @@ typedef struct __SPI_HandleTypeDef * @} */ -/** @defgroup SPI_Flag_definition +/** @defgroup SPI_Flags_definition SPI Flags Definition * @{ */ #define SPI_FLAG_RXNE SPI_SR_RXNE @@ -335,7 +296,6 @@ typedef struct __SPI_HandleTypeDef #define SPI_FLAG_OVR SPI_SR_OVR #define SPI_FLAG_BSY SPI_SR_BSY #define SPI_FLAG_FRE SPI_SR_FRE - /** * @} */ @@ -345,7 +305,9 @@ typedef struct __SPI_HandleTypeDef */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup SPI_Exported_Macros SPI Exported Macros + * @{ + */ /** @brief Reset SPI handle state * @param __HANDLE__: specifies the SPI handle. * This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral. @@ -406,44 +368,74 @@ typedef struct __SPI_HandleTypeDef * This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral. * @retval None */ -#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR;\ - (__HANDLE__)->Instance->CR1 &= (~SPI_CR1_SPE);}while(0) +#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + (__HANDLE__)->Instance->CR1 &= (~SPI_CR1_SPE); \ + UNUSED(tmpreg); \ + } while(0) /** @brief Clear the SPI OVR pending flag. * @param __HANDLE__: specifies the SPI handle. * This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral. * @retval None */ -#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__) do{(__HANDLE__)->Instance->DR;\ - (__HANDLE__)->Instance->SR;}while(0) +#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->DR; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + UNUSED(tmpreg); \ + } while(0) /** @brief Clear the SPI FRE pending flag. * @param __HANDLE__: specifies the SPI handle. * This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral. * @retval None + */ +#define __HAL_SPI_CLEAR_FREFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + UNUSED(tmpreg); \ + }while(0) + +/** @brief Enable SPI + * @param __HANDLE__: specifies the SPI Handle. + * @retval None */ -#define __HAL_SPI_CLEAR_FREFLAG(__HANDLE__) ((__HANDLE__)->Instance->SR) - #define __HAL_SPI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= SPI_CR1_SPE) -#define __HAL_SPI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~SPI_CR1_SPE) - -#define IS_SPI_CRC_POLYNOMIAL(POLYNOMIAL) (((POLYNOMIAL) >= 0x1) && ((POLYNOMIAL) <= 0xFFFF)) - -#define __HAL_SPI_1LINE_TX(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= SPI_CR1_BIDIOE) - -#define __HAL_SPI_1LINE_RX(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~SPI_CR1_BIDIOE) - -#define __HAL_SPI_RESET_CRC(__HANDLE__) do{(__HANDLE__)->Instance->CR1 &= (~SPI_CR1_CRCEN);\ - (__HANDLE__)->Instance->CR1 |= SPI_CR1_CRCEN;}while(0) +/** @brief Disable SPI + * @param __HANDLE__: specifies the SPI Handle. + * @retval None + */ +#define __HAL_SPI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~SPI_CR1_SPE) +/** + * @} + */ + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup SPI_Exported_Functions + * @{ + */ +/** @addtogroup SPI_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi); HAL_StatusTypeDef HAL_SPI_DeInit (SPI_HandleTypeDef *hspi); void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi); void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi); +/** + * @} + */ +/** @addtogroup SPI_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions *****************************************************/ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout); @@ -466,10 +458,104 @@ void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi); void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi); void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi); void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi); - +/** + * @} + */ + +/** @addtogroup SPI_Exported_Functions_Group3 + * @{ + */ /* Peripheral State and Control functions **************************************/ HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi); -HAL_SPI_ErrorTypeDef HAL_SPI_GetError(SPI_HandleTypeDef *hspi); +uint32_t HAL_SPI_GetError(SPI_HandleTypeDef *hspi); + +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup SPI_Private_Constants SPI Private Constants + * @{ + */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup SPI_Private_Macros SPI Private Macros + * @{ + */ + +#define IS_SPI_MODE(MODE) (((MODE) == SPI_MODE_SLAVE) || \ + ((MODE) == SPI_MODE_MASTER)) + + +#define IS_SPI_DIRECTION_MODE(MODE) (((MODE) == SPI_DIRECTION_2LINES) || \ + ((MODE) == SPI_DIRECTION_2LINES_RXONLY) || \ + ((MODE) == SPI_DIRECTION_1LINE)) + +#define IS_SPI_DIRECTION_2LINES_OR_1LINE(MODE) (((MODE) == SPI_DIRECTION_2LINES) || \ + ((MODE) == SPI_DIRECTION_1LINE)) + +#define IS_SPI_DIRECTION_2LINES(MODE) ((MODE) == SPI_DIRECTION_2LINES) + +#define IS_SPI_DATASIZE(DATASIZE) (((DATASIZE) == SPI_DATASIZE_16BIT) || \ + ((DATASIZE) == SPI_DATASIZE_8BIT)) + +#define IS_SPI_CPOL(CPOL) (((CPOL) == SPI_POLARITY_LOW) || \ + ((CPOL) == SPI_POLARITY_HIGH)) + +#define IS_SPI_CPHA(CPHA) (((CPHA) == SPI_PHASE_1EDGE) || \ + ((CPHA) == SPI_PHASE_2EDGE)) + +#define IS_SPI_NSS(NSS) (((NSS) == SPI_NSS_SOFT) || \ + ((NSS) == SPI_NSS_HARD_INPUT) || \ + ((NSS) == SPI_NSS_HARD_OUTPUT)) + +#define IS_SPI_BAUDRATE_PRESCALER(PRESCALER) (((PRESCALER) == SPI_BAUDRATEPRESCALER_2) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_4) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_8) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_16) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_32) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_64) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_128) || \ + ((PRESCALER) == SPI_BAUDRATEPRESCALER_256)) + +#define IS_SPI_FIRST_BIT(BIT) (((BIT) == SPI_FIRSTBIT_MSB) || \ + ((BIT) == SPI_FIRSTBIT_LSB)) + +#define IS_SPI_TIMODE(MODE) (((MODE) == SPI_TIMODE_DISABLE) || \ + ((MODE) == SPI_TIMODE_ENABLE)) + +#define IS_SPI_CRC_CALCULATION(CALCULATION) (((CALCULATION) == SPI_CRCCALCULATION_DISABLE) || \ + ((CALCULATION) == SPI_CRCCALCULATION_ENABLE)) + +#define IS_SPI_CRC_POLYNOMIAL(POLYNOMIAL) (((POLYNOMIAL) >= 0x1) && ((POLYNOMIAL) <= 0xFFFF)) + +#define SPI_1LINE_TX(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= SPI_CR1_BIDIOE) + +#define SPI_1LINE_RX(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~SPI_CR1_BIDIOE) + +#define SPI_RESET_CRC(__HANDLE__) do{(__HANDLE__)->Instance->CR1 &= (~SPI_CR1_CRCEN);\ + (__HANDLE__)->Instance->CR1 |= SPI_CR1_CRCEN;}while(0) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup SPI_Private_Functions SPI Private Functions + * @{ + */ + +/** + * @} + */ /** * @} @@ -478,6 +564,7 @@ HAL_SPI_ErrorTypeDef HAL_SPI_GetError(SPI_HandleTypeDef *hspi); /** * @} */ + #ifdef __cplusplus } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.c index 691e7938b94..2672c5fcb00 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_sram.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SRAM HAL module driver. * This file provides a generic firmware to drive SRAM memories * mounted as external device. @@ -64,7 +64,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -98,27 +98,27 @@ * @{ */ -/** @defgroup SRAM +/** @defgroup SRAM SRAM * @brief SRAM driver modules * @{ */ #ifdef HAL_SRAM_MODULE_ENABLED -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ - /* Private functions ---------------------------------------------------------*/ -/** @defgroup SRAM_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup SRAM_Exported_Functions SRAM Exported Functions * @{ */ - -/** @defgroup SRAM_Group1 Initialization and de-initialization functions +/** @defgroup SRAM_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -150,6 +150,8 @@ HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FMC_NORSRAM_TimingTyp if(hsram->State == HAL_SRAM_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hsram->Lock = HAL_UNLOCKED; /* Initialize the low level hardware (MSP) */ HAL_SRAM_MspInit(hsram); } @@ -219,7 +221,7 @@ __weak void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram) /** * @brief DMA transfer complete callback. - * @param hsram: pointer to a SRAM_HandleTypeDef structure that contains + * @param hdma: pointer to a SRAM_HandleTypeDef structure that contains * the configuration information for SRAM module. * @retval None */ @@ -232,7 +234,7 @@ __weak void HAL_SRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma) /** * @brief DMA transfer complete error callback. - * @param hsram: pointer to a SRAM_HandleTypeDef structure that contains + * @param hdma: pointer to a SRAM_HandleTypeDef structure that contains * the configuration information for SRAM module. * @retval None */ @@ -247,7 +249,7 @@ __weak void HAL_SRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma) * @} */ -/** @defgroup SRAM_Group2 Input and Output functions +/** @defgroup SRAM_Exported_Functions_Group2 Input and Output functions * @brief Input Output and memory control functions * @verbatim @@ -567,7 +569,7 @@ HAL_StatusTypeDef HAL_SRAM_Write_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddre * @} */ -/** @defgroup SRAM_Group3 Control functions +/** @defgroup SRAM_Exported_Functions_Group3 Control functions * @brief management functions * @verbatim @@ -635,7 +637,7 @@ HAL_StatusTypeDef HAL_SRAM_WriteOperation_Disable(SRAM_HandleTypeDef *hsram) * @} */ -/** @defgroup SRAM_Group4 State functions +/** @defgroup SRAM_Exported_Functions_Group4 State functions * @brief Peripheral State functions * @verbatim @@ -660,7 +662,6 @@ HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram) { return hsram->State; } - /** * @} */ @@ -668,7 +669,7 @@ HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram) /** * @} */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ #endif /* HAL_SRAM_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.h index 596b25c249f..3ccdd56ddd4 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_sram.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_sram.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SRAM HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -48,23 +48,27 @@ #include "stm32f4xx_ll_fsmc.h" #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) || defined(STM32F446xx) #include "stm32f4xx_ll_fmc.h" -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** @addtogroup STM32F4xx_HAL_Driver * @{ */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ + defined(STM32F446xx) /** @addtogroup SRAM * @{ */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Exported typedef ----------------------------------------------------------*/ +/** @defgroup SRAM_Exported_Types SRAM Exported Types + * @{ + */ /** * @brief HAL SRAM State structures definition */ @@ -97,23 +101,49 @@ typedef struct }SRAM_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup SRAM_Exported_Macros SRAM Exported Macros + * @{ + */ /** @brief Reset SRAM handle state * @param __HANDLE__: SRAM handle * @retval None */ #define __HAL_SRAM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SRAM_STATE_RESET) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup SRAM_Exported_Functions + * @{ + */ + +/** @addtogroup SRAM_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming); HAL_StatusTypeDef HAL_SRAM_DeInit(SRAM_HandleTypeDef *hsram); -void HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram); -void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram); +void HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram); +void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram); + +void HAL_SRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma); +void HAL_SRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma); +/** + * @} + */ +/** @addtogroup SRAM_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions *****************************************************/ HAL_StatusTypeDef HAL_SRAM_Read_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pDstBuffer, uint32_t BufferSize); HAL_StatusTypeDef HAL_SRAM_Write_8b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint8_t *pSrcBuffer, uint32_t BufferSize); @@ -123,26 +153,46 @@ HAL_StatusTypeDef HAL_SRAM_Read_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddres HAL_StatusTypeDef HAL_SRAM_Write_32b(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize); HAL_StatusTypeDef HAL_SRAM_Read_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pDstBuffer, uint32_t BufferSize); HAL_StatusTypeDef HAL_SRAM_Write_DMA(SRAM_HandleTypeDef *hsram, uint32_t *pAddress, uint32_t *pSrcBuffer, uint32_t BufferSize); +/** + * @} + */ -void HAL_SRAM_DMA_XferCpltCallback(DMA_HandleTypeDef *hdma); -void HAL_SRAM_DMA_XferErrorCallback(DMA_HandleTypeDef *hdma); - +/** @addtogroup SRAM_Exported_Functions_Group3 + * @{ + */ /* SRAM Control functions ******************************************************/ HAL_StatusTypeDef HAL_SRAM_WriteOperation_Enable(SRAM_HandleTypeDef *hsram); HAL_StatusTypeDef HAL_SRAM_WriteOperation_Disable(SRAM_HandleTypeDef *hsram); +/** + * @} + */ +/** @addtogroup SRAM_Exported_Functions_Group4 + * @{ + */ /* SRAM State functions *********************************************************/ HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram); +/** + * @} + */ + +/** + * @} + */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ /** * @} */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ /** * @} */ - #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.c index 31c66b25950..aafc96f4c59 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_tim.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief TIM HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Timer (TIM) peripheral: @@ -98,7 +98,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -132,7 +132,7 @@ * @{ */ -/** @defgroup TIM +/** @defgroup TIM TIM * @brief TIM HAL module driver * @{ */ @@ -143,6 +143,9 @@ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup TIM_Private_Functions + * @{ + */ /* Private function prototypes -----------------------------------------------*/ static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config); static void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config); @@ -163,13 +166,18 @@ static void TIM_ETR_SetConfig(TIM_TypeDef* TIMx, uint32_t TIM_ExtTRGPrescaler, static void TIM_ITRx_SetConfig(TIM_TypeDef* TIMx, uint16_t TIM_ITRx); static void TIM_DMAPeriodElapsedCplt(DMA_HandleTypeDef *hdma); static void TIM_DMATriggerCplt(DMA_HandleTypeDef *hdma); -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup TIM_Private_Functions +static void TIM_SlaveTimer_SetConfig(TIM_HandleTypeDef *htim, + TIM_SlaveConfigTypeDef * sSlaveConfig); +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup TIM_Exported_Functions TIM Exported Functions * @{ */ -/** @defgroup TIM_Group1 Time Base functions +/** @defgroup TIM_Exported_Functions_Group1 Time Base functions * @brief Time Base functions * @verbatim @@ -212,6 +220,8 @@ HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim) if(htim->State == HAL_TIM_STATE_RESET) { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC */ HAL_TIM_Base_MspInit(htim); } @@ -403,7 +413,7 @@ HAL_StatusTypeDef HAL_TIM_Base_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pDat htim->hdma[TIM_DMA_ID_UPDATE]->XferCpltCallback = TIM_DMAPeriodElapsedCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_UPDATE], (uint32_t)pData, (uint32_t)&htim->Instance->ARR, Length); @@ -441,12 +451,11 @@ HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA(TIM_HandleTypeDef *htim) /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIM_Group2 Time Output Compare functions +/** @defgroup TIM_Exported_Functions_Group2 Time Output Compare functions * @brief Time Output Compare functions * @verbatim @@ -488,7 +497,9 @@ HAL_StatusTypeDef HAL_TIM_OC_Init(TIM_HandleTypeDef* htim) assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); if(htim->State == HAL_TIM_STATE_RESET) - { + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ HAL_TIM_OC_MspInit(htim); } @@ -614,7 +625,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -748,7 +759,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -798,10 +809,10 @@ HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length); @@ -814,10 +825,10 @@ HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length); @@ -830,10 +841,10 @@ HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3,Length); @@ -846,10 +857,10 @@ HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, Length); @@ -935,7 +946,7 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -948,12 +959,11 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIM_Group3 Time PWM functions +/** @defgroup TIM_Exported_Functions_Group3 Time PWM functions * @brief Time PWM functions * @verbatim @@ -996,6 +1006,8 @@ HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim) if(htim->State == HAL_TIM_STATE_RESET) { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ HAL_TIM_PWM_MspInit(htim); } @@ -1121,7 +1133,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -1258,7 +1270,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT (TIM_HandleTypeDef *htim, uint32_t Channel if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -1308,10 +1320,10 @@ HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channe case TIM_CHANNEL_1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length); @@ -1324,10 +1336,10 @@ HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channe case TIM_CHANNEL_2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length); @@ -1340,10 +1352,10 @@ HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channe case TIM_CHANNEL_3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3,Length); @@ -1356,10 +1368,10 @@ HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channe case TIM_CHANNEL_4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, Length); @@ -1445,7 +1457,7 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -1458,12 +1470,11 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIM_Group4 Time Input Capture functions +/** @defgroup TIM_Exported_Functions_Group4 Time Input Capture functions * @brief Time Input Capture functions * @verbatim @@ -1505,7 +1516,9 @@ HAL_StatusTypeDef HAL_TIM_IC_Init(TIM_HandleTypeDef *htim) assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); if(htim->State == HAL_TIM_STATE_RESET) - { + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ HAL_TIM_IC_MspInit(htim); } @@ -1792,10 +1805,10 @@ HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, Length); @@ -1808,10 +1821,10 @@ HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData, Length); @@ -1824,10 +1837,10 @@ HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)&htim->Instance->CCR3, (uint32_t)pData, Length); @@ -1840,10 +1853,10 @@ HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel case TIM_CHANNEL_4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)&htim->Instance->CCR4, (uint32_t)pData, Length); @@ -1935,7 +1948,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) * @} */ -/** @defgroup TIM_Group5 Time One Pulse functions +/** @defgroup TIM_Exported_Functions_Group5 Time One Pulse functions * @brief Time One Pulse functions * @verbatim @@ -1964,7 +1977,7 @@ HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) * @param OnePulseMode: Select the One pulse mode. * This parameter can be one of the following values: * @arg TIM_OPMODE_SINGLE: Only one pulse will be generated. - * @arg TIM_OPMODE_REPETITIVE: Repetitive pulses wil be generated. + * @arg TIM_OPMODE_REPETITIVE: Repetitive pulses will be generated. * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePulseMode) @@ -1982,7 +1995,9 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePul assert_param(IS_TIM_OPM_MODE(OnePulseMode)); if(htim->State == HAL_TIM_STATE_RESET) - { + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ HAL_TIM_OnePulse_MspInit(htim); } @@ -2116,7 +2131,7 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_Stop(TIM_HandleTypeDef *htim, uint32_t Output if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -2195,7 +2210,7 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Out if(IS_TIM_ADVANCED_INSTANCE(htim->Instance) != RESET) { - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); } @@ -2205,12 +2220,11 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Out /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIM_Group6 Time Encoder functions +/** @defgroup TIM_Exported_Functions_Group6 Time Encoder functions * @brief Time Encoder functions * @verbatim @@ -2264,6 +2278,8 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, TIM_Encoder_Ini if(htim->State == HAL_TIM_STATE_RESET) { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ HAL_TIM_Encoder_MspInit(htim); } @@ -2293,7 +2309,7 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, TIM_Encoder_Ini tmpccmr1 &= ~(TIM_CCMR1_CC1S | TIM_CCMR1_CC2S); tmpccmr1 |= (sConfig->IC1Selection | (sConfig->IC2Selection << 8)); - /* Set the the Capture Compare 1 and the Capture Compare 2 prescalers and filters */ + /* Set the Capture Compare 1 and the Capture Compare 2 prescalers and filters */ tmpccmr1 &= ~(TIM_CCMR1_IC1PSC | TIM_CCMR1_IC2PSC); tmpccmr1 &= ~(TIM_CCMR1_IC1F | TIM_CCMR1_IC2F); tmpccmr1 |= sConfig->IC1Prescaler | (sConfig->IC2Prescaler << 8); @@ -2381,6 +2397,7 @@ __weak void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef *htim) * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_Encoder_Start(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -2423,6 +2440,7 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Start(TIM_HandleTypeDef *htim, uint32_t Channe * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_Encoder_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -2466,6 +2484,7 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Stop(TIM_HandleTypeDef *htim, uint32_t Channel * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -2514,6 +2533,7 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT(TIM_HandleTypeDef *htim, uint32_t Cha * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -2565,6 +2585,7 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Chan * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected * @param pData1: The destination Buffer address for IC1. * @param pData2: The destination Buffer address for IC2. * @param Length: The length of data to be transferred from TIM peripheral to memory. @@ -2596,10 +2617,10 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Ch case TIM_CHANNEL_1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t )pData1, Length); @@ -2618,10 +2639,10 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Ch case TIM_CHANNEL_2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData2, Length); @@ -2639,19 +2660,19 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Ch case TIM_CHANNEL_ALL: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData1, Length); /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData2, Length); @@ -2685,6 +2706,7 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Ch * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -2727,11 +2749,11 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Cha /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIM_Group7 TIM IRQ handler management + +/** @defgroup TIM_Exported_Functions_Group7 TIM IRQ handler management * @brief IRQ handler management * @verbatim @@ -2755,7 +2777,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* Capture compare 1 event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC1) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_CC1) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC1) !=RESET) { { __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC1); @@ -2779,7 +2801,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* Capture compare 2 event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC2) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_CC2) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC2) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC2); htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; @@ -2800,7 +2822,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* Capture compare 3 event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC3) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_CC3) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC3) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC3); htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; @@ -2821,7 +2843,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* Capture compare 4 event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC4) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_CC4) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC4) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC4); htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; @@ -2842,7 +2864,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* TIM Update event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_UPDATE) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_UPDATE) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_UPDATE) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); HAL_TIM_PeriodElapsedCallback(htim); @@ -2851,7 +2873,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* TIM Break input event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_BREAK) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_IT_BREAK); HAL_TIMEx_BreakCallback(htim); @@ -2860,7 +2882,7 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* TIM Trigger detection event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_TRIGGER) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_TRIGGER) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_TRIGGER) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_IT_TRIGGER); HAL_TIM_TriggerCallback(htim); @@ -2869,19 +2891,18 @@ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) /* TIM commutation event */ if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_COM) != RESET) { - if(__HAL_TIM_GET_ITSTATUS(htim, TIM_IT_COM) !=RESET) + if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_COM) !=RESET) { __HAL_TIM_CLEAR_IT(htim, TIM_FLAG_COM); HAL_TIMEx_CommutationCallback(htim); } } } - /** * @} */ -/** @defgroup TIM_Group8 Peripheral Control functions +/** @defgroup TIM_Exported_Functions_Group8 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -2921,7 +2942,6 @@ HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitT assert_param(IS_TIM_OC_MODE(sConfig->OCMode)); assert_param(IS_TIM_OC_POLARITY(sConfig->OCPolarity)); assert_param(IS_TIM_OCN_POLARITY(sConfig->OCNPolarity)); - assert_param(IS_TIM_FAST_STATE(sConfig->OCFastMode)); assert_param(IS_TIM_OCNIDLE_STATE(sConfig->OCNIdleState)); assert_param(IS_TIM_OCIDLE_STATE(sConfig->OCIdleState)); @@ -3096,7 +3116,8 @@ HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_Init assert_param(IS_TIM_OCN_POLARITY(sConfig->OCNPolarity)); assert_param(IS_TIM_OCNIDLE_STATE(sConfig->OCNIdleState)); assert_param(IS_TIM_OCIDLE_STATE(sConfig->OCIdleState)); - + assert_param(IS_TIM_FAST_STATE(sConfig->OCFastMode)); + htim->State = HAL_TIM_STATE_BUSY; switch (Channel) @@ -3202,7 +3223,7 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_O htim->State = HAL_TIM_STATE_BUSY; - /* Extract the Ouput compare configuration from sConfig structure */ + /* Extract the Output compare configuration from sConfig structure */ temp1.OCMode = sConfig->OCMode; temp1.Pulse = sConfig->Pulse; temp1.OCPolarity = sConfig->OCPolarity; @@ -3292,25 +3313,25 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_O * the configuration information for TIM module. * @param BurstBaseAddress: TIM Base address from when the DMA will starts the Data write. * This parameters can be on of the following values: - * @arg TIM_DMABase_CR1 - * @arg TIM_DMABase_CR2 - * @arg TIM_DMABase_SMCR - * @arg TIM_DMABase_DIER - * @arg TIM_DMABase_SR - * @arg TIM_DMABase_EGR - * @arg TIM_DMABase_CCMR1 - * @arg TIM_DMABase_CCMR2 - * @arg TIM_DMABase_CCER - * @arg TIM_DMABase_CNT - * @arg TIM_DMABase_PSC - * @arg TIM_DMABase_ARR - * @arg TIM_DMABase_RCR - * @arg TIM_DMABase_CCR1 - * @arg TIM_DMABase_CCR2 - * @arg TIM_DMABase_CCR3 - * @arg TIM_DMABase_CCR4 - * @arg TIM_DMABase_BDTR - * @arg TIM_DMABase_DCR + * @arg TIM_DMABASE_CR1 + * @arg TIM_DMABASE_CR2 + * @arg TIM_DMABASE_SMCR + * @arg TIM_DMABASE_DIER + * @arg TIM_DMABASE_SR + * @arg TIM_DMABASE_EGR + * @arg TIM_DMABASE_CCMR1 + * @arg TIM_DMABASE_CCMR2 + * @arg TIM_DMABASE_CCER + * @arg TIM_DMABASE_CNT + * @arg TIM_DMABASE_PSC + * @arg TIM_DMABASE_ARR + * @arg TIM_DMABASE_RCR + * @arg TIM_DMABASE_CCR1 + * @arg TIM_DMABASE_CCR2 + * @arg TIM_DMABASE_CCR3 + * @arg TIM_DMABASE_CCR4 + * @arg TIM_DMABASE_BDTR + * @arg TIM_DMABASE_DCR * @param BurstRequestSrc: TIM DMA Request sources. * This parameters can be on of the following values: * @arg TIM_DMA_UPDATE: TIM update Interrupt source @@ -3322,7 +3343,7 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_O * @arg TIM_DMA_TRIGGER: TIM Trigger DMA source * @param BurstBuffer: The Buffer address. * @param BurstLength: DMA Burst length. This parameter can be one value - * between TIM_DMABurstLength_1Transfer and TIM_DMABurstLength_18Transfers. + * between TIM_DMABURSTLENGTH_1TRANSFER and TIM_DMABURSTLENGTH_18TRANSFERS. * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, @@ -3357,7 +3378,7 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t htim->hdma[TIM_DMA_ID_UPDATE]->XferCpltCallback = TIM_DMAPeriodElapsedCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_UPDATE], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3366,10 +3387,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t case TIM_DMA_CC1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3378,10 +3399,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t case TIM_DMA_CC2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3390,10 +3411,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t case TIM_DMA_CC3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3402,10 +3423,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t case TIM_DMA_CC4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3414,10 +3435,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t case TIM_DMA_COM: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = HAL_TIMEx_DMACommutationCplt; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = TIMEx_DMACommutationCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_COMMUTATION], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3429,7 +3450,7 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t htim->hdma[TIM_DMA_ID_TRIGGER]->XferCpltCallback = TIM_DMATriggerCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_TRIGGER]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_TRIGGER]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_TRIGGER], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8) + 1); @@ -3462,6 +3483,48 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t B /* Check the parameters */ assert_param(IS_TIM_DMA_SOURCE(BurstRequestSrc)); + /* Abort the DMA transfer (at least disable the DMA channel) */ + switch(BurstRequestSrc) + { + case TIM_DMA_UPDATE: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_UPDATE]); + } + break; + case TIM_DMA_CC1: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC1]); + } + break; + case TIM_DMA_CC2: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC2]); + } + break; + case TIM_DMA_CC3: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC3]); + } + break; + case TIM_DMA_CC4: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC4]); + } + break; + case TIM_DMA_COM: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_COMMUTATION]); + } + break; + case TIM_DMA_TRIGGER: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_TRIGGER]); + } + break; + default: + break; + } + /* Disable the TIM Update DMA request */ __HAL_TIM_DISABLE_DMA(htim, BurstRequestSrc); @@ -3475,25 +3538,25 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t B * the configuration information for TIM module. * @param BurstBaseAddress: TIM Base address from when the DMA will starts the Data read. * This parameters can be on of the following values: - * @arg TIM_DMABase_CR1 - * @arg TIM_DMABase_CR2 - * @arg TIM_DMABase_SMCR - * @arg TIM_DMABase_DIER - * @arg TIM_DMABase_SR - * @arg TIM_DMABase_EGR - * @arg TIM_DMABase_CCMR1 - * @arg TIM_DMABase_CCMR2 - * @arg TIM_DMABase_CCER - * @arg TIM_DMABase_CNT - * @arg TIM_DMABase_PSC - * @arg TIM_DMABase_ARR - * @arg TIM_DMABase_RCR - * @arg TIM_DMABase_CCR1 - * @arg TIM_DMABase_CCR2 - * @arg TIM_DMABase_CCR3 - * @arg TIM_DMABase_CCR4 - * @arg TIM_DMABase_BDTR - * @arg TIM_DMABase_DCR + * @arg TIM_DMABASE_CR1 + * @arg TIM_DMABASE_CR2 + * @arg TIM_DMABASE_SMCR + * @arg TIM_DMABASE_DIER + * @arg TIM_DMABASE_SR + * @arg TIM_DMABASE_EGR + * @arg TIM_DMABASE_CCMR1 + * @arg TIM_DMABASE_CCMR2 + * @arg TIM_DMABASE_CCER + * @arg TIM_DMABASE_CNT + * @arg TIM_DMABASE_PSC + * @arg TIM_DMABASE_ARR + * @arg TIM_DMABASE_RCR + * @arg TIM_DMABASE_CCR1 + * @arg TIM_DMABASE_CCR2 + * @arg TIM_DMABASE_CCR3 + * @arg TIM_DMABASE_CCR4 + * @arg TIM_DMABASE_BDTR + * @arg TIM_DMABASE_DCR * @param BurstRequestSrc: TIM DMA Request sources. * This parameters can be on of the following values: * @arg TIM_DMA_UPDATE: TIM update Interrupt source @@ -3505,7 +3568,7 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t B * @arg TIM_DMA_TRIGGER: TIM Trigger DMA source * @param BurstBuffer: The Buffer address. * @param BurstLength: DMA Burst length. This parameter can be one value - * between TIM_DMABurstLength_1Transfer and TIM_DMABurstLength_18Transfers. + * between TIM_DMABURSTLENGTH_1TRANSFER and TIM_DMABURSTLENGTH_18TRANSFERS. * @retval HAL status */ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, @@ -3540,7 +3603,7 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B htim->hdma[TIM_DMA_ID_UPDATE]->XferCpltCallback = TIM_DMAPeriodElapsedCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_UPDATE], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3549,10 +3612,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B case TIM_DMA_CC1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3561,10 +3624,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B case TIM_DMA_CC2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3573,10 +3636,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B case TIM_DMA_CC3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3585,10 +3648,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B case TIM_DMA_CC4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3597,10 +3660,10 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B case TIM_DMA_COM: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = HAL_TIMEx_DMACommutationCplt; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = TIMEx_DMACommutationCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_COMMUTATION], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3612,7 +3675,7 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t B htim->hdma[TIM_DMA_ID_TRIGGER]->XferCpltCallback = TIM_DMATriggerCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_TRIGGER]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_TRIGGER]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_TRIGGER], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, ((BurstLength) >> 8) + 1); @@ -3646,6 +3709,48 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t Bu /* Check the parameters */ assert_param(IS_TIM_DMA_SOURCE(BurstRequestSrc)); + /* Abort the DMA transfer (at least disable the DMA channel) */ + switch(BurstRequestSrc) + { + case TIM_DMA_UPDATE: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_UPDATE]); + } + break; + case TIM_DMA_CC1: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC1]); + } + break; + case TIM_DMA_CC2: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC2]); + } + break; + case TIM_DMA_CC3: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC3]); + } + break; + case TIM_DMA_CC4: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_CC4]); + } + break; + case TIM_DMA_COM: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_COMMUTATION]); + } + break; + case TIM_DMA_TRIGGER: + { + HAL_DMA_Abort(htim->hdma[TIM_DMA_ID_TRIGGER]); + } + break; + default: + break; + } + /* Disable the TIM Update DMA request */ __HAL_TIM_DISABLE_DMA(htim, BurstRequestSrc); @@ -3659,16 +3764,16 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t Bu * the configuration information for TIM module. * @param EventSource: specifies the event source. * This parameter can be one of the following values: - * @arg TIM_EventSource_Update: Timer update Event source - * @arg TIM_EventSource_CC1: Timer Capture Compare 1 Event source - * @arg TIM_EventSource_CC2: Timer Capture Compare 2 Event source - * @arg TIM_EventSource_CC3: Timer Capture Compare 3 Event source - * @arg TIM_EventSource_CC4: Timer Capture Compare 4 Event source - * @arg TIM_EventSource_COM: Timer COM event source - * @arg TIM_EventSource_Trigger: Timer Trigger Event source - * @arg TIM_EventSource_Break: Timer Break event source + * @arg TIM_EVENTSOURCE_UPDATE: Timer update Event source + * @arg TIM_EVENTSOURCE_CC1: Timer Capture Compare 1 Event source + * @arg TIM_EVENTSOURCE_CC2: Timer Capture Compare 2 Event source + * @arg TIM_EVENTSOURCE_CC3: Timer Capture Compare 3 Event source + * @arg TIM_EVENTSOURCE_CC4: Timer Capture Compare 4 Event source + * @arg TIM_EVENTSOURCE_COM: Timer COM event source + * @arg TIM_EVENTSOURCE_TRIGGER: Timer Trigger Event source + * @arg TIM_EVENTSOURCE_BREAK: Timer Break event source * @note TIM6 and TIM7 can only generate an update event. - * @note TIM_EventSource_COM and TIM_EventSource_Break are used only with TIM1 and TIM8. + * @note TIM_EVENTSOURCE_COM and TIM_EVENTSOURCE_BREAK are used only with TIM1 and TIM8. * @retval HAL status */ @@ -3942,7 +4047,7 @@ HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockCo * @brief Selects the signal connected to the TI1 input: direct from CH1_input * or a XOR combination between CH1_input, CH2_input & CH3_input * @param htim: pointer to a TIM_HandleTypeDef structure that contains - * the configuration information for TIM module.. + * the configuration information for TIM module. * @param TI1_Selection: Indicate whether or not channel 1 is connected to the * output of a XOR gate. * This parameter can be one of the following values: @@ -3965,7 +4070,7 @@ HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_S /* Reset the TI1 selection */ tmpcr2 &= ~TIM_CR2_TI1S; - /* Set the the TI1 selection */ + /* Set the TI1 selection */ tmpcr2 |= TI1_Selection; /* Write to TIMxCR2 */ @@ -3977,7 +4082,7 @@ HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_S /** * @brief Configures the TIM in Slave mode * @param htim: pointer to a TIM_HandleTypeDef structure that contains - * the configuration information for TIM module.. + * the configuration information for TIM module. * @param sSlaveConfig: pointer to a TIM_SlaveConfigTypeDef structure that * contains the selected trigger (internal trigger input, filtered * timer input or external trigger input) and the ) and the Slave @@ -3986,10 +4091,6 @@ HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_S */ HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef * sSlaveConfig) { - uint32_t tmpsmcr = 0; - uint32_t tmpccmr1 = 0; - uint32_t tmpccer = 0; - /* Check the parameters */ assert_param(IS_TIM_SLAVE_INSTANCE(htim->Instance)); assert_param(IS_TIM_SLAVE_MODE(sSlaveConfig->SlaveMode)); @@ -3999,133 +4100,61 @@ HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization(TIM_HandleTypeDef *htim, TI htim->State = HAL_TIM_STATE_BUSY; - /* Get the TIMx SMCR register value */ - tmpsmcr = htim->Instance->SMCR; - - /* Reset the Trigger Selection Bits */ - tmpsmcr &= ~TIM_SMCR_TS; - /* Set the Input Trigger source */ - tmpsmcr |= sSlaveConfig->InputTrigger; - - /* Reset the slave mode Bits */ - tmpsmcr &= ~TIM_SMCR_SMS; - /* Set the slave mode */ - tmpsmcr |= sSlaveConfig->SlaveMode; + TIM_SlaveTimer_SetConfig(htim, sSlaveConfig); + + /* Disable Trigger Interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_TRIGGER); + + /* Disable Trigger DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_TRIGGER); + + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return HAL_OK; +} - /* Write to TIMx SMCR */ - htim->Instance->SMCR = tmpsmcr; +/** + * @brief Configures the TIM in Slave mode in interrupt mode + * @param htim: TIM handle. + * @param sSlaveConfig: pointer to a TIM_SlaveConfigTypeDef structure that + * contains the selected trigger (internal trigger input, filtered + * timer input or external trigger input) and the ) and the Slave + * mode (Disable, Reset, Gated, Trigger, External clock mode 1). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization_IT(TIM_HandleTypeDef *htim, + TIM_SlaveConfigTypeDef * sSlaveConfig) +{ + /* Check the parameters */ + assert_param(IS_TIM_SLAVE_INSTANCE(htim->Instance)); + assert_param(IS_TIM_SLAVE_MODE(sSlaveConfig->SlaveMode)); + assert_param(IS_TIM_TRIGGER_SELECTION(sSlaveConfig->InputTrigger)); - /* Configure the trigger prescaler, filter, and polarity */ - switch (sSlaveConfig->InputTrigger) - { - case TIM_TS_ETRF: - { - /* Check the parameters */ - assert_param(IS_TIM_ETR_INSTANCE(htim->Instance)); - assert_param(IS_TIM_TRIGGERPRESCALER(sSlaveConfig->TriggerPrescaler)); - assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); - assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); - /* Configure the ETR Trigger source */ - TIM_ETR_SetConfig(htim->Instance, - sSlaveConfig->TriggerPrescaler, - sSlaveConfig->TriggerPolarity, - sSlaveConfig->TriggerFilter); - } - break; - - case TIM_TS_TI1F_ED: - { - /* Check the parameters */ - assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); - assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); - - /* Disable the Channel 1: Reset the CC1E Bit */ - tmpccer = htim->Instance->CCER; - htim->Instance->CCER &= ~TIM_CCER_CC1E; - tmpccmr1 = htim->Instance->CCMR1; - - /* Set the filter */ - tmpccmr1 &= ~TIM_CCMR1_IC1F; - tmpccmr1 |= ((sSlaveConfig->TriggerFilter) << 4); - - /* Write to TIMx CCMR1 and CCER registers */ - htim->Instance->CCMR1 = tmpccmr1; - htim->Instance->CCER = tmpccer; - - } - break; - - case TIM_TS_TI1FP1: - { - /* Check the parameters */ - assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); - assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); - assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + __HAL_LOCK(htim); - /* Configure TI1 Filter and Polarity */ - TIM_TI1_ConfigInputStage(htim->Instance, - sSlaveConfig->TriggerPolarity, - sSlaveConfig->TriggerFilter); - } - break; - - case TIM_TS_TI2FP2: - { - /* Check the parameters */ - assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); - assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); - assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); - - /* Configure TI2 Filter and Polarity */ - TIM_TI2_ConfigInputStage(htim->Instance, - sSlaveConfig->TriggerPolarity, - sSlaveConfig->TriggerFilter); - } - break; - - case TIM_TS_ITR0: - { - /* Check the parameter */ - assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); - } - break; - - case TIM_TS_ITR1: - { - /* Check the parameter */ - assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); - } - break; - - case TIM_TS_ITR2: - { - /* Check the parameter */ - assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); - } - break; - - case TIM_TS_ITR3: - { - /* Check the parameter */ - assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); - } - break; - - default: - break; - } + htim->State = HAL_TIM_STATE_BUSY; + + TIM_SlaveTimer_SetConfig(htim, sSlaveConfig); + + /* Enable Trigger Interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_TRIGGER); + + /* Disable Trigger DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_TRIGGER); htim->State = HAL_TIM_STATE_READY; __HAL_UNLOCK(htim); return HAL_OK; -} +} /** * @brief Read the captured value from Capture Compare unit * @param htim: pointer to a TIM_HandleTypeDef structure that contains - * the configuration information for TIM module.. + * the configuration information for TIM module. * @param Channel: TIM Channels to be enabled. * This parameter can be one of the following values: * @arg TIM_CHANNEL_1: TIM Channel 1 selected @@ -4192,12 +4221,11 @@ uint32_t HAL_TIM_ReadCapturedValue(TIM_HandleTypeDef *htim, uint32_t Channel) __HAL_UNLOCK(htim); return tmpreg; } - /** * @} */ -/** @defgroup TIM_Group9 TIM Callbacks functions +/** @defgroup TIM_Exported_Functions_Group9 TIM Callbacks functions * @brief TIM Callbacks functions * @verbatim @@ -4292,12 +4320,11 @@ __weak void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim) the HAL_TIM_ErrorCallback could be implemented in the user file */ } - /** * @} */ -/** @defgroup TIM_Group10 Peripheral State functions +/** @defgroup TIM_Exported_Functions_Group10 Peripheral State functions * @brief Peripheral State functions * @verbatim @@ -4377,95 +4404,20 @@ HAL_TIM_StateTypeDef HAL_TIM_Encoder_GetState(TIM_HandleTypeDef *htim) { return htim->State; } - /** * @} */ /** - * @brief TIM DMA error callback - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. + * @brief Time Base configuration + * @param TIMx: TIM peripheral + * @param Structure: pointer on TIM Time Base required parameters * @retval None */ -void HAL_TIM_DMAError(DMA_HandleTypeDef *hdma) +void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure) { - TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - htim->State= HAL_TIM_STATE_READY; - - HAL_TIM_ErrorCallback(htim); -} - -/** - * @brief TIM DMA Delay Pulse complete callback. - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. - * @retval None - */ -void HAL_TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma) -{ - TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - htim->State= HAL_TIM_STATE_READY; - - HAL_TIM_PWM_PulseFinishedCallback(htim); -} -/** - * @brief TIM DMA Capture complete callback. - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. - * @retval None - */ -void HAL_TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma) -{ - TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - htim->State= HAL_TIM_STATE_READY; - - HAL_TIM_IC_CaptureCallback(htim); - -} - -/** - * @brief TIM DMA Period Elapse complete callback. - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. - * @retval None - */ -static void TIM_DMAPeriodElapsedCplt(DMA_HandleTypeDef *hdma) -{ - TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - htim->State= HAL_TIM_STATE_READY; - - HAL_TIM_PeriodElapsedCallback(htim); -} - -/** - * @brief TIM DMA Trigger callback. - * @param hdma: pointer to a DMA_HandleTypeDef structure that contains - * the configuration information for the specified DMA module. - * @retval None - */ -static void TIM_DMATriggerCplt(DMA_HandleTypeDef *hdma) -{ - TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; - - htim->State= HAL_TIM_STATE_READY; - - HAL_TIM_TriggerCallback(htim); -} - -/** - * @brief Time Base configuration - * @param TIMx: TIM periheral - * @retval None - */ -void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure) -{ - uint32_t tmpcr1 = 0; - tmpcr1 = TIMx->CR1; + uint32_t tmpcr1 = 0; + tmpcr1 = TIMx->CR1; /* Set TIM Time Base Unit parameters ---------------------------------------*/ if(IS_TIM_CC3_INSTANCE(TIMx) != RESET) @@ -4484,7 +4436,7 @@ void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure) TIMx->CR1 = tmpcr1; - /* Set the Autoreload value */ + /* Set the Auto-reload value */ TIMx->ARR = (uint32_t)Structure->Period ; /* Set the Prescaler value */ @@ -4497,26 +4449,82 @@ void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure) } /* Generate an update event to reload the Prescaler - and the repetition counter(only for TIM1 and TIM8) value immediatly */ + and the repetition counter(only for TIM1 and TIM8) value immediately */ TIMx->EGR = TIM_EGR_UG; } /** - * @brief Time Ouput Compare 1 configuration - * @param TIMx to select the TIM peripheral - * @param OC_Config: The ouput configuration structure + * @brief Configure the TI1 as Input. + * @param TIMx to select the TIM peripheral. + * @param TIM_ICPolarity : The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Rising + * @arg TIM_ICPolarity_Falling + * @arg TIM_ICPolarity_BothEdge + * @param TIM_ICSelection: specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSelection_DirectTI: TIM Input 1 is selected to be connected to IC1. + * @arg TIM_ICSelection_IndirectTI: TIM Input 1 is selected to be connected to IC2. + * @arg TIM_ICSelection_TRC: TIM Input 1 is selected to be connected to TRC. + * @param TIM_ICFilter: Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI2FP1 + * (on channel2 path) is used as the input signal. Therefore CCMR1 must be + * protected against un-initialized filter and polarity values. * @retval None */ -static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) +void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter) { - uint32_t tmpccmrx = 0; + uint32_t tmpccmr1 = 0; uint32_t tmpccer = 0; - uint32_t tmpcr2 = 0; - + /* Disable the Channel 1: Reset the CC1E Bit */ TIMx->CCER &= ~TIM_CCER_CC1E; + tmpccmr1 = TIMx->CCMR1; + tmpccer = TIMx->CCER; + + /* Select the Input */ + if(IS_TIM_CC2_INSTANCE(TIMx) != RESET) + { + tmpccmr1 &= ~TIM_CCMR1_CC1S; + tmpccmr1 |= TIM_ICSelection; + } + else + { + tmpccmr1 &= ~TIM_CCMR1_CC1S; + tmpccmr1 |= TIM_CCMR1_CC1S_0; + } + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC1F; + tmpccmr1 |= ((TIM_ICFilter << 4) & TIM_CCMR1_IC1F); + + /* Select the Polarity and set the CC1E Bit */ + tmpccer &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP); + tmpccer |= (TIM_ICPolarity & (TIM_CCER_CC1P | TIM_CCER_CC1NP)); + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1; + TIMx->CCER = tmpccer; +} + +/** + * @brief Time Output Compare 2 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config: The output configuration structure + * @retval None + */ +void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx = 0; + uint32_t tmpccer = 0; + uint32_t tmpcr2 = 0; + + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= ~TIM_CCER_CC2E; - /* Get the TIMx CCER register value */ + /* Get the TIMx CCER register value */ tmpccer = TIMx->CCER; /* Get the TIMx CR2 register value */ tmpcr2 = TIMx->CR2; @@ -4524,34 +4532,38 @@ static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) /* Get the TIMx CCMR1 register value */ tmpccmrx = TIMx->CCMR1; - /* Reset the Output Compare Mode Bits */ - tmpccmrx &= ~TIM_CCMR1_OC1M; - tmpccmrx &= ~TIM_CCMR1_CC1S; + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= ~TIM_CCMR1_OC2M; + tmpccmrx &= ~TIM_CCMR1_CC2S; + /* Select the Output Compare Mode */ - tmpccmrx |= OC_Config->OCMode; + tmpccmrx |= (OC_Config->OCMode << 8); /* Reset the Output Polarity level */ - tmpccer &= ~TIM_CCER_CC1P; + tmpccer &= ~TIM_CCER_CC2P; /* Set the Output Compare Polarity */ - tmpccer |= OC_Config->OCPolarity; - + tmpccer |= (OC_Config->OCPolarity << 4); if(IS_TIM_ADVANCED_INSTANCE(TIMx) != RESET) - { + { + assert_param(IS_TIM_OCN_POLARITY(OC_Config->OCNPolarity)); + assert_param(IS_TIM_OCNIDLE_STATE(OC_Config->OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(OC_Config->OCIdleState)); + /* Reset the Output N Polarity level */ - tmpccer &= ~TIM_CCER_CC1NP; + tmpccer &= ~TIM_CCER_CC2NP; /* Set the Output N Polarity */ - tmpccer |= OC_Config->OCNPolarity; + tmpccer |= (OC_Config->OCNPolarity << 4); /* Reset the Output N State */ - tmpccer &= ~TIM_CCER_CC1NE; + tmpccer &= ~TIM_CCER_CC2NE; /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= ~TIM_CR2_OIS1; - tmpcr2 &= ~TIM_CR2_OIS1N; + tmpcr2 &= ~TIM_CR2_OIS2; + tmpcr2 &= ~TIM_CR2_OIS2N; /* Set the Output Idle state */ - tmpcr2 |= OC_Config->OCIdleState; + tmpcr2 |= (OC_Config->OCIdleState << 2); /* Set the Output N Idle state */ - tmpcr2 |= OC_Config->OCNIdleState; + tmpcr2 |= (OC_Config->OCNIdleState << 2); } /* Write to TIMx CR2 */ TIMx->CR2 = tmpcr2; @@ -4559,29 +4571,172 @@ static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) /* Write to TIMx CCMR1 */ TIMx->CCMR1 = tmpccmrx; - /* Set the Capture Compare Register value */ - TIMx->CCR1 = OC_Config->Pulse; + /* Set the Capture Compare Register value */ + TIMx->CCR2 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief TIM DMA Delay Pulse complete callback. + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +void TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + htim->State= HAL_TIM_STATE_READY; + + if(hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + } + else if(hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + } + else if(hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + } + else if(hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + } + + HAL_TIM_PWM_PulseFinishedCallback(htim); + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA error callback + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +void TIM_DMAError(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + htim->State= HAL_TIM_STATE_READY; + + HAL_TIM_ErrorCallback(htim); +} + +/** + * @brief TIM DMA Capture complete callback. + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + htim->State= HAL_TIM_STATE_READY; + + if(hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + } + else if(hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + } + else if(hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + } + else if(hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + } + + HAL_TIM_IC_CaptureCallback(htim); + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief Enables or disables the TIM Capture Compare Channel x. + * @param TIMx to select the TIM peripheral + * @param Channel: specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_Channel_1: TIM Channel 1 + * @arg TIM_Channel_2: TIM Channel 2 + * @arg TIM_Channel_3: TIM Channel 3 + * @arg TIM_Channel_4: TIM Channel 4 + * @param ChannelState: specifies the TIM Channel CCxE bit new state. + * This parameter can be: TIM_CCx_ENABLE or TIM_CCx_Disable. + * @retval None + */ +void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState) +{ + uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(TIMx)); + assert_param(IS_TIM_CHANNELS(Channel)); + + tmp = TIM_CCER_CC1E << Channel; + + /* Reset the CCxE Bit */ + TIMx->CCER &= ~tmp; + + /* Set or reset the CCxE Bit */ + TIMx->CCER |= (uint32_t)(ChannelState << Channel); +} + +/** + * @brief TIM DMA Period Elapse complete callback. + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +static void TIM_DMAPeriodElapsedCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + htim->State= HAL_TIM_STATE_READY; + + HAL_TIM_PeriodElapsedCallback(htim); +} + +/** + * @brief TIM DMA Trigger callback. + * @param hdma: pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA module. + * @retval None + */ +static void TIM_DMATriggerCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + htim->State= HAL_TIM_STATE_READY; - /* Write to TIMx CCER */ - TIMx->CCER = tmpccer; -} + HAL_TIM_TriggerCallback(htim); +} /** - * @brief Time Ouput Compare 2 configuration + * @brief Time Output Compare 1 configuration * @param TIMx to select the TIM peripheral - * @param OC_Config: The ouput configuration structure + * @param OC_Config: The output configuration structure * @retval None */ -void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) +static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) { uint32_t tmpccmrx = 0; uint32_t tmpccer = 0; - uint32_t tmpcr2 = 0; - - /* Disable the Channel 2: Reset the CC2E Bit */ - TIMx->CCER &= ~TIM_CCER_CC2E; + uint32_t tmpcr2 = 0; + + /* Disable the Channel 1: Reset the CC1E Bit */ + TIMx->CCER &= ~TIM_CCER_CC1E; - /* Get the TIMx CCER register value */ + /* Get the TIMx CCER register value */ tmpccer = TIMx->CCER; /* Get the TIMx CR2 register value */ tmpcr2 = TIMx->CR2; @@ -4589,38 +4744,34 @@ void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) /* Get the TIMx CCMR1 register value */ tmpccmrx = TIMx->CCMR1; - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= ~TIM_CCMR1_OC2M; - tmpccmrx &= ~TIM_CCMR1_CC2S; - + /* Reset the Output Compare Mode Bits */ + tmpccmrx &= ~TIM_CCMR1_OC1M; + tmpccmrx &= ~TIM_CCMR1_CC1S; /* Select the Output Compare Mode */ - tmpccmrx |= (OC_Config->OCMode << 8); + tmpccmrx |= OC_Config->OCMode; /* Reset the Output Polarity level */ - tmpccer &= ~TIM_CCER_CC2P; + tmpccer &= ~TIM_CCER_CC1P; /* Set the Output Compare Polarity */ - tmpccer |= (OC_Config->OCPolarity << 4); + tmpccer |= OC_Config->OCPolarity; + if(IS_TIM_ADVANCED_INSTANCE(TIMx) != RESET) - { - assert_param(IS_TIM_OCN_POLARITY(OC_Config->OCNPolarity)); - assert_param(IS_TIM_OCNIDLE_STATE(OC_Config->OCNIdleState)); - assert_param(IS_TIM_OCIDLE_STATE(OC_Config->OCIdleState)); - + { /* Reset the Output N Polarity level */ - tmpccer &= ~TIM_CCER_CC2NP; + tmpccer &= ~TIM_CCER_CC1NP; /* Set the Output N Polarity */ - tmpccer |= (OC_Config->OCNPolarity << 4); + tmpccer |= OC_Config->OCNPolarity; /* Reset the Output N State */ - tmpccer &= ~TIM_CCER_CC2NE; + tmpccer &= ~TIM_CCER_CC1NE; /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= ~TIM_CR2_OIS2; - tmpcr2 &= ~TIM_CR2_OIS2N; + tmpcr2 &= ~TIM_CR2_OIS1; + tmpcr2 &= ~TIM_CR2_OIS1N; /* Set the Output Idle state */ - tmpcr2 |= (OC_Config->OCIdleState << 2); + tmpcr2 |= OC_Config->OCIdleState; /* Set the Output N Idle state */ - tmpcr2 |= (OC_Config->OCNIdleState << 2); + tmpcr2 |= OC_Config->OCNIdleState; } /* Write to TIMx CR2 */ TIMx->CR2 = tmpcr2; @@ -4629,16 +4780,16 @@ void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) TIMx->CCMR1 = tmpccmrx; /* Set the Capture Compare Register value */ - TIMx->CCR2 = OC_Config->Pulse; + TIMx->CCR1 = OC_Config->Pulse; /* Write to TIMx CCER */ - TIMx->CCER = tmpccer; -} + TIMx->CCER = tmpccer; +} /** - * @brief Time Ouput Compare 3 configuration + * @brief Time Output Compare 3 configuration * @param TIMx to select the TIM peripheral - * @param OC_Config: The ouput configuration structure + * @param OC_Config: The output configuration structure * @retval None */ static void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) @@ -4704,9 +4855,9 @@ static void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) } /** - * @brief Time Ouput Compare 4 configuration + * @brief Time Output Compare 4 configuration * @param TIMx to select the TIM peripheral - * @param OC_Config: The ouput configuration structure + * @param OC_Config: The output configuration structure * @retval None */ static void TIM_OC4_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) @@ -4761,58 +4912,137 @@ static void TIM_OC4_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config) } /** - * @brief Configure the TI1 as Input. - * @param TIMx to select the TIM peripheral. - * @param TIM_ICPolarity : The Input Polarity. - * This parameter can be one of the following values: - * @arg TIM_ICPolarity_Rising - * @arg TIM_ICPolarity_Falling - * @arg TIM_ICPolarity_BothEdge - * @param TIM_ICSelection: specifies the input to be used. - * This parameter can be one of the following values: - * @arg TIM_ICSelection_DirectTI: TIM Input 1 is selected to be connected to IC1. - * @arg TIM_ICSelection_IndirectTI: TIM Input 1 is selected to be connected to IC2. - * @arg TIM_ICSelection_TRC: TIM Input 1 is selected to be connected to TRC. - * @param TIM_ICFilter: Specifies the Input Capture Filter. - * This parameter must be a value between 0x00 and 0x0F. + * @brief Time Output Compare 4 configuration + * @param htim: pointer to a TIM_HandleTypeDef structure that contains + * the configuration information for TIM module. + * @param sSlaveConfig: The slave configuration structure * @retval None */ -void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, - uint32_t TIM_ICFilter) +static void TIM_SlaveTimer_SetConfig(TIM_HandleTypeDef *htim, + TIM_SlaveConfigTypeDef * sSlaveConfig) { + uint32_t tmpsmcr = 0; uint32_t tmpccmr1 = 0; uint32_t tmpccer = 0; - - /* Disable the Channel 1: Reset the CC1E Bit */ - TIMx->CCER &= ~TIM_CCER_CC1E; - tmpccmr1 = TIMx->CCMR1; - tmpccer = TIMx->CCER; - /* Select the Input */ - if(IS_TIM_CC2_INSTANCE(TIMx) != RESET) - { - tmpccmr1 &= ~TIM_CCMR1_CC1S; - tmpccmr1 |= TIM_ICSelection; - } - else - { - tmpccmr1 &= ~TIM_CCMR1_CC1S; - tmpccmr1 |= TIM_CCMR1_CC1S_0; - } - - /* Set the filter */ - tmpccmr1 &= ~TIM_CCMR1_IC1F; - tmpccmr1 |= (TIM_ICFilter << 4); + /* Get the TIMx SMCR register value */ + tmpsmcr = htim->Instance->SMCR; - /* Select the Polarity and set the CC1E Bit */ - tmpccer &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP); - tmpccer |= TIM_ICPolarity; + /* Reset the Trigger Selection Bits */ + tmpsmcr &= ~TIM_SMCR_TS; + /* Set the Input Trigger source */ + tmpsmcr |= sSlaveConfig->InputTrigger; - /* Write to TIMx CCMR1 and CCER registers */ - TIMx->CCMR1 = tmpccmr1; - TIMx->CCER = tmpccer; + /* Reset the slave mode Bits */ + tmpsmcr &= ~TIM_SMCR_SMS; + /* Set the slave mode */ + tmpsmcr |= sSlaveConfig->SlaveMode; + + /* Write to TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + + /* Configure the trigger prescaler, filter, and polarity */ + switch (sSlaveConfig->InputTrigger) + { + case TIM_TS_ETRF: + { + /* Check the parameters */ + assert_param(IS_TIM_ETR_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERPRESCALER(sSlaveConfig->TriggerPrescaler)); + assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + /* Configure the ETR Trigger source */ + TIM_ETR_SetConfig(htim->Instance, + sSlaveConfig->TriggerPrescaler, + sSlaveConfig->TriggerPolarity, + sSlaveConfig->TriggerFilter); + } + break; + + case TIM_TS_TI1F_ED: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + + /* Disable the Channel 1: Reset the CC1E Bit */ + tmpccer = htim->Instance->CCER; + htim->Instance->CCER &= ~TIM_CCER_CC1E; + tmpccmr1 = htim->Instance->CCMR1; + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC1F; + tmpccmr1 |= ((sSlaveConfig->TriggerFilter) << 4); + + /* Write to TIMx CCMR1 and CCER registers */ + htim->Instance->CCMR1 = tmpccmr1; + htim->Instance->CCER = tmpccer; + + } + break; + + case TIM_TS_TI1FP1: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + + /* Configure TI1 Filter and Polarity */ + TIM_TI1_ConfigInputStage(htim->Instance, + sSlaveConfig->TriggerPolarity, + sSlaveConfig->TriggerFilter); + } + break; + + case TIM_TS_TI2FP2: + { + /* Check the parameters */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + + /* Configure TI2 Filter and Polarity */ + TIM_TI2_ConfigInputStage(htim->Instance, + sSlaveConfig->TriggerPolarity, + sSlaveConfig->TriggerFilter); + } + break; + + case TIM_TS_ITR0: + { + /* Check the parameter */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + } + break; + + case TIM_TS_ITR1: + { + /* Check the parameter */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + } + break; + + case TIM_TS_ITR2: + { + /* Check the parameter */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + } + break; + + case TIM_TS_ITR3: + { + /* Check the parameter */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + } + break; + + default: + break; + } } + /** * @brief Configure the Polarity and Filter for TI1. * @param TIMx to select the TIM peripheral. @@ -4863,6 +5093,9 @@ static void TIM_TI1_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, * @arg TIM_ICSelection_TRC: TIM Input 2 is selected to be connected to TRC. * @param TIM_ICFilter: Specifies the Input Capture Filter. * This parameter must be a value between 0x00 and 0x0F. + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI1FP2 + * (on channel1 path) is used as the input signal. Therefore CCMR1 must be + * protected against un-initialized filter and polarity values. * @retval None */ static void TIM_TI2_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, @@ -4882,11 +5115,11 @@ static void TIM_TI2_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32 /* Set the filter */ tmpccmr1 &= ~TIM_CCMR1_IC2F; - tmpccmr1 |= (TIM_ICFilter << 12); + tmpccmr1 |= ((TIM_ICFilter << 12) & TIM_CCMR1_IC2F); /* Select the Polarity and set the CC2E Bit */ tmpccer &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP); - tmpccer |= (TIM_ICPolarity << 4); + tmpccer |= ((TIM_ICPolarity << 4) & (TIM_CCER_CC2P | TIM_CCER_CC2NP)); /* Write to TIMx CCMR1 and CCER registers */ TIMx->CCMR1 = tmpccmr1 ; @@ -4943,6 +5176,9 @@ static void TIM_TI2_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, * @arg TIM_ICSelection_TRC: TIM Input 3 is selected to be connected to TRC. * @param TIM_ICFilter: Specifies the Input Capture Filter. * This parameter must be a value between 0x00 and 0x0F. + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI4FP3 + * (on channel4 path) is used as the input signal. Therefore CCMR2 must be + * protected against un-initialized filter and polarity values. * @retval None */ static void TIM_TI3_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, @@ -4962,11 +5198,11 @@ static void TIM_TI3_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32 /* Set the filter */ tmpccmr2 &= ~TIM_CCMR2_IC3F; - tmpccmr2 |= (TIM_ICFilter << 4); + tmpccmr2 |= ((TIM_ICFilter << 4) & TIM_CCMR2_IC3F); /* Select the Polarity and set the CC3E Bit */ tmpccer &= ~(TIM_CCER_CC3P | TIM_CCER_CC3NP); - tmpccer |= (TIM_ICPolarity << 8); + tmpccer |= ((TIM_ICPolarity << 8) & (TIM_CCER_CC3P | TIM_CCER_CC3NP)); /* Write to TIMx CCMR2 and CCER registers */ TIMx->CCMR2 = tmpccmr2; @@ -4988,6 +5224,9 @@ static void TIM_TI3_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32 * @arg TIM_ICSelection_TRC: TIM Input 4 is selected to be connected to TRC. * @param TIM_ICFilter: Specifies the Input Capture Filter. * This parameter must be a value between 0x00 and 0x0F. + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI3FP4 + * (on channel3 path) is used as the input signal. Therefore CCMR2 must be + * protected against un-initialized filter and polarity values. * @retval None */ static void TIM_TI4_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, @@ -5007,11 +5246,11 @@ static void TIM_TI4_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32 /* Set the filter */ tmpccmr2 &= ~TIM_CCMR2_IC4F; - tmpccmr2 |= (TIM_ICFilter << 12); + tmpccmr2 |= ((TIM_ICFilter << 12) & TIM_CCMR2_IC4F); /* Select the Polarity and set the CC4E Bit */ tmpccer &= ~(TIM_CCER_CC4P | TIM_CCER_CC4NP); - tmpccer |= (TIM_ICPolarity << 12); + tmpccer |= ((TIM_ICPolarity << 12) & (TIM_CCER_CC4P | TIM_CCER_CC4NP)); /* Write to TIMx CCMR2 and CCER registers */ TIMx->CCMR2 = tmpccmr2; @@ -5021,7 +5260,7 @@ static void TIM_TI4_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32 /** * @brief Selects the Input Trigger source * @param TIMx to select the TIM peripheral - * @param InputTriggerSource: The Input Trigger source. + * @param TIM_ITRx: The Input Trigger source. * This parameter can be one of the following values: * @arg TIM_TS_ITR0: Internal Trigger 0 * @arg TIM_TS_ITR1: Internal Trigger 1 @@ -5046,6 +5285,7 @@ static void TIM_ITRx_SetConfig(TIM_TypeDef *TIMx, uint16_t TIM_ITRx) /* Write to TIMx SMCR */ TIMx->SMCR = tmpsmcr; } + /** * @brief Configures the TIMx External Trigger (ETR). * @param TIMx to select the TIM peripheral @@ -5080,37 +5320,6 @@ static void TIM_ETR_SetConfig(TIM_TypeDef* TIMx, uint32_t TIM_ExtTRGPrescaler, TIMx->SMCR = tmpsmcr; } -/** - * @brief Enables or disables the TIM Capture Compare Channel x. - * @param TIMx to select the TIM peripheral - * @param Channel: specifies the TIM Channel - * This parameter can be one of the following values: - * @arg TIM_Channel_1: TIM Channel 1 - * @arg TIM_Channel_2: TIM Channel 2 - * @arg TIM_Channel_3: TIM Channel 3 - * @arg TIM_Channel_4: TIM Channel 4 - * @param ChannelState: specifies the TIM Channel CCxE bit new state. - * This parameter can be: TIM_CCx_ENABLE or TIM_CCx_Disable. - * @retval None - */ -void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState) -{ - uint32_t tmp = 0; - - /* Check the parameters */ - assert_param(IS_TIM_CC1_INSTANCE(TIMx)); - assert_param(IS_TIM_CHANNELS(Channel)); - - tmp = TIM_CCER_CC1E << Channel; - - /* Reset the CCxE Bit */ - TIMx->CCER &= ~tmp; - - /* Set or reset the CCxE Bit */ - TIMx->CCER |= (uint32_t)(ChannelState << Channel); -} - - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.h index 28cea36d5d4..db8ddf2dfcd 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_tim.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of TIM HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,7 +46,7 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" -/** @addtogroup STM32F4xx_HAL +/** @addtogroup STM32F4xx_HAL_Driver * @{ */ @@ -55,7 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup TIM_Exported_Types TIM Exported Types + * @{ + */ + /** * @brief TIM Time base Configuration Structure definition */ @@ -293,13 +296,16 @@ typedef struct HAL_LockTypeDef Lock; /*!< Locking object */ __IO HAL_TIM_StateTypeDef State; /*!< TIM operation state */ }TIM_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup TIM_Exported_Constants +/** @defgroup TIM_Exported_Constants TIM Exported Constants * @{ */ -/** @defgroup TIM_Input_Channel_Polarity +/** @defgroup TIM_Input_Channel_Polarity TIM Input Channel Polarity * @{ */ #define TIM_INPUTCHANNELPOLARITY_RISING ((uint32_t)0x00000000) /*!< Polarity for TIx source */ @@ -309,7 +315,7 @@ typedef struct * @} */ -/** @defgroup TIM_ETR_Polarity +/** @defgroup TIM_ETR_Polarity TIM ETR Polarity * @{ */ #define TIM_ETRPOLARITY_INVERTED (TIM_SMCR_ETP) /*!< Polarity for ETR source */ @@ -318,7 +324,7 @@ typedef struct * @} */ -/** @defgroup TIM_ETR_Prescaler +/** @defgroup TIM_ETR_Prescaler TIM ETR Prescaler * @{ */ #define TIM_ETRPRESCALER_DIV1 ((uint32_t)0x0000) /*!< No prescaler is used */ @@ -329,7 +335,7 @@ typedef struct * @} */ -/** @defgroup TIM_Counter_Mode +/** @defgroup TIM_Counter_Mode TIM Counter Mode * @{ */ #define TIM_COUNTERMODE_UP ((uint32_t)0x0000) @@ -337,31 +343,21 @@ typedef struct #define TIM_COUNTERMODE_CENTERALIGNED1 TIM_CR1_CMS_0 #define TIM_COUNTERMODE_CENTERALIGNED2 TIM_CR1_CMS_1 #define TIM_COUNTERMODE_CENTERALIGNED3 TIM_CR1_CMS - -#define IS_TIM_COUNTER_MODE(MODE) (((MODE) == TIM_COUNTERMODE_UP) || \ - ((MODE) == TIM_COUNTERMODE_DOWN) || \ - ((MODE) == TIM_COUNTERMODE_CENTERALIGNED1) || \ - ((MODE) == TIM_COUNTERMODE_CENTERALIGNED2) || \ - ((MODE) == TIM_COUNTERMODE_CENTERALIGNED3)) /** * @} */ -/** @defgroup TIM_ClockDivision +/** @defgroup TIM_ClockDivision TIM Clock Division * @{ */ #define TIM_CLOCKDIVISION_DIV1 ((uint32_t)0x0000) #define TIM_CLOCKDIVISION_DIV2 (TIM_CR1_CKD_0) #define TIM_CLOCKDIVISION_DIV4 (TIM_CR1_CKD_1) - -#define IS_TIM_CLOCKDIVISION_DIV(DIV) (((DIV) == TIM_CLOCKDIVISION_DIV1) || \ - ((DIV) == TIM_CLOCKDIVISION_DIV2) || \ - ((DIV) == TIM_CLOCKDIVISION_DIV4)) /** * @} */ -/** @defgroup TIM_Output_Compare_and_PWM_modes +/** @defgroup TIM_Output_Compare_and_PWM_modes TIM Output Compare and PWM modes * @{ */ #define TIM_OCMODE_TIMING ((uint32_t)0x0000) @@ -373,102 +369,56 @@ typedef struct #define TIM_OCMODE_FORCED_ACTIVE (TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) #define TIM_OCMODE_FORCED_INACTIVE (TIM_CCMR1_OC1M_2) -#define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \ - ((MODE) == TIM_OCMODE_PWM2)) - -#define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \ - ((MODE) == TIM_OCMODE_ACTIVE) || \ - ((MODE) == TIM_OCMODE_INACTIVE) || \ - ((MODE) == TIM_OCMODE_TOGGLE) || \ - ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \ - ((MODE) == TIM_OCMODE_FORCED_INACTIVE)) -/** - * @} - */ - -/** @defgroup TIM_Output_Compare_State - * @{ - */ -#define TIM_OUTPUTSTATE_DISABLE ((uint32_t)0x0000) -#define TIM_OUTPUTSTATE_ENABLE (TIM_CCER_CC1E) - -#define IS_TIM_OUTPUT_STATE(STATE) (((STATE) == TIM_OUTPUTSTATE_DISABLE) || \ - ((STATE) == TIM_OUTPUTSTATE_ENABLE)) /** * @} */ -/** @defgroup TIM_Output_Fast_State +/** @defgroup TIM_Output_Fast_State TIM Output Fast State * @{ */ #define TIM_OCFAST_DISABLE ((uint32_t)0x0000) #define TIM_OCFAST_ENABLE (TIM_CCMR1_OC1FE) - -#define IS_TIM_FAST_STATE(STATE) (((STATE) == TIM_OCFAST_DISABLE) || \ - ((STATE) == TIM_OCFAST_ENABLE)) /** * @} */ -/** @defgroup TIM_Output_Compare_N_State - * @{ - */ -#define TIM_OUTPUTNSTATE_DISABLE ((uint32_t)0x0000) -#define TIM_OUTPUTNSTATE_ENABLE (TIM_CCER_CC1NE) - -#define IS_TIM_OUTPUTN_STATE(STATE) (((STATE) == TIM_OUTPUTNSTATE_DISABLE) || \ - ((STATE) == TIM_OUTPUTNSTATE_ENABLE)) -/** - * @} - */ - -/** @defgroup TIM_Output_Compare_Polarity +/** @defgroup TIM_Output_Compare_Polarity TIM Output Compare Polarity * @{ */ #define TIM_OCPOLARITY_HIGH ((uint32_t)0x0000) #define TIM_OCPOLARITY_LOW (TIM_CCER_CC1P) - -#define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPOLARITY_HIGH) || \ - ((POLARITY) == TIM_OCPOLARITY_LOW)) /** * @} */ -/** @defgroup TIM_Output_Compare_N_Polarity +/** @defgroup TIM_Output_Compare_N_Polarity TIM Output CompareN Polarity * @{ */ #define TIM_OCNPOLARITY_HIGH ((uint32_t)0x0000) #define TIM_OCNPOLARITY_LOW (TIM_CCER_CC1NP) - -#define IS_TIM_OCN_POLARITY(POLARITY) (((POLARITY) == TIM_OCNPOLARITY_HIGH) || \ - ((POLARITY) == TIM_OCNPOLARITY_LOW)) /** * @} */ -/** @defgroup TIM_Output_Compare_Idle_State +/** @defgroup TIM_Output_Compare_Idle_State TIM Output Compare Idle State * @{ */ #define TIM_OCIDLESTATE_SET (TIM_CR2_OIS1) #define TIM_OCIDLESTATE_RESET ((uint32_t)0x0000) -#define IS_TIM_OCIDLE_STATE(STATE) (((STATE) == TIM_OCIDLESTATE_SET) || \ - ((STATE) == TIM_OCIDLESTATE_RESET)) /** * @} */ -/** @defgroup TIM_Output_Compare_N_Idle_State +/** @defgroup TIM_Output_Compare_N_Idle_State TIM Output Compare N Idle State * @{ */ #define TIM_OCNIDLESTATE_SET (TIM_CR2_OIS1N) #define TIM_OCNIDLESTATE_RESET ((uint32_t)0x0000) -#define IS_TIM_OCNIDLE_STATE(STATE) (((STATE) == TIM_OCNIDLESTATE_SET) || \ - ((STATE) == TIM_OCNIDLESTATE_RESET)) /** * @} */ -/** @defgroup TIM_Channel +/** @defgroup TIM_Channel TIM Channel * @{ */ #define TIM_CHANNEL_1 ((uint32_t)0x0000) @@ -477,40 +427,21 @@ typedef struct #define TIM_CHANNEL_4 ((uint32_t)0x000C) #define TIM_CHANNEL_ALL ((uint32_t)0x0018) -#define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ - ((CHANNEL) == TIM_CHANNEL_2) || \ - ((CHANNEL) == TIM_CHANNEL_3) || \ - ((CHANNEL) == TIM_CHANNEL_4) || \ - ((CHANNEL) == TIM_CHANNEL_ALL)) - -#define IS_TIM_PWMI_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ - ((CHANNEL) == TIM_CHANNEL_2)) - -#define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ - ((CHANNEL) == TIM_CHANNEL_2)) - -#define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ - ((CHANNEL) == TIM_CHANNEL_2) || \ - ((CHANNEL) == TIM_CHANNEL_3)) /** * @} */ -/** @defgroup TIM_Input_Capture_Polarity +/** @defgroup TIM_Input_Capture_Polarity TIM Input Capture Polarity * @{ */ #define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING #define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING #define TIM_ICPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE - -#define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPOLARITY_RISING) || \ - ((POLARITY) == TIM_ICPOLARITY_FALLING) || \ - ((POLARITY) == TIM_ICPOLARITY_BOTHEDGE)) /** * @} */ -/** @defgroup TIM_Input_Capture_Selection +/** @defgroup TIM_Input_Capture_Selection TIM Input Capture Selection * @{ */ #define TIM_ICSELECTION_DIRECTTI (TIM_CCMR1_CC1S_0) /*!< TIM Input 1, 2, 3 or 4 is selected to be @@ -519,54 +450,42 @@ typedef struct connected to IC2, IC1, IC4 or IC3, respectively */ #define TIM_ICSELECTION_TRC (TIM_CCMR1_CC1S) /*!< TIM Input 1, 2, 3 or 4 is selected to be connected to TRC */ -#define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSELECTION_DIRECTTI) || \ - ((SELECTION) == TIM_ICSELECTION_INDIRECTTI) || \ - ((SELECTION) == TIM_ICSELECTION_TRC)) /** * @} */ -/** @defgroup TIM_Input_Capture_Prescaler +/** @defgroup TIM_Input_Capture_Prescaler TIM Input Capture Prescaler * @{ */ #define TIM_ICPSC_DIV1 ((uint32_t)0x0000) /*!< Capture performed each time an edge is detected on the capture input */ #define TIM_ICPSC_DIV2 (TIM_CCMR1_IC1PSC_0) /*!< Capture performed once every 2 events */ #define TIM_ICPSC_DIV4 (TIM_CCMR1_IC1PSC_1) /*!< Capture performed once every 4 events */ #define TIM_ICPSC_DIV8 (TIM_CCMR1_IC1PSC) /*!< Capture performed once every 8 events */ - -#define IS_TIM_IC_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ICPSC_DIV1) || \ - ((PRESCALER) == TIM_ICPSC_DIV2) || \ - ((PRESCALER) == TIM_ICPSC_DIV4) || \ - ((PRESCALER) == TIM_ICPSC_DIV8)) /** * @} */ -/** @defgroup TIM_One_Pulse_Mode +/** @defgroup TIM_One_Pulse_Mode TIM One Pulse Mode * @{ */ #define TIM_OPMODE_SINGLE (TIM_CR1_OPM) #define TIM_OPMODE_REPETITIVE ((uint32_t)0x0000) -#define IS_TIM_OPM_MODE(MODE) (((MODE) == TIM_OPMODE_SINGLE) || \ - ((MODE) == TIM_OPMODE_REPETITIVE)) /** * @} */ -/** @defgroup TIM_Encoder_Mode +/** @defgroup TIM_Encoder_Mode TIM Encoder Mode * @{ */ #define TIM_ENCODERMODE_TI1 (TIM_SMCR_SMS_0) #define TIM_ENCODERMODE_TI2 (TIM_SMCR_SMS_1) #define TIM_ENCODERMODE_TI12 (TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0) -#define IS_TIM_ENCODER_MODE(MODE) (((MODE) == TIM_ENCODERMODE_TI1) || \ - ((MODE) == TIM_ENCODERMODE_TI2) || \ - ((MODE) == TIM_ENCODERMODE_TI12)) + /** * @} */ -/** @defgroup TIM_Interrupt_definition +/** @defgroup TIM_Interrupt_definition TIM Interrupt definition * @{ */ #define TIM_IT_UPDATE (TIM_DIER_UIE) @@ -577,24 +496,20 @@ typedef struct #define TIM_IT_COM (TIM_DIER_COMIE) #define TIM_IT_TRIGGER (TIM_DIER_TIE) #define TIM_IT_BREAK (TIM_DIER_BIE) - -#define IS_TIM_IT(IT) ((((IT) & 0xFFFFFF00) == 0x00000000) && ((IT) != 0x00000000)) - -#define IS_TIM_GET_IT(IT) (((IT) == TIM_IT_UPDATE) || \ - ((IT) == TIM_IT_CC1) || \ - ((IT) == TIM_IT_CC2) || \ - ((IT) == TIM_IT_CC3) || \ - ((IT) == TIM_IT_CC4) || \ - ((IT) == TIM_IT_COM) || \ - ((IT) == TIM_IT_TRIGGER) || \ - ((IT) == TIM_IT_BREAK)) /** * @} */ + +/** @defgroup TIM_Commutation_Source TIM Commutation Source + * @{ + */ #define TIM_COMMUTATION_TRGI (TIM_CR2_CCUS) #define TIM_COMMUTATION_SOFTWARE ((uint32_t)0x0000) +/** + * @} + */ -/** @defgroup TIM_DMA_sources +/** @defgroup TIM_DMA_sources TIM DMA sources * @{ */ #define TIM_DMA_UPDATE (TIM_DIER_UDE) @@ -604,28 +519,27 @@ typedef struct #define TIM_DMA_CC4 (TIM_DIER_CC4DE) #define TIM_DMA_COM (TIM_DIER_COMDE) #define TIM_DMA_TRIGGER (TIM_DIER_TDE) -#define IS_TIM_DMA_SOURCE(SOURCE) ((((SOURCE) & 0xFFFF80FF) == 0x00000000) && ((SOURCE) != 0x00000000)) /** * @} */ -/** @defgroup TIM_Event_Source +/** @defgroup TIM_Event_Source TIM Event Source * @{ */ -#define TIM_EventSource_Update TIM_EGR_UG -#define TIM_EventSource_CC1 TIM_EGR_CC1G -#define TIM_EventSource_CC2 TIM_EGR_CC2G -#define TIM_EventSource_CC3 TIM_EGR_CC3G -#define TIM_EventSource_CC4 TIM_EGR_CC4G -#define TIM_EventSource_COM TIM_EGR_COMG -#define TIM_EventSource_Trigger TIM_EGR_TG -#define TIM_EventSource_Break TIM_EGR_BG -#define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & 0xFFFFFF00) == 0x00000000) && ((SOURCE) != 0x00000000)) +#define TIM_EVENTSOURCE_UPDATE TIM_EGR_UG +#define TIM_EVENTSOURCE_CC1 TIM_EGR_CC1G +#define TIM_EVENTSOURCE_CC2 TIM_EGR_CC2G +#define TIM_EVENTSOURCE_CC3 TIM_EGR_CC3G +#define TIM_EVENTSOURCE_CC4 TIM_EGR_CC4G +#define TIM_EVENTSOURCE_COM TIM_EGR_COMG +#define TIM_EVENTSOURCE_TRIGGER TIM_EGR_TG +#define TIM_EVENTSOURCE_BREAK TIM_EGR_BG + /** * @} */ -/** @defgroup TIM_Flag_definition +/** @defgroup TIM_Flag_definition TIM Flag definition * @{ */ #define TIM_FLAG_UPDATE (TIM_SR_UIF) @@ -640,24 +554,11 @@ typedef struct #define TIM_FLAG_CC2OF (TIM_SR_CC2OF) #define TIM_FLAG_CC3OF (TIM_SR_CC3OF) #define TIM_FLAG_CC4OF (TIM_SR_CC4OF) - -#define IS_TIM_FLAG(FLAG) (((FLAG) == TIM_FLAG_UPDATE) || \ - ((FLAG) == TIM_FLAG_CC1) || \ - ((FLAG) == TIM_FLAG_CC2) || \ - ((FLAG) == TIM_FLAG_CC3) || \ - ((FLAG) == TIM_FLAG_CC4) || \ - ((FLAG) == TIM_FLAG_COM) || \ - ((FLAG) == TIM_FLAG_TRIGGER) || \ - ((FLAG) == TIM_FLAG_BREAK) || \ - ((FLAG) == TIM_FLAG_CC1OF) || \ - ((FLAG) == TIM_FLAG_CC2OF) || \ - ((FLAG) == TIM_FLAG_CC3OF) || \ - ((FLAG) == TIM_FLAG_CC4OF)) /** * @} */ -/** @defgroup TIM_Clock_Source +/** @defgroup TIM_Clock_Source TIM Clock Source * @{ */ #define TIM_CLOCKSOURCE_ETRMODE2 (TIM_SMCR_ETPS_1) @@ -670,22 +571,11 @@ typedef struct #define TIM_CLOCKSOURCE_TI1 (TIM_SMCR_TS_0 | TIM_SMCR_TS_2) #define TIM_CLOCKSOURCE_TI2 (TIM_SMCR_TS_1 | TIM_SMCR_TS_2) #define TIM_CLOCKSOURCE_ETRMODE1 (TIM_SMCR_TS) - -#define IS_TIM_CLOCKSOURCE(CLOCK) (((CLOCK) == TIM_CLOCKSOURCE_INTERNAL) || \ - ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE2) || \ - ((CLOCK) == TIM_CLOCKSOURCE_ITR0) || \ - ((CLOCK) == TIM_CLOCKSOURCE_ITR1) || \ - ((CLOCK) == TIM_CLOCKSOURCE_ITR2) || \ - ((CLOCK) == TIM_CLOCKSOURCE_ITR3) || \ - ((CLOCK) == TIM_CLOCKSOURCE_TI1ED) || \ - ((CLOCK) == TIM_CLOCKSOURCE_TI1) || \ - ((CLOCK) == TIM_CLOCKSOURCE_TI2) || \ - ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE1)) /** * @} */ -/** @defgroup TIM_Clock_Polarity +/** @defgroup TIM_Clock_Polarity TIM Clock Polarity * @{ */ #define TIM_CLOCKPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx clock sources */ @@ -693,159 +583,106 @@ typedef struct #define TIM_CLOCKPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Polarity for TIx clock sources */ #define TIM_CLOCKPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Polarity for TIx clock sources */ #define TIM_CLOCKPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Polarity for TIx clock sources */ - -#define IS_TIM_CLOCKPOLARITY(POLARITY) (((POLARITY) == TIM_CLOCKPOLARITY_INVERTED) || \ - ((POLARITY) == TIM_CLOCKPOLARITY_NONINVERTED) || \ - ((POLARITY) == TIM_CLOCKPOLARITY_RISING) || \ - ((POLARITY) == TIM_CLOCKPOLARITY_FALLING) || \ - ((POLARITY) == TIM_CLOCKPOLARITY_BOTHEDGE)) /** * @} */ -/** @defgroup TIM_Clock_Prescaler +/** @defgroup TIM_Clock_Prescaler TIM Clock Prescaler * @{ */ -#define TIM_CLOCKPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ -#define TIM_CLOCKPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Clock: Capture performed once every 2 events. */ -#define TIM_CLOCKPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Clock: Capture performed once every 4 events. */ -#define TIM_CLOCKPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Clock: Capture performed once every 8 events. */ - -#define IS_TIM_CLOCKPRESCALER(PRESCALER) (((PRESCALER) == TIM_CLOCKPRESCALER_DIV1) || \ - ((PRESCALER) == TIM_CLOCKPRESCALER_DIV2) || \ - ((PRESCALER) == TIM_CLOCKPRESCALER_DIV4) || \ - ((PRESCALER) == TIM_CLOCKPRESCALER_DIV8)) +#define TIM_CLOCKPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ +#define TIM_CLOCKPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Clock: Capture performed once every 2 events. */ +#define TIM_CLOCKPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Clock: Capture performed once every 4 events. */ +#define TIM_CLOCKPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Clock: Capture performed once every 8 events. */ /** * @} */ -/** @defgroup TIM_Clock_Filter - * @{ - */ -#define IS_TIM_CLOCKFILTER(ICFILTER) ((ICFILTER) <= 0xF) -/** - * @} - */ - -/** @defgroup TIM_ClearInput_Source +/** @defgroup TIM_ClearInput_Source TIM Clear Input Source * @{ */ #define TIM_CLEARINPUTSOURCE_ETR ((uint32_t)0x0001) #define TIM_CLEARINPUTSOURCE_NONE ((uint32_t)0x0000) - -#define IS_TIM_CLEARINPUT_SOURCE(SOURCE) (((SOURCE) == TIM_CLEARINPUTSOURCE_NONE) || \ - ((SOURCE) == TIM_CLEARINPUTSOURCE_ETR)) /** * @} */ -/** @defgroup TIM_ClearInput_Polarity +/** @defgroup TIM_ClearInput_Polarity TIM Clear Input Polarity * @{ */ #define TIM_CLEARINPUTPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx pin */ #define TIM_CLEARINPUTPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx pin */ -#define IS_TIM_CLEARINPUT_POLARITY(POLARITY) (((POLARITY) == TIM_CLEARINPUTPOLARITY_INVERTED) || \ - ((POLARITY) == TIM_CLEARINPUTPOLARITY_NONINVERTED)) /** * @} */ -/** @defgroup TIM_ClearInput_Prescaler +/** @defgroup TIM_ClearInput_Prescaler TIM Clear Input Prescaler * @{ */ #define TIM_CLEARINPUTPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ #define TIM_CLEARINPUTPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR pin: Capture performed once every 2 events. */ #define TIM_CLEARINPUTPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR pin: Capture performed once every 4 events. */ #define TIM_CLEARINPUTPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR pin: Capture performed once every 8 events. */ -#define IS_TIM_CLEARINPUT_PRESCALER(PRESCALER) (((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV1) || \ - ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV2) || \ - ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV4) || \ - ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV8)) -/** - * @} - */ - -/** @defgroup TIM_ClearInput_Filter - * @{ - */ -#define IS_TIM_CLEARINPUT_FILTER(ICFILTER) ((ICFILTER) <= 0xF) /** * @} */ -/** @defgroup TIM_OSSR_Off_State_Selection_for_Run_mode_state +/** @defgroup TIM_OSSR_Off_State_Selection_for_Run_mode_state TIM OSSR OffState Selection for Run mode state * @{ */ #define TIM_OSSR_ENABLE (TIM_BDTR_OSSR) -#define TIM_OSSR_DISABLE ((uint32_t)0x0000) - -#define IS_TIM_OSSR_STATE(STATE) (((STATE) == TIM_OSSR_ENABLE) || \ - ((STATE) == TIM_OSSR_DISABLE)) +#define TIM_OSSR_DISABLE ((uint32_t)0x0000) /** * @} */ -/** @defgroup TIM_OSSI_Off_State_Selection_for_Idle_mode_state +/** @defgroup TIM_OSSI_Off_State_Selection_for_Idle_mode_state TIM OSSI OffState Selection for Idle mode state * @{ */ #define TIM_OSSI_ENABLE (TIM_BDTR_OSSI) #define TIM_OSSI_DISABLE ((uint32_t)0x0000) - -#define IS_TIM_OSSI_STATE(STATE) (((STATE) == TIM_OSSI_ENABLE) || \ - ((STATE) == TIM_OSSI_DISABLE)) /** * @} */ -/** @defgroup TIM_Lock_level + +/** @defgroup TIM_Lock_level TIM Lock level * @{ */ #define TIM_LOCKLEVEL_OFF ((uint32_t)0x0000) #define TIM_LOCKLEVEL_1 (TIM_BDTR_LOCK_0) #define TIM_LOCKLEVEL_2 (TIM_BDTR_LOCK_1) #define TIM_LOCKLEVEL_3 (TIM_BDTR_LOCK) - -#define IS_TIM_LOCK_LEVEL(LEVEL) (((LEVEL) == TIM_LOCKLEVEL_OFF) || \ - ((LEVEL) == TIM_LOCKLEVEL_1) || \ - ((LEVEL) == TIM_LOCKLEVEL_2) || \ - ((LEVEL) == TIM_LOCKLEVEL_3)) /** * @} */ -/** @defgroup TIM_Break_Input_enable_disable +/** @defgroup TIM_Break_Input_enable_disable TIM Break Input State * @{ */ #define TIM_BREAK_ENABLE (TIM_BDTR_BKE) #define TIM_BREAK_DISABLE ((uint32_t)0x0000) - -#define IS_TIM_BREAK_STATE(STATE) (((STATE) == TIM_BREAK_ENABLE) || \ - ((STATE) == TIM_BREAK_DISABLE)) /** * @} */ -/** @defgroup TIM_Break_Polarity + +/** @defgroup TIM_Break_Polarity TIM Break Polarity * @{ */ #define TIM_BREAKPOLARITY_LOW ((uint32_t)0x0000) #define TIM_BREAKPOLARITY_HIGH (TIM_BDTR_BKP) - -#define IS_TIM_BREAK_POLARITY(POLARITY) (((POLARITY) == TIM_BREAKPOLARITY_LOW) || \ - ((POLARITY) == TIM_BREAKPOLARITY_HIGH)) /** * @} */ -/** @defgroup TIM_AOE_Bit_Set_Reset + +/** @defgroup TIM_AOE_Bit_Set_Reset TIM AOE Bit State * @{ */ #define TIM_AUTOMATICOUTPUT_ENABLE (TIM_BDTR_AOE) #define TIM_AUTOMATICOUTPUT_DISABLE ((uint32_t)0x0000) - -#define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE) (((STATE) == TIM_AUTOMATICOUTPUT_ENABLE) || \ - ((STATE) == TIM_AUTOMATICOUTPUT_DISABLE)) /** * @} */ -/** @defgroup TIM_Master_Mode_Selection +/** @defgroup TIM_Master_Mode_Selection TIM Master Mode Selection * @{ */ #define TIM_TRGO_RESET ((uint32_t)0x0000) @@ -855,22 +692,12 @@ typedef struct #define TIM_TRGO_OC1REF (TIM_CR2_MMS_2) #define TIM_TRGO_OC2REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_0)) #define TIM_TRGO_OC3REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1)) -#define TIM_TRGO_OC4REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1 | TIM_CR2_MMS_0)) - -#define IS_TIM_TRGO_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO_RESET) || \ - ((SOURCE) == TIM_TRGO_ENABLE) || \ - ((SOURCE) == TIM_TRGO_UPDATE) || \ - ((SOURCE) == TIM_TRGO_OC1) || \ - ((SOURCE) == TIM_TRGO_OC1REF) || \ - ((SOURCE) == TIM_TRGO_OC2REF) || \ - ((SOURCE) == TIM_TRGO_OC3REF) || \ - ((SOURCE) == TIM_TRGO_OC4REF)) - - +#define TIM_TRGO_OC4REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1 | TIM_CR2_MMS_0)) /** * @} */ -/** @defgroup TIM_Slave_Mode + +/** @defgroup TIM_Slave_Mode TIM Slave Mode * @{ */ #define TIM_SLAVEMODE_DISABLE ((uint32_t)0x0000) @@ -878,28 +705,20 @@ typedef struct #define TIM_SLAVEMODE_GATED ((uint32_t)0x0005) #define TIM_SLAVEMODE_TRIGGER ((uint32_t)0x0006) #define TIM_SLAVEMODE_EXTERNAL1 ((uint32_t)0x0007) - -#define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \ - ((MODE) == TIM_SLAVEMODE_GATED) || \ - ((MODE) == TIM_SLAVEMODE_RESET) || \ - ((MODE) == TIM_SLAVEMODE_TRIGGER) || \ - ((MODE) == TIM_SLAVEMODE_EXTERNAL1)) /** * @} */ -/** @defgroup TIM_Master_Slave_Mode +/** @defgroup TIM_Master_Slave_Mode TIM Master Slave Mode * @{ */ - #define TIM_MASTERSLAVEMODE_ENABLE ((uint32_t)0x0080) #define TIM_MASTERSLAVEMODE_DISABLE ((uint32_t)0x0000) -#define IS_TIM_MSM_STATE(STATE) (((STATE) == TIM_MASTERSLAVEMODE_ENABLE) || \ - ((STATE) == TIM_MASTERSLAVEMODE_DISABLE)) /** * @} */ -/** @defgroup TIM_Trigger_Selection + +/** @defgroup TIM_Trigger_Selection TIM Trigger Selection * @{ */ #define TIM_TS_ITR0 ((uint32_t)0x0000) @@ -911,28 +730,11 @@ typedef struct #define TIM_TS_TI2FP2 ((uint32_t)0x0060) #define TIM_TS_ETRF ((uint32_t)0x0070) #define TIM_TS_NONE ((uint32_t)0xFFFF) -#define IS_TIM_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ - ((SELECTION) == TIM_TS_ITR1) || \ - ((SELECTION) == TIM_TS_ITR2) || \ - ((SELECTION) == TIM_TS_ITR3) || \ - ((SELECTION) == TIM_TS_TI1F_ED) || \ - ((SELECTION) == TIM_TS_TI1FP1) || \ - ((SELECTION) == TIM_TS_TI2FP2) || \ - ((SELECTION) == TIM_TS_ETRF)) -#define IS_TIM_INTERNAL_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ - ((SELECTION) == TIM_TS_ITR1) || \ - ((SELECTION) == TIM_TS_ITR2) || \ - ((SELECTION) == TIM_TS_ITR3)) -#define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ - ((SELECTION) == TIM_TS_ITR1) || \ - ((SELECTION) == TIM_TS_ITR2) || \ - ((SELECTION) == TIM_TS_ITR3) || \ - ((SELECTION) == TIM_TS_NONE)) /** * @} */ -/** @defgroup TIM_Trigger_Polarity +/** @defgroup TIM_Trigger_Polarity TIM Trigger Polarity * @{ */ #define TIM_TRIGGERPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx trigger sources */ @@ -940,151 +742,84 @@ typedef struct #define TIM_TRIGGERPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Polarity for TIxFPx or TI1_ED trigger sources */ #define TIM_TRIGGERPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Polarity for TIxFPx or TI1_ED trigger sources */ #define TIM_TRIGGERPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Polarity for TIxFPx or TI1_ED trigger sources */ - -#define IS_TIM_TRIGGERPOLARITY(POLARITY) (((POLARITY) == TIM_TRIGGERPOLARITY_INVERTED ) || \ - ((POLARITY) == TIM_TRIGGERPOLARITY_NONINVERTED) || \ - ((POLARITY) == TIM_TRIGGERPOLARITY_RISING ) || \ - ((POLARITY) == TIM_TRIGGERPOLARITY_FALLING ) || \ - ((POLARITY) == TIM_TRIGGERPOLARITY_BOTHEDGE )) /** * @} */ -/** @defgroup TIM_Trigger_Prescaler +/** @defgroup TIM_Trigger_Prescaler TIM Trigger Prescaler * @{ */ #define TIM_TRIGGERPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ #define TIM_TRIGGERPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Trigger: Capture performed once every 2 events. */ #define TIM_TRIGGERPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Trigger: Capture performed once every 4 events. */ #define TIM_TRIGGERPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Trigger: Capture performed once every 8 events. */ - -#define IS_TIM_TRIGGERPRESCALER(PRESCALER) (((PRESCALER) == TIM_TRIGGERPRESCALER_DIV1) || \ - ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV2) || \ - ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV4) || \ - ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV8)) /** * @} */ -/** @defgroup TIM_Trigger_Filter - * @{ - */ -#define IS_TIM_TRIGGERFILTER(ICFILTER) ((ICFILTER) <= 0xF) -/** - * @} - */ - /** @defgroup TIM_TI1_Selection +/** @defgroup TIM_TI1_Selection TIM TI1 Selection * @{ */ #define TIM_TI1SELECTION_CH1 ((uint32_t)0x0000) #define TIM_TI1SELECTION_XORCOMBINATION (TIM_CR2_TI1S) - -#define IS_TIM_TI1SELECTION(TI1SELECTION) (((TI1SELECTION) == TIM_TI1SELECTION_CH1) || \ - ((TI1SELECTION) == TIM_TI1SELECTION_XORCOMBINATION)) /** * @} */ -/** @defgroup TIM_DMA_Base_address - * @{ - */ -#define TIM_DMABase_CR1 (0x00000000) -#define TIM_DMABase_CR2 (0x00000001) -#define TIM_DMABase_SMCR (0x00000002) -#define TIM_DMABase_DIER (0x00000003) -#define TIM_DMABase_SR (0x00000004) -#define TIM_DMABase_EGR (0x00000005) -#define TIM_DMABase_CCMR1 (0x00000006) -#define TIM_DMABase_CCMR2 (0x00000007) -#define TIM_DMABase_CCER (0x00000008) -#define TIM_DMABase_CNT (0x00000009) -#define TIM_DMABase_PSC (0x0000000A) -#define TIM_DMABase_ARR (0x0000000B) -#define TIM_DMABase_RCR (0x0000000C) -#define TIM_DMABase_CCR1 (0x0000000D) -#define TIM_DMABase_CCR2 (0x0000000E) -#define TIM_DMABase_CCR3 (0x0000000F) -#define TIM_DMABase_CCR4 (0x00000010) -#define TIM_DMABase_BDTR (0x00000011) -#define TIM_DMABase_DCR (0x00000012) -#define TIM_DMABase_OR (0x00000013) -#define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABase_CR1) || \ - ((BASE) == TIM_DMABase_CR2) || \ - ((BASE) == TIM_DMABase_SMCR) || \ - ((BASE) == TIM_DMABase_DIER) || \ - ((BASE) == TIM_DMABase_SR) || \ - ((BASE) == TIM_DMABase_EGR) || \ - ((BASE) == TIM_DMABase_CCMR1) || \ - ((BASE) == TIM_DMABase_CCMR2) || \ - ((BASE) == TIM_DMABase_CCER) || \ - ((BASE) == TIM_DMABase_CNT) || \ - ((BASE) == TIM_DMABase_PSC) || \ - ((BASE) == TIM_DMABase_ARR) || \ - ((BASE) == TIM_DMABase_RCR) || \ - ((BASE) == TIM_DMABase_CCR1) || \ - ((BASE) == TIM_DMABase_CCR2) || \ - ((BASE) == TIM_DMABase_CCR3) || \ - ((BASE) == TIM_DMABase_CCR4) || \ - ((BASE) == TIM_DMABase_BDTR) || \ - ((BASE) == TIM_DMABase_DCR) || \ - ((BASE) == TIM_DMABase_OR)) +/** @defgroup TIM_DMA_Base_address TIM DMA Base address + * @{ + */ +#define TIM_DMABASE_CR1 (0x00000000) +#define TIM_DMABASE_CR2 (0x00000001) +#define TIM_DMABASE_SMCR (0x00000002) +#define TIM_DMABASE_DIER (0x00000003) +#define TIM_DMABASE_SR (0x00000004) +#define TIM_DMABASE_EGR (0x00000005) +#define TIM_DMABASE_CCMR1 (0x00000006) +#define TIM_DMABASE_CCMR2 (0x00000007) +#define TIM_DMABASE_CCER (0x00000008) +#define TIM_DMABASE_CNT (0x00000009) +#define TIM_DMABASE_PSC (0x0000000A) +#define TIM_DMABASE_ARR (0x0000000B) +#define TIM_DMABASE_RCR (0x0000000C) +#define TIM_DMABASE_CCR1 (0x0000000D) +#define TIM_DMABASE_CCR2 (0x0000000E) +#define TIM_DMABASE_CCR3 (0x0000000F) +#define TIM_DMABASE_CCR4 (0x00000010) +#define TIM_DMABASE_BDTR (0x00000011) +#define TIM_DMABASE_DCR (0x00000012) +#define TIM_DMABASE_OR (0x00000013) /** * @} */ -/** @defgroup TIM_DMA_Burst_Length - * @{ - */ -#define TIM_DMABurstLength_1Transfer (0x00000000) -#define TIM_DMABurstLength_2Transfers (0x00000100) -#define TIM_DMABurstLength_3Transfers (0x00000200) -#define TIM_DMABurstLength_4Transfers (0x00000300) -#define TIM_DMABurstLength_5Transfers (0x00000400) -#define TIM_DMABurstLength_6Transfers (0x00000500) -#define TIM_DMABurstLength_7Transfers (0x00000600) -#define TIM_DMABurstLength_8Transfers (0x00000700) -#define TIM_DMABurstLength_9Transfers (0x00000800) -#define TIM_DMABurstLength_10Transfers (0x00000900) -#define TIM_DMABurstLength_11Transfers (0x00000A00) -#define TIM_DMABurstLength_12Transfers (0x00000B00) -#define TIM_DMABurstLength_13Transfers (0x00000C00) -#define TIM_DMABurstLength_14Transfers (0x00000D00) -#define TIM_DMABurstLength_15Transfers (0x00000E00) -#define TIM_DMABurstLength_16Transfers (0x00000F00) -#define TIM_DMABurstLength_17Transfers (0x00001000) -#define TIM_DMABurstLength_18Transfers (0x00001100) -#define IS_TIM_DMA_LENGTH(LENGTH) (((LENGTH) == TIM_DMABurstLength_1Transfer) || \ - ((LENGTH) == TIM_DMABurstLength_2Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_3Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_4Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_5Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_6Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_7Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_8Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_9Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_10Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_11Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_12Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_13Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_14Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_15Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_16Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_17Transfers) || \ - ((LENGTH) == TIM_DMABurstLength_18Transfers)) -/** - * @} - */ - -/** @defgroup TIM_Input_Capture_Filer_Value - * @{ - */ -#define IS_TIM_IC_FILTER(ICFILTER) ((ICFILTER) <= 0xF) +/** @defgroup TIM_DMA_Burst_Length TIM DMA Burst Length + * @{ + */ +#define TIM_DMABURSTLENGTH_1TRANSFER (0x00000000) +#define TIM_DMABURSTLENGTH_2TRANSFERS (0x00000100) +#define TIM_DMABURSTLENGTH_3TRANSFERS (0x00000200) +#define TIM_DMABURSTLENGTH_4TRANSFERS (0x00000300) +#define TIM_DMABURSTLENGTH_5TRANSFERS (0x00000400) +#define TIM_DMABURSTLENGTH_6TRANSFERS (0x00000500) +#define TIM_DMABURSTLENGTH_7TRANSFERS (0x00000600) +#define TIM_DMABURSTLENGTH_8TRANSFERS (0x00000700) +#define TIM_DMABURSTLENGTH_9TRANSFERS (0x00000800) +#define TIM_DMABURSTLENGTH_10TRANSFERS (0x00000900) +#define TIM_DMABURSTLENGTH_11TRANSFERS (0x00000A00) +#define TIM_DMABURSTLENGTH_12TRANSFERS (0x00000B00) +#define TIM_DMABURSTLENGTH_13TRANSFERS (0x00000C00) +#define TIM_DMABURSTLENGTH_14TRANSFERS (0x00000D00) +#define TIM_DMABURSTLENGTH_15TRANSFERS (0x00000E00) +#define TIM_DMABURSTLENGTH_16TRANSFERS (0x00000F00) +#define TIM_DMABURSTLENGTH_17TRANSFERS (0x00001000) +#define TIM_DMABURSTLENGTH_18TRANSFERS (0x00001100) /** * @} - */ + */ -/** @defgroup DMA_Handle_index +/** @defgroup DMA_Handle_index DMA Handle index * @{ */ #define TIM_DMA_ID_UPDATE ((uint16_t) 0x0) /*!< Index of the DMA handle used for Update DMA requests */ @@ -1098,7 +833,7 @@ typedef struct * @} */ -/** @defgroup Channel_CC_State +/** @defgroup Channel_CC_State Channel CC State * @{ */ #define TIM_CCx_ENABLE ((uint32_t)0x0001) @@ -1114,7 +849,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ - +/** @defgroup TIM_Exported_Macros TIM Exported Macros + * @{ + */ /** @brief Reset TIM handle state * @param __HANDLE__: TIM handle * @retval None @@ -1136,11 +873,6 @@ typedef struct #define __HAL_TIM_MOE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->BDTR|=(TIM_BDTR_MOE)) -/* The counter of a timer instance is disabled only if all the CCx and CCxN - channels have been disabled */ -#define CCER_CCxE_MASK ((uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E)) -#define CCER_CCxNE_MASK ((uint32_t)(TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) - /** * @brief Disable the TIM peripheral. * @param __HANDLE__: TIM handle @@ -1148,9 +880,9 @@ typedef struct */ #define __HAL_TIM_DISABLE(__HANDLE__) \ do { \ - if (((__HANDLE__)->Instance->CCER & CCER_CCxE_MASK) == 0) \ + if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0) \ { \ - if(((__HANDLE__)->Instance->CCER & CCER_CCxNE_MASK) == 0) \ + if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0) \ { \ (__HANDLE__)->Instance->CR1 &= ~(TIM_CR1_CEN); \ } \ @@ -1166,9 +898,9 @@ typedef struct */ #define __HAL_TIM_MOE_DISABLE(__HANDLE__) \ do { \ - if (((__HANDLE__)->Instance->CCER & CCER_CCxE_MASK) == 0) \ + if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0) \ { \ - if(((__HANDLE__)->Instance->CCER & CCER_CCxNE_MASK) == 0) \ + if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0) \ { \ (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE); \ } \ @@ -1182,24 +914,36 @@ typedef struct #define __HAL_TIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__)) #define __HAL_TIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__)) -#define __HAL_TIM_GET_ITSTATUS(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) +#define __HAL_TIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) #define __HAL_TIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->SR = ~(__INTERRUPT__)) -#define __HAL_TIM_DIRECTION_STATUS(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR)) -#define __HAL_TIM_PRESCALER (__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__)) +#define __HAL_TIM_IS_TIM_COUNTING_DOWN(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR)) +#define __HAL_TIM_SET_PRESCALER(__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__)) -#define __HAL_TIM_SetICPrescalerValue(__HANDLE__, __CHANNEL__, __ICPSC__) \ +#define TIM_SET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__, __ICPSC__) \ (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= (__ICPSC__)) :\ ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= ((__ICPSC__) << 8)) :\ ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= (__ICPSC__)) :\ ((__HANDLE__)->Instance->CCMR2 |= ((__ICPSC__) << 8))) -#define __HAL_TIM_ResetICPrescalerValue(__HANDLE__, __CHANNEL__) \ +#define TIM_RESET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__) \ (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC1PSC) :\ ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC2PSC) :\ ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC3PSC) :\ ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC4PSC)) +#define TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \ +(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER |= (__POLARITY__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 4)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 8)) :\ + ((__HANDLE__)->Instance->CCER |= (((__POLARITY__) << 12) & TIM_CCER_CC4P))) + +#define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \ +(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\ + ((__HANDLE__)->Instance->CCER &= (uint16_t)~TIM_CCER_CC4P)) + /** * @brief Sets the TIM Capture Compare Register value on runtime without * calling another time ConfigChannel function. @@ -1213,7 +957,7 @@ typedef struct * @param __COMPARE__: specifies the Capture Compare register new value. * @retval None */ -#define __HAL_TIM_SetCompare(__HANDLE__, __CHANNEL__, __COMPARE__) \ +#define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \ (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2)) = (__COMPARE__)) /** @@ -1227,7 +971,7 @@ typedef struct * @arg TIM_CHANNEL_4: get capture/compare 4 register value * @retval None */ -#define __HAL_TIM_GetCompare(__HANDLE__, __CHANNEL__) \ +#define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \ (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2))) /** @@ -1236,14 +980,14 @@ typedef struct * @param __COUNTER__: specifies the Counter register new value. * @retval None */ -#define __HAL_TIM_SetCounter(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__)) +#define __HAL_TIM_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__)) /** * @brief Gets the TIM Counter Register value on runtime. * @param __HANDLE__: TIM handle. * @retval None */ -#define __HAL_TIM_GetCounter(__HANDLE__) ((__HANDLE__)->Instance->CNT) +#define __HAL_TIM_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNT) /** * @brief Sets the TIM Autoreload Register value on runtime without calling @@ -1252,7 +996,7 @@ typedef struct * @param __AUTORELOAD__: specifies the Counter register new value. * @retval None */ -#define __HAL_TIM_SetAutoreload(__HANDLE__, __AUTORELOAD__) \ +#define __HAL_TIM_SET_AUTORELOAD(__HANDLE__, __AUTORELOAD__) \ do{ \ (__HANDLE__)->Instance->ARR = (__AUTORELOAD__); \ (__HANDLE__)->Init.Period = (__AUTORELOAD__); \ @@ -1262,7 +1006,7 @@ typedef struct * @param __HANDLE__: TIM handle. * @retval None */ -#define __HAL_TIM_GetAutoreload(__HANDLE__) ((__HANDLE__)->Instance->ARR) +#define __HAL_TIM_GET_AUTORELOAD(__HANDLE__) ((__HANDLE__)->Instance->ARR) /** * @brief Sets the TIM Clock Division value on runtime without calling @@ -1275,7 +1019,7 @@ typedef struct * @arg TIM_CLOCKDIVISION_DIV4 * @retval None */ -#define __HAL_TIM_SetClockDivision(__HANDLE__, __CKD__) \ +#define __HAL_TIM_SET_CLOCKDIVISION(__HANDLE__, __CKD__) \ do{ \ (__HANDLE__)->Instance->CR1 &= (uint16_t)(~TIM_CR1_CKD); \ (__HANDLE__)->Instance->CR1 |= (__CKD__); \ @@ -1286,7 +1030,7 @@ typedef struct * @param __HANDLE__: TIM handle. * @retval None */ -#define __HAL_TIM_GetClockDivision(__HANDLE__) ((__HANDLE__)->Instance->CR1 & TIM_CR1_CKD) +#define __HAL_TIM_GET_CLOCKDIVISION(__HANDLE__) ((__HANDLE__)->Instance->CR1 & TIM_CR1_CKD) /** * @brief Sets the TIM Input Capture prescaler on runtime without calling @@ -1306,10 +1050,10 @@ typedef struct * @arg TIM_ICPSC_DIV8: capture is done once every 8 events * @retval None */ -#define __HAL_TIM_SetICPrescaler(__HANDLE__, __CHANNEL__, __ICPSC__) \ +#define __HAL_TIM_SET_ICPRESCALER(__HANDLE__, __CHANNEL__, __ICPSC__) \ do{ \ - __HAL_TIM_ResetICPrescalerValue((__HANDLE__), (__CHANNEL__)); \ - __HAL_TIM_SetICPrescalerValue((__HANDLE__), (__CHANNEL__), (__ICPSC__)); \ + TIM_RESET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__)); \ + TIM_SET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__), (__ICPSC__)); \ } while(0) /** @@ -1323,11 +1067,58 @@ typedef struct * @arg TIM_CHANNEL_4: get input capture 4 prescaler value * @retval None */ -#define __HAL_TIM_GetICPrescaler(__HANDLE__, __CHANNEL__) \ +#define __HAL_TIM_GET_ICPRESCALER(__HANDLE__, __CHANNEL__) \ (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC1PSC) :\ ((__CHANNEL__) == TIM_CHANNEL_2) ? (((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC2PSC) >> 8) :\ ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC3PSC) :\ (((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC4PSC)) >> 8) + +/** + * @brief Set the Update Request Source (URS) bit of the TIMx_CR1 register + * @param __HANDLE__: TIM handle. + * @note When the USR bit of the TIMx_CR1 register is set, only counter + * overflow/underflow generates an update interrupt or DMA request (if + * enabled) + * @retval None + */ +#define __HAL_TIM_URS_ENABLE(__HANDLE__) \ + ((__HANDLE__)->Instance->CR1|= (TIM_CR1_URS)) + +/** + * @brief Reset the Update Request Source (URS) bit of the TIMx_CR1 register + * @param __HANDLE__: TIM handle. + * @note When the USR bit of the TIMx_CR1 register is reset, any of the + * following events generate an update interrupt or DMA request (if + * enabled): + * – Counter overflow/underflow + * – Setting the UG bit + * – Update generation through the slave mode controller + * @retval None + */ +#define __HAL_TIM_URS_DISABLE(__HANDLE__) \ + ((__HANDLE__)->Instance->CR1&=~(TIM_CR1_URS)) + +/** + * @brief Sets the TIM Capture x input polarity on runtime. + * @param __HANDLE__: TIM handle. + * @param __CHANNEL__: TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @param __POLARITY__: Polarity for TIx source + * @arg TIM_INPUTCHANNELPOLARITY_RISING: Rising Edge + * @arg TIM_INPUTCHANNELPOLARITY_FALLING: Falling Edge + * @arg TIM_INPUTCHANNELPOLARITY_BOTHEDGE: Rising and Falling Edge + * @note The polarity TIM_INPUTCHANNELPOLARITY_BOTHEDGE is not authorized for TIM Channel 4. + * @retval None + */ +#define __HAL_TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \ + do{ \ + TIM_RESET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__)); \ + TIM_SET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__), (__POLARITY__)); \ + }while(0) /** * @} */ @@ -1336,6 +1127,13 @@ typedef struct #include "stm32f4xx_hal_tim_ex.h" /* Exported functions --------------------------------------------------------*/ +/** @addtogroup TIM_Exported_Functions + * @{ + */ + +/** @addtogroup TIM_Exported_Functions_Group1 + * @{ + */ /* Time Base functions ********************************************************/ HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim); @@ -1351,7 +1149,13 @@ HAL_StatusTypeDef HAL_TIM_Base_Stop_IT(TIM_HandleTypeDef *htim); /* Non-Blocking mode: DMA */ HAL_StatusTypeDef HAL_TIM_Base_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA(TIM_HandleTypeDef *htim); +/** + * @} + */ +/** @addtogroup TIM_Exported_Functions_Group2 + * @{ + */ /* Timer Output Compare functions **********************************************/ HAL_StatusTypeDef HAL_TIM_OC_Init(TIM_HandleTypeDef *htim); HAL_StatusTypeDef HAL_TIM_OC_DeInit(TIM_HandleTypeDef *htim); @@ -1367,6 +1171,13 @@ HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group3 + * @{ + */ /* Timer PWM functions *********************************************************/ HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim); HAL_StatusTypeDef HAL_TIM_PWM_DeInit(TIM_HandleTypeDef *htim); @@ -1382,6 +1193,13 @@ HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group4 + * @{ + */ /* Timer Input Capture functions ***********************************************/ HAL_StatusTypeDef HAL_TIM_IC_Init(TIM_HandleTypeDef *htim); HAL_StatusTypeDef HAL_TIM_IC_DeInit(TIM_HandleTypeDef *htim); @@ -1397,6 +1215,13 @@ HAL_StatusTypeDef HAL_TIM_IC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group5 + * @{ + */ /* Timer One Pulse functions ***************************************************/ HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePulseMode); HAL_StatusTypeDef HAL_TIM_OnePulse_DeInit(TIM_HandleTypeDef *htim); @@ -1410,6 +1235,13 @@ HAL_StatusTypeDef HAL_TIM_OnePulse_Stop(TIM_HandleTypeDef *htim, uint32_t Output HAL_StatusTypeDef HAL_TIM_OnePulse_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group6 + * @{ + */ /* Timer Encoder functions *****************************************************/ HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, TIM_Encoder_InitTypeDef* sConfig); HAL_StatusTypeDef HAL_TIM_Encoder_DeInit(TIM_HandleTypeDef *htim); @@ -1425,9 +1257,23 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Chan HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData1, uint32_t *pData2, uint16_t Length); HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group7 + * @{ + */ /* Interrupt Handler functions **********************************************/ void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group8 + * @{ + */ /* Control functions *********************************************************/ HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef* sConfig, uint32_t Channel); HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef* sConfig, uint32_t Channel); @@ -1437,6 +1283,7 @@ HAL_StatusTypeDef HAL_TIM_ConfigOCrefClear(TIM_HandleTypeDef *htim, TIM_ClearInp HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockConfigTypeDef * sClockSourceConfig); HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_Selection); HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef * sSlaveConfig); +HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization_IT(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef * sSlaveConfig); HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, \ uint32_t *BurstBuffer, uint32_t BurstLength); HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc); @@ -1446,6 +1293,13 @@ HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t Bu HAL_StatusTypeDef HAL_TIM_GenerateEvent(TIM_HandleTypeDef *htim, uint32_t EventSource); uint32_t HAL_TIM_ReadCapturedValue(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group9 + * @{ + */ /* Callback in non blocking modes (Interrupt and DMA) *************************/ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim); void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim); @@ -1454,6 +1308,13 @@ void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim); void HAL_TIM_TriggerCallback(TIM_HandleTypeDef *htim); void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group10 + * @{ + */ /* Peripheral State functions **************************************************/ HAL_TIM_StateTypeDef HAL_TIM_Base_GetState(TIM_HandleTypeDef *htim); HAL_TIM_StateTypeDef HAL_TIM_OC_GetState(TIM_HandleTypeDef *htim); @@ -1462,14 +1323,274 @@ HAL_TIM_StateTypeDef HAL_TIM_IC_GetState(TIM_HandleTypeDef *htim); HAL_TIM_StateTypeDef HAL_TIM_OnePulse_GetState(TIM_HandleTypeDef *htim); HAL_TIM_StateTypeDef HAL_TIM_Encoder_GetState(TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup TIM_Private_Macros TIM Private Macros + * @{ + */ + +/** @defgroup TIM_IS_TIM_Definitions TIM Private macros to check input parameters + * @{ + */ +#define IS_TIM_COUNTER_MODE(MODE) (((MODE) == TIM_COUNTERMODE_UP) || \ + ((MODE) == TIM_COUNTERMODE_DOWN) || \ + ((MODE) == TIM_COUNTERMODE_CENTERALIGNED1) || \ + ((MODE) == TIM_COUNTERMODE_CENTERALIGNED2) || \ + ((MODE) == TIM_COUNTERMODE_CENTERALIGNED3)) + +#define IS_TIM_CLOCKDIVISION_DIV(DIV) (((DIV) == TIM_CLOCKDIVISION_DIV1) || \ + ((DIV) == TIM_CLOCKDIVISION_DIV2) || \ + ((DIV) == TIM_CLOCKDIVISION_DIV4)) + +#define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \ + ((MODE) == TIM_OCMODE_PWM2)) + +#define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \ + ((MODE) == TIM_OCMODE_ACTIVE) || \ + ((MODE) == TIM_OCMODE_INACTIVE) || \ + ((MODE) == TIM_OCMODE_TOGGLE) || \ + ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \ + ((MODE) == TIM_OCMODE_FORCED_INACTIVE)) + +#define IS_TIM_FAST_STATE(STATE) (((STATE) == TIM_OCFAST_DISABLE) || \ + ((STATE) == TIM_OCFAST_ENABLE)) + +#define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPOLARITY_HIGH) || \ + ((POLARITY) == TIM_OCPOLARITY_LOW)) + +#define IS_TIM_OCN_POLARITY(POLARITY) (((POLARITY) == TIM_OCNPOLARITY_HIGH) || \ + ((POLARITY) == TIM_OCNPOLARITY_LOW)) + +#define IS_TIM_OCIDLE_STATE(STATE) (((STATE) == TIM_OCIDLESTATE_SET) || \ + ((STATE) == TIM_OCIDLESTATE_RESET)) + +#define IS_TIM_OCNIDLE_STATE(STATE) (((STATE) == TIM_OCNIDLESTATE_SET) || \ + ((STATE) == TIM_OCNIDLESTATE_RESET)) + +#define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ + ((CHANNEL) == TIM_CHANNEL_2) || \ + ((CHANNEL) == TIM_CHANNEL_3) || \ + ((CHANNEL) == TIM_CHANNEL_4) || \ + ((CHANNEL) == TIM_CHANNEL_ALL)) + +#define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ + ((CHANNEL) == TIM_CHANNEL_2)) + +#define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ + ((CHANNEL) == TIM_CHANNEL_2) || \ + ((CHANNEL) == TIM_CHANNEL_3)) + +#define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPOLARITY_RISING) || \ + ((POLARITY) == TIM_ICPOLARITY_FALLING) || \ + ((POLARITY) == TIM_ICPOLARITY_BOTHEDGE)) + +#define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSELECTION_DIRECTTI) || \ + ((SELECTION) == TIM_ICSELECTION_INDIRECTTI) || \ + ((SELECTION) == TIM_ICSELECTION_TRC)) + +#define IS_TIM_IC_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ICPSC_DIV1) || \ + ((PRESCALER) == TIM_ICPSC_DIV2) || \ + ((PRESCALER) == TIM_ICPSC_DIV4) || \ + ((PRESCALER) == TIM_ICPSC_DIV8)) + +#define IS_TIM_OPM_MODE(MODE) (((MODE) == TIM_OPMODE_SINGLE) || \ + ((MODE) == TIM_OPMODE_REPETITIVE)) + +#define IS_TIM_DMA_SOURCE(SOURCE) ((((SOURCE) & 0xFFFF80FF) == 0x00000000) && ((SOURCE) != 0x00000000)) + +#define IS_TIM_ENCODER_MODE(MODE) (((MODE) == TIM_ENCODERMODE_TI1) || \ + ((MODE) == TIM_ENCODERMODE_TI2) || \ + ((MODE) == TIM_ENCODERMODE_TI12)) + +#define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & 0xFFFFFF00) == 0x00000000) && ((SOURCE) != 0x00000000)) + +#define IS_TIM_CLOCKSOURCE(CLOCK) (((CLOCK) == TIM_CLOCKSOURCE_INTERNAL) || \ + ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE2) || \ + ((CLOCK) == TIM_CLOCKSOURCE_ITR0) || \ + ((CLOCK) == TIM_CLOCKSOURCE_ITR1) || \ + ((CLOCK) == TIM_CLOCKSOURCE_ITR2) || \ + ((CLOCK) == TIM_CLOCKSOURCE_ITR3) || \ + ((CLOCK) == TIM_CLOCKSOURCE_TI1ED) || \ + ((CLOCK) == TIM_CLOCKSOURCE_TI1) || \ + ((CLOCK) == TIM_CLOCKSOURCE_TI2) || \ + ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE1)) + +#define IS_TIM_CLOCKPOLARITY(POLARITY) (((POLARITY) == TIM_CLOCKPOLARITY_INVERTED) || \ + ((POLARITY) == TIM_CLOCKPOLARITY_NONINVERTED) || \ + ((POLARITY) == TIM_CLOCKPOLARITY_RISING) || \ + ((POLARITY) == TIM_CLOCKPOLARITY_FALLING) || \ + ((POLARITY) == TIM_CLOCKPOLARITY_BOTHEDGE)) + +#define IS_TIM_CLOCKPRESCALER(PRESCALER) (((PRESCALER) == TIM_CLOCKPRESCALER_DIV1) || \ + ((PRESCALER) == TIM_CLOCKPRESCALER_DIV2) || \ + ((PRESCALER) == TIM_CLOCKPRESCALER_DIV4) || \ + ((PRESCALER) == TIM_CLOCKPRESCALER_DIV8)) + +#define IS_TIM_CLOCKFILTER(ICFILTER) ((ICFILTER) <= 0xF) + +#define IS_TIM_CLEARINPUT_SOURCE(SOURCE) (((SOURCE) == TIM_CLEARINPUTSOURCE_NONE) || \ + ((SOURCE) == TIM_CLEARINPUTSOURCE_ETR)) + +#define IS_TIM_CLEARINPUT_POLARITY(POLARITY) (((POLARITY) == TIM_CLEARINPUTPOLARITY_INVERTED) || \ + ((POLARITY) == TIM_CLEARINPUTPOLARITY_NONINVERTED)) + +#define IS_TIM_CLEARINPUT_PRESCALER(PRESCALER) (((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV1) || \ + ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV2) || \ + ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV4) || \ + ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV8)) + +#define IS_TIM_CLEARINPUT_FILTER(ICFILTER) ((ICFILTER) <= 0xF) + +#define IS_TIM_OSSR_STATE(STATE) (((STATE) == TIM_OSSR_ENABLE) || \ + ((STATE) == TIM_OSSR_DISABLE)) + +#define IS_TIM_OSSI_STATE(STATE) (((STATE) == TIM_OSSI_ENABLE) || \ + ((STATE) == TIM_OSSI_DISABLE)) + +#define IS_TIM_LOCK_LEVEL(LEVEL) (((LEVEL) == TIM_LOCKLEVEL_OFF) || \ + ((LEVEL) == TIM_LOCKLEVEL_1) || \ + ((LEVEL) == TIM_LOCKLEVEL_2) || \ + ((LEVEL) == TIM_LOCKLEVEL_3)) + +#define IS_TIM_BREAK_STATE(STATE) (((STATE) == TIM_BREAK_ENABLE) || \ + ((STATE) == TIM_BREAK_DISABLE)) + +#define IS_TIM_BREAK_POLARITY(POLARITY) (((POLARITY) == TIM_BREAKPOLARITY_LOW) || \ + ((POLARITY) == TIM_BREAKPOLARITY_HIGH)) + +#define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE) (((STATE) == TIM_AUTOMATICOUTPUT_ENABLE) || \ + ((STATE) == TIM_AUTOMATICOUTPUT_DISABLE)) + +#define IS_TIM_TRGO_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO_RESET) || \ + ((SOURCE) == TIM_TRGO_ENABLE) || \ + ((SOURCE) == TIM_TRGO_UPDATE) || \ + ((SOURCE) == TIM_TRGO_OC1) || \ + ((SOURCE) == TIM_TRGO_OC1REF) || \ + ((SOURCE) == TIM_TRGO_OC2REF) || \ + ((SOURCE) == TIM_TRGO_OC3REF) || \ + ((SOURCE) == TIM_TRGO_OC4REF)) + +#define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \ + ((MODE) == TIM_SLAVEMODE_GATED) || \ + ((MODE) == TIM_SLAVEMODE_RESET) || \ + ((MODE) == TIM_SLAVEMODE_TRIGGER) || \ + ((MODE) == TIM_SLAVEMODE_EXTERNAL1)) + +#define IS_TIM_MSM_STATE(STATE) (((STATE) == TIM_MASTERSLAVEMODE_ENABLE) || \ + ((STATE) == TIM_MASTERSLAVEMODE_DISABLE)) + +#define IS_TIM_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ + ((SELECTION) == TIM_TS_ITR1) || \ + ((SELECTION) == TIM_TS_ITR2) || \ + ((SELECTION) == TIM_TS_ITR3) || \ + ((SELECTION) == TIM_TS_TI1F_ED) || \ + ((SELECTION) == TIM_TS_TI1FP1) || \ + ((SELECTION) == TIM_TS_TI2FP2) || \ + ((SELECTION) == TIM_TS_ETRF)) + +#define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ + ((SELECTION) == TIM_TS_ITR1) || \ + ((SELECTION) == TIM_TS_ITR2) || \ + ((SELECTION) == TIM_TS_ITR3) || \ + ((SELECTION) == TIM_TS_NONE)) +#define IS_TIM_TRIGGERPOLARITY(POLARITY) (((POLARITY) == TIM_TRIGGERPOLARITY_INVERTED ) || \ + ((POLARITY) == TIM_TRIGGERPOLARITY_NONINVERTED) || \ + ((POLARITY) == TIM_TRIGGERPOLARITY_RISING ) || \ + ((POLARITY) == TIM_TRIGGERPOLARITY_FALLING ) || \ + ((POLARITY) == TIM_TRIGGERPOLARITY_BOTHEDGE )) + +#define IS_TIM_TRIGGERPRESCALER(PRESCALER) (((PRESCALER) == TIM_TRIGGERPRESCALER_DIV1) || \ + ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV2) || \ + ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV4) || \ + ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV8)) + +#define IS_TIM_TRIGGERFILTER(ICFILTER) ((ICFILTER) <= 0xF) + +#define IS_TIM_TI1SELECTION(TI1SELECTION) (((TI1SELECTION) == TIM_TI1SELECTION_CH1) || \ + ((TI1SELECTION) == TIM_TI1SELECTION_XORCOMBINATION)) + +#define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABASE_CR1) || \ + ((BASE) == TIM_DMABASE_CR2) || \ + ((BASE) == TIM_DMABASE_SMCR) || \ + ((BASE) == TIM_DMABASE_DIER) || \ + ((BASE) == TIM_DMABASE_SR) || \ + ((BASE) == TIM_DMABASE_EGR) || \ + ((BASE) == TIM_DMABASE_CCMR1) || \ + ((BASE) == TIM_DMABASE_CCMR2) || \ + ((BASE) == TIM_DMABASE_CCER) || \ + ((BASE) == TIM_DMABASE_CNT) || \ + ((BASE) == TIM_DMABASE_PSC) || \ + ((BASE) == TIM_DMABASE_ARR) || \ + ((BASE) == TIM_DMABASE_RCR) || \ + ((BASE) == TIM_DMABASE_CCR1) || \ + ((BASE) == TIM_DMABASE_CCR2) || \ + ((BASE) == TIM_DMABASE_CCR3) || \ + ((BASE) == TIM_DMABASE_CCR4) || \ + ((BASE) == TIM_DMABASE_BDTR) || \ + ((BASE) == TIM_DMABASE_DCR) || \ + ((BASE) == TIM_DMABASE_OR)) + +#define IS_TIM_DMA_LENGTH(LENGTH) (((LENGTH) == TIM_DMABURSTLENGTH_1TRANSFER) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_2TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_3TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_4TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_5TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_6TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_7TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_8TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_9TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_10TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_11TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_12TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_13TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_14TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_15TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_16TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_17TRANSFERS) || \ + ((LENGTH) == TIM_DMABURSTLENGTH_18TRANSFERS)) + +#define IS_TIM_IC_FILTER(ICFILTER) ((ICFILTER) <= 0xF) +/** + * @} + */ + +/** @defgroup TIM_Mask_Definitions TIM Mask Definition + * @{ + */ +/* The counter of a timer instance is disabled only if all the CCx and CCxN + channels have been disabled */ +#define TIM_CCER_CCxE_MASK ((uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E)) +#define TIM_CCER_CCxNE_MASK ((uint32_t)(TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) +/** + * @} + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup TIM_Private_Functions TIM Private Functions + * @{ + */ void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure); void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter); void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config); -void HAL_TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma); -void HAL_TIM_DMAError(DMA_HandleTypeDef *hdma); -void HAL_TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma); -void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState); - +void TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma); +void TIM_DMAError(DMA_HandleTypeDef *hdma); +void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma); +void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState); +/** + * @} + */ + /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.c index e638b2e2019..43fe5e22b70 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_tim_ex.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief TIM HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Timer extension peripheral: @@ -69,7 +69,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,7 @@ * @{ */ -/** @defgroup TIMEx +/** @defgroup TIMEx TIMEx * @brief TIM HAL module driver * @{ */ @@ -114,15 +114,21 @@ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ +/** @addtogroup TIMEx_Private_Functions + * @{ + */ /* Private function prototypes -----------------------------------------------*/ -static void TIM_CCxNChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelNState); -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup TIMEx_Private_Functions +static void TIM_CCxNChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelNState); +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup TIMEx_Exported_Functions TIM Exported Functions * @{ */ -/** @defgroup TIMEx_Group1 Timer Hall Sensor functions +/** @defgroup TIMEx_Exported_Functions_Group1 Timer Hall Sensor functions * @brief Timer Hall Sensor functions * @verbatim @@ -398,9 +404,9 @@ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32 TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); /* Set the DMA Input Capture 1 Callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream for Capture 1*/ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, Length); @@ -440,12 +446,11 @@ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim) /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIMEx_Group2 Timer Complementary Output Compare functions +/** @defgroup TIMEx_Exported_Functions_Group2 Timer Complementary Output Compare functions * @brief Timer Complementary Output Compare functions * @verbatim @@ -472,10 +477,10 @@ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim) * the configuration information for TIM module. * @param Channel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -486,7 +491,7 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel) /* Enable the Capture compare channel N */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Enable the Peripheral */ @@ -503,10 +508,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel) * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -517,7 +522,7 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) /* Disable the Capture compare channel N */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -534,10 +539,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) * the configuration information for TIM module. * @param Channel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -579,12 +584,15 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Chann break; } - /* Enable the Capture compare channel N */ - TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); - - /* Enable the Main Ouput */ - __HAL_TIM_MOE_ENABLE(htim); - + /* Enable the TIM Break interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_BREAK); + + /* Enable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + /* Enable the Peripheral */ __HAL_TIM_ENABLE(htim); @@ -599,10 +607,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Chann * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -643,13 +651,19 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channe default: break; } - - /* Disable the Capture compare channel N */ - TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); - - /* Disable the Main Ouput */ - __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + /* Disable the TIM Break interrupt (only if no more channel is active) */ + if((READ_REG(htim->Instance->CCER) & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == RESET) + { + __HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK); + } + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + /* Disable the Peripheral */ __HAL_TIM_DISABLE(htim); @@ -664,10 +678,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channe * the configuration information for TIM module. * @param Channel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @param pData: The source Buffer address. * @param Length: The length of data to be transferred from memory to TIM peripheral * @retval HAL status @@ -697,10 +711,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Chan case TIM_CHANNEL_1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length); @@ -713,10 +727,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Chan case TIM_CHANNEL_2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length); @@ -729,10 +743,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Chan case TIM_CHANNEL_3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3,Length); @@ -745,10 +759,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Chan case TIM_CHANNEL_4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, Length); @@ -765,7 +779,7 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Chan /* Enable the Capture compare channel N */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Enable the Peripheral */ @@ -782,10 +796,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Chan * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -830,7 +844,7 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chann /* Disable the Capture compare channel N */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -842,12 +856,11 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chann /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIMEx_Group3 Timer Complementary PWM functions +/** @defgroup TIMEx_Exported_Functions_Group3 Timer Complementary PWM functions * @brief Timer Complementary PWM functions * @verbatim @@ -883,10 +896,10 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chann * the configuration information for TIM module. * @param Channel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -897,7 +910,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel /* Enable the complementary PWM output */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Enable the Peripheral */ @@ -913,10 +926,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -927,7 +940,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) /* Disable the complementary PWM output */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -944,10 +957,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -995,7 +1008,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Chan /* Enable the complementary PWM output */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Enable the Peripheral */ @@ -1012,10 +1025,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Chan * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT (TIM_HandleTypeDef *htim, uint32_t Channel) @@ -1057,13 +1070,16 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT (TIM_HandleTypeDef *htim, uint32_t Chan break; } - /* Disable the TIM Break interrupt */ - __HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK); - /* Disable the complementary PWM output */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the TIM Break interrupt (only if no more channel is active) */ + if((READ_REG(htim->Instance->CCER) & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == RESET) + { + __HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK); + } + + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -1080,10 +1096,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT (TIM_HandleTypeDef *htim, uint32_t Chan * the configuration information for TIM module. * @param Channel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @param pData: The source Buffer address. * @param Length: The length of data to be transferred from memory to TIM peripheral * @retval HAL status @@ -1113,10 +1129,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Cha case TIM_CHANNEL_1: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length); @@ -1129,10 +1145,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Cha case TIM_CHANNEL_2: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length); @@ -1145,10 +1161,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Cha case TIM_CHANNEL_3: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3,Length); @@ -1161,10 +1177,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Cha case TIM_CHANNEL_4: { /* Set the DMA Period elapsed callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = HAL_TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = HAL_TIM_DMAError ; + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, Length); @@ -1181,7 +1197,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Cha /* Enable the complementary PWM output */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Enable the Peripheral */ @@ -1198,10 +1214,10 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Cha * the configuration information for TIM module. * @param Channel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1/ - * TIM_CHANNEL_2/ - * TIM_CHANNEL_3/ - * TIM_CHANNEL_4 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) @@ -1246,7 +1262,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chan /* Disable the complementary PWM output */ TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -1263,7 +1279,7 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chan * @} */ -/** @defgroup TIMEx_Group4 Timer Complementary One Pulse functions +/** @defgroup TIMEx_Exported_Functions_Group4 Timer Complementary One Pulse functions * @brief Timer Complementary One Pulse functions * @verbatim @@ -1282,14 +1298,14 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Chan */ /** - * @brief Starts the TIM One Pulse signal generation on the complemetary + * @brief Starts the TIM One Pulse signal generation on the complementary * output. * @param htim: pointer to a TIM_HandleTypeDef structure that contains * the configuration information for TIM module. * @param OutputChannel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1 / - * IM_CHANNEL_2 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel) @@ -1300,7 +1316,7 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t Ou /* Enable the complementary One Pulse output */ TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Return function status */ @@ -1314,7 +1330,8 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t Ou * the configuration information for TIM module. * @param OutputChannel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1 / TIM_CHANNEL_2 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel) @@ -1326,7 +1343,7 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t Out /* Disable the complementary One Pulse output */ TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -1343,7 +1360,8 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t Out * the configuration information for TIM module. * @param OutputChannel: TIM Channel to be enabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1 / IM_CHANNEL_2 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel) @@ -1360,7 +1378,7 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t /* Enable the complementary One Pulse output */ TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE); - /* Enable the Main Ouput */ + /* Enable the Main Output */ __HAL_TIM_MOE_ENABLE(htim); /* Return function status */ @@ -1374,7 +1392,8 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t * the configuration information for TIM module. * @param OutputChannel: TIM Channel to be disabled. * This parameter can be one of the following values: - * TIM_CHANNEL_1 / IM_CHANNEL_2 + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected * @retval HAL status */ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel) @@ -1391,7 +1410,7 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t /* Disable the complementary One Pulse output */ TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE); - /* Disable the Main Ouput */ + /* Disable the Main Output */ __HAL_TIM_MOE_DISABLE(htim); /* Disable the Peripheral */ @@ -1400,11 +1419,11 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t /* Return function status */ return HAL_OK; } - /** * @} */ -/** @defgroup TIMEx_Group5 Peripheral Control functions + +/** @defgroup TIMEx_Exported_Functions_Group5 Peripheral Control functions * @brief Peripheral Control functions * @verbatim @@ -1435,11 +1454,11 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t * the configuration information for TIM module. * @param InputTrigger: the Internal trigger corresponding to the Timer Interfacing with the Hall sensor. * This parameter can be one of the following values: - * TIM_TS_ITR0 / - * TIM_TS_ITR1 / - * TIM_TS_ITR2 / - * TIM_TS_ITR3 / - * TIM_TS_NONE + * @arg TIM_TS_ITR0: Internal trigger 0 selected + * @arg TIM_TS_ITR1: Internal trigger 1 selected + * @arg TIM_TS_ITR2: Internal trigger 2 selected + * @arg TIM_TS_ITR3: Internal trigger 3 selected + * @arg TIM_TS_NONE: No trigger is needed * @param CommutationSource: the Commutation Event source. * This parameter can be one of the following values: * @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer @@ -1485,11 +1504,11 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef *htim, uint * the configuration information for TIM module. * @param InputTrigger: the Internal trigger corresponding to the Timer Interfacing with the Hall sensor. * This parameter can be one of the following values: - * TIM_TS_ITR0 / - * TIM_TS_ITR1 / - * TIM_TS_ITR2 / - * TIM_TS_ITR3 / - * TIM_TS_NONE + * @arg TIM_TS_ITR0: Internal trigger 0 selected + * @arg TIM_TS_ITR1: Internal trigger 1 selected + * @arg TIM_TS_ITR2: Internal trigger 2 selected + * @arg TIM_TS_ITR3: Internal trigger 3 selected + * @arg TIM_TS_NONE: No trigger is needed * @param CommutationSource: the Commutation Event source. * This parameter can be one of the following values: * @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer @@ -1539,11 +1558,11 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef *htim, u * the configuration information for TIM module. * @param InputTrigger: the Internal trigger corresponding to the Timer Interfacing with the Hall sensor. * This parameter can be one of the following values: - * TIM_TS_ITR0 / - * TIM_TS_ITR1 / - * TIM_TS_ITR2 / - * TIM_TS_ITR3 / - * TIM_TS_NONE + * @arg TIM_TS_ITR0: Internal trigger 0 selected + * @arg TIM_TS_ITR1: Internal trigger 1 selected + * @arg TIM_TS_ITR2: Internal trigger 2 selected + * @arg TIM_TS_ITR3: Internal trigger 3 selected + * @arg TIM_TS_NONE: No trigger is needed * @param CommutationSource: the Commutation Event source. * This parameter can be one of the following values: * @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer @@ -1574,9 +1593,9 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef *htim, /* Enable the Commutation DMA Request */ /* Set the DMA Commutation Callback */ - htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = HAL_TIMEx_DMACommutationCplt; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = TIMEx_DMACommutationCplt; /* Set the DMA error callback */ - htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = HAL_TIM_DMAError; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = TIM_DMAError; /* Enable the Commutation DMA Request */ __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_COM); @@ -1643,6 +1662,7 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, assert_param(IS_TIM_BREAK_STATE(sBreakDeadTimeConfig->BreakState)); assert_param(IS_TIM_BREAK_POLARITY(sBreakDeadTimeConfig->BreakPolarity)); assert_param(IS_TIM_AUTOMATIC_OUTPUT_STATE(sBreakDeadTimeConfig->AutomaticOutput)); + assert_param(IS_TIM_DEADTIME(sBreakDeadTimeConfig->DeadTime)); /* Process Locked */ __HAL_LOCK(htim); @@ -1670,11 +1690,11 @@ HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, /** * @brief Configures the TIM2, TIM5 and TIM11 Remapping input capabilities. * @param htim: pointer to a TIM_HandleTypeDef structure that contains - * the configuration information for TIM module.. - * @param TIM_Remap: specifies the TIM input remapping source. + * the configuration information for TIM module. + * @param Remap: specifies the TIM input remapping source. * This parameter can be one of the following values: * @arg TIM_TIM2_TIM8_TRGO: TIM2 ITR1 input is connected to TIM8 Trigger output(default) - * @arg TIM_TIM2_ETH_PTP: TIM2 ITR1 input is connected to ETH PTP trogger output. + * @arg TIM_TIM2_ETH_PTP: TIM2 ITR1 input is connected to ETH PTP trigger output. * @arg TIM_TIM2_USBFS_SOF: TIM2 ITR1 input is connected to USB FS SOF. * @arg TIM_TIM2_USBHS_SOF: TIM2 ITR1 input is connected to USB HS SOF. * @arg TIM_TIM5_GPIO: TIM5 CH4 input is connected to dedicated Timer pin(default) @@ -1703,12 +1723,11 @@ HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap) return HAL_OK; } - /** * @} */ -/** @defgroup TIMEx_Group6 Extension Callbacks functions +/** @defgroup TIMEx_Exported_Functions_Group6 Extension Callbacks functions * @brief Extension Callbacks functions * @verbatim @@ -1749,12 +1768,11 @@ __weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim) the HAL_TIMEx_BreakCallback could be implemented in the user file */ } - /** * @} */ -/** @defgroup TIMEx_Group7 Extension Peripheral State functions +/** @defgroup TIMEx_Exported_Functions_Group7 Extension Peripheral State functions * @brief Extension Peripheral State functions * @verbatim @@ -1790,7 +1808,7 @@ HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim) * the configuration information for the specified DMA module. * @retval None */ -void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma) +void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma) { TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; @@ -1798,7 +1816,10 @@ void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma) HAL_TIMEx_CommutationCallback(htim); } - +/** + * @} + */ + /** * @brief Enables or disables the TIM Capture Compare Channel xN. * @param TIMx to select the TIM peripheral diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.h index 878b8e4f420..a1f70d7efab 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_tim_ex.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_tim_ex.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of TIM HAL Extension module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -46,7 +46,7 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" -/** @addtogroup STM32F4xx_HAL +/** @addtogroup STM32F4xx_HAL_Driver * @{ */ @@ -55,7 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup TIMEx_Exported_Types TIM Exported Types + * @{ + */ + /** * @brief TIM Hall sensor Configuration Structure definition */ @@ -90,31 +93,33 @@ typedef struct { */ typedef struct { - uint32_t OffStateRunMode; /*!< TIM off state in run mode. + uint32_t OffStateRunMode; /*!< TIM off state in run mode. This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */ - uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode. + uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode. This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */ - uint32_t LockLevel; /*!< TIM Lock level. + uint32_t LockLevel; /*!< TIM Lock level. This parameter can be a value of @ref TIM_Lock_level */ - uint32_t DeadTime; /*!< TIM dead Time. + uint32_t DeadTime; /*!< TIM dead Time. This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */ - uint32_t BreakState; /*!< TIM Break State. + uint32_t BreakState; /*!< TIM Break State. This parameter can be a value of @ref TIM_Break_Input_enable_disable */ - uint32_t BreakPolarity; /*!< TIM Break input polarity. + uint32_t BreakPolarity; /*!< TIM Break input polarity. This parameter can be a value of @ref TIM_Break_Polarity */ - uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state. + uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state. This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */ }TIM_BreakDeadTimeConfigTypeDef; - +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup TIMEx_Exported_Constants +/** @defgroup TIMEx_Exported_Constants TIM Exported Constants * @{ */ -/** @defgroup TIMEx_Remap +/** @defgroup TIMEx_Remap TIM Remap * @{ */ - #define TIM_TIM2_TIM8_TRGO (0x00000000) #define TIM_TIM2_ETH_PTP (0x00000400) #define TIM_TIM2_USBFS_SOF (0x00000800) @@ -126,29 +131,26 @@ typedef struct #define TIM_TIM11_GPIO (0x00000000) #define TIM_TIM11_HSE (0x00000002) -#define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\ - ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\ - ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\ - ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\ - ((TIM_REMAP) == TIM_TIM5_GPIO)||\ - ((TIM_REMAP) == TIM_TIM5_LSI)||\ - ((TIM_REMAP) == TIM_TIM5_LSE)||\ - ((TIM_REMAP) == TIM_TIM5_RTC)||\ - ((TIM_REMAP) == TIM_TIM11_GPIO)||\ - ((TIM_REMAP) == TIM_TIM11_HSE)) - +#if defined (STM32F446xx) +#define TIM_TIM11_SPDIFRX (0x00000001) +#endif /* STM32F446xx */ /** * @} - */ - + */ + /** * @} - */ - + */ + /* Exported macro ------------------------------------------------------------*/ - /* Exported functions --------------------------------------------------------*/ +/** @addtogroup TIMEx_Exported_Functions + * @{ + */ +/** @addtogroup TIMEx_Exported_Functions_Group1 + * @{ + */ /* Timer Hall Sensor functions **********************************************/ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef* htim, TIM_HallSensor_InitTypeDef* sConfig); HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef* htim); @@ -165,7 +167,13 @@ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef* htim); /* Non-Blocking mode: DMA */ HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef* htim, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef* htim); +/** + * @} + */ +/** @addtogroup TIMEx_Exported_Functions_Group2 + * @{ + */ /* Timer Complementary Output Compare functions *****************************/ /* Blocking mode: Polling */ HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef* htim, uint32_t Channel); @@ -178,7 +186,13 @@ HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channe /* Non-Blocking mode: DMA */ HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel); +/** + * @} + */ +/** @addtogroup TIMEx_Exported_Functions_Group3 + * @{ + */ /* Timer Complementary PWM functions ****************************************/ /* Blocking mode: Polling */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef* htim, uint32_t Channel); @@ -190,7 +204,13 @@ HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Chann /* Non-Blocking mode: DMA */ HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length); HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel); +/** + * @} + */ +/** @addtogroup TIMEx_Exported_Functions_Group4 + * @{ + */ /* Timer Complementary One Pulse functions **********************************/ /* Blocking mode: Polling */ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef* htim, uint32_t OutputChannel); @@ -199,23 +219,40 @@ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef* htim, uint32_t Out /* Non-Blocking mode: Interrupt */ HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel); HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel); +/** + * @} + */ -/* Extnsion Control functions ************************************************/ +/** @addtogroup TIMEx_Exported_Functions_Group5 + * @{ + */ +/* Extension Control functions ************************************************/ HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource); HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource); HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource); HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef* htim, TIM_MasterConfigTypeDef * sMasterConfig); HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef* htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig); HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef* htim, uint32_t Remap); +/** + * @} + */ +/** @addtogroup TIMEx_Exported_Functions_Group6 + * @{ + */ /* Extension Callback *********************************************************/ void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef* htim); void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef* htim); -void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma); +void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma); +/** + * @} + */ +/** @addtogroup TIMEx_Exported_Functions_Group7 + * @{ + */ /* Extension Peripheral State functions **************************************/ HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim); - /** * @} */ @@ -223,7 +260,62 @@ HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim); /** * @} */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup TIMEx_Private_Macros TIM Private Macros + * @{ + */ +#if defined (STM32F446xx) +#define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\ + ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\ + ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\ + ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\ + ((TIM_REMAP) == TIM_TIM5_GPIO)||\ + ((TIM_REMAP) == TIM_TIM5_LSI)||\ + ((TIM_REMAP) == TIM_TIM5_LSE)||\ + ((TIM_REMAP) == TIM_TIM5_RTC)||\ + ((TIM_REMAP) == TIM_TIM11_GPIO)||\ + ((TIM_REMAP) == TIM_TIM11_SPDIFRX)||\ + ((TIM_REMAP) == TIM_TIM11_HSE)) +#else +#define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\ + ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\ + ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\ + ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\ + ((TIM_REMAP) == TIM_TIM5_GPIO)||\ + ((TIM_REMAP) == TIM_TIM5_LSI)||\ + ((TIM_REMAP) == TIM_TIM5_LSE)||\ + ((TIM_REMAP) == TIM_TIM5_RTC)||\ + ((TIM_REMAP) == TIM_TIM11_GPIO)||\ + ((TIM_REMAP) == TIM_TIM11_HSE)) +#endif /* STM32F446xx */ + + +#define IS_TIM_DEADTIME(DEADTIME) ((DEADTIME) <= 0xFF) +/** + * @} + */ +/* Private functions ---------------------------------------------------------*/ +/** @defgroup TIMEx_Private_Functions TIM Private Functions + * @{ + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.c index 53adc6983b0..b78f938e886 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_uart.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief UART HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Universal Asynchronous Receiver Transmitter (UART) peripheral: @@ -63,7 +63,7 @@ [..] (@) These APIs (HAL_UART_Init() and HAL_HalfDuplex_Init()) configure also the - low level Hardware GPIO, CLOCK, CORTEX...etc) by calling the customed + low level Hardware GPIO, CLOCK, CORTEX...etc) by calling the customized HAL_UART_MspInit() API. [..] @@ -79,13 +79,9 @@ =================================== [..] (+) Send an amount of data in non blocking mode using HAL_UART_Transmit_IT() - (+) At transmission end of half transfer HAL_UART_TxHalfCpltCallback is executed and user can - add his own code by customization of function pointer HAL_UART_TxHalfCpltCallback (+) At transmission end of transfer HAL_UART_TxCpltCallback is executed and user can add his own code by customization of function pointer HAL_UART_TxCpltCallback (+) Receive an amount of data in non blocking mode using HAL_UART_Receive_IT() - (+) At reception end of half transfer HAL_UART_RxHalfCpltCallback is executed and user can - add his own code by customization of function pointer HAL_UART_RxHalfCpltCallback (+) At reception end of transfer HAL_UART_RxCpltCallback is executed and user can add his own code by customization of function pointer HAL_UART_RxCpltCallback (+) In case of transfer Error, HAL_UART_ErrorCallback() function is executed and user can @@ -121,6 +117,7 @@ (+) __HAL_UART_CLEAR_FLAG : Clear the specified UART pending flag (+) __HAL_UART_ENABLE_IT: Enable the specified UART interrupt (+) __HAL_UART_DISABLE_IT: Disable the specified UART interrupt + (+) __HAL_UART_GET_IT_SOURCE: Check whether the specified UART interrupt has occurred or not [..] (@) You can refer to the UART HAL driver header file for more useful macros @@ -129,7 +126,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -163,7 +160,7 @@ * @{ */ -/** @defgroup UART +/** @defgroup UART UART * @brief HAL UART module driver * @{ */ @@ -171,12 +168,22 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +/** @addtogroup UART_Private_Constants + * @{ + */ #define UART_TIMEOUT_VALUE 22000 +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/** @addtogroup UART_Private_Functions UART Private Functions + * @{ + */ static void UART_SetConfig (UART_HandleTypeDef *huart); static HAL_StatusTypeDef UART_Transmit_IT(UART_HandleTypeDef *huart); +static HAL_StatusTypeDef UART_EndTransmit_IT(UART_HandleTypeDef *huart); static HAL_StatusTypeDef UART_Receive_IT(UART_HandleTypeDef *huart); static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma); static void UART_DMATxHalfCplt(DMA_HandleTypeDef *hdma); @@ -184,14 +191,16 @@ static void UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma); static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma); static void UART_DMAError(DMA_HandleTypeDef *hdma); static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Timeout); +/** + * @} + */ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup UART_Private_Functions +/* Exported functions ---------------------------------------------------------*/ +/** @defgroup UART_Exported_Functions UART Exported Functions * @{ */ -/** @defgroup UART_Group1 Initialization and de-initialization functions +/** @defgroup UART_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -211,7 +220,7 @@ static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, please refer to Reference manual for possible UART frame formats. (++) Hardware flow control (++) Receiver/transmitter modes - (++) Over Sampling Methode + (++) Over Sampling Method [..] The HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init() and HAL_MultiProcessor_Init() APIs follow respectively the UART asynchronous, UART Half duplex, LIN and Multi-Processor @@ -235,20 +244,25 @@ HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart) { return HAL_ERROR; } - + + /* Check the parameters */ if(huart->Init.HwFlowCtl != UART_HWCONTROL_NONE) - { - /* Check the parameters */ + { + /* The hardware flow control is available only for USART1, USART2, USART3 and USART6 */ assert_param(IS_UART_HWFLOW_INSTANCE(huart->Instance)); + assert_param(IS_UART_HARDWARE_FLOW_CONTROL(huart->Init.HwFlowCtl)); } else { - /* Check the parameters */ assert_param(IS_UART_INSTANCE(huart->Instance)); } + assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); + assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling)); if(huart->State == HAL_UART_STATE_RESET) { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_UART_MspInit(huart); } @@ -291,9 +305,16 @@ HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart) { return HAL_ERROR; } - + + /* Check the parameters */ + assert_param(IS_UART_INSTANCE(huart->Instance)); + assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); + assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling)); + if(huart->State == HAL_UART_STATE_RESET) - { + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_UART_MspInit(huart); } @@ -343,11 +364,17 @@ HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLe { return HAL_ERROR; } - /* Check the Break detection length parameter */ + + /* Check the parameters */ + assert_param(IS_UART_INSTANCE(huart->Instance)); assert_param(IS_UART_LIN_BREAK_DETECT_LENGTH(BreakDetectLength)); - + assert_param(IS_UART_LIN_WORD_LENGTH(huart->Init.WordLength)); + assert_param(IS_UART_LIN_OVERSAMPLING(huart->Init.OverSampling)); + if(huart->State == HAL_UART_STATE_RESET) - { + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_UART_MspInit(huart); } @@ -389,13 +416,13 @@ HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLe * @param huart: pointer to a UART_HandleTypeDef structure that contains * the configuration information for the specified UART module. * @param Address: USART address - * @param WakeUpMethode: specifies the USART wakeup method. + * @param WakeUpMethod: specifies the USART wake-up method. * This parameter can be one of the following values: - * @arg UART_WAKEUPMETHODE_IDLELINE: Wakeup by an idle line detection - * @arg UART_WAKEUPMETHODE_ADDRESSMARK: Wakeup by an address mark + * @arg UART_WAKEUPMETHOD_IDLELINE: Wake-up by an idle line detection + * @arg UART_WAKEUPMETHOD_ADDRESSMARK: Wake-up by an address mark * @retval HAL status */ -HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethode) +HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod) { /* Check the UART handle allocation */ if(huart == HAL_NULL) @@ -403,12 +430,17 @@ HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Add return HAL_ERROR; } - /* Check the Address & wake up method parameters */ - assert_param(IS_UART_WAKEUPMETHODE(WakeUpMethode)); + /* Check the parameters */ + assert_param(IS_UART_INSTANCE(huart->Instance)); + assert_param(IS_UART_WAKEUPMETHOD(WakeUpMethod)); assert_param(IS_UART_ADDRESS(Address)); - + assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); + assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling)); + if(huart->State == HAL_UART_STATE_RESET) - { + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_UART_MspInit(huart); } @@ -432,9 +464,9 @@ HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Add /* Set the USART address node */ huart->Instance->CR2 |= Address; - /* Set the wake up methode by setting the WAKE bit in the CR1 register */ + /* Set the wake up method by setting the WAKE bit in the CR1 register */ huart->Instance->CR1 &= ~(USART_CR1_WAKE); - huart->Instance->CR1 |= WakeUpMethode; + huart->Instance->CR1 |= WakeUpMethod; /* Enable the peripheral */ __HAL_UART_ENABLE(huart); @@ -507,7 +539,7 @@ HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart) * @} */ -/** @defgroup UART_Group2 IO operation functions +/** @defgroup UART_Exported_Functions_Group2 IO operation functions * @brief UART Transmit and Receive functions * @verbatim @@ -528,7 +560,7 @@ HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart) dedicated UART IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_UART_TxCpltCallback(), HAL_UART_RxCpltCallback() user callbacks - will be executed respectivelly at the end of the transmit or receive process. + will be executed respectively at the end of the transmit or receive process. The HAL_UART_ErrorCallback() user callback will be executed when a communication error is detected. @@ -921,6 +953,9 @@ HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, uint8_t *pDat tmp = (uint32_t*)&pData; HAL_DMA_Start_IT(huart->hdmatx, *(uint32_t*)tmp, (uint32_t)&huart->Instance->DR, Size); + /* Clear the TC flag in the SR register by writing 0 to it */ + __HAL_UART_CLEAR_FLAG(huart, UART_FLAG_TC); + /* Enable the DMA transfer for transmit request by setting the DMAT bit in the UART CR3 register */ huart->Instance->CR3 |= USART_CR3_DMAT; @@ -1055,14 +1090,14 @@ HAL_StatusTypeDef HAL_UART_DMAResume(UART_HandleTypeDef *huart) } else if(huart->State == HAL_UART_STATE_BUSY_RX) { - /* Clear the Overrun flag before resumming the Rx transfer*/ + /* Clear the Overrun flag before resuming the Rx transfer*/ __HAL_UART_CLEAR_OREFLAG(huart); /* Enable the UART DMA Rx request */ huart->Instance->CR3 |= USART_CR3_DMAR; } else if(huart->State == HAL_UART_STATE_BUSY_TX_RX) { - /* Clear the Overrun flag before resumming the Rx transfer*/ + /* Clear the Overrun flag before resuming the Rx transfer*/ __HAL_UART_CLEAR_OREFLAG(huart); /* Enable the UART DMA Tx & Rx request */ huart->Instance->CR3 |= USART_CR3_DMAT; @@ -1175,6 +1210,14 @@ void HAL_UART_IRQHandler(UART_HandleTypeDef *huart) UART_Transmit_IT(huart); } + tmp1 = __HAL_UART_GET_FLAG(huart, UART_FLAG_TC); + tmp2 = __HAL_UART_GET_IT_SOURCE(huart, UART_IT_TC); + /* UART in mode Transmitter end --------------------------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + UART_EndTransmit_IT(huart); + } + if(huart->ErrorCode != HAL_UART_ERROR_NONE) { /* Set the UART state ready to be able to start again the process */ @@ -1253,7 +1296,7 @@ __weak void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart) * @} */ -/** @defgroup UART_Group3 Peripheral Control functions +/** @defgroup UART_Exported_Functions_Group3 Peripheral Control functions * @brief UART control functions * @verbatim @@ -1425,7 +1468,7 @@ HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart) * @} */ -/** @defgroup UART_Group4 Peripheral State and Errors functions +/** @defgroup UART_Exported_Functions_Group4 Peripheral State and Errors functions * @brief UART State and Errors functions * @verbatim @@ -1486,27 +1529,8 @@ static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma) in the UART CR3 register */ huart->Instance->CR3 &= (uint32_t)~((uint32_t)USART_CR3_DMAT); - /* Wait for UART TC Flag */ - if(UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TC, RESET, UART_TIMEOUT_VALUE) != HAL_OK) - { - /* Timeout occurred */ - huart->State = HAL_UART_STATE_TIMEOUT; - HAL_UART_ErrorCallback(huart); - } - else - { - /* No Timeout */ - /* Check if a receive process is ongoing or not */ - if(huart->State == HAL_UART_STATE_BUSY_TX_RX) - { - huart->State = HAL_UART_STATE_BUSY_RX; - } - else - { - huart->State = HAL_UART_STATE_READY; - } - HAL_UART_TxCpltCallback(huart); - } + /* Enable the UART Transmit Complete Interrupt */ + __HAL_UART_ENABLE_IT(huart, UART_IT_TC); } /* DMA Circular mode */ else @@ -1658,7 +1682,7 @@ static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, /** * @brief Sends an amount of data in non blocking mode. - * @param huart: pointer to a UART_HandleTypeDef structure that contains + * @param huart: Pointer to a UART_HandleTypeDef structure that contains * the configuration information for the specified UART module. * @retval HAL status */ @@ -1693,31 +1717,8 @@ static HAL_StatusTypeDef UART_Transmit_IT(UART_HandleTypeDef *huart) /* Disable the UART Transmit Complete Interrupt */ __HAL_UART_DISABLE_IT(huart, UART_IT_TXE); - /* Check if a receive process is ongoing or not */ - if(huart->State == HAL_UART_STATE_BUSY_TX_RX) - { - huart->State = HAL_UART_STATE_BUSY_RX; - } - else - { - /* Disable the UART Parity Error Interrupt */ - __HAL_UART_DISABLE_IT(huart, UART_IT_PE); - - /* Disable the UART Error Interrupt: (Frame error, noise error, overrun error) */ - __HAL_UART_DISABLE_IT(huart, UART_IT_ERR); - - huart->State = HAL_UART_STATE_READY; - } - - /* Wait on TC flag to be able to start a second transfer */ - if(UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TC, RESET, UART_TIMEOUT_VALUE) != HAL_OK) - { - return HAL_TIMEOUT; - } - - HAL_UART_TxCpltCallback(huart); - - return HAL_OK; + /* Enable the UART Transmit Complete Interrupt */ + __HAL_UART_ENABLE_IT(huart, UART_IT_TC); } return HAL_OK; } @@ -1727,6 +1728,39 @@ static HAL_StatusTypeDef UART_Transmit_IT(UART_HandleTypeDef *huart) } } + +/** + * @brief Wraps up transmission in non blocking mode. + * @param huart: pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART module. + * @retval HAL status + */ +static HAL_StatusTypeDef UART_EndTransmit_IT(UART_HandleTypeDef *huart) +{ + /* Disable the UART Transmit Complete Interrupt */ + __HAL_UART_DISABLE_IT(huart, UART_IT_TC); + + /* Check if a receive process is ongoing or not */ + if(huart->State == HAL_UART_STATE_BUSY_TX_RX) + { + huart->State = HAL_UART_STATE_BUSY_RX; + } + else + { + /* Disable the UART Parity Error Interrupt */ + __HAL_UART_DISABLE_IT(huart, UART_IT_PE); + + /* Disable the UART Error Interrupt: (Frame error, noise error, overrun error) */ + __HAL_UART_DISABLE_IT(huart, UART_IT_ERR); + + huart->State = HAL_UART_STATE_READY; + } + + HAL_UART_TxCpltCallback(huart); + + return HAL_OK; +} + /** * @brief Receives an amount of data in non blocking mode * @param huart: pointer to a UART_HandleTypeDef structure that contains @@ -1809,19 +1843,10 @@ static void UART_SetConfig(UART_HandleTypeDef *huart) uint32_t tmpreg = 0x00; /* Check the parameters */ - assert_param(IS_UART_INSTANCE(huart->Instance)); assert_param(IS_UART_BAUDRATE(huart->Init.BaudRate)); - assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); assert_param(IS_UART_STOPBITS(huart->Init.StopBits)); assert_param(IS_UART_PARITY(huart->Init.Parity)); assert_param(IS_UART_MODE(huart->Init.Mode)); - assert_param(IS_UART_HARDWARE_FLOW_CONTROL(huart->Init.HwFlowCtl)); - - /* The hardware flow control is available only for USART1, USART2, USART3 and USART6 */ - if(huart->Init.HwFlowCtl != UART_HWCONTROL_NONE) - { - assert_param(IS_UART_HWFLOW_INSTANCE(huart->Instance)); - } /*-------------------------- USART CR2 Configuration -----------------------*/ tmpreg = huart->Instance->CR2; @@ -1870,11 +1895,11 @@ static void UART_SetConfig(UART_HandleTypeDef *huart) /*-------------------------- USART BRR Configuration ---------------------*/ if((huart->Instance == USART1) || (huart->Instance == USART6)) { - huart->Instance->BRR = __UART_BRR_SAMPLING8(HAL_RCC_GetPCLK2Freq(), huart->Init.BaudRate); + huart->Instance->BRR = UART_BRR_SAMPLING8(HAL_RCC_GetPCLK2Freq(), huart->Init.BaudRate); } else { - huart->Instance->BRR = __UART_BRR_SAMPLING8(HAL_RCC_GetPCLK1Freq(), huart->Init.BaudRate); + huart->Instance->BRR = UART_BRR_SAMPLING8(HAL_RCC_GetPCLK1Freq(), huart->Init.BaudRate); } } else @@ -1882,11 +1907,11 @@ static void UART_SetConfig(UART_HandleTypeDef *huart) /*-------------------------- USART BRR Configuration ---------------------*/ if((huart->Instance == USART1) || (huart->Instance == USART6)) { - huart->Instance->BRR = __UART_BRR_SAMPLING16(HAL_RCC_GetPCLK2Freq(), huart->Init.BaudRate); + huart->Instance->BRR = UART_BRR_SAMPLING16(HAL_RCC_GetPCLK2Freq(), huart->Init.BaudRate); } else { - huart->Instance->BRR = __UART_BRR_SAMPLING16(HAL_RCC_GetPCLK1Freq(), huart->Init.BaudRate); + huart->Instance->BRR = UART_BRR_SAMPLING16(HAL_RCC_GetPCLK1Freq(), huart->Init.BaudRate); } } } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.h index 4b28e1bfe92..7434a1ccdc1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_uart.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_uart.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of UART HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,6 +55,9 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup UART_Exported_Types UART Exported Types + * @{ + */ /** * @brief UART Init Structure definition @@ -80,14 +83,14 @@ typedef struct the word length is set to 9 data bits; 8th bit when the word length is set to 8 data bits). */ - uint32_t Mode; /*!< Specifies wether the Receive or Transmit mode is enabled or disabled. + uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled. This parameter can be a value of @ref UART_Mode */ - uint32_t HwFlowCtl; /*!< Specifies wether the hardware flow control mode is enabled + uint32_t HwFlowCtl; /*!< Specifies whether the hardware flow control mode is enabled or disabled. This parameter can be a value of @ref UART_Hardware_Flow_Control */ - uint32_t OverSampling; /*!< Specifies wether the Over sampling 8 is enabled or disabled, to achieve higher speed (up to fPCLK/8). + uint32_t OverSampling; /*!< Specifies whether the Over sampling 8 is enabled or disabled, to achieve higher speed (up to fPCLK/8). This parameter can be a value of @ref UART_Over_Sampling */ }UART_InitTypeDef; @@ -106,203 +109,186 @@ typedef enum HAL_UART_STATE_ERROR = 0x04 /*!< Error */ }HAL_UART_StateTypeDef; -/** - * @brief HAL UART Error Code structure definition - */ -typedef enum -{ - HAL_UART_ERROR_NONE = 0x00, /*!< No error */ - HAL_UART_ERROR_PE = 0x01, /*!< Parity error */ - HAL_UART_ERROR_NE = 0x02, /*!< Noise error */ - HAL_UART_ERROR_FE = 0x04, /*!< frame error */ - HAL_UART_ERROR_ORE = 0x08, /*!< Overrun error */ - HAL_UART_ERROR_DMA = 0x10 /*!< DMA transfer error */ -}HAL_UART_ErrorTypeDef; - /** * @brief UART handle Structure definition */ typedef struct { - USART_TypeDef *Instance; /* UART registers base address */ + USART_TypeDef *Instance; /*!< UART registers base address */ - UART_InitTypeDef Init; /* UART communication parameters */ + UART_InitTypeDef Init; /*!< UART communication parameters */ - uint8_t *pTxBuffPtr; /* Pointer to UART Tx transfer Buffer */ + uint8_t *pTxBuffPtr; /*!< Pointer to UART Tx transfer Buffer */ - uint16_t TxXferSize; /* UART Tx Transfer size */ + uint16_t TxXferSize; /*!< UART Tx Transfer size */ - uint16_t TxXferCount; /* UART Tx Transfer Counter */ + uint16_t TxXferCount; /*!< UART Tx Transfer Counter */ - uint8_t *pRxBuffPtr; /* Pointer to UART Rx transfer Buffer */ + uint8_t *pRxBuffPtr; /*!< Pointer to UART Rx transfer Buffer */ - uint16_t RxXferSize; /* UART Rx Transfer size */ + uint16_t RxXferSize; /*!< UART Rx Transfer size */ - uint16_t RxXferCount; /* UART Rx Transfer Counter */ + uint16_t RxXferCount; /*!< UART Rx Transfer Counter */ - DMA_HandleTypeDef *hdmatx; /* UART Tx DMA Handle parameters */ + DMA_HandleTypeDef *hdmatx; /*!< UART Tx DMA Handle parameters */ - DMA_HandleTypeDef *hdmarx; /* UART Rx DMA Handle parameters */ + DMA_HandleTypeDef *hdmarx; /*!< UART Rx DMA Handle parameters */ - HAL_LockTypeDef Lock; /* Locking object */ + HAL_LockTypeDef Lock; /*!< Locking object */ - __IO HAL_UART_StateTypeDef State; /* UART communication state */ - - __IO HAL_UART_ErrorTypeDef ErrorCode; /* UART Error code */ + __IO HAL_UART_StateTypeDef State; /*!< UART communication state */ + __IO uint32_t ErrorCode; /*!< UART Error code */ + }UART_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup UART_Exported_Constants +/** @defgroup UART_Exported_Constants UART Exported constants * @{ */ - -/** @defgroup UART_Word_Length + +/** @defgroup UART_Error_Code UART Error Code + * @brief UART Error Code + * @{ + */ +#define HAL_UART_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_UART_ERROR_PE ((uint32_t)0x00000001) /*!< Parity error */ +#define HAL_UART_ERROR_NE ((uint32_t)0x00000002) /*!< Noise error */ +#define HAL_UART_ERROR_FE ((uint32_t)0x00000004) /*!< Frame error */ +#define HAL_UART_ERROR_ORE ((uint32_t)0x00000008) /*!< Overrun error */ +#define HAL_UART_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ +/** + * @} + */ + +/** @defgroup UART_Word_Length UART Word Length * @{ */ #define UART_WORDLENGTH_8B ((uint32_t)0x00000000) #define UART_WORDLENGTH_9B ((uint32_t)USART_CR1_M) -#define IS_UART_WORD_LENGTH(LENGTH) (((LENGTH) == UART_WORDLENGTH_8B) || \ - ((LENGTH) == UART_WORDLENGTH_9B)) /** * @} */ -/** @defgroup UART_Stop_Bits +/** @defgroup UART_Stop_Bits UART Number of Stop Bits * @{ */ #define UART_STOPBITS_1 ((uint32_t)0x00000000) #define UART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) -#define IS_UART_STOPBITS(STOPBITS) (((STOPBITS) == UART_STOPBITS_1) || \ - ((STOPBITS) == UART_STOPBITS_2)) /** * @} */ -/** @defgroup UART_Parity +/** @defgroup UART_Parity UART Parity * @{ */ #define UART_PARITY_NONE ((uint32_t)0x00000000) #define UART_PARITY_EVEN ((uint32_t)USART_CR1_PCE) #define UART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) -#define IS_UART_PARITY(PARITY) (((PARITY) == UART_PARITY_NONE) || \ - ((PARITY) == UART_PARITY_EVEN) || \ - ((PARITY) == UART_PARITY_ODD)) /** * @} */ -/** @defgroup UART_Hardware_Flow_Control +/** @defgroup UART_Hardware_Flow_Control UART Hardware Flow Control * @{ */ #define UART_HWCONTROL_NONE ((uint32_t)0x00000000) #define UART_HWCONTROL_RTS ((uint32_t)USART_CR3_RTSE) #define UART_HWCONTROL_CTS ((uint32_t)USART_CR3_CTSE) #define UART_HWCONTROL_RTS_CTS ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE)) -#define IS_UART_HARDWARE_FLOW_CONTROL(CONTROL)\ - (((CONTROL) == UART_HWCONTROL_NONE) || \ - ((CONTROL) == UART_HWCONTROL_RTS) || \ - ((CONTROL) == UART_HWCONTROL_CTS) || \ - ((CONTROL) == UART_HWCONTROL_RTS_CTS)) /** * @} */ -/** @defgroup UART_Mode +/** @defgroup UART_Mode UART Transfer Mode * @{ */ #define UART_MODE_RX ((uint32_t)USART_CR1_RE) #define UART_MODE_TX ((uint32_t)USART_CR1_TE) #define UART_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE)) -#define IS_UART_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) /** * @} */ - /** @defgroup UART_State + /** @defgroup UART_State UART State * @{ */ #define UART_STATE_DISABLE ((uint32_t)0x00000000) #define UART_STATE_ENABLE ((uint32_t)USART_CR1_UE) -#define IS_UART_STATE(STATE) (((STATE) == UART_STATE_DISABLE) || \ - ((STATE) == UART_STATE_ENABLE)) /** * @} */ -/** @defgroup UART_Over_Sampling +/** @defgroup UART_Over_Sampling UART Over Sampling * @{ */ #define UART_OVERSAMPLING_16 ((uint32_t)0x00000000) #define UART_OVERSAMPLING_8 ((uint32_t)USART_CR1_OVER8) -#define IS_UART_OVERSAMPLING(SAMPLING) (((SAMPLING) == UART_OVERSAMPLING_16) || \ - ((SAMPLING) == UART_OVERSAMPLING_8)) /** * @} */ -/** @defgroup UART_LIN_Break_Detection_Length +/** @defgroup UART_LIN_Break_Detection_Length UART LIN Break Detection Length * @{ */ #define UART_LINBREAKDETECTLENGTH_10B ((uint32_t)0x00000000) #define UART_LINBREAKDETECTLENGTH_11B ((uint32_t)0x00000020) -#define IS_UART_LIN_BREAK_DETECT_LENGTH(LENGTH) (((LENGTH) == UART_LINBREAKDETECTLENGTH_10B) || \ - ((LENGTH) == UART_LINBREAKDETECTLENGTH_11B)) /** * @} */ -/** @defgroup UART_WakeUp_functions +/** @defgroup UART_WakeUp_functions UART Wakeup Functions * @{ */ -#define UART_WAKEUPMETHODE_IDLELINE ((uint32_t)0x00000000) -#define UART_WAKEUPMETHODE_ADDRESSMARK ((uint32_t)0x00000800) -#define IS_UART_WAKEUPMETHODE(WAKEUP) (((WAKEUP) == UART_WAKEUPMETHODE_IDLELINE) || \ - ((WAKEUP) == UART_WAKEUPMETHODE_ADDRESSMARK)) +#define UART_WAKEUPMETHOD_IDLELINE ((uint32_t)0x00000000) +#define UART_WAKEUPMETHOD_ADDRESSMARK ((uint32_t)0x00000800) /** * @} */ -/** @defgroup UART_Flags +/** @defgroup UART_Flags UART FLags * Elements values convention: 0xXXXX * - 0xXXXX : Flag mask in the SR register * @{ */ -#define UART_FLAG_CTS ((uint32_t)0x00000200) -#define UART_FLAG_LBD ((uint32_t)0x00000100) -#define UART_FLAG_TXE ((uint32_t)0x00000080) -#define UART_FLAG_TC ((uint32_t)0x00000040) -#define UART_FLAG_RXNE ((uint32_t)0x00000020) -#define UART_FLAG_IDLE ((uint32_t)0x00000010) -#define UART_FLAG_ORE ((uint32_t)0x00000008) -#define UART_FLAG_NE ((uint32_t)0x00000004) -#define UART_FLAG_FE ((uint32_t)0x00000002) -#define UART_FLAG_PE ((uint32_t)0x00000001) +#define UART_FLAG_CTS ((uint32_t)USART_SR_CTS) +#define UART_FLAG_LBD ((uint32_t)USART_SR_LBD) +#define UART_FLAG_TXE ((uint32_t)USART_SR_TXE) +#define UART_FLAG_TC ((uint32_t)USART_SR_TC) +#define UART_FLAG_RXNE ((uint32_t)USART_SR_RXNE) +#define UART_FLAG_IDLE ((uint32_t)USART_SR_IDLE) +#define UART_FLAG_ORE ((uint32_t)USART_SR_ORE) +#define UART_FLAG_NE ((uint32_t)USART_SR_NE) +#define UART_FLAG_FE ((uint32_t)USART_SR_FE) +#define UART_FLAG_PE ((uint32_t)USART_SR_PE) /** * @} */ -/** @defgroup UART_Interrupt_definition +/** @defgroup UART_Interrupt_definition UART Interrupt Definitions * Elements values convention: 0xY000XXXX - * - XXXX : Interrupt mask in the XX register + * - XXXX : Interrupt mask (16 bits) in the Y register * - Y : Interrupt source register (2bits) - * - 01: CR1 register - * - 10: CR2 register - * - 11: CR3 register + * - 0001: CR1 register + * - 0010: CR2 register + * - 0011: CR3 register * * @{ - */ -#define UART_IT_PE ((uint32_t)0x10000100) -#define UART_IT_TXE ((uint32_t)0x10000080) -#define UART_IT_TC ((uint32_t)0x10000040) -#define UART_IT_RXNE ((uint32_t)0x10000020) -#define UART_IT_IDLE ((uint32_t)0x10000010) + */ -#define UART_IT_LBD ((uint32_t)0x20000040) -#define UART_IT_CTS ((uint32_t)0x30000400) +#define UART_IT_PE ((uint32_t)(UART_CR1_REG_INDEX << 28 | USART_CR1_PEIE)) +#define UART_IT_TXE ((uint32_t)(UART_CR1_REG_INDEX << 28 | USART_CR1_TXEIE)) +#define UART_IT_TC ((uint32_t)(UART_CR1_REG_INDEX << 28 | USART_CR1_TCIE)) +#define UART_IT_RXNE ((uint32_t)(UART_CR1_REG_INDEX << 28 | USART_CR1_RXNEIE)) +#define UART_IT_IDLE ((uint32_t)(UART_CR1_REG_INDEX << 28 | USART_CR1_IDLEIE)) -#define UART_IT_ERR ((uint32_t)0x30000001) +#define UART_IT_LBD ((uint32_t)(UART_CR2_REG_INDEX << 28 | USART_CR2_LBDIE)) +#define UART_IT_CTS ((uint32_t)(UART_CR3_REG_INDEX << 28 | USART_CR3_CTSIE)) +#define UART_IT_ERR ((uint32_t)(UART_CR3_REG_INDEX << 28 | USART_CR3_EIE)) /** * @} */ @@ -312,6 +298,9 @@ typedef struct */ /* Exported macro ------------------------------------------------------------*/ +/** @defgroup UART_Exported_Macros UART Exported Macros + * @{ + */ /** @brief Reset UART handle state * @param __HANDLE__: specifies the UART Handle. @@ -321,7 +310,7 @@ typedef struct */ #define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_UART_STATE_RESET) -/** @brief Flushs the UART DR register +/** @brief Flushes the UART DR register * @param __HANDLE__: specifies the UART Handle. */ #define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) ((__HANDLE__)->Instance->DR) @@ -338,7 +327,7 @@ typedef struct * @arg UART_FLAG_TC: Transmission Complete flag * @arg UART_FLAG_RXNE: Receive data register not empty flag * @arg UART_FLAG_IDLE: Idle Line detection flag - * @arg UART_FLAG_ORE: OverRun Error flag + * @arg UART_FLAG_ORE: Overrun Error flag * @arg UART_FLAG_NE: Noise Error flag * @arg UART_FLAG_FE: Framing Error flag * @arg UART_FLAG_PE: Parity Error flag @@ -358,7 +347,7 @@ typedef struct * @arg UART_FLAG_TC: Transmission Complete flag. * @arg UART_FLAG_RXNE: Receive data register not empty flag. * - * @note PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun + * @note PE (Parity error), FE (Framing error), NE (Noise error), ORE (Overrun * error) and IDLE (Idle line detected) flags are cleared by software * sequence: a read operation to USART_SR register followed by a read * operation to USART_DR register. @@ -377,8 +366,14 @@ typedef struct * UART peripheral. * @retval None */ -#define __HAL_UART_CLEAR_PEFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR;\ - (__HANDLE__)->Instance->DR;}while(0) +#define __HAL_UART_CLEAR_PEFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + tmpreg = (__HANDLE__)->Instance->DR; \ + UNUSED(tmpreg); \ + } while(0) + /** @brief Clear the UART FE pending flag. * @param __HANDLE__: specifies the UART Handle. * This parameter can be UARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or @@ -411,11 +406,11 @@ typedef struct */ #define __HAL_UART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_UART_CLEAR_PEFLAG(__HANDLE__) -/** @brief Enables or disables the specified UART interrupt. +/** @brief Enable the specified UART interrupt. * @param __HANDLE__: specifies the UART Handle. * This parameter can be UARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or * UART peripheral. - * @param __INTERRUPT__: specifies the UART interrupt source to check. + * @param __INTERRUPT__: specifies the UART interrupt source to enable. * This parameter can be one of the following values: * @arg UART_IT_CTS: CTS change interrupt * @arg UART_IT_LBD: LIN Break detection interrupt @@ -425,14 +420,28 @@ typedef struct * @arg UART_IT_IDLE: Idle line detection interrupt * @arg UART_IT_PE: Parity Error interrupt * @arg UART_IT_ERR: Error interrupt(Frame error, noise error, overrun error) - * @param NewState: new state of the specified UART interrupt. - * This parameter can be: ENABLE or DISABLE. * @retval None */ #define UART_IT_MASK ((uint32_t)0x0000FFFF) #define __HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & UART_IT_MASK)): \ (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 |= ((__INTERRUPT__) & UART_IT_MASK)): \ ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & UART_IT_MASK))) +/** @brief Disable the specified UART interrupt. + * @param __HANDLE__: specifies the UART Handle. + * This parameter can be UARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or + * UART peripheral. + * @param __INTERRUPT__: specifies the UART interrupt source to disable. + * This parameter can be one of the following values: + * @arg UART_IT_CTS: CTS change interrupt + * @arg UART_IT_LBD: LIN Break detection interrupt + * @arg UART_IT_TXE: Transmit Data Register empty interrupt + * @arg UART_IT_TC: Transmission complete interrupt + * @arg UART_IT_RXNE: Receive Data register not empty interrupt + * @arg UART_IT_IDLE: Idle line detection interrupt + * @arg UART_IT_PE: Parity Error interrupt + * @arg UART_IT_ERR: Error interrupt(Frame error, noise error, overrun error) + * @retval None + */ #define __HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & UART_IT_MASK)): \ (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & UART_IT_MASK)): \ ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & UART_IT_MASK))) @@ -531,39 +540,56 @@ typedef struct (__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_RTSE); \ } while(0) -/** @brief macros to enables or disables the UART's one bit sampling method +/** @brief macros to enables the UART's one bit sample method * @param __HANDLE__: specifies the UART Handle. * @retval None */ -#define __HAL_UART_ONEBIT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) -#define __HAL_UART_ONEBIT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT)) +#define __HAL_UART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) +/** @brief macros to disables the UART's one bit sample method + * @param __HANDLE__: specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT)) + +/** @brief Enable UART + * @param __HANDLE__: specifies the UART Handle. + * @retval None + */ #define __HAL_UART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) + +/** @brief Disable UART + * @param __HANDLE__: specifies the UART Handle. + * @retval None + */ #define __HAL_UART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) +/** + * @} + */ -#define __DIV_SAMPLING16(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) -#define __DIVMANT_SAMPLING16(_PCLK_, _BAUD_) (__DIV_SAMPLING16((_PCLK_), (_BAUD_))/100) -#define __DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_) (((__DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (__DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) -#define __UART_BRR_SAMPLING16(_PCLK_, _BAUD_) ((__DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ_SAMPLING16((_PCLK_), (_BAUD_)) & 0x0F)) - -#define __DIV_SAMPLING8(_PCLK_, _BAUD_) (((_PCLK_)*25)/(2*(_BAUD_))) -#define __DIVMANT_SAMPLING8(_PCLK_, _BAUD_) (__DIV_SAMPLING8((_PCLK_), (_BAUD_))/100) -#define __DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_) (((__DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (__DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) -#define __UART_BRR_SAMPLING8(_PCLK_, _BAUD_) ((__DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ_SAMPLING8((_PCLK_), (_BAUD_)) & 0x0F)) - -#define IS_UART_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) -#define IS_UART_ADDRESS(ADDRESS) ((ADDRESS) <= 0xF) - /* Exported functions --------------------------------------------------------*/ +/** @addtogroup UART_Exported_Functions + * @{ + */ + +/** @addtogroup UART_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLength); -HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethode); +HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod); HAL_StatusTypeDef HAL_UART_DeInit (UART_HandleTypeDef *huart); void HAL_UART_MspInit(UART_HandleTypeDef *huart); void HAL_UART_MspDeInit(UART_HandleTypeDef *huart); +/** + * @} + */ +/** @addtogroup UART_Exported_Functions_Group2 + * @{ + */ /* IO operation functions *******************************************************/ HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout); @@ -580,26 +606,113 @@ void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *huart); void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart); void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart); void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart); +/** + * @} + */ +/** @addtogroup UART_Exported_Functions_Group3 + * @{ + */ /* Peripheral Control functions ************************************************/ HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_MultiProcessor_ExitMuteMode(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart); +/** + * @} + */ +/** @addtogroup UART_Exported_Functions_Group4 + * @{ + */ /* Peripheral State functions **************************************************/ HAL_UART_StateTypeDef HAL_UART_GetState(UART_HandleTypeDef *huart); uint32_t HAL_UART_GetError(UART_HandleTypeDef *huart); +/** + * @} + */ /** * @} */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup UART_Private_Constants UART Private Constants + * @{ + */ +/** @brief UART interruptions flag mask + * + */ +#define UART_CR1_REG_INDEX 1 +#define UART_CR2_REG_INDEX 2 +#define UART_CR3_REG_INDEX 3 +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup UART_Private_Macros UART Private Macros + * @{ + */ +#define IS_UART_WORD_LENGTH(LENGTH) (((LENGTH) == UART_WORDLENGTH_8B) || \ + ((LENGTH) == UART_WORDLENGTH_9B)) +#define IS_UART_LIN_WORD_LENGTH(LENGTH) (((LENGTH) == UART_WORDLENGTH_8B)) +#define IS_UART_STOPBITS(STOPBITS) (((STOPBITS) == UART_STOPBITS_1) || \ + ((STOPBITS) == UART_STOPBITS_2)) +#define IS_UART_PARITY(PARITY) (((PARITY) == UART_PARITY_NONE) || \ + ((PARITY) == UART_PARITY_EVEN) || \ + ((PARITY) == UART_PARITY_ODD)) +#define IS_UART_HARDWARE_FLOW_CONTROL(CONTROL)\ + (((CONTROL) == UART_HWCONTROL_NONE) || \ + ((CONTROL) == UART_HWCONTROL_RTS) || \ + ((CONTROL) == UART_HWCONTROL_CTS) || \ + ((CONTROL) == UART_HWCONTROL_RTS_CTS)) +#define IS_UART_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) +#define IS_UART_STATE(STATE) (((STATE) == UART_STATE_DISABLE) || \ + ((STATE) == UART_STATE_ENABLE)) +#define IS_UART_OVERSAMPLING(SAMPLING) (((SAMPLING) == UART_OVERSAMPLING_16) || \ + ((SAMPLING) == UART_OVERSAMPLING_8)) +#define IS_UART_LIN_OVERSAMPLING(SAMPLING) (((SAMPLING) == UART_OVERSAMPLING_16)) +#define IS_UART_LIN_BREAK_DETECT_LENGTH(LENGTH) (((LENGTH) == UART_LINBREAKDETECTLENGTH_10B) || \ + ((LENGTH) == UART_LINBREAKDETECTLENGTH_11B)) +#define IS_UART_WAKEUPMETHOD(WAKEUP) (((WAKEUP) == UART_WAKEUPMETHOD_IDLELINE) || \ + ((WAKEUP) == UART_WAKEUPMETHOD_ADDRESSMARK)) +#define IS_UART_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) +#define IS_UART_ADDRESS(ADDRESS) ((ADDRESS) <= 0xF) + +#define UART_DIV_SAMPLING16(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) +#define UART_DIVMANT_SAMPLING16(_PCLK_, _BAUD_) (UART_DIV_SAMPLING16((_PCLK_), (_BAUD_))/100) +#define UART_DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_) (((UART_DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) +#define UART_BRR_SAMPLING16(_PCLK_, _BAUD_) ((UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) << 4)|(UART_DIVFRAQ_SAMPLING16((_PCLK_), (_BAUD_)) & 0x0F)) + +#define UART_DIV_SAMPLING8(_PCLK_, _BAUD_) (((_PCLK_)*25)/(2*(_BAUD_))) +#define UART_DIVMANT_SAMPLING8(_PCLK_, _BAUD_) (UART_DIV_SAMPLING8((_PCLK_), (_BAUD_))/100) +#define UART_DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_) (((UART_DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) +#define UART_BRR_SAMPLING8(_PCLK_, _BAUD_) ((UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) << 4)|(UART_DIVFRAQ_SAMPLING8((_PCLK_), (_BAUD_)) & 0x0F)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup UART_Private_Functions UART Private Functions + * @{ + */ + +/** + * @} + */ /** * @} */ - + +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.c index 73118b5b174..250a488f640 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_usart.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief USART HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Universal Synchronous Asynchronous Receiver Transmitter (USART) peripheral: @@ -33,7 +33,7 @@ (+++) Enable the DMAx interface clock. (+++) Configure the declared DMA handle structure with the required Tx/Rx parameters. (+++) Configure the DMA Tx/Rx Stream. - (+++) Associate the initilalized DMA handle to the USART DMA Tx/Rx handle. + (+++) Associate the initialized DMA handle to the USART DMA Tx/Rx handle. (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx/Rx Stream. (#) Program the Baud Rate, Word Length, Stop Bit, Parity, Hardware @@ -41,11 +41,11 @@ (#) Initialize the USART registers by calling the HAL_USART_Init() API: (++) These APIs configures also the low level Hardware GPIO, CLOCK, CORTEX...etc) - by calling the customed HAL_USART_MspInit(&husart) API. + by calling the customized HAL_USART_MspInit(&husart) API. -@@- The specific USART interrupts (Transmission complete interrupt, RXNE interrupt and Error Interrupts) will be managed using the macros - __USART_ENABLE_IT() and __USART_DISABLE_IT() inside the transmit and receive process. + __HAL_USART_ENABLE_IT() and __HAL_USART_DISABLE_IT() inside the transmit and receive process. (#) Three operation modes are available within this driver : @@ -59,15 +59,11 @@ =================================== [..] (+) Send an amount of data in non blocking mode using HAL_USART_Transmit_IT() - (+) At transmission end of half transfer HAL_USART_TxHalfCpltCallback is executed and user can - add his own code by customization of function pointer HAL_USART_TxHalfCpltCallback - (+) At transmission end of transfer HAL_USART_TxCpltCallback is executed and user can + (+) At transmission end of transfer HAL_USART_TxHalfCpltCallback is executed and user can add his own code by customization of function pointer HAL_USART_TxCpltCallback (+) Receive an amount of data in non blocking mode using HAL_USART_Receive_IT() - (+) At reception end of half transfer HAL_USART_RxHalfCpltCallback is executed and user can - add his own code by customization of function pointer HAL_USART_RxHalfCpltCallback (+) At reception end of transfer HAL_USART_RxCpltCallback is executed and user can - add his own code by customization of function pointer HAL_USART_RxCpltCallback + add his own code by customization of function pointer HAL_UART_RxCpltCallback (+) In case of transfer Error, HAL_USART_ErrorCallback() function is executed and user can add his own code by customization of function pointer HAL_USART_ErrorCallback @@ -109,7 +105,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -143,19 +139,30 @@ * @{ */ -/** @defgroup USART +/** @defgroup USART USART * @brief HAL USART Synchronous module driver * @{ */ #ifdef HAL_USART_MODULE_ENABLED /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ -#define DUMMY_DATA 0xFFFF +/** @addtogroup USART_Private_Constants + * @{ + */ +#define DUMMY_DATA 0xFFFF #define USART_TIMEOUT_VALUE 22000 +/** + * @} + */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +/** @addtogroup USART_Private_Functions + * @{ + */ static HAL_StatusTypeDef USART_Transmit_IT(USART_HandleTypeDef *husart); +static HAL_StatusTypeDef USART_EndTransmit_IT(USART_HandleTypeDef *husart); static HAL_StatusTypeDef USART_Receive_IT(USART_HandleTypeDef *husart); static HAL_StatusTypeDef USART_TransmitReceive_IT(USART_HandleTypeDef *husart); static void USART_SetConfig (USART_HandleTypeDef *husart); @@ -165,14 +172,16 @@ static void USART_DMAReceiveCplt(DMA_HandleTypeDef *hdma); static void USART_DMARxHalfCplt(DMA_HandleTypeDef *hdma); static void USART_DMAError(DMA_HandleTypeDef *hdma); static HAL_StatusTypeDef USART_WaitOnFlagUntilTimeout(USART_HandleTypeDef *husart, uint32_t Flag, FlagStatus Status, uint32_t Timeout); -/* Private functions ---------------------------------------------------------*/ - +/** + * @} + */ -/** @defgroup USART_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup USART_Exported_Functions USART Exported Functions * @{ */ -/** @defgroup USART_Group1 USART Initialization and de-initialization functions +/** @defgroup USART_Exported_Functions_Group1 USART Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -223,6 +232,8 @@ HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart) if(husart->State == HAL_USART_STATE_RESET) { + /* Allocate lock resource and initialize it */ + husart->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_USART_MspInit(husart); } @@ -239,7 +250,7 @@ HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart) husart->Instance->CR3 &= ~(USART_CR3_IREN | USART_CR3_SCEN | USART_CR3_HDSEL); /* Enable the Peripheral */ - __USART_ENABLE(husart); + __HAL_USART_ENABLE(husart); /* Initialize the USART state */ husart->ErrorCode = HAL_USART_ERROR_NONE; @@ -267,6 +278,9 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart) husart->State = HAL_USART_STATE_BUSY; + /* Disable the Peripheral */ + __HAL_USART_DISABLE(husart); + /* DeInit the low level hardware */ HAL_USART_MspDeInit(husart); @@ -288,7 +302,7 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart) __weak void HAL_USART_MspInit(USART_HandleTypeDef *husart) { /* NOTE: This function Should not be modified, when the callback is needed, - the HAL_USART_MspInit could be implenetd in the user file + the HAL_USART_MspInit could be implemented in the user file */ } @@ -301,7 +315,7 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart) __weak void HAL_USART_MspDeInit(USART_HandleTypeDef *husart) { /* NOTE: This function Should not be modified, when the callback is needed, - the HAL_USART_MspDeInit could be implenetd in the user file + the HAL_USART_MspDeInit could be implemented in the user file */ } @@ -309,7 +323,7 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart) * @} */ -/** @defgroup USART_Group2 IO operation functions +/** @defgroup USART_Exported_Functions_Group2 IO operation functions * @brief USART Transmit and Receive functions * @verbatim @@ -335,7 +349,7 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart) using DMA mode. The HAL_USART_TxCpltCallback(), HAL_USART_RxCpltCallback() and HAL_USART_TxRxCpltCallback() user callbacks - will be executed respectivelly at the end of the transmit or Receive process + will be executed respectively at the end of the transmit or Receive process The HAL_USART_ErrorCallback() user callback will be executed when a communication error is detected @@ -354,13 +368,18 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart) (++) HAL_USART_Transmit_DMA()in simplex mode (++) HAL_USART_Receive_DMA() in full duplex receive only (++) HAL_USART_TransmitReceie_DMA() in full duplex mode - + (++) HAL_USART_DMAPause() + (++) HAL_USART_DMAResume() + (++) HAL_USART_DMAStop() + (#) A set of Transfer Complete Callbacks are provided in non Blocking mode: + (++) HAL_USART_TxHalfCpltCallback() (++) HAL_USART_TxCpltCallback() + (++) HAL_USART_RxHalfCpltCallback() (++) HAL_USART_RxCpltCallback() (++) HAL_USART_ErrorCallback() (++) HAL_USART_TxRxCpltCallback() - + @endverbatim * @{ */ @@ -687,14 +706,14 @@ HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, uint8_t *pT when the USART mode is configured for transmit and receive "USART_MODE_TX_RX" to benefit for the frame error and noise interrupts the USART mode should be configured only for transmit "USART_MODE_TX" - The __USART_ENABLE_IT(husart, USART_IT_ERR) can be used to enable the Frame error, + The __HAL_USART_ENABLE_IT(husart, USART_IT_ERR) can be used to enable the Frame error, Noise error interrupt */ /* Process Unlocked */ __HAL_UNLOCK(husart); /* Enable the USART Transmit Data Register Empty Interrupt */ - __USART_ENABLE_IT(husart, USART_IT_TXE); + __HAL_USART_ENABLE_IT(husart, USART_IT_TXE); return HAL_OK; } @@ -730,17 +749,17 @@ HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRx husart->ErrorCode = HAL_USART_ERROR_NONE; husart->State = HAL_USART_STATE_BUSY_RX; + /* Process Unlocked */ + __HAL_UNLOCK(husart); + /* Enable the USART Data Register not empty Interrupt */ - __USART_ENABLE_IT(husart, USART_IT_RXNE); + __HAL_USART_ENABLE_IT(husart, USART_IT_RXNE); /* Enable the USART Parity Error Interrupt */ - __USART_ENABLE_IT(husart, USART_IT_PE); + __HAL_USART_ENABLE_IT(husart, USART_IT_PE); /* Enable the USART Error Interrupt: (Frame error, noise error, overrun error) */ - __USART_ENABLE_IT(husart, USART_IT_ERR); - - /* Process Unlocked */ - __HAL_UNLOCK(husart); + __HAL_USART_ENABLE_IT(husart, USART_IT_ERR); /* Send dummy byte in order to generate the clock for the slave to send data */ husart->Instance->DR = (DUMMY_DATA & (uint16_t)0x01FF); @@ -783,20 +802,20 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint husart->ErrorCode = HAL_USART_ERROR_NONE; husart->State = HAL_USART_STATE_BUSY_TX_RX; + /* Process Unlocked */ + __HAL_UNLOCK(husart); + /* Enable the USART Data Register not empty Interrupt */ - __USART_ENABLE_IT(husart, USART_IT_RXNE); + __HAL_USART_ENABLE_IT(husart, USART_IT_RXNE); /* Enable the USART Parity Error Interrupt */ - __USART_ENABLE_IT(husart, USART_IT_PE); + __HAL_USART_ENABLE_IT(husart, USART_IT_PE); /* Enable the USART Error Interrupt: (Frame error, noise error, overrun error) */ - __USART_ENABLE_IT(husart, USART_IT_ERR); - - /* Process Unlocked */ - __HAL_UNLOCK(husart); + __HAL_USART_ENABLE_IT(husart, USART_IT_ERR); /* Enable the USART Transmit Data Register Empty Interrupt */ - __USART_ENABLE_IT(husart, USART_IT_TXE); + __HAL_USART_ENABLE_IT(husart, USART_IT_TXE); return HAL_OK; } @@ -847,6 +866,9 @@ HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *p tmp = (uint32_t*)&pTxData; HAL_DMA_Start_IT(husart->hdmatx, *(uint32_t*)tmp, (uint32_t)&husart->Instance->DR, Size); + /* Clear the TC flag in the SR register by writing 0 to it */ + __HAL_USART_CLEAR_FLAG(husart, USART_FLAG_TC); + /* Enable the DMA transfer for transmit request by setting the DMAT bit in the USART CR3 register */ husart->Instance->CR3 |= USART_CR3_DMAT; @@ -992,6 +1014,9 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uin tmp = (uint32_t*)&pTxData; HAL_DMA_Start_IT(husart->hdmatx, *(uint32_t*)tmp, (uint32_t)&husart->Instance->DR, Size); + /* Clear the TC flag in the SR register by writing 0 to it */ + __HAL_USART_CLEAR_FLAG(husart, USART_FLAG_TC); + /* Clear the Overrun flag: mandatory for the second transfer in circular mode */ __HAL_USART_CLEAR_OREFLAG(husart); @@ -1171,6 +1196,14 @@ void HAL_USART_IRQHandler(USART_HandleTypeDef *husart) USART_TransmitReceive_IT(husart); } } + + tmp1 = __HAL_USART_GET_FLAG(husart, USART_FLAG_TC); + tmp2 = __HAL_USART_GET_IT_SOURCE(husart, USART_IT_TC); + /* USART in mode Transmitter (transmission end) ----------------------------*/ + if((tmp1 != RESET) && (tmp2 != RESET)) + { + USART_EndTransmit_IT(husart); + } } /** @@ -1255,7 +1288,7 @@ __weak void HAL_USART_TxRxCpltCallback(USART_HandleTypeDef *husart) * @} */ -/** @defgroup USART_Group3 Peripheral State and Errors functions +/** @defgroup USART_Exported_Functions_Group3 Peripheral State and Errors functions * @brief USART State and Errors functions * @verbatim @@ -1315,22 +1348,12 @@ static void USART_DMATransmitCplt(DMA_HandleTypeDef *hdma) husart->TxXferCount = 0; if(husart->State == HAL_USART_STATE_BUSY_TX) { - /* Wait for USART TC Flag */ - if(USART_WaitOnFlagUntilTimeout(husart, USART_FLAG_TC, RESET, USART_TIMEOUT_VALUE) != HAL_OK) - { - /* Timeout occurred */ - husart->State = HAL_USART_STATE_TIMEOUT; - HAL_USART_ErrorCallback(husart); - } - else - { - /* No Timeout */ - /* Disable the DMA transfer for transmit request by setting the DMAT bit + /* Disable the DMA transfer for transmit request by resetting the DMAT bit in the USART CR3 register */ - husart->Instance->CR3 &= ~(USART_CR3_DMAT); - husart->State= HAL_USART_STATE_READY; - HAL_USART_TxCpltCallback(husart); - } + CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAT); + + /* Enable the USART Transmit Complete Interrupt */ + __HAL_USART_ENABLE_IT(husart, USART_IT_TC); } } /* DMA Circular mode */ @@ -1368,23 +1391,24 @@ static void USART_DMAReceiveCplt(DMA_HandleTypeDef *hdma) if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0) { husart->RxXferCount = 0; - husart->State= HAL_USART_STATE_READY; if(husart->State == HAL_USART_STATE_BUSY_RX) { /* Disable the DMA transfer for the Transmit/receiver requests by setting the DMAT/DMAR bit in the USART CR3 register */ husart->Instance->CR3 &= ~(USART_CR3_DMAR); + husart->State= HAL_USART_STATE_READY; HAL_USART_RxCpltCallback(husart); } - /* the usart state is HAL_USART_STATE_BUSY_TX_RX*/ + /* The USART state is HAL_USART_STATE_BUSY_TX_RX */ else { /* Disable the DMA transfer for the Transmit/receiver requests by setting the DMAT/DMAR bit in the USART CR3 register */ husart->Instance->CR3 &= ~(USART_CR3_DMAR); husart->Instance->CR3 &= ~(USART_CR3_DMAT); - + + husart->State= HAL_USART_STATE_READY; HAL_USART_TxRxCpltCallback(husart); } } @@ -1395,7 +1419,7 @@ static void USART_DMAReceiveCplt(DMA_HandleTypeDef *hdma) { HAL_USART_RxCpltCallback(husart); } - /* the usart state is HAL_USART_STATE_BUSY_TX_RX*/ + /* The USART state is HAL_USART_STATE_BUSY_TX_RX */ else { HAL_USART_TxRxCpltCallback(husart); @@ -1460,10 +1484,10 @@ static HAL_StatusTypeDef USART_WaitOnFlagUntilTimeout(USART_HandleTypeDef *husar if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) { /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */ - __USART_DISABLE_IT(husart, USART_IT_TXE); - __USART_DISABLE_IT(husart, USART_IT_RXNE); - __USART_DISABLE_IT(husart, USART_IT_PE); - __USART_DISABLE_IT(husart, USART_IT_ERR); + __HAL_USART_DISABLE_IT(husart, USART_IT_TXE); + __HAL_USART_DISABLE_IT(husart, USART_IT_RXNE); + __HAL_USART_DISABLE_IT(husart, USART_IT_PE); + __HAL_USART_DISABLE_IT(husart, USART_IT_ERR); husart->State= HAL_USART_STATE_READY; @@ -1485,10 +1509,10 @@ static HAL_StatusTypeDef USART_WaitOnFlagUntilTimeout(USART_HandleTypeDef *husar if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) { /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */ - __USART_DISABLE_IT(husart, USART_IT_TXE); - __USART_DISABLE_IT(husart, USART_IT_RXNE); - __USART_DISABLE_IT(husart, USART_IT_PE); - __USART_DISABLE_IT(husart, USART_IT_ERR); + __HAL_USART_DISABLE_IT(husart, USART_IT_TXE); + __HAL_USART_DISABLE_IT(husart, USART_IT_RXNE); + __HAL_USART_DISABLE_IT(husart, USART_IT_PE); + __HAL_USART_DISABLE_IT(husart, USART_IT_ERR); husart->State= HAL_USART_STATE_READY; @@ -1538,21 +1562,10 @@ static HAL_StatusTypeDef USART_Transmit_IT(USART_HandleTypeDef *husart) if(--husart->TxXferCount == 0) { /* Disable the USART Transmit data register empty Interrupt */ - __USART_DISABLE_IT(husart, USART_IT_TXE); - - /* Disable the USART Error Interrupt: (Frame error, noise error, overrun error) */ - __USART_DISABLE_IT(husart, USART_IT_ERR); - - - if(USART_WaitOnFlagUntilTimeout(husart, USART_FLAG_TC, RESET, USART_TIMEOUT_VALUE) != HAL_OK) - { - return HAL_TIMEOUT; - } - husart->State = HAL_USART_STATE_READY; - - HAL_USART_TxCpltCallback(husart); + __HAL_USART_DISABLE_IT(husart, USART_IT_TXE); - return HAL_OK; + /* Enable the USART Transmit Complete Interrupt */ + __HAL_USART_ENABLE_IT(husart, USART_IT_TC); } return HAL_OK; } @@ -1562,6 +1575,27 @@ static HAL_StatusTypeDef USART_Transmit_IT(USART_HandleTypeDef *husart) } } +/** + * @brief Wraps up transmission in non blocking mode. + * @param husart: pointer to a USART_HandleTypeDef structure that contains + * the configuration information for the specified USART module. + * @retval HAL status + */ +static HAL_StatusTypeDef USART_EndTransmit_IT(USART_HandleTypeDef *husart) +{ + /* Disable the USART Transmit Complete Interrupt */ + __HAL_USART_DISABLE_IT(husart, USART_IT_TC); + + /* Disable the USART Error Interrupt: (Frame error, noise error, overrun error) */ + __HAL_USART_DISABLE_IT(husart, USART_IT_ERR); + + husart->State = HAL_USART_STATE_READY; + + HAL_USART_TxCpltCallback(husart); + + return HAL_OK; +} + /** * @brief Simplex Receive an amount of data in non-blocking mode. * @param husart: pointer to a USART_HandleTypeDef structure that contains @@ -1613,13 +1647,13 @@ static HAL_StatusTypeDef USART_Receive_IT(USART_HandleTypeDef *husart) if(husart->RxXferCount == 0) { /* Disable the USART RXNE Interrupt */ - __USART_DISABLE_IT(husart, USART_IT_RXNE); + __HAL_USART_DISABLE_IT(husart, USART_IT_RXNE); /* Disable the USART Parity Error Interrupt */ - __USART_DISABLE_IT(husart, USART_IT_PE); + __HAL_USART_DISABLE_IT(husart, USART_IT_PE); /* Disable the USART Error Interrupt: (Frame error, noise error, overrun error) */ - __USART_DISABLE_IT(husart, USART_IT_ERR); + __HAL_USART_DISABLE_IT(husart, USART_IT_ERR); husart->State = HAL_USART_STATE_READY; HAL_USART_RxCpltCallback(husart); @@ -1672,7 +1706,7 @@ static HAL_StatusTypeDef USART_TransmitReceive_IT(USART_HandleTypeDef *husart) /* Check the latest data transmitted */ if(husart->TxXferCount == 0) { - __USART_DISABLE_IT(husart, USART_IT_TXE); + __HAL_USART_DISABLE_IT(husart, USART_IT_TXE); } } } @@ -1713,13 +1747,13 @@ static HAL_StatusTypeDef USART_TransmitReceive_IT(USART_HandleTypeDef *husart) /* Check the latest data received */ if(husart->RxXferCount == 0) { - __USART_DISABLE_IT(husart, USART_IT_RXNE); + __HAL_USART_DISABLE_IT(husart, USART_IT_RXNE); /* Disable the USART Parity Error Interrupt */ - __USART_DISABLE_IT(husart, USART_IT_PE); + __HAL_USART_DISABLE_IT(husart, USART_IT_PE); /* Disable the USART Error Interrupt: (Frame error, noise error, overrun error) */ - __USART_DISABLE_IT(husart, USART_IT_ERR); + __HAL_USART_DISABLE_IT(husart, USART_IT_ERR); husart->State = HAL_USART_STATE_READY; @@ -1770,7 +1804,7 @@ static void USART_SetConfig(USART_HandleTypeDef *husart) /* Set CPHA bit according to husart->Init.CLKPhase value */ /* Set LBCL bit according to husart->Init.CLKLastBit value */ /* Set Stop Bits: Set STOP[13:12] bits according to husart->Init.StopBits value */ - tmpreg |= (uint32_t)(USART_CLOCK_ENABLED| husart->Init.CLKPolarity | + tmpreg |= (uint32_t)(USART_CLOCK_ENABLE| husart->Init.CLKPolarity | husart->Init.CLKPhase| husart->Init.CLKLastBit | husart->Init.StopBits); /* Write to USART CR2 */ husart->Instance->CR2 = (uint32_t)tmpreg; @@ -1778,15 +1812,16 @@ static void USART_SetConfig(USART_HandleTypeDef *husart) /*-------------------------- USART CR1 Configuration -----------------------*/ tmpreg = husart->Instance->CR1; - /* Clear M, PCE, PS, TE and RE bits */ + /* Clear M, PCE, PS, TE, RE and OVER8 bits */ tmpreg &= (uint32_t)~((uint32_t)(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | \ - USART_CR1_RE)); + USART_CR1_RE | USART_CR1_OVER8)); /* Configure the USART Word Length, Parity and mode: Set the M bits according to husart->Init.WordLength value Set PCE and PS bits according to husart->Init.Parity value - Set TE and RE bits according to husart->Init.Mode value */ - tmpreg |= (uint32_t)husart->Init.WordLength | husart->Init.Parity | husart->Init.Mode; + Set TE and RE bits according to husart->Init.Mode value + Force OVER8 bit to 1 in order to reach the max USART frequencies */ + tmpreg |= (uint32_t)husart->Init.WordLength | husart->Init.Parity | husart->Init.Mode | USART_CR1_OVER8; /* Write to USART CR1 */ husart->Instance->CR1 = (uint32_t)tmpreg; @@ -1798,11 +1833,11 @@ static void USART_SetConfig(USART_HandleTypeDef *husart) /*-------------------------- USART BRR Configuration -----------------------*/ if((husart->Instance == USART1) || (husart->Instance == USART6)) { - husart->Instance->BRR = __USART_BRR(HAL_RCC_GetPCLK2Freq(), husart->Init.BaudRate); + husart->Instance->BRR = USART_BRR(HAL_RCC_GetPCLK2Freq(), husart->Init.BaudRate); } else { - husart->Instance->BRR = __USART_BRR(HAL_RCC_GetPCLK1Freq(), husart->Init.BaudRate); + husart->Instance->BRR = USART_BRR(HAL_RCC_GetPCLK1Freq(), husart->Init.BaudRate); } } diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.h index 7290a1dbda2..72341d75a9d 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_usart.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_usart.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of USART HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,6 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup USART_Exported_Types USART Exported Types + * @{ + */ + /** * @brief USART Init Structure definition */ @@ -78,7 +82,7 @@ typedef struct the word length is set to 9 data bits; 8th bit when the word length is set to 8 data bits). */ - uint32_t Mode; /*!< Specifies wether the Receive or Transmit mode is enabled or disabled. + uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled. This parameter can be a value of @ref USART_Mode */ uint32_t CLKPolarity; /*!< Specifies the steady state of the serial clock. @@ -107,19 +111,6 @@ typedef enum HAL_USART_STATE_ERROR = 0x04 /*!< Error */ }HAL_USART_StateTypeDef; -/** - * @brief HAL USART Error Code structure definition - */ -typedef enum -{ - HAL_USART_ERROR_NONE = 0x00, /*!< No error */ - HAL_USART_ERROR_PE = 0x01, /*!< Parity error */ - HAL_USART_ERROR_NE = 0x02, /*!< Noise error */ - HAL_USART_ERROR_FE = 0x04, /*!< frame error */ - HAL_USART_ERROR_ORE = 0x08, /*!< Overrun error */ - HAL_USART_ERROR_DMA = 0x10 /*!< DMA transfer error */ -}HAL_USART_ErrorTypeDef; - /** * @brief USART handle Structure definition */ @@ -149,125 +140,122 @@ typedef struct __IO HAL_USART_StateTypeDef State; /* Usart communication state */ - __IO HAL_USART_ErrorTypeDef ErrorCode; /* USART Error code */ - -}USART_HandleTypeDef; + __IO uint32_t ErrorCode; /* USART Error code */ +}USART_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ -/** @defgroup USART_Exported_Constants +/** @defgroup USART_Exported_Constants USART Exported Constants + * @{ + */ + +/** @defgroup USART_Error_Code USART Error Code + * @brief USART Error Code * @{ + */ +#define HAL_USART_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ +#define HAL_USART_ERROR_PE ((uint32_t)0x00000001) /*!< Parity error */ +#define HAL_USART_ERROR_NE ((uint32_t)0x00000002) /*!< Noise error */ +#define HAL_USART_ERROR_FE ((uint32_t)0x00000004) /*!< Frame error */ +#define HAL_USART_ERROR_ORE ((uint32_t)0x00000008) /*!< Overrun error */ +#define HAL_USART_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */ +/** + * @} */ -/** @defgroup USART_Word_Length +/** @defgroup USART_Word_Length USART Word Length * @{ */ #define USART_WORDLENGTH_8B ((uint32_t)0x00000000) #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M) -#define IS_USART_WORD_LENGTH(LENGTH) (((LENGTH) == USART_WORDLENGTH_8B) || \ - ((LENGTH) == USART_WORDLENGTH_9B)) /** * @} */ -/** @defgroup USART_Stop_Bits +/** @defgroup USART_Stop_Bits USART Number of Stop Bits * @{ */ #define USART_STOPBITS_1 ((uint32_t)0x00000000) #define USART_STOPBITS_0_5 ((uint32_t)USART_CR2_STOP_0) #define USART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) #define USART_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1)) -#define IS_USART_STOPBITS(STOPBITS) (((STOPBITS) == USART_STOPBITS_1) || \ - ((STOPBITS) == USART_STOPBITS_0_5) || \ - ((STOPBITS) == USART_STOPBITS_1_5) || \ - ((STOPBITS) == USART_STOPBITS_2)) /** * @} */ -/** @defgroup USART_Parity +/** @defgroup USART_Parity USART Parity * @{ */ #define USART_PARITY_NONE ((uint32_t)0x00000000) #define USART_PARITY_EVEN ((uint32_t)USART_CR1_PCE) -#define USART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) -#define IS_USART_PARITY(PARITY) (((PARITY) == USART_PARITY_NONE) || \ - ((PARITY) == USART_PARITY_EVEN) || \ - ((PARITY) == USART_PARITY_ODD)) +#define USART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) /** * @} */ -/** @defgroup USART_Mode +/** @defgroup USART_Mode USART Mode * @{ */ #define USART_MODE_RX ((uint32_t)USART_CR1_RE) #define USART_MODE_TX ((uint32_t)USART_CR1_TE) #define USART_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE)) -#define IS_USART_MODE(MODE) ((((MODE) & (uint32_t)0xFFF3) == 0x00) && ((MODE) != (uint32_t)0x00)) /** * @} */ -/** @defgroup USART_Clock +/** @defgroup USART_Clock USART Clock * @{ */ -#define USART_CLOCK_DISABLED ((uint32_t)0x00000000) -#define USART_CLOCK_ENABLED ((uint32_t)USART_CR2_CLKEN) -#define IS_USART_CLOCK(CLOCK) (((CLOCK) == USART_CLOCK_DISABLED) || \ - ((CLOCK) == USART_CLOCK_ENABLED)) +#define USART_CLOCK_DISABLE ((uint32_t)0x00000000) +#define USART_CLOCK_ENABLE ((uint32_t)USART_CR2_CLKEN) /** * @} */ -/** @defgroup USART_Clock_Polarity +/** @defgroup USART_Clock_Polarity USART Clock Polarity * @{ */ #define USART_POLARITY_LOW ((uint32_t)0x00000000) #define USART_POLARITY_HIGH ((uint32_t)USART_CR2_CPOL) -#define IS_USART_POLARITY(CPOL) (((CPOL) == USART_POLARITY_LOW) || ((CPOL) == USART_POLARITY_HIGH)) /** * @} */ -/** @defgroup USART_Clock_Phase +/** @defgroup USART_Clock_Phase USART Clock Phase * @{ */ #define USART_PHASE_1EDGE ((uint32_t)0x00000000) #define USART_PHASE_2EDGE ((uint32_t)USART_CR2_CPHA) -#define IS_USART_PHASE(CPHA) (((CPHA) == USART_PHASE_1EDGE) || ((CPHA) == USART_PHASE_2EDGE)) /** * @} */ -/** @defgroup USART_Last_Bit +/** @defgroup USART_Last_Bit USART Last Bit * @{ */ #define USART_LASTBIT_DISABLE ((uint32_t)0x00000000) #define USART_LASTBIT_ENABLE ((uint32_t)USART_CR2_LBCL) -#define IS_USART_LASTBIT(LASTBIT) (((LASTBIT) == USART_LASTBIT_DISABLE) || \ - ((LASTBIT) == USART_LASTBIT_ENABLE)) /** * @} */ -/** @defgroup USART_NACK_State +/** @defgroup USART_NACK_State USART NACK State * @{ */ -#define USARTNACK_ENABLED ((uint32_t)USART_CR3_NACK) -#define USARTNACK_DISABLED ((uint32_t)0x00000000) -#define IS_USART_NACK_STATE(NACK) (((NACK) == USARTNACK_ENABLED) || \ - ((NACK) == USARTNACK_DISABLED)) +#define USART_NACK_ENABLE ((uint32_t)USART_CR3_NACK) +#define USART_NACK_DISABLE ((uint32_t)0x00000000) /** * @} */ -/** @defgroup USART_Flags +/** @defgroup USART_Flags USART Flags * Elements values convention: 0xXXXX * - 0xXXXX : Flag mask in the SR register * @{ */ - #define USART_FLAG_TXE ((uint32_t)0x00000080) #define USART_FLAG_TC ((uint32_t)0x00000040) #define USART_FLAG_RXNE ((uint32_t)0x00000020) @@ -280,7 +268,7 @@ typedef struct * @} */ -/** @defgroup USART_Interrupt_definition +/** @defgroup USART_Interrupt_definition USART Interrupts Definition * Elements values convention: 0xY000XXXX * - XXXX : Interrupt mask in the XX register * - Y : Interrupt source register (2bits) @@ -290,18 +278,16 @@ typedef struct * * @{ */ -#define USART_IT_PE ((uint32_t)0x10000100) -#define USART_IT_TXE ((uint32_t)0x10000080) -#define USART_IT_TC ((uint32_t)0x10000040) -#define USART_IT_RXNE ((uint32_t)0x10000020) -#define USART_IT_IDLE ((uint32_t)0x10000010) - -#define USART_IT_LBD ((uint32_t)0x20000040) -#define USART_IT_CTS ((uint32_t)0x30000400) - -#define USART_IT_ERR ((uint32_t)0x30000001) +#define USART_IT_PE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_PEIE)) +#define USART_IT_TXE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_TXEIE)) +#define USART_IT_TC ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_TCIE)) +#define USART_IT_RXNE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_RXNEIE)) +#define USART_IT_IDLE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_IDLEIE)) +#define USART_IT_LBD ((uint32_t)(USART_CR2_REG_INDEX << 28 | USART_CR2_LBDIE)) +#define USART_IT_CTS ((uint32_t)(USART_CR3_REG_INDEX << 28 | USART_CR3_CTSIE)) +#define USART_IT_ERR ((uint32_t)(USART_CR3_REG_INDEX << 28 | USART_CR3_EIE)) /** * @} */ @@ -309,8 +295,12 @@ typedef struct /** * @} */ - + /* Exported macro ------------------------------------------------------------*/ +/** @defgroup USART_Exported_Macros USART Exported Macros + * @{ + */ + /** @brief Reset USART handle state * @param __HANDLE__: specifies the USART Handle. * This parameter can be USARTx where x: 1, 2, 3 or 6 to select the USART peripheral. @@ -327,13 +317,12 @@ typedef struct * @arg USART_FLAG_TC: Transmission Complete flag * @arg USART_FLAG_RXNE: Receive data register not empty flag * @arg USART_FLAG_IDLE: Idle Line detection flag - * @arg USART_FLAG_ORE: OverRun Error flag + * @arg USART_FLAG_ORE: Overrun Error flag * @arg USART_FLAG_NE: Noise Error flag * @arg USART_FLAG_FE: Framing Error flag * @arg USART_FLAG_PE: Parity Error flag * @retval The new state of __FLAG__ (TRUE or FALSE). */ - #define __HAL_USART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) /** @brief Clears the specified Smartcard pending flags. @@ -344,7 +333,7 @@ typedef struct * @arg USART_FLAG_TC: Transmission Complete flag. * @arg USART_FLAG_RXNE: Receive data register not empty flag. * - * @note PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun + * @note PE (Parity error), FE (Framing error), NE (Noise error), ORE (Overrun * error) and IDLE (Idle line detected) flags are cleared by software * sequence: a read operation to USART_SR register followed by a read * operation to USART_DR register. @@ -362,8 +351,14 @@ typedef struct * This parameter can be USARTx where x: 1, 2, 3 or 6 to select the USART peripheral. * @retval None */ -#define __HAL_USART_CLEAR_PEFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR;\ - (__HANDLE__)->Instance->DR;}while(0) +#define __HAL_USART_CLEAR_PEFLAG(__HANDLE__) \ + do{ \ + __IO uint32_t tmpreg; \ + tmpreg = (__HANDLE__)->Instance->SR; \ + tmpreg = (__HANDLE__)->Instance->DR; \ + UNUSED(tmpreg); \ + } while(0) + /** @brief Clear the USART FE pending flag. * @param __HANDLE__: specifies the USART Handle. * This parameter can be USARTx where x: 1, 2, 3 or 6 to select the USART peripheral. @@ -392,7 +387,7 @@ typedef struct */ #define __HAL_USART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_USART_CLEAR_PEFLAG(__HANDLE__) -/** @brief Enables or disables the specified Usart interrupts. +/** @brief Enables or disables the specified USART interrupts. * @param __HANDLE__: specifies the USART Handle. * This parameter can be USARTx where x: 1, 2, 3 or 6 to select the USART peripheral. * @param __INTERRUPT__: specifies the USART interrupt source to check. @@ -403,20 +398,17 @@ typedef struct * @arg USART_IT_IDLE: Idle line detection interrupt * @arg USART_IT_PE: Parity Error interrupt * @arg USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error) - * @param NewState: new state of the specified Usart interrupt. * This parameter can be: ENABLE or DISABLE. * @retval None */ -#define USART_IT_MASK ((uint32_t)0x0000FFFF) -#define __USART_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & USART_IT_MASK)): \ - (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 |= ((__INTERRUPT__) & USART_IT_MASK)): \ - ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & USART_IT_MASK))) -#define __USART_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & USART_IT_MASK)): \ - (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & USART_IT_MASK)): \ - ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & USART_IT_MASK))) - +#define __HAL_USART_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & USART_IT_MASK)): \ + (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 |= ((__INTERRUPT__) & USART_IT_MASK)): \ + ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & USART_IT_MASK))) +#define __HAL_USART_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & USART_IT_MASK)): \ + (((__INTERRUPT__) >> 28) == 2)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & USART_IT_MASK)): \ + ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & USART_IT_MASK))) -/** @brief Checks whether the specified Usart interrupt has occurred or not. +/** @brief Checks whether the specified USART interrupt has occurred or not. * @param __HANDLE__: specifies the USART Handle. * This parameter can be USARTx where x: 1, 2, 3 or 6 to select the USART peripheral. * @param __IT__: specifies the USART interrupt source to check. @@ -432,22 +424,55 @@ typedef struct #define __HAL_USART_GET_IT_SOURCE(__HANDLE__, __IT__) (((((__IT__) >> 28) == 1)? (__HANDLE__)->Instance->CR1:(((((uint32_t)(__IT__)) >> 28) == 2)? \ (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & (((uint32_t)(__IT__)) & USART_IT_MASK)) -#define __USART_ENABLE(__HANDLE__) ( (__HANDLE__)->Instance->CR1 |= USART_CR1_UE) -#define __USART_DISABLE(__HANDLE__) ( (__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) - -#define __DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) -#define __DIVMANT(_PCLK_, _BAUD_) (__DIV((_PCLK_), (_BAUD_))/100) -#define __DIVFRAQ(_PCLK_, _BAUD_) (((__DIV((_PCLK_), (_BAUD_)) - (__DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) -#define __USART_BRR(_PCLK_, _BAUD_) ((__DIVMANT((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) +/** @brief Macro to enable the USART's one bit sample method + * @param __HANDLE__: specifies the USART Handle. + * @retval None + */ +#define __HAL_USART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) -#define IS_USART_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) - +/** @brief Macro to disable the USART's one bit sample method + * @param __HANDLE__: specifies the USART Handle. + * @retval None + */ +#define __HAL_USART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT)) + +/** @brief Enable USART + * @param __HANDLE__: specifies the USART Handle. + * USART Handle selects the USARTx peripheral (USART availability and x value depending on device). + * @retval None + */ +#define __HAL_USART_ENABLE(__HANDLE__) ( (__HANDLE__)->Instance->CR1 |= USART_CR1_UE) + +/** @brief Disable USART + * @param __HANDLE__: specifies the USART Handle. + * USART Handle selects the USARTx peripheral (USART availability and x value depending on device). + * @retval None + */ +#define __HAL_USART_DISABLE(__HANDLE__) ( (__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) + +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup USART_Exported_Functions + * @{ + */ + +/** @addtogroup USART_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart); HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart); void HAL_USART_MspInit(USART_HandleTypeDef *husart); void HAL_USART_MspDeInit(USART_HandleTypeDef *husart); +/** + * @} + */ + +/** @addtogroup USART_Exported_Functions_Group2 + * @{ + */ /* IO operation functions *******************************************************/ HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_USART_Receive(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout); @@ -468,10 +493,83 @@ void HAL_USART_RxCpltCallback(USART_HandleTypeDef *husart); void HAL_USART_RxHalfCpltCallback(USART_HandleTypeDef *husart); void HAL_USART_TxRxCpltCallback(USART_HandleTypeDef *husart); void HAL_USART_ErrorCallback(USART_HandleTypeDef *husart); +/** + * @} + */ -/* Peripheral State functions **************************************************/ +/** @addtogroup USART_Exported_Functions_Group3 + * @{ + */ +/* Peripheral State functions ************************************************/ HAL_USART_StateTypeDef HAL_USART_GetState(USART_HandleTypeDef *husart); uint32_t HAL_USART_GetError(USART_HandleTypeDef *husart); +/** + * @} + */ + +/** + * @} + */ +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup USART_Private_Constants USART Private Constants + * @{ + */ +/** @brief USART interruptions flag mask + * + */ +#define USART_IT_MASK ((uint32_t) USART_CR1_PEIE | USART_CR1_TXEIE | USART_CR1_TCIE | USART_CR1_RXNEIE | \ + USART_CR1_IDLEIE | USART_CR2_LBDIE | USART_CR3_CTSIE | USART_CR3_EIE ) + + +#define USART_CR1_REG_INDEX 1 +#define USART_CR2_REG_INDEX 2 +#define USART_CR3_REG_INDEX 3 +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup USART_Private_Macros USART Private Macros + * @{ + */ +#define IS_USART_NACK_STATE(NACK) (((NACK) == USART_NACK_ENABLE) || \ + ((NACK) == USART_NACK_DISABLE)) +#define IS_USART_LASTBIT(LASTBIT) (((LASTBIT) == USART_LASTBIT_DISABLE) || \ + ((LASTBIT) == USART_LASTBIT_ENABLE)) +#define IS_USART_PHASE(CPHA) (((CPHA) == USART_PHASE_1EDGE) || ((CPHA) == USART_PHASE_2EDGE)) +#define IS_USART_POLARITY(CPOL) (((CPOL) == USART_POLARITY_LOW) || ((CPOL) == USART_POLARITY_HIGH)) +#define IS_USART_CLOCK(CLOCK) (((CLOCK) == USART_CLOCK_DISABLE) || \ + ((CLOCK) == USART_CLOCK_ENABLE)) +#define IS_USART_WORD_LENGTH(LENGTH) (((LENGTH) == USART_WORDLENGTH_8B) || \ + ((LENGTH) == USART_WORDLENGTH_9B)) +#define IS_USART_STOPBITS(STOPBITS) (((STOPBITS) == USART_STOPBITS_1) || \ + ((STOPBITS) == USART_STOPBITS_0_5) || \ + ((STOPBITS) == USART_STOPBITS_1_5) || \ + ((STOPBITS) == USART_STOPBITS_2)) +#define IS_USART_PARITY(PARITY) (((PARITY) == USART_PARITY_NONE) || \ + ((PARITY) == USART_PARITY_EVEN) || \ + ((PARITY) == USART_PARITY_ODD)) +#define IS_USART_MODE(MODE) ((((MODE) & (uint32_t)0xFFF3) == 0x00) && ((MODE) != (uint32_t)0x00)) +#define IS_USART_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) + +#define USART_DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(2*(_BAUD_))) +#define USART_DIVMANT(_PCLK_, _BAUD_) (USART_DIV((_PCLK_), (_BAUD_))/100) +#define USART_DIVFRAQ(_PCLK_, _BAUD_) (((USART_DIV((_PCLK_), (_BAUD_)) - (USART_DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) +#define USART_BRR(_PCLK_, _BAUD_) ((USART_DIVMANT((_PCLK_), (_BAUD_)) << 4)|(USART_DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup USART_Private_Functions USART Private Functions + * @{ + */ + +/** + * @} + */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.c index 8b114f68a89..530ed46313b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_hal_wwdg.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief WWDG HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Window Watchdog (WWDG) peripheral: @@ -40,7 +40,7 @@ ##### How to use this driver ##### ============================================================================== [..] - (+) Enable WWDG APB1 clock using __WWDG_CLK_ENABLE(). + (+) Enable WWDG APB1 clock using __HAL_RCC_WWDG_CLK_ENABLE(). (+) Set the WWDG prescaler, refresh window and counter value using HAL_WWDG_Init() function. (+) Start the WWDG using HAL_WWDG_Start() function. @@ -64,13 +64,13 @@ (+) __HAL_WWDG_ENABLE: Enable the WWDG peripheral (+) __HAL_WWDG_GET_FLAG: Get the selected WWDG's flag status (+) __HAL_WWDG_CLEAR_FLAG: Clear the WWDG's pending flags - (+) __HAL_WWDG_ENABLE_IT: Enables the WWDG early wakeup interrupt + (+) __HAL_WWDG_ENABLE_IT: Enables the WWDG early wake-up interrupt @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -104,7 +104,7 @@ * @{ */ -/** @defgroup WWDG +/** @defgroup WWDG WWDG * @brief WWDG HAL module driver. * @{ */ @@ -116,13 +116,12 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/** @defgroup WWDG_Private_Functions +/* Exported functions --------------------------------------------------------*/ +/** @defgroup WWDG_Exported_Functions WWDG Exported Functions * @{ */ -/** @defgroup WWDG_Group1 Initialization and de-initialization functions +/** @defgroup WWDG_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions. * @verbatim @@ -164,6 +163,8 @@ HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg) if(hwwdg->State == HAL_WWDG_STATE_RESET) { + /* Allocate lock resource and initialize it */ + hwwdg->Lock = HAL_UNLOCKED; /* Init the low level hardware */ HAL_WWDG_MspInit(hwwdg); } @@ -255,7 +256,7 @@ __weak void HAL_WWDG_MspDeInit(WWDG_HandleTypeDef *hwwdg) * @} */ -/** @defgroup WWDG_Group2 IO operation functions +/** @defgroup WWDG_Exported_Functions_Group2 IO operation functions * @brief IO operation functions * @verbatim @@ -314,7 +315,7 @@ HAL_StatusTypeDef HAL_WWDG_Start_IT(WWDG_HandleTypeDef *hwwdg) hwwdg->State = HAL_WWDG_STATE_BUSY; /* Enable the Early Wakeup Interrupt */ - __HAL_WWDG_ENABLE_IT(WWDG_IT_EWI); + __HAL_WWDG_ENABLE_IT(hwwdg, WWDG_IT_EWI); /* Enable the peripheral */ __HAL_WWDG_ENABLE(hwwdg); @@ -369,20 +370,24 @@ HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg, uint32_t Counter) */ void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg) { - /* WWDG Early Wakeup Interrupt occurred */ - if(__HAL_WWDG_GET_FLAG(hwwdg, WWDG_FLAG_EWIF) != RESET) + /* Check if Early Wakeup Interrupt is enable */ + if(__HAL_WWDG_GET_IT_SOURCE(hwwdg, WWDG_IT_EWI) != RESET) { - /* Early Wakeup callback */ - HAL_WWDG_WakeupCallback(hwwdg); - - /* Change WWDG peripheral state */ - hwwdg->State = HAL_WWDG_STATE_READY; - - /* Clear the WWDG Data Ready flag */ - __HAL_WWDG_CLEAR_FLAG(hwwdg, WWDG_FLAG_EWIF); - - /* Process Unlocked */ - __HAL_UNLOCK(hwwdg); + /* Check if WWDG Early Wakeup Interrupt occurred */ + if(__HAL_WWDG_GET_FLAG(hwwdg, WWDG_FLAG_EWIF) != RESET) + { + /* Early Wakeup callback */ + HAL_WWDG_WakeupCallback(hwwdg); + + /* Change WWDG peripheral state */ + hwwdg->State = HAL_WWDG_STATE_READY; + + /* Clear the WWDG Early Wakeup flag */ + __HAL_WWDG_CLEAR_FLAG(hwwdg, WWDG_FLAG_EWIF); + + /* Process Unlocked */ + __HAL_UNLOCK(hwwdg); + } } } @@ -403,7 +408,7 @@ __weak void HAL_WWDG_WakeupCallback(WWDG_HandleTypeDef* hwwdg) * @} */ -/** @defgroup WWDG_Group3 Peripheral State functions +/** @defgroup WWDG_Exported_Functions_Group3 Peripheral State functions * @brief Peripheral State functions. * @verbatim diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.h index 5c8943f937d..b34d3f4d884 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_wwdg.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_hal_wwdg.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of WWDG HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -55,7 +55,10 @@ */ /* Exported types ------------------------------------------------------------*/ - +/** @defgroup WWDG_Exported_Types WWDG Exported Types + * @{ + */ + /** * @brief WWDG HAL State Structure definition */ @@ -98,90 +101,52 @@ typedef struct __IO HAL_WWDG_StateTypeDef State; /*!< WWDG communication state */ }WWDG_HandleTypeDef; +/** + * @} + */ /* Exported constants --------------------------------------------------------*/ - -/** @defgroup WWDG_Exported_Constants - * @{ - */ - -/** @defgroup WWDG_BitAddress_AliasRegion - * @brief WWDG registers bit address in the alias region +/** @defgroup WWDG_Exported_Constants WWDG Exported Constants * @{ */ -/* --- CFR Register ---*/ -/* Alias word address of EWI bit */ -#define CFR_BASE (uint32_t)(WWDG_BASE + 0x04) - -/** - * @} - */ - -/** @defgroup WWDG_Interrupt_definition +/** @defgroup WWDG_Interrupt_definition WWDG Interrupt definition * @{ */ -#define WWDG_IT_EWI ((uint32_t)WWDG_CFR_EWI) - -#define IS_WWDG_IT(__IT__) ((__IT__) == WWDG_IT_EWI) - +#define WWDG_IT_EWI WWDG_CFR_EWI /*!< Early wakeup interrupt */ /** * @} */ -/** @defgroup WWDG_Flag_definition +/** @defgroup WWDG_Flag_definition WWDG Flag definition * @brief WWDG Flag definition * @{ */ -#define WWDG_FLAG_EWIF ((uint32_t)WWDG_SR_EWIF) /*!< Early wakeup interrupt flag */ -#define IS_WWDG_FLAG(__FLAG__) ((__FLAG__) == WWDG_FLAG_EWIF)) - - +#define WWDG_FLAG_EWIF WWDG_SR_EWIF /*!< Early wakeup interrupt flag */ /** * @} */ -/** @defgroup WWDG_Prescaler +/** @defgroup WWDG_Prescaler WWDG Prescaler * @{ */ -#define WWDG_PRESCALER_1 ((uint32_t)0x00000000) /*!< WWDG counter clock = (PCLK1/4096)/1 */ -#define WWDG_PRESCALER_2 ((uint32_t)WWDG_CFR_WDGTB0) /*!< WWDG counter clock = (PCLK1/4096)/2 */ -#define WWDG_PRESCALER_4 ((uint32_t)WWDG_CFR_WDGTB1) /*!< WWDG counter clock = (PCLK1/4096)/4 */ -#define WWDG_PRESCALER_8 ((uint32_t)WWDG_CFR_WDGTB) /*!< WWDG counter clock = (PCLK1/4096)/8 */ - -#define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \ - ((__PRESCALER__) == WWDG_PRESCALER_2) || \ - ((__PRESCALER__) == WWDG_PRESCALER_4) || \ - ((__PRESCALER__) == WWDG_PRESCALER_8)) - +#define WWDG_PRESCALER_1 ((uint32_t)0x00000000) /*!< WWDG counter clock = (PCLK1/4096)/1 */ +#define WWDG_PRESCALER_2 WWDG_CFR_WDGTB0 /*!< WWDG counter clock = (PCLK1/4096)/2 */ +#define WWDG_PRESCALER_4 WWDG_CFR_WDGTB1 /*!< WWDG counter clock = (PCLK1/4096)/4 */ +#define WWDG_PRESCALER_8 WWDG_CFR_WDGTB /*!< WWDG counter clock = (PCLK1/4096)/8 */ /** * @} */ -/** @defgroup WWDG_Window - * @{ - */ -#define IS_WWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= 0x7F) - /** * @} */ -/** @defgroup WWDG_Counter +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup WWDG_Exported_Macros WWDG Exported Macros * @{ - */ -#define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= 0x40) && ((__COUNTER__) <= 0x7F)) - -/** - * @} */ -/** - * @} - */ - -/* Exported macro ------------------------------------------------------------*/ - /** @brief Reset WWDG handle state * @param __HANDLE__: WWDG handle * @retval None @@ -196,69 +161,185 @@ typedef struct #define __HAL_WWDG_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA) /** - * @brief Gets the selected WWDG's flag status. + * @brief Disables the WWDG peripheral. * @param __HANDLE__: WWDG handle - * @param __FLAG__: specifies the flag to check. - * This parameter can be one of the following values: - * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag - * @retval The new state of WWDG_FLAG (SET or RESET). + * @note WARNING: This is a dummy macro for HAL code alignment. + * Once enable, WWDG Peripheral cannot be disabled except by a system reset. + * @retval None */ -#define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) +#define __HAL_WWDG_DISABLE(__HANDLE__) /* dummy macro */ /** - * @brief Clears the WWDG's pending flags. + * @brief Gets the selected WWDG's it status. * @param __HANDLE__: WWDG handle - * @param __FLAG__: specifies the flag to clear. + * @param __INTERRUPT__: specifies the it to check. + * This parameter can be one of the following values: + * @arg WWDG_FLAG_EWIF: Early wakeup interrupt IT + * @retval The new state of WWDG_FLAG (SET or RESET). + */ +#define __HAL_WWDG_GET_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_GET_FLAG((__HANDLE__),(__INTERRUPT__)) + +/** @brief Clear the WWDG's interrupt pending bits + * bits to clear the selected interrupt pending bits. + * @param __HANDLE__: WWDG handle + * @param __INTERRUPT__: specifies the interrupt pending bit to clear. * This parameter can be one of the following values: * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag - * @retval None */ -#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__)) +#define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__)) /** * @brief Enables the WWDG early wakeup interrupt. + * @param __HANDLE__: WWDG handle * @param __INTERRUPT__: specifies the interrupt to enable. * This parameter can be one of the following values: * @arg WWDG_IT_EWI: Early wakeup interrupt * @note Once enabled this interrupt cannot be disabled except by a system reset. * @retval None */ -#define __HAL_WWDG_ENABLE_IT(__INTERRUPT__) (*(__IO uint32_t *) CFR_BASE |= (__INTERRUPT__)) +#define __HAL_WWDG_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CFR, (__INTERRUPT__)) + +/** + * @brief Disables the WWDG early wakeup interrupt. + * @param __HANDLE__: WWDG handle + * @param __INTERRUPT__: specifies the interrupt to disable. + * This parameter can be one of the following values: + * @arg WWDG_IT_EWI: Early wakeup interrupt + * @note WARNING: This is a dummy macro for HAL code alignment. + * Once enabled this interrupt cannot be disabled except by a system reset. + * @retval None + */ +#define __HAL_WWDG_DISABLE_IT(__HANDLE__, __INTERRUPT__) /* dummy macro */ + +/** + * @brief Gets the selected WWDG's flag status. + * @param __HANDLE__: WWDG handle + * @param __FLAG__: specifies the flag to check. + * This parameter can be one of the following values: + * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag + * @retval The new state of WWDG_FLAG (SET or RESET). + */ +#define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) -/** @brief Clear the WWDG's interrupt pending bits - * bits to clear the selected interrupt pending bits. +/** + * @brief Clears the WWDG's pending flags. * @param __HANDLE__: WWDG handle - * @param __INTERRUPT__: specifies the interrupt pending bit to clear. + * @param __FLAG__: specifies the flag to clear. * This parameter can be one of the following values: * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag + * @retval None */ -#define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__)) +#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__)) + +/** @brief Checks if the specified WWDG interrupt source is enabled or disabled. + * @param __HANDLE__: WWDG Handle. + * @param __INTERRUPT__: specifies the WWDG interrupt source to check. + * This parameter can be one of the following values: + * @arg WWDG_IT_EWI: Early Wakeup Interrupt + * @retval state of __INTERRUPT__ (TRUE or FALSE). + */ +#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR & (__INTERRUPT__)) == (__INTERRUPT__)) + +/** + * @} + */ + /* Exported functions --------------------------------------------------------*/ +/** @addtogroup WWDG_Exported_Functions + * @{ + */ +/** @addtogroup WWDG_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg); HAL_StatusTypeDef HAL_WWDG_DeInit(WWDG_HandleTypeDef *hwwdg); void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg); void HAL_WWDG_MspDeInit(WWDG_HandleTypeDef *hwwdg); void HAL_WWDG_WakeupCallback(WWDG_HandleTypeDef* hwwdg); +/** + * @} + */ +/** @addtogroup WWDG_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions ******************************************************/ HAL_StatusTypeDef HAL_WWDG_Start(WWDG_HandleTypeDef *hwwdg); HAL_StatusTypeDef HAL_WWDG_Start_IT(WWDG_HandleTypeDef *hwwdg); HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg, uint32_t Counter); void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg); +/** + * @} + */ +/** @addtogroup WWDG_Exported_Functions_Group3 + * @{ + */ /* Peripheral State functions **************************************************/ HAL_WWDG_StateTypeDef HAL_WWDG_GetState(WWDG_HandleTypeDef *hwwdg); - /** * @} */ +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup WWDG_Private_Constants WWDG Private Constants + * @{ + */ +/** @defgroup WWDG_BitAddress_AliasRegion WWDG BitAddress + * @brief WWDG registers bit address in the alias region + * @{ + */ + +/* --- CFR Register ---*/ +/* Alias word address of EWI bit */ +#define WWDG_CFR_BASE (uint32_t)(WWDG_BASE + 0x04) + +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup WWDG_Private_Macros WWDG Private Macros + * @{ + */ +#define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \ + ((__PRESCALER__) == WWDG_PRESCALER_2) || \ + ((__PRESCALER__) == WWDG_PRESCALER_4) || \ + ((__PRESCALER__) == WWDG_PRESCALER_8)) +#define IS_WWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= 0x7F) +#define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= 0x40) && ((__COUNTER__) <= 0x7F)) +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup WWDG_Private_Functions WWDG Private Functions + * @{ + */ + +/** + * @} + */ + /** * @} */ - + +/** + * @} + */ #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.c index a45ccb7e2dd..ed5b85f81a1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_ll_fmc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief FMC Low Layer HAL module driver. * * This file provides firmware functions to manage the following @@ -46,7 +46,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -80,14 +80,14 @@ * @{ */ -/** @defgroup FMC +/** @defgroup FMC_LL FMC Low Layer * @brief FMC driver modules * @{ */ #if defined (HAL_SRAM_MODULE_ENABLED) || defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED) || defined(HAL_PCCARD_MODULE_ENABLED) || defined(HAL_SDRAM_MODULE_ENABLED) -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ @@ -95,13 +95,12 @@ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup FMC_Private_Functions +/** @addtogroup FMC_LL_Private_Functions * @{ */ -/** @defgroup FMC_NORSRAM Controller functions - * @brief NORSRAM Controller functions +/** @addtogroup FMC_LL_NORSRAM + * @brief NORSRAM Controller functions * @verbatim ============================================================================== @@ -125,7 +124,7 @@ * @{ */ -/** @defgroup HAL_FMC_NORSRAM_Group1 Initialization/de-initialization functions +/** @addtogroup FMC_LL_NORSRAM_Private_Functions_Group1 * @brief Initialization and Configuration functions * @verbatim @@ -161,17 +160,35 @@ HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_Ini assert_param(IS_FMC_NORSRAM_MEMORY_WIDTH(Init->MemoryDataWidth)); assert_param(IS_FMC_BURSTMODE(Init->BurstAccessMode)); assert_param(IS_FMC_WAIT_POLARITY(Init->WaitSignalPolarity)); +#if !defined (STM32F446xx) assert_param(IS_FMC_WRAP_MODE(Init->WrapMode)); +#endif /* !defined (STM32F446xx) */ assert_param(IS_FMC_WAIT_SIGNAL_ACTIVE(Init->WaitSignalActive)); assert_param(IS_FMC_WRITE_OPERATION(Init->WriteOperation)); assert_param(IS_FMC_WAITE_SIGNAL(Init->WaitSignal)); assert_param(IS_FMC_EXTENDED_MODE(Init->ExtendedMode)); assert_param(IS_FMC_ASYNWAIT(Init->AsynchronousWait)); assert_param(IS_FMC_WRITE_BURST(Init->WriteBurst)); - assert_param(IS_FMC_CONTINOUS_CLOCK(Init->ContinuousClock)); + assert_param(IS_FMC_CONTINOUS_CLOCK(Init->ContinuousClock)); +#if defined (STM32F446xx) + assert_param(IS_FMC_WRITE_FIFO(Init->WriteFifo)); + assert_param(IS_FMC_PAGESIZE(Init->PageSize)); +#endif /* defined (STM32F446xx) */ + + /* Get the BTCR register value */ + tmpr = Device->BTCR[Init->NSBank]; + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /* Clear MBKEN, MUXEN, MTYP, MWID, FACCEN, BURSTEN, WAITPOL, WRAPMOD, WAITCFG, WREN, + WAITEN, EXTMOD, ASYNCWAIT, CBURSTRW and CCLKEN bits */ + tmpr &= ((uint32_t)~(FMC_BCR1_MBKEN | FMC_BCR1_MUXEN | FMC_BCR1_MTYP | \ + FMC_BCR1_MWID | FMC_BCR1_FACCEN | FMC_BCR1_BURSTEN | \ + FMC_BCR1_WAITPOL | FMC_BCR1_WRAPMOD | FMC_BCR1_WAITCFG | \ + FMC_BCR1_WREN | FMC_BCR1_WAITEN | FMC_BCR1_EXTMOD | \ + FMC_BCR1_ASYNCWAIT | FMC_BCR1_CBURSTRW | FMC_BCR1_CCLKEN)); /* Set NORSRAM device control parameters */ - tmpr = (uint32_t)(Init->DataAddressMux |\ + tmpr |= (uint32_t)(Init->DataAddressMux |\ Init->MemoryType |\ Init->MemoryDataWidth |\ Init->BurstAccessMode |\ @@ -183,8 +200,33 @@ HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_Ini Init->ExtendedMode |\ Init->AsynchronousWait |\ Init->WriteBurst |\ - Init->ContinuousClock - ); + Init->ContinuousClock); +#else /* defined(STM32F446xx) */ + /* Clear MBKEN, MUXEN, MTYP, MWID, FACCEN, BURSTEN, WAITPOL, CPSIZE, WAITCFG, WREN, + WAITEN, EXTMOD, ASYNCWAIT, CBURSTRW, CCLKEN and WFDIS bits */ + tmpr &= ((uint32_t)~(FMC_BCR1_MBKEN | FMC_BCR1_MUXEN | FMC_BCR1_MTYP | \ + FMC_BCR1_MWID | FMC_BCR1_FACCEN | FMC_BCR1_BURSTEN | \ + FMC_BCR1_WAITPOL | FMC_BCR1_WAITCFG | FMC_BCR1_CPSIZE | \ + FMC_BCR1_WREN | FMC_BCR1_WAITEN | FMC_BCR1_EXTMOD | \ + FMC_BCR1_ASYNCWAIT | FMC_BCR1_CBURSTRW | FMC_BCR1_CCLKEN | \ + FMC_BCR1_WFDIS)); + + /* Set NORSRAM device control parameters */ + tmpr |= (uint32_t)(Init->DataAddressMux |\ + Init->MemoryType |\ + Init->MemoryDataWidth |\ + Init->BurstAccessMode |\ + Init->WaitSignalPolarity |\ + Init->WaitSignalActive |\ + Init->WriteOperation |\ + Init->WaitSignal |\ + Init->ExtendedMode |\ + Init->AsynchronousWait |\ + Init->WriteBurst |\ + Init->ContinuousClock |\ + Init->PageSize |\ + Init->WriteFifo); +#endif /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ if(Init->MemoryType == FMC_MEMORY_TYPE_NOR) { @@ -198,13 +240,19 @@ HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_Ini { Init->BurstAccessMode = FMC_BURST_ACCESS_MODE_ENABLE; Device->BTCR[FMC_NORSRAM_BANK1] |= (uint32_t)(Init->BurstAccessMode |\ - Init->ContinuousClock); - } + Init->ContinuousClock); + } + +#if defined(STM32F446xx) + if(Init->NSBank != FMC_NORSRAM_BANK1) + { + Device->BTCR[FMC_NORSRAM_BANK1] |= (uint32_t)(Init->WriteFifo); + } +#endif /* defined(STM32F446xx) */ return HAL_OK; } - /** * @brief DeInitialize the FMC_NORSRAM peripheral * @param Device: Pointer to NORSRAM device instance @@ -226,12 +274,12 @@ HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EX /* FMC_NORSRAM_BANK1 */ if(Bank == FMC_NORSRAM_BANK1) { - Device->BTCR[Bank] = 0x000030DB; + Device->BTCR[Bank] = 0x000030DB; } /* FMC_NORSRAM_BANK2, FMC_NORSRAM_BANK3 or FMC_NORSRAM_BANK4 */ else { - Device->BTCR[Bank] = 0x000030D2; + Device->BTCR[Bank] = 0x000030D2; } Device->BTCR[Bank + 1] = 0x0FFFFFFF; @@ -240,7 +288,6 @@ HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EX return HAL_OK; } - /** * @brief Initialize the FMC_NORSRAM Timing according to the specified * parameters in the FMC_NORSRAM_TimingTypeDef @@ -264,15 +311,22 @@ HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSR assert_param(IS_FMC_ACCESS_MODE(Timing->AccessMode)); assert_param(IS_FMC_NORSRAM_BANK(Bank)); + /* Get the BTCR register value */ + tmpr = Device->BTCR[Bank + 1]; + + /* Clear ADDSET, ADDHLD, DATAST, BUSTURN, CLKDIV, DATLAT and ACCMOD bits */ + tmpr &= ((uint32_t)~(FMC_BTR1_ADDSET | FMC_BTR1_ADDHLD | FMC_BTR1_DATAST | \ + FMC_BTR1_BUSTURN | FMC_BTR1_CLKDIV | FMC_BTR1_DATLAT | \ + FMC_BTR1_ACCMOD)); + /* Set FMC_NORSRAM device timing parameters */ - tmpr = (uint32_t)(Timing->AddressSetupTime |\ - ((Timing->AddressHoldTime) << 4) |\ - ((Timing->DataSetupTime) << 8) |\ - ((Timing->BusTurnAroundDuration) << 16) |\ - (((Timing->CLKDivision)-1) << 20) |\ - (((Timing->DataLatency)-2) << 24) |\ - (Timing->AccessMode) - ); + tmpr |= (uint32_t)(Timing->AddressSetupTime |\ + ((Timing->AddressHoldTime) << 4) |\ + ((Timing->DataSetupTime) << 8) |\ + ((Timing->BusTurnAroundDuration) << 16) |\ + (((Timing->CLKDivision)-1) << 20) |\ + (((Timing->DataLatency)-2) << 24) |\ + (Timing->AccessMode)); Device->BTCR[Bank + 1] = tmpr; @@ -297,46 +351,69 @@ HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSR */ HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FMC_EXTENDED_MODE(ExtendedMode)); /* Set NORSRAM device timing register for write configuration, if extended mode is used */ if(ExtendedMode == FMC_EXTENDED_MODE_ENABLE) { - /* Check the parameters */ + /* Check the parameters */ assert_param(IS_FMC_NORSRAM_EXTENDED_DEVICE(Device)); assert_param(IS_FMC_ADDRESS_SETUP_TIME(Timing->AddressSetupTime)); assert_param(IS_FMC_ADDRESS_HOLD_TIME(Timing->AddressHoldTime)); assert_param(IS_FMC_DATASETUP_TIME(Timing->DataSetupTime)); assert_param(IS_FMC_TURNAROUND_TIME(Timing->BusTurnAroundDuration)); +#if !defined(STM32F446xx) assert_param(IS_FMC_CLK_DIV(Timing->CLKDivision)); assert_param(IS_FMC_DATA_LATENCY(Timing->DataLatency)); +#endif /* !defined(STM32F446xx) */ assert_param(IS_FMC_ACCESS_MODE(Timing->AccessMode)); assert_param(IS_FMC_NORSRAM_BANK(Bank)); - Device->BWTR[Bank] = (uint32_t)(Timing->AddressSetupTime |\ - ((Timing->AddressHoldTime) << 4) |\ - ((Timing->DataSetupTime) << 8) |\ - ((Timing->BusTurnAroundDuration) << 16) |\ - (((Timing->CLKDivision)-1) << 20) |\ - (((Timing->DataLatency)-2) << 24) |\ - (Timing->AccessMode)); + /* Get the BWTR register value */ + tmpr = Device->BWTR[Bank]; + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /* Clear ADDSET, ADDHLD, DATAST, BUSTURN, CLKDIV, DATLAT and ACCMOD bits */ + tmpr &= ((uint32_t)~(FMC_BWTR1_ADDSET | FMC_BWTR1_ADDHLD | FMC_BWTR1_DATAST | \ + FMC_BWTR1_BUSTURN | FMC_BWTR1_CLKDIV | FMC_BWTR1_DATLAT | \ + FMC_BWTR1_ACCMOD)); + + tmpr |= (uint32_t)(Timing->AddressSetupTime |\ + ((Timing->AddressHoldTime) << 4) |\ + ((Timing->DataSetupTime) << 8) |\ + ((Timing->BusTurnAroundDuration) << 16) |\ + (((Timing->CLKDivision)-1) << 20) |\ + (((Timing->DataLatency)-2) << 24) |\ + (Timing->AccessMode)); +#else /* defined(STM32F446xx) */ + /* Clear ADDSET, ADDHLD, DATAST, BUSTURN and ACCMOD bits */ + tmpr &= ((uint32_t)~(FMC_BWTR1_ADDSET | FMC_BWTR1_ADDHLD | FMC_BWTR1_DATAST | \ + FMC_BWTR1_BUSTURN | FMC_BWTR1_ACCMOD)); + + tmpr |= (uint32_t)(Timing->AddressSetupTime |\ + ((Timing->AddressHoldTime) << 4) |\ + ((Timing->DataSetupTime) << 8) |\ + ((Timing->BusTurnAroundDuration) << 16) |\ + (Timing->AccessMode)); +#endif /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ + + Device->BWTR[Bank] = tmpr; } - else + else { Device->BWTR[Bank] = 0x0FFFFFFF; } return HAL_OK; } - - /** * @} */ - -/** @defgroup HAL_FMC_NORSRAM_Group3 Control functions +/** @addtogroup FMC_LL_NORSRAM_Private_Functions_Group2 * @brief management functions * @verbatim @@ -350,7 +427,6 @@ HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef @endverbatim * @{ */ - /** * @brief Enables dynamically FMC_NORSRAM write operation. * @param Device: Pointer to NORSRAM device instance @@ -394,9 +470,9 @@ HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device /** * @} */ - -/** @defgroup FMC_PCCARD Controller functions - * @brief PCCARD Controller functions + +/** @addtogroup FMC_LL_NAND + * @brief NAND Controller functions * @verbatim ============================================================================== @@ -419,7 +495,8 @@ HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device @endverbatim * @{ */ - + +#if defined(STM32F446xx) /** @defgroup HAL_FMC_NAND_Group1 Initialization/de-initialization functions * @brief Initialization and Configuration functions * @@ -436,7 +513,274 @@ HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device @endverbatim * @{ */ + +/** + * @brief Initializes the FMC_NAND device according to the specified + * control parameters in the FMC_NAND_HandleTypeDef + * @param Device: Pointer to NAND device instance + * @param Init: Pointer to NAND Initialization structure + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init) +{ + uint32_t tmpr = 0; + + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_NAND_BANK(Init->NandBank)); + assert_param(IS_FMC_WAIT_FEATURE(Init->Waitfeature)); + assert_param(IS_FMC_NAND_MEMORY_WIDTH(Init->MemoryDataWidth)); + assert_param(IS_FMC_ECC_STATE(Init->EccComputation)); + assert_param(IS_FMC_ECCPAGE_SIZE(Init->ECCPageSize)); + assert_param(IS_FMC_TCLR_TIME(Init->TCLRSetupTime)); + assert_param(IS_FMC_TAR_TIME(Init->TARSetupTime)); + + /* Get the NAND bank register value */ + tmpr = Device->PCR; + + /* Clear PWAITEN, PBKEN, PTYP, PWID, ECCEN, TCLR, TAR and ECCPS bits */ + tmpr &= ((uint32_t)~(FMC_PCR_PWAITEN | FMC_PCR_PBKEN | FMC_PCR_PTYP | \ + FMC_PCR_PWID | FMC_PCR_ECCEN | FMC_PCR_TCLR | \ + FMC_PCR_TAR | FMC_PCR_ECCPS)); + + /* Set NAND device control parameters */ + tmpr |= (uint32_t)(Init->Waitfeature |\ + FMC_PCR_MEMORY_TYPE_NAND |\ + Init->MemoryDataWidth |\ + Init->EccComputation |\ + Init->ECCPageSize |\ + ((Init->TCLRSetupTime) << 9) |\ + ((Init->TARSetupTime) << 13)); + + /* NAND bank registers configuration */ + Device->PCR = tmpr; + + return HAL_OK; +} + +/** + * @brief Initializes the FMC_NAND Common space Timing according to the specified + * parameters in the FMC_NAND_PCC_TimingTypeDef + * @param Device: Pointer to NAND device instance + * @param Timing: Pointer to NAND timing structure + * @param Bank: NAND bank number + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank) +{ + uint32_t tmpr = 0; + + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime)); + assert_param(IS_FMC_WAIT_TIME(Timing->WaitSetupTime)); + assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime)); + assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); + assert_param(IS_FMC_NAND_BANK(Bank)); + + /* Get the NAND bank 2 register value */ + tmpr = Device->PMEM; + + + /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */ + tmpr &= ((uint32_t)~(FMC_PMEM_MEMSET2 | FMC_PMEM_MEMWAIT2 | FMC_PMEM_MEMHOLD2 | \ + FMC_PMEM_MEMHIZ2)); + + /* Set FMC_NAND device timing parameters */ + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24) + ); + + /* NAND bank registers configuration */ + Device->PMEM = tmpr; + + return HAL_OK; +} + +/** + * @brief Initializes the FMC_NAND Attribute space Timing according to the specified + * parameters in the FMC_NAND_PCC_TimingTypeDef + * @param Device: Pointer to NAND device instance + * @param Timing: Pointer to NAND timing structure + * @param Bank: NAND bank number + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank) +{ + uint32_t tmpr = 0; + + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime)); + assert_param(IS_FMC_WAIT_TIME(Timing->WaitSetupTime)); + assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime)); + assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); + assert_param(IS_FMC_NAND_BANK(Bank)); + + /* Get the NAND bank register value */ + tmpr = Device->PATT; + + /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */ + tmpr &= ((uint32_t)~(FMC_PATT_ATTSET2 | FMC_PATT_ATTWAIT2 | FMC_PATT_ATTHOLD2 | \ + FMC_PATT_ATTHIZ2)); + + /* Set FMC_NAND device timing parameters */ + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + + /* NAND bank registers configuration */ + Device->PATT = tmpr; + + return HAL_OK; +} + + +/** + * @brief DeInitializes the FMC_NAND device + * @param Device: Pointer to NAND device instance + * @param Bank: NAND bank number + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank) +{ + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_NAND_BANK(Bank)); + + /* Disable the NAND Bank */ + __FMC_NAND_DISABLE(Device, Bank); + + /* De-initialize the NAND Bank */ + /* Set the FMC_NAND_BANK registers to their reset values */ + Device->PCR = 0x00000018; + Device->SR = 0x00000040; + Device->PMEM = 0xFCFCFCFC; + Device->PATT = 0xFCFCFCFC; + + return HAL_OK; +} + +/** + * @} + */ + + +/** @defgroup HAL_FMC_NAND_Group2 Control functions + * @brief management functions + * +@verbatim + ============================================================================== + ##### FMC_NAND Control functions ##### + ============================================================================== + [..] + This subsection provides a set of functions allowing to control dynamically + the FMC NAND interface. + +@endverbatim + * @{ + */ + + +/** + * @brief Enables dynamically FMC_NAND ECC feature. + * @param Device: Pointer to NAND device instance + * @param Bank: NAND bank number + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank) +{ + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_NAND_BANK(Bank)); + + /* Enable ECC feature */ + Device->PCR |= FMC_PCR_ECCEN; + + return HAL_OK; +} + + +/** + * @brief Disables dynamically FMC_NAND ECC feature. + * @param Device: Pointer to NAND device instance + * @param Bank: NAND bank number + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_ECC_Disable(FMC_NAND_TypeDef *Device, uint32_t Bank) +{ + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_NAND_BANK(Bank)); + + /* Disable ECC feature */ + Device->PCR &= ~FMC_PCR_ECCEN; + + return HAL_OK; +} + +/** + * @brief Disables dynamically FMC_NAND ECC feature. + * @param Device: Pointer to NAND device instance + * @param ECCval: Pointer to ECC value + * @param Bank: NAND bank number + * @param Timeout: Timeout wait value + * @retval HAL status + */ +HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout) +{ + uint32_t tickstart = 0; + + /* Check the parameters */ + assert_param(IS_FMC_NAND_DEVICE(Device)); + assert_param(IS_FMC_NAND_BANK(Bank)); + + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Wait until FIFO is empty */ + while(__FMC_NAND_GET_FLAG(Device, Bank, FMC_FLAG_FEMPT) == RESET) + { + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout)) + { + return HAL_TIMEOUT; + } + } + } + /* Get the ECCR register value */ + *ECCval = (uint32_t)Device->ECCR; + + return HAL_OK; +} + +/** + * @} + */ + +#else /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ +/** @defgroup HAL_FMC_NAND_Group1 Initialization/de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim + ============================================================================== + ##### Initialization and de_initialization functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the FMC NAND interface + (+) De-initialize the FMC NAND interface + (+) Configure the FMC clock and associated GPIOs + +@endverbatim + * @{ + */ /** * @brief Initializes the FMC_NAND device according to the specified * control parameters in the FMC_NAND_HandleTypeDef @@ -446,7 +790,7 @@ HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device */ HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init) { - uint32_t tmppcr = 0; + uint32_t tmpr = 0; /* Check the parameters */ assert_param(IS_FMC_NAND_DEVICE(Device)); @@ -458,25 +802,40 @@ HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef * assert_param(IS_FMC_TCLR_TIME(Init->TCLRSetupTime)); assert_param(IS_FMC_TAR_TIME(Init->TARSetupTime)); + if(Init->NandBank == FMC_NAND_BANK2) + { + /* Get the NAND bank 2 register value */ + tmpr = Device->PCR2; + } + else + { + /* Get the NAND bank 3 register value */ + tmpr = Device->PCR3; + } + + /* Clear PWAITEN, PBKEN, PTYP, PWID, ECCEN, TCLR, TAR and ECCPS bits */ + tmpr &= ((uint32_t)~(FMC_PCR2_PWAITEN | FMC_PCR2_PBKEN | FMC_PCR2_PTYP | \ + FMC_PCR2_PWID | FMC_PCR2_ECCEN | FMC_PCR2_TCLR | \ + FMC_PCR2_TAR | FMC_PCR2_ECCPS)); + /* Set NAND device control parameters */ - tmppcr = (uint32_t)(Init->Waitfeature |\ - FMC_PCR_MEMORY_TYPE_NAND |\ - Init->MemoryDataWidth |\ - Init->EccComputation |\ - Init->ECCPageSize |\ - ((Init->TCLRSetupTime) << 9) |\ - ((Init->TARSetupTime) << 13) - ); + tmpr |= (uint32_t)(Init->Waitfeature |\ + FMC_PCR_MEMORY_TYPE_NAND |\ + Init->MemoryDataWidth |\ + Init->EccComputation |\ + Init->ECCPageSize |\ + ((Init->TCLRSetupTime) << 9) |\ + ((Init->TARSetupTime) << 13)); if(Init->NandBank == FMC_NAND_BANK2) { /* NAND bank 2 registers configuration */ - Device->PCR2 = tmppcr; + Device->PCR2 = tmpr; } else { /* NAND bank 3 registers configuration */ - Device->PCR3 = tmppcr; + Device->PCR3 = tmpr; } return HAL_OK; @@ -493,7 +852,7 @@ HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef * */ HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank) { - uint32_t tmppmem = 0; + uint32_t tmpr = 0; /* Check the parameters */ assert_param(IS_FMC_NAND_DEVICE(Device)); @@ -503,8 +862,23 @@ HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); assert_param(IS_FMC_NAND_BANK(Bank)); + if(Bank == FMC_NAND_BANK2) + { + /* Get the NAND bank 2 register value */ + tmpr = Device->PMEM2; + } + else + { + /* Get the NAND bank 3 register value */ + tmpr = Device->PMEM3; + } + + /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */ + tmpr &= ((uint32_t)~(FMC_PMEM2_MEMSET2 | FMC_PMEM2_MEMWAIT2 | FMC_PMEM2_MEMHOLD2 | \ + FMC_PMEM2_MEMHIZ2)); + /* Set FMC_NAND device timing parameters */ - tmppmem = (uint32_t)(Timing->SetupTime |\ + tmpr |= (uint32_t)(Timing->SetupTime |\ ((Timing->WaitSetupTime) << 8) |\ ((Timing->HoldSetupTime) << 16) |\ ((Timing->HiZSetupTime) << 24) @@ -513,12 +887,12 @@ HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC if(Bank == FMC_NAND_BANK2) { /* NAND bank 2 registers configuration */ - Device->PMEM2 = tmppmem; + Device->PMEM2 = tmpr; } else { /* NAND bank 3 registers configuration */ - Device->PMEM3 = tmppmem; + Device->PMEM3 = tmpr; } return HAL_OK; @@ -534,7 +908,7 @@ HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC */ HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank) { - uint32_t tmppatt = 0; + uint32_t tmpr = 0; /* Check the parameters */ assert_param(IS_FMC_NAND_DEVICE(Device)); @@ -544,28 +918,41 @@ HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); assert_param(IS_FMC_NAND_BANK(Bank)); + if(Bank == FMC_NAND_BANK2) + { + /* Get the NAND bank 2 register value */ + tmpr = Device->PATT2; + } + else + { + /* Get the NAND bank 3 register value */ + tmpr = Device->PATT3; + } + + /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */ + tmpr &= ((uint32_t)~(FMC_PATT2_ATTSET2 | FMC_PATT2_ATTWAIT2 | FMC_PATT2_ATTHOLD2 | \ + FMC_PATT2_ATTHIZ2)); + /* Set FMC_NAND device timing parameters */ - tmppatt = (uint32_t)(Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - ((Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); if(Bank == FMC_NAND_BANK2) { /* NAND bank 2 registers configuration */ - Device->PATT2 = tmppatt; + Device->PATT2 = tmpr; } else { /* NAND bank 3 registers configuration */ - Device->PATT3 = tmppatt; + Device->PATT3 = tmpr; } return HAL_OK; } - /** * @brief DeInitializes the FMC_NAND device * @param Device: Pointer to NAND device instance @@ -606,11 +993,10 @@ HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank) /** * @} */ - - -/** @defgroup HAL_FMC_NAND_Group3 Control functions - * @brief management functions - * + +/** @addtogroup FMC_LL_NAND_Private_Functions_Group2 + * @brief management functions + * @verbatim ============================================================================== ##### FMC_NAND Control functions ##### @@ -622,8 +1008,6 @@ HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank) @endverbatim * @{ */ - - /** * @brief Enables dynamically FMC_NAND ECC feature. * @param Device: Pointer to NAND device instance @@ -649,7 +1033,6 @@ HAL_StatusTypeDef FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank) return HAL_OK; } - /** * @brief Disables dynamically FMC_NAND ECC feature. * @param Device: Pointer to NAND device instance @@ -694,8 +1077,8 @@ HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, ui /* Get tick */ tickstart = HAL_GetTick(); - /* Wait untill FIFO is empty */ - while(__FMC_NAND_GET_FLAG(Device, Bank, FMC_FLAG_FEMPT)) + /* Wait until FIFO is empty */ + while(__FMC_NAND_GET_FLAG(Device, Bank, FMC_FLAG_FEMPT) == RESET) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -724,12 +1107,14 @@ HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, ui /** * @} */ - + +#endif /* defined(STM32F446xx) */ /** * @} */ - -/** @defgroup FMC_PCCARD Controller functions + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @addtogroup FMC_LL_PCCARD * @brief PCCARD Controller functions * @verbatim @@ -748,15 +1133,13 @@ HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, ui FMC_PCCARD_AttributeSpace_Timing_Init() (+) FMC PCCARD bank IO space timing configuration using the function FMC_PCCARD_IOSpace_Timing_Init() - - @endverbatim * @{ */ -/** @defgroup HAL_FMC_PCCARD_Group1 Initialization/de-initialization functions - * @brief Initialization and Configuration functions - * +/** @addtogroup FMC_LL_PCCARD_Private_Functions_Group1 + * @brief Initialization and Configuration functions + * @verbatim ============================================================================== ##### Initialization and de_initialization functions ##### @@ -780,20 +1163,30 @@ HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, ui */ HAL_StatusTypeDef FMC_PCCARD_Init(FMC_PCCARD_TypeDef *Device, FMC_PCCARD_InitTypeDef *Init) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FMC_PCCARD_DEVICE(Device)); assert_param(IS_FMC_WAIT_FEATURE(Init->Waitfeature)); assert_param(IS_FMC_TCLR_TIME(Init->TCLRSetupTime)); assert_param(IS_FMC_TAR_TIME(Init->TARSetupTime)); + /* Get PCCARD control register value */ + tmpr = Device->PCR4; + + /* Clear TAR, TCLR, PWAITEN and PWID bits */ + tmpr &= ((uint32_t)~(FMC_PCR4_TAR | FMC_PCR4_TCLR | FMC_PCR4_PWAITEN | \ + FMC_PCR4_PWID)); + /* Set FMC_PCCARD device control parameters */ - Device->PCR4 = (uint32_t)(Init->Waitfeature |\ - FMC_NAND_PCC_MEM_BUS_WIDTH_16 |\ - (Init->TCLRSetupTime << 9) |\ - (Init->TARSetupTime << 13)); + tmpr |= (uint32_t)(Init->Waitfeature |\ + FMC_NAND_PCC_MEM_BUS_WIDTH_16 |\ + (Init->TCLRSetupTime << 9) |\ + (Init->TARSetupTime << 13)); + + Device->PCR4 = tmpr; return HAL_OK; - } /** @@ -805,6 +1198,8 @@ HAL_StatusTypeDef FMC_PCCARD_Init(FMC_PCCARD_TypeDef *Device, FMC_PCCARD_InitTyp */ HAL_StatusTypeDef FMC_PCCARD_CommonSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FMC_PCCARD_DEVICE(Device)); assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime)); @@ -812,13 +1207,20 @@ HAL_StatusTypeDef FMC_PCCARD_CommonSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); + /* Get PCCARD common space timing register value */ + tmpr = Device->PMEM4; + + /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */ + tmpr &= ((uint32_t)~(FMC_PMEM4_MEMSET4 | FMC_PMEM4_MEMWAIT4 | FMC_PMEM4_MEMHOLD4 | \ + FMC_PMEM4_MEMHIZ4)); /* Set PCCARD timing parameters */ - Device->PMEM4 = (uint32_t)((Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - (Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + Device->PMEM4 = tmpr; + return HAL_OK; } @@ -831,6 +1233,8 @@ HAL_StatusTypeDef FMC_PCCARD_CommonSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, */ HAL_StatusTypeDef FMC_PCCARD_AttributeSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FMC_PCCARD_DEVICE(Device)); assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime)); @@ -838,13 +1242,20 @@ HAL_StatusTypeDef FMC_PCCARD_AttributeSpace_Timing_Init(FMC_PCCARD_TypeDef *Devi assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); + /* Get PCCARD timing parameters */ + tmpr = Device->PATT4; + + /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */ + tmpr &= ((uint32_t)~(FMC_PATT4_ATTSET4 | FMC_PATT4_ATTWAIT4 | FMC_PATT4_ATTHOLD4 | \ + FMC_PATT4_ATTHIZ4)); + /* Set PCCARD timing parameters */ - Device->PATT4 = (uint32_t)((Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - (Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); - + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + Device->PATT4 = tmpr; + return HAL_OK; } @@ -857,6 +1268,8 @@ HAL_StatusTypeDef FMC_PCCARD_AttributeSpace_Timing_Init(FMC_PCCARD_TypeDef *Devi */ HAL_StatusTypeDef FMC_PCCARD_IOSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FMC_PCCARD_DEVICE(Device)); assert_param(IS_FMC_SETUP_TIME(Timing->SetupTime)); @@ -864,13 +1277,21 @@ HAL_StatusTypeDef FMC_PCCARD_IOSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC assert_param(IS_FMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FMC_HIZ_TIME(Timing->HiZSetupTime)); + /* Get FMC_PCCARD device timing parameters */ + tmpr = Device->PIO4; + + /* Clear IOSET4, IOWAIT4, IOHOLD4 and IOHIZ4 bits */ + tmpr &= ((uint32_t)~(FMC_PIO4_IOSET4 | FMC_PIO4_IOWAIT4 | FMC_PIO4_IOHOLD4 | \ + FMC_PIO4_IOHIZ4)); + /* Set FMC_PCCARD device timing parameters */ - Device->PIO4 = (uint32_t)((Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - (Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + Device->PIO4 = tmpr; + return HAL_OK; } @@ -900,9 +1321,10 @@ HAL_StatusTypeDef FMC_PCCARD_DeInit(FMC_PCCARD_TypeDef *Device) /** * @} */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -/** @defgroup FMC_SDRAM Controller functions +/** @addtogroup FMC_LL_SDRAM * @brief SDRAM Controller functions * @verbatim @@ -924,9 +1346,9 @@ HAL_StatusTypeDef FMC_PCCARD_DeInit(FMC_PCCARD_TypeDef *Device) * @{ */ -/** @defgroup HAL_FMC_SDRAM_Group1 Initialization/de-initialization functions - * @brief Initialization and Configuration functions - * +/** @addtogroup FMC_LL_SDRAM_Private_Functions_Group1 + * @brief Initialization and Configuration functions + * @verbatim ============================================================================== ##### Initialization and de_initialization functions ##### @@ -968,8 +1390,16 @@ HAL_StatusTypeDef FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDe /* Set SDRAM bank configuration parameters */ if (Init->SDBank != FMC_SDRAM_BANK2) - { - Device->SDCR[FMC_SDRAM_BANK1] = (uint32_t)(Init->ColumnBitsNumber |\ + { + tmpr1 = Device->SDCR[FMC_SDRAM_BANK1]; + + /* Clear NC, NR, MWID, NB, CAS, WP, SDCLK, RBURST, and RPIPE bits */ + tmpr1 &= ((uint32_t)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ + FMC_SDCR1_NB | FMC_SDCR1_CAS | FMC_SDCR1_WP | \ + FMC_SDCR1_SDCLK | FMC_SDCR1_RBURST | FMC_SDCR1_RPIPE)); + + + tmpr1 |= (uint32_t)(Init->ColumnBitsNumber |\ Init->RowBitsNumber |\ Init->MemoryDataWidth |\ Init->InternalBankNumber |\ @@ -978,23 +1408,36 @@ HAL_StatusTypeDef FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDe Init->SDClockPeriod |\ Init->ReadBurst |\ Init->ReadPipeDelay - ); + ); + Device->SDCR[FMC_SDRAM_BANK1] = tmpr1; } else /* FMC_Bank2_SDRAM */ { - tmpr1 = (uint32_t)(Init->SDClockPeriod |\ - Init->ReadBurst |\ - Init->ReadPipeDelay - ); + tmpr1 = Device->SDCR[FMC_SDRAM_BANK1]; + + /* Clear NC, NR, MWID, NB, CAS, WP, SDCLK, RBURST, and RPIPE bits */ + tmpr1 &= ((uint32_t)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ + FMC_SDCR1_NB | FMC_SDCR1_CAS | FMC_SDCR1_WP | \ + FMC_SDCR1_SDCLK | FMC_SDCR1_RBURST | FMC_SDCR1_RPIPE)); + + tmpr1 |= (uint32_t)(Init->SDClockPeriod |\ + Init->ReadBurst |\ + Init->ReadPipeDelay); + + tmpr2 = Device->SDCR[FMC_SDRAM_BANK2]; + + /* Clear NC, NR, MWID, NB, CAS, WP, SDCLK, RBURST, and RPIPE bits */ + tmpr2 &= ((uint32_t)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ + FMC_SDCR1_NB | FMC_SDCR1_CAS | FMC_SDCR1_WP | \ + FMC_SDCR1_SDCLK | FMC_SDCR1_RBURST | FMC_SDCR1_RPIPE)); - tmpr2 = (uint32_t)(Init->ColumnBitsNumber |\ + tmpr2 |= (uint32_t)(Init->ColumnBitsNumber |\ Init->RowBitsNumber |\ Init->MemoryDataWidth |\ Init->InternalBankNumber |\ Init->CASLatency |\ - Init->WriteProtection - ); - + Init->WriteProtection); + Device->SDCR[FMC_SDRAM_BANK1] = tmpr1; Device->SDCR[FMC_SDRAM_BANK2] = tmpr2; } @@ -1028,29 +1471,46 @@ HAL_StatusTypeDef FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_Tim /* Set SDRAM device timing parameters */ if (Bank != FMC_SDRAM_BANK2) - { - Device->SDTR[FMC_SDRAM_BANK1] = (uint32_t)(((Timing->LoadToActiveDelay)-1) |\ - (((Timing->ExitSelfRefreshDelay)-1) << 4) |\ - (((Timing->SelfRefreshTime)-1) << 8) |\ - (((Timing->RowCycleDelay)-1) << 12) |\ - (((Timing->WriteRecoveryTime)-1) <<16) |\ - (((Timing->RPDelay)-1) << 20) |\ - (((Timing->RCDDelay)-1) << 24) - ); + { + tmpr1 = Device->SDTR[FMC_SDRAM_BANK1]; + + /* Clear TMRD, TXSR, TRAS, TRC, TWR, TRP and TRCD bits */ + tmpr1 &= ((uint32_t)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ + FMC_SDTR1_TRC | FMC_SDTR1_TWR | FMC_SDTR1_TRP | \ + FMC_SDTR1_TRCD)); + + tmpr1 |= (uint32_t)(((Timing->LoadToActiveDelay)-1) |\ + (((Timing->ExitSelfRefreshDelay)-1) << 4) |\ + (((Timing->SelfRefreshTime)-1) << 8) |\ + (((Timing->RowCycleDelay)-1) << 12) |\ + (((Timing->WriteRecoveryTime)-1) <<16) |\ + (((Timing->RPDelay)-1) << 20) |\ + (((Timing->RCDDelay)-1) << 24)); + Device->SDTR[FMC_SDRAM_BANK1] = tmpr1; } else /* FMC_Bank2_SDRAM */ { - - tmpr1 = (uint32_t)(((Timing->LoadToActiveDelay)-1) |\ + tmpr1 = Device->SDTR[FMC_SDRAM_BANK2]; + + /* Clear TMRD, TXSR, TRAS, TRC, TWR, TRP and TRCD bits */ + tmpr1 &= ((uint32_t)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ + FMC_SDTR1_TRC | FMC_SDTR1_TWR | FMC_SDTR1_TRP | \ + FMC_SDTR1_TRCD)); + + tmpr1 |= (uint32_t)(((Timing->LoadToActiveDelay)-1) |\ (((Timing->ExitSelfRefreshDelay)-1) << 4) |\ (((Timing->SelfRefreshTime)-1) << 8) |\ (((Timing->WriteRecoveryTime)-1) <<16) |\ - (((Timing->RCDDelay)-1) << 24) - ); - - tmpr2 = (uint32_t)((((Timing->RowCycleDelay)-1) << 12) |\ - (((Timing->RPDelay)-1) << 20) - ); + (((Timing->RCDDelay)-1) << 24)); + + tmpr2 = Device->SDTR[FMC_SDRAM_BANK1]; + + /* Clear TMRD, TXSR, TRAS, TRC, TWR, TRP and TRCD bits */ + tmpr2 &= ((uint32_t)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ + FMC_SDTR1_TRC | FMC_SDTR1_TWR | FMC_SDTR1_TRP | \ + FMC_SDTR1_TRCD)); + tmpr2 |= (uint32_t)((((Timing->RowCycleDelay)-1) << 12) |\ + (((Timing->RPDelay)-1) << 20)); Device->SDTR[FMC_SDRAM_BANK2] = tmpr1; Device->SDTR[FMC_SDRAM_BANK1] = tmpr2; @@ -1083,11 +1543,10 @@ HAL_StatusTypeDef FMC_SDRAM_DeInit(FMC_SDRAM_TypeDef *Device, uint32_t Bank) /** * @} */ - -/** @defgroup HAL_FMC_SDRAM_Group3 Control functions - * @brief management functions - * +/** @addtogroup FMC_LL_SDRAMPrivate_Functions_Group2 + * @brief management functions + * @verbatim ============================================================================== ##### FMC_SDRAM Control functions ##### @@ -1099,7 +1558,6 @@ HAL_StatusTypeDef FMC_SDRAM_DeInit(FMC_SDRAM_TypeDef *Device, uint32_t Bank) @endverbatim * @{ */ - /** * @brief Enables dynamically FMC_SDRAM write protection. * @param Device: Pointer to SDRAM device instance @@ -1260,9 +1718,11 @@ uint32_t FMC_SDRAM_GetModeStatus(FMC_SDRAM_TypeDef *Device, uint32_t Bank) * @} */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ - -#endif /* HAL_FMC_MODULE_ENABLED */ +/** + * @} + */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +#endif /* HAL_SRAM_MODULE_ENABLED || HAL_NOR_MODULE_ENABLED || HAL_NAND_MODULE_ENABLED || HAL_PCCARD_MODULE_ENABLED || HAL_SDRAM_MODULE_ENABLED */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.h index 5660eaa09ce..824dca82346 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fmc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_ll_fmc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of FMC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,34 +43,24 @@ extern "C" { #endif -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" /** @addtogroup STM32F4xx_HAL_Driver * @{ */ - -/** @addtogroup FMC + +/** @addtogroup FMC_LL * @{ */ - -/* Exported typedef ----------------------------------------------------------*/ -#define FMC_NORSRAM_TypeDef FMC_Bank1_TypeDef -#define FMC_NORSRAM_EXTENDED_TypeDef FMC_Bank1E_TypeDef -#define FMC_NAND_TypeDef FMC_Bank2_3_TypeDef -#define FMC_PCCARD_TypeDef FMC_Bank4_TypeDef -#define FMC_SDRAM_TypeDef FMC_Bank5_6_TypeDef - -#define FMC_NORSRAM_DEVICE FMC_Bank1 -#define FMC_NORSRAM_EXTENDED_DEVICE FMC_Bank1E -#define FMC_NAND_DEVICE FMC_Bank2_3 -#define FMC_PCCARD_DEVICE FMC_Bank4 -#define FMC_SDRAM_DEVICE FMC_Bank5_6 +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) +/* Private types -------------------------------------------------------------*/ +/** @defgroup FMC_LL_Private_Types FMC Private Types + * @{ + */ /** - * @brief FMC_NORSRAM Configuration Structure definition + * @brief FMC NORSRAM Configuration Structure definition */ typedef struct { @@ -98,7 +88,8 @@ typedef struct uint32_t WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash memory, valid only when accessing Flash memories in burst mode. - This parameter can be a value of @ref FMC_Wrap_Mode */ + This parameter can be a value of @ref FMC_Wrap_Mode + This mode is not available for the STM32F446xx devices */ uint32_t WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one clock cycle before the wait state or during the wait state, @@ -127,10 +118,20 @@ typedef struct through FMC_BCR2..4 registers. This parameter can be a value of @ref FMC_Continous_Clock */ + uint32_t WriteFifo; /*!< Enables or disables the write FIFO used by the FMC controller. + This parameter is only enabled through the FMC_BCR1 register, and don't care + through FMC_BCR2..4 registers. + This parameter can be a value of @ref FMC_Write_FIFO + This mode is available only for the STM32F446xx devices */ + + uint32_t PageSize; /*!< Specifies the memory page size. + This parameter can be a value of @ref FMC_Page_Size + This mode is available only for the STM32F446xx devices */ + }FMC_NORSRAM_InitTypeDef; /** - * @brief FMC_NORSRAM Timing parameters structure definition + * @brief FMC NORSRAM Timing parameters structure definition */ typedef struct { @@ -173,7 +174,7 @@ typedef struct }FMC_NORSRAM_TimingTypeDef; /** - * @brief FMC_NAND Configuration Structure definition + * @brief FMC NAND Configuration Structure definition */ typedef struct { @@ -202,7 +203,7 @@ typedef struct }FMC_NAND_InitTypeDef; /** - * @brief FMC_NAND_PCCARD Timing parameters structure definition + * @brief FMC NAND/PCCARD Timing parameters structure definition */ typedef struct { @@ -233,7 +234,7 @@ typedef struct }FMC_NAND_PCC_TimingTypeDef; /** - * @brief FMC_NAND Configuration Structure definition + * @brief FMC NAND Configuration Structure definition */ typedef struct { @@ -250,7 +251,7 @@ typedef struct }FMC_PCCARD_InitTypeDef; /** - * @brief FMC_SDRAM Configuration Structure definition + * @brief FMC SDRAM Configuration Structure definition */ typedef struct { @@ -288,7 +289,7 @@ typedef struct }FMC_SDRAM_InitTypeDef; /** - * @brief FMC_SDRAM Timing parameters structure definition + * @brief FMC SDRAM Timing parameters structure definition */ typedef struct { @@ -322,7 +323,7 @@ typedef struct }FMC_SDRAM_TimingTypeDef; /** - * @brief SDRAM command parameters structure definition + * @brief SDRAM command parameters structure definition */ typedef struct { @@ -337,70 +338,59 @@ typedef struct This parameter can be a value between Min_Data = 1 and Max_Data = 16 */ uint32_t ModeRegisterDefinition; /*!< Defines the SDRAM Mode register content */ }FMC_SDRAM_CommandTypeDef; +/** + * @} + */ -/* Exported constants --------------------------------------------------------*/ - -/** @defgroup FMC_NOR_SRAM_Controller +/* Private constants ---------------------------------------------------------*/ +/** @defgroup FMC_LL_Private_Constants FMC Private Constants * @{ */ -/** @defgroup FMC_NORSRAM_Bank +/** @defgroup FMC_LL_NOR_SRAM_Controller FMC NOR/SRAM Controller + * @{ + */ +/** @defgroup FMC_NORSRAM_Bank FMC NOR/SRAM Bank * @{ */ #define FMC_NORSRAM_BANK1 ((uint32_t)0x00000000) #define FMC_NORSRAM_BANK2 ((uint32_t)0x00000002) #define FMC_NORSRAM_BANK3 ((uint32_t)0x00000004) #define FMC_NORSRAM_BANK4 ((uint32_t)0x00000006) - -#define IS_FMC_NORSRAM_BANK(BANK) (((BANK) == FMC_NORSRAM_BANK1) || \ - ((BANK) == FMC_NORSRAM_BANK2) || \ - ((BANK) == FMC_NORSRAM_BANK3) || \ - ((BANK) == FMC_NORSRAM_BANK4)) /** * @} */ -/** @defgroup FMC_Data_Address_Bus_Multiplexing +/** @defgroup FMC_Data_Address_Bus_Multiplexing FMC Data Address Bus Multiplexing * @{ */ #define FMC_DATA_ADDRESS_MUX_DISABLE ((uint32_t)0x00000000) #define FMC_DATA_ADDRESS_MUX_ENABLE ((uint32_t)0x00000002) - -#define IS_FMC_MUX(MUX) (((MUX) == FMC_DATA_ADDRESS_MUX_DISABLE) || \ - ((MUX) == FMC_DATA_ADDRESS_MUX_ENABLE)) /** * @} */ -/** @defgroup FMC_Memory_Type +/** @defgroup FMC_Memory_Type FMC Memory Type * @{ */ #define FMC_MEMORY_TYPE_SRAM ((uint32_t)0x00000000) #define FMC_MEMORY_TYPE_PSRAM ((uint32_t)0x00000004) #define FMC_MEMORY_TYPE_NOR ((uint32_t)0x00000008) - -#define IS_FMC_MEMORY(MEMORY) (((MEMORY) == FMC_MEMORY_TYPE_SRAM) || \ - ((MEMORY) == FMC_MEMORY_TYPE_PSRAM)|| \ - ((MEMORY) == FMC_MEMORY_TYPE_NOR)) /** * @} */ -/** @defgroup FMC_NORSRAM_Data_Width +/** @defgroup FMC_NORSRAM_Data_Width FMC NORSRAM Data Width * @{ */ #define FMC_NORSRAM_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000) #define FMC_NORSRAM_MEM_BUS_WIDTH_16 ((uint32_t)0x00000010) #define FMC_NORSRAM_MEM_BUS_WIDTH_32 ((uint32_t)0x00000020) - -#define IS_FMC_NORSRAM_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NORSRAM_MEM_BUS_WIDTH_8) || \ - ((WIDTH) == FMC_NORSRAM_MEM_BUS_WIDTH_16) || \ - ((WIDTH) == FMC_NORSRAM_MEM_BUS_WIDTH_32)) /** * @} */ -/** @defgroup FMC_NORSRAM_Flash_Access +/** @defgroup FMC_NORSRAM_Flash_Access FMC NOR/SRAM Flash Access * @{ */ #define FMC_NORSRAM_FLASH_ACCESS_ENABLE ((uint32_t)0x00000040) @@ -409,224 +399,157 @@ typedef struct * @} */ -/** @defgroup FMC_Burst_Access_Mode +/** @defgroup FMC_Burst_Access_Mode FMC Burst Access Mode * @{ */ #define FMC_BURST_ACCESS_MODE_DISABLE ((uint32_t)0x00000000) #define FMC_BURST_ACCESS_MODE_ENABLE ((uint32_t)0x00000100) - -#define IS_FMC_BURSTMODE(STATE) (((STATE) == FMC_BURST_ACCESS_MODE_DISABLE) || \ - ((STATE) == FMC_BURST_ACCESS_MODE_ENABLE)) /** * @} */ - -/** @defgroup FMC_Wait_Signal_Polarity +/** @defgroup FMC_Wait_Signal_Polarity FMC Wait Signal Polarity * @{ */ #define FMC_WAIT_SIGNAL_POLARITY_LOW ((uint32_t)0x00000000) #define FMC_WAIT_SIGNAL_POLARITY_HIGH ((uint32_t)0x00000200) - -#define IS_FMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FMC_WAIT_SIGNAL_POLARITY_LOW) || \ - ((POLARITY) == FMC_WAIT_SIGNAL_POLARITY_HIGH)) /** * @} */ -/** @defgroup FMC_Wrap_Mode +/** @defgroup FMC_Wrap_Mode FMC Wrap Mode * @{ */ +/** @note This mode is not available for the STM32F446xx devices + */ #define FMC_WRAP_MODE_DISABLE ((uint32_t)0x00000000) -#define FMC_WRAP_MODE_ENABLE ((uint32_t)0x00000400) - -#define IS_FMC_WRAP_MODE(MODE) (((MODE) == FMC_WRAP_MODE_DISABLE) || \ - ((MODE) == FMC_WRAP_MODE_ENABLE)) +#define FMC_WRAP_MODE_ENABLE ((uint32_t)0x00000400) /** * @} */ -/** @defgroup FMC_Wait_Timing +/** @defgroup FMC_Wait_Timing FMC Wait Timing * @{ */ #define FMC_WAIT_TIMING_BEFORE_WS ((uint32_t)0x00000000) -#define FMC_WAIT_TIMING_DURING_WS ((uint32_t)0x00000800) - -#define IS_FMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FMC_WAIT_TIMING_BEFORE_WS) || \ - ((ACTIVE) == FMC_WAIT_TIMING_DURING_WS)) +#define FMC_WAIT_TIMING_DURING_WS ((uint32_t)0x00000800) /** * @} */ -/** @defgroup FMC_Write_Operation +/** @defgroup FMC_Write_Operation FMC Write Operation * @{ */ #define FMC_WRITE_OPERATION_DISABLE ((uint32_t)0x00000000) #define FMC_WRITE_OPERATION_ENABLE ((uint32_t)0x00001000) - -#define IS_FMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FMC_WRITE_OPERATION_DISABLE) || \ - ((OPERATION) == FMC_WRITE_OPERATION_ENABLE)) /** * @} */ -/** @defgroup FMC_Wait_Signal +/** @defgroup FMC_Wait_Signal FMC Wait Signal * @{ */ #define FMC_WAIT_SIGNAL_DISABLE ((uint32_t)0x00000000) #define FMC_WAIT_SIGNAL_ENABLE ((uint32_t)0x00002000) - -#define IS_FMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FMC_WAIT_SIGNAL_DISABLE) || \ - ((SIGNAL) == FMC_WAIT_SIGNAL_ENABLE)) /** * @} */ -/** @defgroup FMC_Extended_Mode +/** @defgroup FMC_Extended_Mode FMC Extended Mode * @{ */ #define FMC_EXTENDED_MODE_DISABLE ((uint32_t)0x00000000) #define FMC_EXTENDED_MODE_ENABLE ((uint32_t)0x00004000) - -#define IS_FMC_EXTENDED_MODE(MODE) (((MODE) == FMC_EXTENDED_MODE_DISABLE) || \ - ((MODE) == FMC_EXTENDED_MODE_ENABLE)) /** * @} */ -/** @defgroup FMC_AsynchronousWait +/** @defgroup FMC_AsynchronousWait FMC Asynchronous Wait * @{ */ #define FMC_ASYNCHRONOUS_WAIT_DISABLE ((uint32_t)0x00000000) #define FMC_ASYNCHRONOUS_WAIT_ENABLE ((uint32_t)0x00008000) - -#define IS_FMC_ASYNWAIT(STATE) (((STATE) == FMC_ASYNCHRONOUS_WAIT_DISABLE) || \ - ((STATE) == FMC_ASYNCHRONOUS_WAIT_ENABLE)) /** * @} */ -/** @defgroup FMC_Write_Burst - * @{ - */ -#define FMC_WRITE_BURST_DISABLE ((uint32_t)0x00000000) -#define FMC_WRITE_BURST_ENABLE ((uint32_t)0x00080000) - -#define IS_FMC_WRITE_BURST(BURST) (((BURST) == FMC_WRITE_BURST_DISABLE) || \ - ((BURST) == FMC_WRITE_BURST_ENABLE)) -/** - * @} - */ - -/** @defgroup FMC_Continous_Clock - * @{ - */ -#define FMC_CONTINUOUS_CLOCK_SYNC_ONLY ((uint32_t)0x00000000) -#define FMC_CONTINUOUS_CLOCK_SYNC_ASYNC ((uint32_t)0x00100000) - -#define IS_FMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \ - ((CCLOCK) == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC)) -/** - * @} - */ - -/** @defgroup FMC_Address_Setup_Time - * @{ - */ -#define IS_FMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 15) -/** - * @} - */ - -/** @defgroup FMC_Address_Hold_Time +/** @defgroup FMC_Page_Size FMC Page Size + * @note These values are available only for the STM32F446xx devices. * @{ */ -#define IS_FMC_ADDRESS_HOLD_TIME(TIME) (((TIME) > 0) && ((TIME) <= 15)) +#define FMC_PAGE_SIZE_NONE ((uint32_t)0x00000000) +#define FMC_PAGE_SIZE_128 ((uint32_t)FMC_BCR1_CPSIZE_0) +#define FMC_PAGE_SIZE_256 ((uint32_t)FMC_BCR1_CPSIZE_1) +#define FMC_PAGE_SIZE_1024 ((uint32_t)FMC_BCR1_CPSIZE_2) /** * @} */ -/** @defgroup FMC_Data_Setup_Time +/** @defgroup FMC_Write_FIFO FMC Write FIFO + * @note These values are available only for the STM32F446xx devices. * @{ */ -#define IS_FMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 255)) +#define FMC_WRITE_FIFO_DISABLE ((uint32_t)0x00000000) +#define FMC_WRITE_FIFO_ENABLE ((uint32_t)FMC_BCR1_WFDIS) /** * @} */ -/** @defgroup FMC_Bus_Turn_around_Duration +/** @defgroup FMC_Write_Burst FMC Write Burst * @{ */ -#define IS_FMC_TURNAROUND_TIME(TIME) ((TIME) <= 15) +#define FMC_WRITE_BURST_DISABLE ((uint32_t)0x00000000) +#define FMC_WRITE_BURST_ENABLE ((uint32_t)0x00080000) /** * @} */ - -/** @defgroup FMC_CLK_Division + +/** @defgroup FMC_Continous_Clock FMC Continuous Clock * @{ */ -#define IS_FMC_CLK_DIV(DIV) (((DIV) > 1) && ((DIV) <= 16)) +#define FMC_CONTINUOUS_CLOCK_SYNC_ONLY ((uint32_t)0x00000000) +#define FMC_CONTINUOUS_CLOCK_SYNC_ASYNC ((uint32_t)0x00100000) /** * @} */ - -/** @defgroup FMC_Data_Latency - * @{ - */ -#define IS_FMC_DATA_LATENCY(LATENCY) (((LATENCY) > 1) && ((LATENCY) <= 17)) -/** - * @} - */ - -/** @defgroup FMC_Access_Mode + +/** @defgroup FMC_Access_Mode FMC Access Mode * @{ */ #define FMC_ACCESS_MODE_A ((uint32_t)0x00000000) #define FMC_ACCESS_MODE_B ((uint32_t)0x10000000) #define FMC_ACCESS_MODE_C ((uint32_t)0x20000000) #define FMC_ACCESS_MODE_D ((uint32_t)0x30000000) - -#define IS_FMC_ACCESS_MODE(MODE) (((MODE) == FMC_ACCESS_MODE_A) || \ - ((MODE) == FMC_ACCESS_MODE_B) || \ - ((MODE) == FMC_ACCESS_MODE_C) || \ - ((MODE) == FMC_ACCESS_MODE_D)) /** * @} */ /** * @} - */ + */ -/** @defgroup FMC_NAND_Controller +/** @defgroup FMC_LL_NAND_Controller FMC NAND Controller * @{ */ - -/** @defgroup FMC_NAND_Bank +/** @defgroup FMC_NAND_Bank FMC NAND Bank * @{ - */ + */ #define FMC_NAND_BANK2 ((uint32_t)0x00000010) -#define FMC_NAND_BANK3 ((uint32_t)0x00000100) - -#define IS_FMC_NAND_BANK(BANK) (((BANK) == FMC_NAND_BANK2) || \ - ((BANK) == FMC_NAND_BANK3)) +#define FMC_NAND_BANK3 ((uint32_t)0x00000100) /** * @} */ -/** @defgroup FMC_Wait_feature +/** @defgroup FMC_Wait_feature FMC Wait feature * @{ */ #define FMC_NAND_PCC_WAIT_FEATURE_DISABLE ((uint32_t)0x00000000) #define FMC_NAND_PCC_WAIT_FEATURE_ENABLE ((uint32_t)0x00000002) - -#define IS_FMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \ - ((FEATURE) == FMC_NAND_PCC_WAIT_FEATURE_ENABLE)) /** * @} */ -/** @defgroup FMC_PCR_Memory_Type +/** @defgroup FMC_PCR_Memory_Type FMC PCR Memory Type * @{ */ #define FMC_PCR_MEMORY_TYPE_PCCARD ((uint32_t)0x00000000) @@ -635,31 +558,25 @@ typedef struct * @} */ -/** @defgroup FMC_NAND_Data_Width +/** @defgroup FMC_NAND_Data_Width FMC NAND Data Width * @{ */ #define FMC_NAND_PCC_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000) #define FMC_NAND_PCC_MEM_BUS_WIDTH_16 ((uint32_t)0x00000010) - -#define IS_FMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NAND_PCC_MEM_BUS_WIDTH_8) || \ - ((WIDTH) == FMC_NAND_PCC_MEM_BUS_WIDTH_16)) /** * @} */ -/** @defgroup FMC_ECC +/** @defgroup FMC_ECC FMC ECC * @{ */ #define FMC_NAND_ECC_DISABLE ((uint32_t)0x00000000) #define FMC_NAND_ECC_ENABLE ((uint32_t)0x00000040) - -#define IS_FMC_ECC_STATE(STATE) (((STATE) == FMC_NAND_ECC_DISABLE) || \ - ((STATE) == FMC_NAND_ECC_ENABLE)) /** * @} */ -/** @defgroup FMC_ECC_Page_Size +/** @defgroup FMC_ECC_Page_Size FMC ECC Page Size * @{ */ #define FMC_NAND_ECC_PAGE_SIZE_256BYTE ((uint32_t)0x00000000) @@ -668,428 +585,218 @@ typedef struct #define FMC_NAND_ECC_PAGE_SIZE_2048BYTE ((uint32_t)0x00060000) #define FMC_NAND_ECC_PAGE_SIZE_4096BYTE ((uint32_t)0x00080000) #define FMC_NAND_ECC_PAGE_SIZE_8192BYTE ((uint32_t)0x000A0000) - -#define IS_FMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FMC_NAND_ECC_PAGE_SIZE_256BYTE) || \ - ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_512BYTE) || \ - ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \ - ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \ - ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \ - ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_8192BYTE)) -/** - * @} - */ - -/** @defgroup FMC_TCLR_Setup_Time - * @{ - */ -#define IS_FMC_TCLR_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ - -/** @defgroup FMC_TAR_Setup_Time - * @{ - */ -#define IS_FMC_TAR_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ - -/** @defgroup FMC_Setup_Time - * @{ - */ -#define IS_FMC_SETUP_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ - -/** @defgroup FMC_Wait_Setup_Time - * @{ - */ -#define IS_FMC_WAIT_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ - -/** @defgroup FMC_Hold_Setup_Time - * @{ - */ -#define IS_FMC_HOLD_TIME(TIME) ((TIME) <= 255) /** * @} */ - -/** @defgroup FMC_HiZ_Setup_Time - * @{ - */ -#define IS_FMC_HIZ_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ - + /** * @} - */ + */ -/** @defgroup FMC_SDRAM_Controller +/** @defgroup FMC_LL_SDRAM_Controller FMC SDRAM Controller * @{ */ - -/** @defgroup FMC_SDRAM_Bank +/** @defgroup FMC_SDRAM_Bank FMC SDRAM Bank * @{ */ #define FMC_SDRAM_BANK1 ((uint32_t)0x00000000) #define FMC_SDRAM_BANK2 ((uint32_t)0x00000001) - -#define IS_FMC_SDRAM_BANK(BANK) (((BANK) == FMC_SDRAM_BANK1) || \ - ((BANK) == FMC_SDRAM_BANK2)) /** * @} */ -/** @defgroup FMC_SDRAM_Column_Bits_number +/** @defgroup FMC_SDRAM_Column_Bits_number FMC SDRAM Column Bits number * @{ */ #define FMC_SDRAM_COLUMN_BITS_NUM_8 ((uint32_t)0x00000000) #define FMC_SDRAM_COLUMN_BITS_NUM_9 ((uint32_t)0x00000001) #define FMC_SDRAM_COLUMN_BITS_NUM_10 ((uint32_t)0x00000002) #define FMC_SDRAM_COLUMN_BITS_NUM_11 ((uint32_t)0x00000003) - -#define IS_FMC_COLUMNBITS_NUMBER(COLUMN) (((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_8) || \ - ((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_9) || \ - ((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_10) || \ - ((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_11)) /** * @} */ -/** @defgroup FMC_SDRAM_Row_Bits_number +/** @defgroup FMC_SDRAM_Row_Bits_number FMC SDRAM Row Bits number * @{ */ #define FMC_SDRAM_ROW_BITS_NUM_11 ((uint32_t)0x00000000) #define FMC_SDRAM_ROW_BITS_NUM_12 ((uint32_t)0x00000004) #define FMC_SDRAM_ROW_BITS_NUM_13 ((uint32_t)0x00000008) - -#define IS_FMC_ROWBITS_NUMBER(ROW) (((ROW) == FMC_SDRAM_ROW_BITS_NUM_11) || \ - ((ROW) == FMC_SDRAM_ROW_BITS_NUM_12) || \ - ((ROW) == FMC_SDRAM_ROW_BITS_NUM_13)) /** * @} */ -/** @defgroup FMC_SDRAM_Memory_Bus_Width +/** @defgroup FMC_SDRAM_Memory_Bus_Width FMC SDRAM Memory Bus Width * @{ */ #define FMC_SDRAM_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000) #define FMC_SDRAM_MEM_BUS_WIDTH_16 ((uint32_t)0x00000010) #define FMC_SDRAM_MEM_BUS_WIDTH_32 ((uint32_t)0x00000020) - -#define IS_FMC_SDMEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_SDRAM_MEM_BUS_WIDTH_8) || \ - ((WIDTH) == FMC_SDRAM_MEM_BUS_WIDTH_16) || \ - ((WIDTH) == FMC_SDRAM_MEM_BUS_WIDTH_32)) /** * @} */ -/** @defgroup FMC_SDRAM_Internal_Banks_Number +/** @defgroup FMC_SDRAM_Internal_Banks_Number FMC SDRAM Internal Banks Number * @{ */ #define FMC_SDRAM_INTERN_BANKS_NUM_2 ((uint32_t)0x00000000) #define FMC_SDRAM_INTERN_BANKS_NUM_4 ((uint32_t)0x00000040) - -#define IS_FMC_INTERNALBANK_NUMBER(NUMBER) (((NUMBER) == FMC_SDRAM_INTERN_BANKS_NUM_2) || \ - ((NUMBER) == FMC_SDRAM_INTERN_BANKS_NUM_4)) /** * @} */ -/** @defgroup FMC_SDRAM_CAS_Latency +/** @defgroup FMC_SDRAM_CAS_Latency FMC SDRAM CAS Latency * @{ */ #define FMC_SDRAM_CAS_LATENCY_1 ((uint32_t)0x00000080) #define FMC_SDRAM_CAS_LATENCY_2 ((uint32_t)0x00000100) #define FMC_SDRAM_CAS_LATENCY_3 ((uint32_t)0x00000180) - -#define IS_FMC_CAS_LATENCY(LATENCY) (((LATENCY) == FMC_SDRAM_CAS_LATENCY_1) || \ - ((LATENCY) == FMC_SDRAM_CAS_LATENCY_2) || \ - ((LATENCY) == FMC_SDRAM_CAS_LATENCY_3)) /** * @} */ -/** @defgroup FMC_SDRAM_Write_Protection +/** @defgroup FMC_SDRAM_Write_Protection FMC SDRAM Write Protection * @{ */ #define FMC_SDRAM_WRITE_PROTECTION_DISABLE ((uint32_t)0x00000000) #define FMC_SDRAM_WRITE_PROTECTION_ENABLE ((uint32_t)0x00000200) -#define IS_FMC_WRITE_PROTECTION(WRITE) (((WRITE) == FMC_SDRAM_WRITE_PROTECTION_DISABLE) || \ - ((WRITE) == FMC_SDRAM_WRITE_PROTECTION_ENABLE)) /** * @} */ -/** @defgroup FMC_SDRAM_Clock_Period +/** @defgroup FMC_SDRAM_Clock_Period FMC SDRAM Clock Period * @{ */ #define FMC_SDRAM_CLOCK_DISABLE ((uint32_t)0x00000000) #define FMC_SDRAM_CLOCK_PERIOD_2 ((uint32_t)0x00000800) #define FMC_SDRAM_CLOCK_PERIOD_3 ((uint32_t)0x00000C00) - -#define IS_FMC_SDCLOCK_PERIOD(PERIOD) (((PERIOD) == FMC_SDRAM_CLOCK_DISABLE) || \ - ((PERIOD) == FMC_SDRAM_CLOCK_PERIOD_2) || \ - ((PERIOD) == FMC_SDRAM_CLOCK_PERIOD_3)) /** * @} */ -/** @defgroup FMC_SDRAM_Read_Burst +/** @defgroup FMC_SDRAM_Read_Burst FMC SDRAM Read Burst * @{ */ #define FMC_SDRAM_RBURST_DISABLE ((uint32_t)0x00000000) #define FMC_SDRAM_RBURST_ENABLE ((uint32_t)0x00001000) - -#define IS_FMC_READ_BURST(RBURST) (((RBURST) == FMC_SDRAM_RBURST_DISABLE) || \ - ((RBURST) == FMC_SDRAM_RBURST_ENABLE)) /** * @} */ -/** @defgroup FMC_SDRAM_Read_Pipe_Delay +/** @defgroup FMC_SDRAM_Read_Pipe_Delay FMC SDRAM Read Pipe Delay * @{ */ #define FMC_SDRAM_RPIPE_DELAY_0 ((uint32_t)0x00000000) #define FMC_SDRAM_RPIPE_DELAY_1 ((uint32_t)0x00002000) #define FMC_SDRAM_RPIPE_DELAY_2 ((uint32_t)0x00004000) - -#define IS_FMC_READPIPE_DELAY(DELAY) (((DELAY) == FMC_SDRAM_RPIPE_DELAY_0) || \ - ((DELAY) == FMC_SDRAM_RPIPE_DELAY_1) || \ - ((DELAY) == FMC_SDRAM_RPIPE_DELAY_2)) /** * @} */ - -/** @defgroup FMC_SDRAM_LoadToActive_Delay + +/** @defgroup FMC_SDRAM_Command_Mode FMC SDRAM Command Mode * @{ */ -#define IS_FMC_LOADTOACTIVE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) +#define FMC_SDRAM_CMD_NORMAL_MODE ((uint32_t)0x00000000) +#define FMC_SDRAM_CMD_CLK_ENABLE ((uint32_t)0x00000001) +#define FMC_SDRAM_CMD_PALL ((uint32_t)0x00000002) +#define FMC_SDRAM_CMD_AUTOREFRESH_MODE ((uint32_t)0x00000003) +#define FMC_SDRAM_CMD_LOAD_MODE ((uint32_t)0x00000004) +#define FMC_SDRAM_CMD_SELFREFRESH_MODE ((uint32_t)0x00000005) +#define FMC_SDRAM_CMD_POWERDOWN_MODE ((uint32_t)0x00000006) /** * @} */ - -/** @defgroup FMC_SDRAM_ExitSelfRefresh_Delay + +/** @defgroup FMC_SDRAM_Command_Target FMC SDRAM Command Target * @{ */ -#define IS_FMC_EXITSELFREFRESH_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) +#define FMC_SDRAM_CMD_TARGET_BANK2 FMC_SDCMR_CTB2 +#define FMC_SDRAM_CMD_TARGET_BANK1 FMC_SDCMR_CTB1 +#define FMC_SDRAM_CMD_TARGET_BANK1_2 ((uint32_t)0x00000018) /** * @} */ - -/** @defgroup FMC_SDRAM_SelfRefresh_Time + +/** @defgroup FMC_SDRAM_Mode_Status FMC SDRAM Mode Status * @{ - */ -#define IS_FMC_SELFREFRESH_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16)) + */ +#define FMC_SDRAM_NORMAL_MODE ((uint32_t)0x00000000) +#define FMC_SDRAM_SELF_REFRESH_MODE FMC_SDSR_MODES1_0 +#define FMC_SDRAM_POWER_DOWN_MODE FMC_SDSR_MODES1_1 /** * @} - */ - -/** @defgroup FMC_SDRAM_RowCycle_Delay - * @{ - */ -#define IS_FMC_ROWCYCLE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + */ + /** * @} - */ - -/** @defgroup FMC_SDRAM_Write_Recovery_Time + */ + +/** @defgroup FMC_LL_Interrupt_definition FMC Interrupt definition * @{ */ -#define IS_FMC_WRITE_RECOVERY_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16)) +#define FMC_IT_RISING_EDGE ((uint32_t)0x00000008) +#define FMC_IT_LEVEL ((uint32_t)0x00000010) +#define FMC_IT_FALLING_EDGE ((uint32_t)0x00000020) +#define FMC_IT_REFRESH_ERROR ((uint32_t)0x00004000) /** * @} - */ - -/** @defgroup FMC_SDRAM_RP_Delay + */ + +/** @defgroup FMC_LL_Flag_definition FMC Flag definition * @{ - */ -#define IS_FMC_RP_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + */ +#define FMC_FLAG_RISING_EDGE ((uint32_t)0x00000001) +#define FMC_FLAG_LEVEL ((uint32_t)0x00000002) +#define FMC_FLAG_FALLING_EDGE ((uint32_t)0x00000004) +#define FMC_FLAG_FEMPT ((uint32_t)0x00000040) +#define FMC_SDRAM_FLAG_REFRESH_IT FMC_SDSR_RE +#define FMC_SDRAM_FLAG_BUSY FMC_SDSR_BUSY +#define FMC_SDRAM_FLAG_REFRESH_ERROR FMC_SDRTR_CRE /** * @} - */ - -/** @defgroup FMC_SDRAM_RCD_Delay + */ + +/** @defgroup FMC_LL_Alias_definition FMC Alias definition * @{ - */ -#define IS_FMC_RCD_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + */ +#if defined(STM32F446xx) + #define FMC_NAND_TypeDef FMC_Bank3_TypeDef +#else + #define FMC_NAND_TypeDef FMC_Bank2_3_TypeDef + #define FMC_PCCARD_TypeDef FMC_Bank4_TypeDef +#endif /* defined(STM32F446xx) */ + #define FMC_NORSRAM_TypeDef FMC_Bank1_TypeDef + #define FMC_NORSRAM_EXTENDED_TypeDef FMC_Bank1E_TypeDef + #define FMC_SDRAM_TypeDef FMC_Bank5_6_TypeDef + +#if defined(STM32F446xx) + #define FMC_NAND_DEVICE FMC_Bank3 +#else + #define FMC_NAND_DEVICE FMC_Bank2_3 + #define FMC_PCCARD_DEVICE FMC_Bank4 +#endif /* defined(STM32F446xx) */ + #define FMC_NORSRAM_DEVICE FMC_Bank1 + #define FMC_NORSRAM_EXTENDED_DEVICE FMC_Bank1E + #define FMC_SDRAM_DEVICE FMC_Bank5_6 /** * @} - */ - -/** @defgroup FMC_SDRAM_Command_Mode - * @{ */ -#define FMC_SDRAM_CMD_NORMAL_MODE ((uint32_t)0x00000000) -#define FMC_SDRAM_CMD_CLK_ENABLE ((uint32_t)0x00000001) -#define FMC_SDRAM_CMD_PALL ((uint32_t)0x00000002) -#define FMC_SDRAM_CMD_AUTOREFRESH_MODE ((uint32_t)0x00000003) -#define FMC_SDRAM_CMD_LOAD_MODE ((uint32_t)0x00000004) -#define FMC_SDRAM_CMD_SELFREFRESH_MODE ((uint32_t)0x00000005) -#define FMC_SDRAM_CMD_POWERDOWN_MODE ((uint32_t)0x00000006) -#define IS_FMC_COMMAND_MODE(COMMAND) (((COMMAND) == FMC_SDRAM_CMD_NORMAL_MODE) || \ - ((COMMAND) == FMC_SDRAM_CMD_CLK_ENABLE) || \ - ((COMMAND) == FMC_SDRAM_CMD_PALL) || \ - ((COMMAND) == FMC_SDRAM_CMD_AUTOREFRESH_MODE) || \ - ((COMMAND) == FMC_SDRAM_CMD_LOAD_MODE) || \ - ((COMMAND) == FMC_SDRAM_CMD_SELFREFRESH_MODE) || \ - ((COMMAND) == FMC_SDRAM_CMD_POWERDOWN_MODE)) /** * @} */ -/** @defgroup FMC_SDRAM_Command_Target +/* Private macro -------------------------------------------------------------*/ +/** @defgroup FMC_LL_Private_Macros FMC Private Macros * @{ */ -#define FMC_SDRAM_CMD_TARGET_BANK2 FMC_SDCMR_CTB2 -#define FMC_SDRAM_CMD_TARGET_BANK1 FMC_SDCMR_CTB1 -#define FMC_SDRAM_CMD_TARGET_BANK1_2 ((uint32_t)0x00000018) - -#define IS_FMC_COMMAND_TARGET(TARGET) (((TARGET) == FMC_SDRAM_CMD_TARGET_BANK1) || \ - ((TARGET) == FMC_SDRAM_CMD_TARGET_BANK2) || \ - ((TARGET) == FMC_SDRAM_CMD_TARGET_BANK1_2)) -/** - * @} - */ - -/** @defgroup FMC_SDRAM_AutoRefresh_Number - * @{ - */ -#define IS_FMC_AUTOREFRESH_NUMBER(NUMBER) (((NUMBER) > 0) && ((NUMBER) <= 16)) -/** - * @} - */ - -/** @defgroup FMC_SDRAM_ModeRegister_Definition - * @{ - */ -#define IS_FMC_MODE_REGISTER(CONTENT) ((CONTENT) <= 8191) -/** - * @} - */ - -/** @defgroup FMC_SDRAM_Refresh_rate - * @{ - */ -#define IS_FMC_REFRESH_RATE(RATE) ((RATE) <= 8191) -/** - * @} - */ - -/** @defgroup FMC_SDRAM_Mode_Status - * @{ - */ -#define FMC_SDRAM_NORMAL_MODE ((uint32_t)0x00000000) -#define FMC_SDRAM_SELF_REFRESH_MODE FMC_SDSR_MODES1_0 -#define FMC_SDRAM_POWER_DOWN_MODE FMC_SDSR_MODES1_1 -/** - * @} - */ - -/** @defgroup FMC_NORSRAM_Device_Instance - * @{ - */ -#define IS_FMC_NORSRAM_DEVICE(INSTANCE) ((INSTANCE) == FMC_NORSRAM_DEVICE) -/** - * @} - */ - -/** @defgroup FMC_NORSRAM_EXTENDED_Device_Instance - * @{ - */ -#define IS_FMC_NORSRAM_EXTENDED_DEVICE(INSTANCE) ((INSTANCE) == FMC_NORSRAM_EXTENDED_DEVICE) -/** - * @} - */ - -/** @defgroup FMC_NAND_Device_Instance - * @{ - */ -#define IS_FMC_NAND_DEVICE(INSTANCE) ((INSTANCE) == FMC_NAND_DEVICE) -/** - * @} - */ - -/** @defgroup FMC_PCCARD_Device_Instance - * @{ - */ -#define IS_FMC_PCCARD_DEVICE(INSTANCE) ((INSTANCE) == FMC_PCCARD_DEVICE) -/** - * @} - */ -/** @defgroup FMC_SDRAM_Device_Instance - * @{ - */ -#define IS_FMC_SDRAM_DEVICE(INSTANCE) ((INSTANCE) == FMC_SDRAM_DEVICE) -/** - * @} - */ - -/** - * @} - */ - -/** @defgroup FMC_Interrupt_definition - * @brief FMC Interrupt definition - * @{ - */ -#define FMC_IT_RISING_EDGE ((uint32_t)0x00000008) -#define FMC_IT_LEVEL ((uint32_t)0x00000010) -#define FMC_IT_FALLING_EDGE ((uint32_t)0x00000020) -#define FMC_IT_REFRESH_ERROR ((uint32_t)0x00004000) - -#define IS_FMC_IT(IT) ((((IT) & (uint32_t)0xFFFFBFC7) == 0x00000000) && ((IT) != 0x00000000)) - -#define IS_FMC_GET_IT(IT) (((IT) == FMC_IT_RISING_EDGE) || \ - ((IT) == FMC_IT_LEVEL) || \ - ((IT) == FMC_IT_FALLING_EDGE) || \ - ((IT) == FMC_IT_REFRESH_ERROR)) -/** - * @} - */ - -/** @defgroup FMC_Flag_definition - * @brief FMC Flag definition - * @{ - */ -#define FMC_FLAG_RISING_EDGE ((uint32_t)0x00000001) -#define FMC_FLAG_LEVEL ((uint32_t)0x00000002) -#define FMC_FLAG_FALLING_EDGE ((uint32_t)0x00000004) -#define FMC_FLAG_FEMPT ((uint32_t)0x00000040) -#define FMC_SDRAM_FLAG_REFRESH_IT FMC_SDSR_RE -#define FMC_SDRAM_FLAG_BUSY FMC_SDSR_BUSY -#define FMC_SDRAM_FLAG_REFRESH_ERROR FMC_SDRTR_CRE - -#define IS_FMC_GET_FLAG(FLAG) (((FLAG) == FMC_FLAG_RISING_EDGE) || \ - ((FLAG) == FMC_FLAG_LEVEL) || \ - ((FLAG) == FMC_FLAG_FALLING_EDGE) || \ - ((FLAG) == FMC_FLAG_FEMPT) || \ - ((FLAG) == FMC_SDRAM_FLAG_REFRESH_IT) || \ - ((FLAG) == FMC_SDRAM_FLAG_BUSY)) - -#define IS_FMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000)) -/** - * @} - */ - -/* Exported macro ------------------------------------------------------------*/ - -/** @defgroup FMC_NOR_Macros +/** @defgroup FMC_LL_NOR_Macros FMC NOR/SRAM Macros * @brief macros to handle NOR device enable/disable and read/write operations * @{ */ - /** * @brief Enable the NORSRAM device access. * @param __INSTANCE__: FMC_NORSRAM Instance @@ -1105,16 +812,31 @@ typedef struct * @retval None */ #define __FMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)] &= ~FMC_BCR1_MBKEN) - /** * @} */ -/** @defgroup FMC_NAND_Macros +/** @defgroup FMC_LL_NAND_Macros FMC NAND Macros * @brief macros to handle NAND device enable/disable * @{ */ - +#if defined(STM32F446xx) +/** + * @brief Enable the NAND device access. + * @param __INSTANCE__: FMC_NAND Instance + * @param __BANK__: FMC_NAND Bank + * @retval None + */ +#define __FMC_NAND_ENABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->PCR |= FMC_PCR_PBKEN) + +/** + * @brief Disable the NAND device access. + * @param __INSTANCE__: FMC_NAND Instance + * @param __BANK__: FMC_NAND Bank + * @retval None + */ +#define __FMC_NAND_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->PCR &= ~FMC_PCR_PBKEN) +#else /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ /** * @brief Enable the NAND device access. * @param __INSTANCE__: FMC_NAND Instance @@ -1132,15 +854,16 @@ typedef struct */ #define __FMC_NAND_DISABLE(__INSTANCE__, __BANK__) (((__BANK__) == FMC_NAND_BANK2)? ((__INSTANCE__)->PCR2 &= ~FMC_PCR2_PBKEN): \ ((__INSTANCE__)->PCR3 &= ~FMC_PCR3_PBKEN)) + +#endif /* defined(STM32F446xx)*/ /** * @} */ - -/** @defgroup FMC_PCCARD_Macros +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @defgroup FMC_LL_PCCARD_Macros FMC PCCARD Macros * @brief macros to handle SRAM read/write operations * @{ */ - /** * @brief Enable the PCCARD device access. * @param __INSTANCE__: FMC_PCCARD Instance @@ -1157,12 +880,66 @@ typedef struct /** * @} */ - -/** @defgroup FMC_Interrupt - * @brief macros to handle FMC interrupts +#endif /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ + +/** @defgroup FMC_LL_Flag_Interrupt_Macros FMC Flag&Interrupt Macros + * @brief macros to handle FMC flags and interrupts * @{ */ +#if defined(STM32F446xx) +/** + * @brief Enable the NAND device interrupt. + * @param __INSTANCE__: FMC_NAND instance + * @param __BANK__: FMC_NAND Bank + * @param __INTERRUPT__: FMC_NAND interrupt + * This parameter can be any combination of the following values: + * @arg FMC_IT_RISING_EDGE: Interrupt rising edge. + * @arg FMC_IT_LEVEL: Interrupt level. + * @arg FMC_IT_FALLING_EDGE: Interrupt falling edge. + * @retval None + */ +#define __FMC_NAND_ENABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) ((__INSTANCE__)->SR |= (__INTERRUPT__)) +/** + * @brief Disable the NAND device interrupt. + * @param __INSTANCE__: FMC_NAND Instance + * @param __BANK__: FMC_NAND Bank + * @param __INTERRUPT__: FMC_NAND interrupt + * This parameter can be any combination of the following values: + * @arg FMC_IT_RISING_EDGE: Interrupt rising edge. + * @arg FMC_IT_LEVEL: Interrupt level. + * @arg FMC_IT_FALLING_EDGE: Interrupt falling edge. + * @retval None + */ +#define __FMC_NAND_DISABLE_IT(__INSTANCE__, __BANK__, __INTERRUPT__) ((__INSTANCE__)->SR &= ~(__INTERRUPT__)) + +/** + * @brief Get flag status of the NAND device. + * @param __INSTANCE__: FMC_NAND Instance + * @param __BANK__: FMC_NAND Bank + * @param __FLAG__: FMC_NAND flag + * This parameter can be any combination of the following values: + * @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag. + * @arg FMC_FLAG_LEVEL: Interrupt level edge flag. + * @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag. + * @arg FMC_FLAG_FEMPT: FIFO empty flag. + * @retval The state of FLAG (SET or RESET). + */ +#define __FMC_NAND_GET_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__INSTANCE__)->SR &(__FLAG__)) == (__FLAG__)) +/** + * @brief Clear flag status of the NAND device. + * @param __INSTANCE__: FMC_NAND Instance + * @param __BANK__: FMC_NAND Bank + * @param __FLAG__: FMC_NAND flag + * This parameter can be any combination of the following values: + * @arg FMC_FLAG_RISING_EDGE: Interrupt rising edge flag. + * @arg FMC_FLAG_LEVEL: Interrupt level edge flag. + * @arg FMC_FLAG_FALLING_EDGE: Interrupt falling edge flag. + * @arg FMC_FLAG_FEMPT: FIFO empty flag. + * @retval None + */ +#define __FMC_NAND_CLEAR_FLAG(__INSTANCE__, __BANK__, __FLAG__) ((__INSTANCE__)->SR &= ~(__FLAG__)) +#else /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ /** * @brief Enable the NAND device interrupt. * @param __INSTANCE__: FMC_NAND instance @@ -1179,7 +956,7 @@ typedef struct /** * @brief Disable the NAND device interrupt. - * @param __INSTANCE__: FMC_NAND handle + * @param __INSTANCE__: FMC_NAND Instance * @param __BANK__: FMC_NAND Bank * @param __INTERRUPT__: FMC_NAND interrupt * This parameter can be any combination of the following values: @@ -1193,7 +970,7 @@ typedef struct /** * @brief Get flag status of the NAND device. - * @param __INSTANCE__: FMC_NAND handle + * @param __INSTANCE__: FMC_NAND Instance * @param __BANK__: FMC_NAND Bank * @param __FLAG__: FMC_NAND flag * This parameter can be any combination of the following values: @@ -1207,7 +984,7 @@ typedef struct (((__INSTANCE__)->SR3 &(__FLAG__)) == (__FLAG__))) /** * @brief Clear flag status of the NAND device. - * @param __INSTANCE__: FMC_NAND handle + * @param __INSTANCE__: FMC_NAND Instance * @param __BANK__: FMC_NAND Bank * @param __FLAG__: FMC_NAND flag * This parameter can be any combination of the following values: @@ -1218,7 +995,10 @@ typedef struct * @retval None */ #define __FMC_NAND_CLEAR_FLAG(__INSTANCE__, __BANK__, __FLAG__) (((__BANK__) == FMC_NAND_BANK2)? ((__INSTANCE__)->SR2 &= ~(__FLAG__)): \ - ((__INSTANCE__)->SR3 &= ~(__FLAG__))) + ((__INSTANCE__)->SR3 &= ~(__FLAG__))) +#endif /* defined(STM32F446xx) */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) /** * @brief Enable the PCCARD device interrupt. * @param __INSTANCE__: FMC_PCCARD instance @@ -1268,7 +1048,8 @@ typedef struct * @retval None */ #define __FMC_PCCARD_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SR4 &= ~(__FLAG__)) - +#endif /* defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) */ + /** * @brief Enable the SDRAM device interrupt. * @param __INSTANCE__: FMC_SDRAM instance @@ -1310,66 +1091,327 @@ typedef struct * @retval None */ #define __FMC_SDRAM_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SDRTR |= (__FLAG__)) +/** + * @} + */ + +/** @defgroup FSMC_LL_Assert_Macros FSMC Assert Macros + * @{ + */ +#define IS_FMC_NORSRAM_BANK(BANK) (((BANK) == FMC_NORSRAM_BANK1) || \ + ((BANK) == FMC_NORSRAM_BANK2) || \ + ((BANK) == FMC_NORSRAM_BANK3) || \ + ((BANK) == FMC_NORSRAM_BANK4)) + +#define IS_FMC_MUX(__MUX__) (((__MUX__) == FMC_DATA_ADDRESS_MUX_DISABLE) || \ + ((__MUX__) == FMC_DATA_ADDRESS_MUX_ENABLE)) + +#define IS_FMC_MEMORY(__MEMORY__) (((__MEMORY__) == FMC_MEMORY_TYPE_SRAM) || \ + ((__MEMORY__) == FMC_MEMORY_TYPE_PSRAM)|| \ + ((__MEMORY__) == FMC_MEMORY_TYPE_NOR)) + +#define IS_FMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_8) || \ + ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_16) || \ + ((__WIDTH__) == FMC_NORSRAM_MEM_BUS_WIDTH_32)) + +#define IS_FMC_ACCESS_MODE(__MODE__) (((__MODE__) == FMC_ACCESS_MODE_A) || \ + ((__MODE__) == FMC_ACCESS_MODE_B) || \ + ((__MODE__) == FMC_ACCESS_MODE_C) || \ + ((__MODE__) == FMC_ACCESS_MODE_D)) + +#define IS_FMC_NAND_BANK(BANK) (((BANK) == FMC_NAND_BANK2) || \ + ((BANK) == FMC_NAND_BANK3)) + +#define IS_FMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \ + ((FEATURE) == FMC_NAND_PCC_WAIT_FEATURE_ENABLE)) + +#define IS_FMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NAND_PCC_MEM_BUS_WIDTH_8) || \ + ((WIDTH) == FMC_NAND_PCC_MEM_BUS_WIDTH_16)) + +#define IS_FMC_ECC_STATE(STATE) (((STATE) == FMC_NAND_ECC_DISABLE) || \ + ((STATE) == FMC_NAND_ECC_ENABLE)) + +#define IS_FMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FMC_NAND_ECC_PAGE_SIZE_256BYTE) || \ + ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_512BYTE) || \ + ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \ + ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \ + ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \ + ((SIZE) == FMC_NAND_ECC_PAGE_SIZE_8192BYTE)) + +#define IS_FMC_TCLR_TIME(TIME) ((TIME) <= 255) + +#define IS_FMC_TAR_TIME(TIME) ((TIME) <= 255) + +#define IS_FMC_SETUP_TIME(TIME) ((TIME) <= 255) + +#define IS_FMC_WAIT_TIME(TIME) ((TIME) <= 255) + +#define IS_FMC_HOLD_TIME(TIME) ((TIME) <= 255) + +#define IS_FMC_HIZ_TIME(TIME) ((TIME) <= 255) + +#define IS_FMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_DEVICE) + +#define IS_FMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_EXTENDED_DEVICE) + +#define IS_FMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NAND_DEVICE) + +#define IS_FMC_PCCARD_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_PCCARD_DEVICE) + +#define IS_FMC_BURSTMODE(__STATE__) (((__STATE__) == FMC_BURST_ACCESS_MODE_DISABLE) || \ + ((__STATE__) == FMC_BURST_ACCESS_MODE_ENABLE)) + +#define IS_FMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_LOW) || \ + ((__POLARITY__) == FMC_WAIT_SIGNAL_POLARITY_HIGH)) + +#if !defined (STM32F446xx) +#define IS_FMC_WRAP_MODE(__MODE__) (((__MODE__) == FMC_WRAP_MODE_DISABLE) || \ + ((__MODE__) == FMC_WRAP_MODE_ENABLE)) +#endif /* !defined (STM32F446xx) */ + +#define IS_FMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FMC_WAIT_TIMING_BEFORE_WS) || \ + ((__ACTIVE__) == FMC_WAIT_TIMING_DURING_WS)) + +#define IS_FMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FMC_WRITE_OPERATION_DISABLE) || \ + ((__OPERATION__) == FMC_WRITE_OPERATION_ENABLE)) + +#define IS_FMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FMC_WAIT_SIGNAL_DISABLE) || \ + ((__SIGNAL__) == FMC_WAIT_SIGNAL_ENABLE)) + +#define IS_FMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FMC_EXTENDED_MODE_DISABLE) || \ + ((__MODE__) == FMC_EXTENDED_MODE_ENABLE)) + +#define IS_FMC_ASYNWAIT(__STATE__) (((__STATE__) == FMC_ASYNCHRONOUS_WAIT_DISABLE) || \ + ((__STATE__) == FMC_ASYNCHRONOUS_WAIT_ENABLE)) + +#define IS_FMC_WRITE_BURST(__BURST__) (((__BURST__) == FMC_WRITE_BURST_DISABLE) || \ + ((__BURST__) == FMC_WRITE_BURST_ENABLE)) + +#define IS_FMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \ + ((CCLOCK) == FMC_CONTINUOUS_CLOCK_SYNC_ASYNC)) + +#define IS_FMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15) + +#define IS_FMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 15)) + +#define IS_FMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 255)) + +#define IS_FMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15) + +#define IS_FMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1) && ((__LATENCY__) <= 17)) + +#define IS_FMC_CLK_DIV(DIV) (((DIV) > 1) && ((DIV) <= 16)) + +#define IS_FMC_SDRAM_BANK(BANK) (((BANK) == FMC_SDRAM_BANK1) || \ + ((BANK) == FMC_SDRAM_BANK2)) + +#define IS_FMC_COLUMNBITS_NUMBER(COLUMN) (((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_8) || \ + ((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_9) || \ + ((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_10) || \ + ((COLUMN) == FMC_SDRAM_COLUMN_BITS_NUM_11)) + +#define IS_FMC_ROWBITS_NUMBER(ROW) (((ROW) == FMC_SDRAM_ROW_BITS_NUM_11) || \ + ((ROW) == FMC_SDRAM_ROW_BITS_NUM_12) || \ + ((ROW) == FMC_SDRAM_ROW_BITS_NUM_13)) + +#define IS_FMC_SDMEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_SDRAM_MEM_BUS_WIDTH_8) || \ + ((WIDTH) == FMC_SDRAM_MEM_BUS_WIDTH_16) || \ + ((WIDTH) == FMC_SDRAM_MEM_BUS_WIDTH_32)) + +#define IS_FMC_INTERNALBANK_NUMBER(NUMBER) (((NUMBER) == FMC_SDRAM_INTERN_BANKS_NUM_2) || \ + ((NUMBER) == FMC_SDRAM_INTERN_BANKS_NUM_4)) + + +#define IS_FMC_CAS_LATENCY(LATENCY) (((LATENCY) == FMC_SDRAM_CAS_LATENCY_1) || \ + ((LATENCY) == FMC_SDRAM_CAS_LATENCY_2) || \ + ((LATENCY) == FMC_SDRAM_CAS_LATENCY_3)) + +#define IS_FMC_SDCLOCK_PERIOD(PERIOD) (((PERIOD) == FMC_SDRAM_CLOCK_DISABLE) || \ + ((PERIOD) == FMC_SDRAM_CLOCK_PERIOD_2) || \ + ((PERIOD) == FMC_SDRAM_CLOCK_PERIOD_3)) + +#define IS_FMC_READ_BURST(RBURST) (((RBURST) == FMC_SDRAM_RBURST_DISABLE) || \ + ((RBURST) == FMC_SDRAM_RBURST_ENABLE)) + + +#define IS_FMC_READPIPE_DELAY(DELAY) (((DELAY) == FMC_SDRAM_RPIPE_DELAY_0) || \ + ((DELAY) == FMC_SDRAM_RPIPE_DELAY_1) || \ + ((DELAY) == FMC_SDRAM_RPIPE_DELAY_2)) + +#define IS_FMC_LOADTOACTIVE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + +#define IS_FMC_EXITSELFREFRESH_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + +#define IS_FMC_SELFREFRESH_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16)) + +#define IS_FMC_ROWCYCLE_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + +#define IS_FMC_WRITE_RECOVERY_TIME(TIME) (((TIME) > 0) && ((TIME) <= 16)) + +#define IS_FMC_RP_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + +#define IS_FMC_RCD_DELAY(DELAY) (((DELAY) > 0) && ((DELAY) <= 16)) + +#define IS_FMC_COMMAND_MODE(COMMAND) (((COMMAND) == FMC_SDRAM_CMD_NORMAL_MODE) || \ + ((COMMAND) == FMC_SDRAM_CMD_CLK_ENABLE) || \ + ((COMMAND) == FMC_SDRAM_CMD_PALL) || \ + ((COMMAND) == FMC_SDRAM_CMD_AUTOREFRESH_MODE) || \ + ((COMMAND) == FMC_SDRAM_CMD_LOAD_MODE) || \ + ((COMMAND) == FMC_SDRAM_CMD_SELFREFRESH_MODE) || \ + ((COMMAND) == FMC_SDRAM_CMD_POWERDOWN_MODE)) + +#define IS_FMC_COMMAND_TARGET(TARGET) (((TARGET) == FMC_SDRAM_CMD_TARGET_BANK1) || \ + ((TARGET) == FMC_SDRAM_CMD_TARGET_BANK2) || \ + ((TARGET) == FMC_SDRAM_CMD_TARGET_BANK1_2)) + +#define IS_FMC_AUTOREFRESH_NUMBER(NUMBER) (((NUMBER) > 0) && ((NUMBER) <= 16)) + +#define IS_FMC_MODE_REGISTER(CONTENT) ((CONTENT) <= 8191) + +#define IS_FMC_REFRESH_RATE(RATE) ((RATE) <= 8191) + +#define IS_FMC_SDRAM_DEVICE(INSTANCE) ((INSTANCE) == FMC_SDRAM_DEVICE) + +#define IS_FMC_WRITE_PROTECTION(WRITE) (((WRITE) == FMC_SDRAM_WRITE_PROTECTION_DISABLE) || \ + ((WRITE) == FMC_SDRAM_WRITE_PROTECTION_ENABLE)) + +#if defined (STM32F446xx) +#define IS_FMC_PAGESIZE(SIZE) (((SIZE) == FMC_PAGE_SIZE_NONE) || \ + ((SIZE) == FMC_PAGE_SIZE_128) || \ + ((SIZE) == FMC_PAGE_SIZE_256) || \ + ((SIZE) == FMC_PAGE_SIZE_1024)) + +#define IS_FMC_WRITE_FIFO(FIFO) (((FIFO) == FMC_WRITE_FIFO_DISABLE) || \ + ((FIFO) == FMC_WRITE_FIFO_ENABLE)) +#endif /* defined (STM32F446xx) */ + +/** + * @} + */ + /** * @} */ -/* Exported functions --------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +/** @defgroup FMC_LL_Private_Functions FMC LL Private Functions + * @{ + */ -/* FMC_NORSRAM Controller functions *******************************************/ -/* Initialization/de-initialization functions */ +/** @defgroup FMC_LL_NORSRAM NOR SRAM + * @{ + */ +/** @defgroup FMC_LL_NORSRAM_Private_Functions_Group1 NOR SRAM Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FMC_NORSRAM_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_InitTypeDef *Init); HAL_StatusTypeDef FMC_NORSRAM_Timing_Init(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FMC_NORSRAM_Extended_Timing_Init(FMC_NORSRAM_EXTENDED_TypeDef *Device, FMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode); HAL_StatusTypeDef FMC_NORSRAM_DeInit(FMC_NORSRAM_TypeDef *Device, FMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank); +/** + * @} + */ -/* FMC_NORSRAM Control functions */ +/** @defgroup FMC_LL_NORSRAM_Private_Functions_Group2 NOR SRAM Control functions + * @{ + */ HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Enable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Device, uint32_t Bank); +/** + * @} + */ +/** + * @} + */ -/* FMC_NAND Controller functions **********************************************/ -/* Initialization/de-initialization functions */ +/** @defgroup FMC_LL_NAND NAND + * @{ + */ +/** @defgroup FMC_LL_NAND_Private_Functions_Group1 NAND Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FMC_NAND_Init(FMC_NAND_TypeDef *Device, FMC_NAND_InitTypeDef *Init); HAL_StatusTypeDef FMC_NAND_CommonSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FMC_NAND_AttributeSpace_Timing_Init(FMC_NAND_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FMC_NAND_DeInit(FMC_NAND_TypeDef *Device, uint32_t Bank); +/** + * @} + */ -/* FMC_NAND Control functions */ +/** @defgroup FMC_LL_NAND_Private_Functions_Group2 NAND Control functions + * @{ + */ HAL_StatusTypeDef FMC_NAND_ECC_Enable(FMC_NAND_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FMC_NAND_ECC_Disable(FMC_NAND_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout); -/* FMC_PCCARD Controller functions ********************************************/ -/* Initialization/de-initialization functions */ +/** + * @} + */ +/** + * @} + */ +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) +/** @defgroup FMC_LL_PCCARD PCCARD + * @{ + */ +/** @defgroup FMC_LL_PCCARD_Private_Functions_Group1 PCCARD Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FMC_PCCARD_Init(FMC_PCCARD_TypeDef *Device, FMC_PCCARD_InitTypeDef *Init); HAL_StatusTypeDef FMC_PCCARD_CommonSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing); HAL_StatusTypeDef FMC_PCCARD_AttributeSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing); HAL_StatusTypeDef FMC_PCCARD_IOSpace_Timing_Init(FMC_PCCARD_TypeDef *Device, FMC_NAND_PCC_TimingTypeDef *Timing); HAL_StatusTypeDef FMC_PCCARD_DeInit(FMC_PCCARD_TypeDef *Device); +/** + * @} + */ +/** + * @} + */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -/* FMC_SDRAM Controller functions *********************************************/ -/* Initialization/de-initialization functions */ +/** @defgroup FMC_LL_SDRAM SDRAM + * @{ + */ +/** @defgroup FMC_LL_SDRAM_Private_Functions_Group1 SDRAM Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDef *Init); HAL_StatusTypeDef FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FMC_SDRAM_DeInit(FMC_SDRAM_TypeDef *Device, uint32_t Bank); +/** + * @} + */ -/* FMC_SDRAM Control functions */ +/** @defgroup FMC_LL_SDRAM_Private_Functions_Group2 SDRAM Control functions + * @{ + */ HAL_StatusTypeDef FMC_SDRAM_WriteProtection_Enable(FMC_SDRAM_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FMC_SDRAM_WriteProtection_Disable(FMC_SDRAM_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout); HAL_StatusTypeDef FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, uint32_t RefreshRate); HAL_StatusTypeDef FMC_SDRAM_SetAutoRefreshNumber(FMC_SDRAM_TypeDef *Device, uint32_t AutoRefreshNumber); uint32_t FMC_SDRAM_GetModeStatus(FMC_SDRAM_TypeDef *Device, uint32_t Bank); +/** + * @} + */ +/** + * @} + */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ /** * @} - */ + */ + +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx */ +/** + * @} + */ /** * @} */ - #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.c index 4eb31dca0c0..089870c9593 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_ll_fsmc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief FSMC Low Layer HAL module driver. * * This file provides firmware functions to manage the following @@ -44,7 +44,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -78,27 +78,24 @@ * @{ */ -/** @defgroup FSMC +/** @defgroup FSMC_LL FSMC Low Layer * @brief FSMC driver modules * @{ */ #if defined (HAL_SRAM_MODULE_ENABLED) || defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED) || defined(HAL_PCCARD_MODULE_ENABLED) - #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) - /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ - -/** @defgroup FSMC_Private_Functions +/** @addtogroup FSMC_LL_Private_Functions * @{ */ -/** @defgroup FSMC_NORSRAM Controller functions +/** @addtogroup FSMC_LL_NORSRAM * @brief NORSRAM Controller functions * @verbatim @@ -122,7 +119,7 @@ * @{ */ -/** @defgroup HAL_FSMC_NORSRAM_Group1 Initialization/de-initialization functions +/** @addtogroup FSMC_LL_NORSRAM_Private_Functions_Group1 * @brief Initialization and Configuration functions * @verbatim @@ -165,20 +162,30 @@ HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_ assert_param(IS_FSMC_ASYNWAIT(Init->AsynchronousWait)); assert_param(IS_FSMC_WRITE_BURST(Init->WriteBurst)); + /* Get the BTCR register value */ + tmpr = Device->BTCR[Init->NSBank]; + + /* Clear MBKEN, MUXEN, MTYP, MWID, FACCEN, BURSTEN, WAITPOL, WRAPMOD, WAITCFG, WREN, + WAITEN, EXTMOD, ASYNCWAIT, CBURSTRW and CCLKEN bits */ + tmpr &= ((uint32_t)~(FSMC_BCR1_MBKEN | FSMC_BCR1_MUXEN | FSMC_BCR1_MTYP | \ + FSMC_BCR1_MWID | FSMC_BCR1_FACCEN | FSMC_BCR1_BURSTEN | \ + FSMC_BCR1_WAITPOL | FSMC_BCR1_WRAPMOD | FSMC_BCR1_WAITCFG | \ + FSMC_BCR1_WREN | FSMC_BCR1_WAITEN | FSMC_BCR1_EXTMOD | \ + FSMC_BCR1_ASYNCWAIT | FSMC_BCR1_CBURSTRW)); /* Set NORSRAM device control parameters */ - tmpr = (uint32_t)(Init->DataAddressMux |\ - Init->MemoryType |\ - Init->MemoryDataWidth |\ - Init->BurstAccessMode |\ - Init->WaitSignalPolarity |\ - Init->WrapMode |\ - Init->WaitSignalActive |\ - Init->WriteOperation |\ - Init->WaitSignal |\ - Init->ExtendedMode |\ - Init->AsynchronousWait |\ - Init->WriteBurst - ); + tmpr |= (uint32_t)(Init->DataAddressMux |\ + Init->MemoryType |\ + Init->MemoryDataWidth |\ + Init->BurstAccessMode |\ + Init->WaitSignalPolarity |\ + Init->WrapMode |\ + Init->WaitSignalActive |\ + Init->WriteOperation |\ + Init->WaitSignal |\ + Init->ExtendedMode |\ + Init->AsynchronousWait |\ + Init->WriteBurst + ); if(Init->MemoryType == FSMC_MEMORY_TYPE_NOR) { @@ -190,7 +197,6 @@ HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_ return HAL_OK; } - /** * @brief DeInitialize the FSMC_NORSRAM peripheral * @param Device: Pointer to NORSRAM device instance @@ -247,15 +253,22 @@ HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NO assert_param(IS_FSMC_DATA_LATENCY(Timing->DataLatency)); assert_param(IS_FSMC_ACCESS_MODE(Timing->AccessMode)); + /* Get the BTCR register value */ + tmpr = Device->BTCR[Bank + 1]; + + /* Clear ADDSET, ADDHLD, DATAST, BUSTURN, CLKDIV, DATLAT and ACCMOD bits */ + tmpr &= ((uint32_t)~(FSMC_BTR1_ADDSET | FSMC_BTR1_ADDHLD | FSMC_BTR1_DATAST | \ + FSMC_BTR1_BUSTURN | FSMC_BTR1_CLKDIV | FSMC_BTR1_DATLAT | \ + FSMC_BTR1_ACCMOD)); + /* Set FSMC_NORSRAM device timing parameters */ - tmpr = (uint32_t)(Timing->AddressSetupTime |\ - ((Timing->AddressHoldTime) << 4) |\ - ((Timing->DataSetupTime) << 8) |\ - ((Timing->BusTurnAroundDuration) << 16) |\ - (((Timing->CLKDivision)-1) << 20) |\ - (((Timing->DataLatency)-2) << 24) |\ - (Timing->AccessMode) - ); + tmpr |= (uint32_t)(Timing->AddressSetupTime |\ + ((Timing->AddressHoldTime) << 4) |\ + ((Timing->DataSetupTime) << 8) |\ + ((Timing->BusTurnAroundDuration) << 16) |\ + (((Timing->CLKDivision)-1) << 20) |\ + (((Timing->DataLatency)-2) << 24) |\ + (Timing->AccessMode)); Device->BTCR[Bank + 1] = tmpr; @@ -272,6 +285,8 @@ HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NO */ HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode) { + uint32_t tmpr = 0; + /* Set NORSRAM device timing register for write configuration, if extended mode is used */ if(ExtendedMode == FSMC_EXTENDED_MODE_ENABLE) { @@ -284,13 +299,23 @@ HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeD assert_param(IS_FSMC_DATA_LATENCY(Timing->DataLatency)); assert_param(IS_FSMC_ACCESS_MODE(Timing->AccessMode)); - Device->BWTR[Bank] = (uint32_t)(Timing->AddressSetupTime |\ - ((Timing->AddressHoldTime) << 4) |\ - ((Timing->DataSetupTime) << 8) |\ - ((Timing->BusTurnAroundDuration) << 16) |\ - (((Timing->CLKDivision)-1) << 20) |\ - (((Timing->DataLatency)-2) << 24) |\ - (Timing->AccessMode)); + /* Get the BWTR register value */ + tmpr = Device->BWTR[Bank]; + + /* Clear ADDSET, ADDHLD, DATAST, BUSTURN, CLKDIV, DATLAT and ACCMOD bits */ + tmpr &= ((uint32_t)~(FSMC_BWTR1_ADDSET | FSMC_BWTR1_ADDHLD | FSMC_BWTR1_DATAST | \ + FSMC_BWTR1_BUSTURN | FSMC_BWTR1_CLKDIV | FSMC_BWTR1_DATLAT | \ + FSMC_BWTR1_ACCMOD)); + + tmpr |= (uint32_t)(Timing->AddressSetupTime |\ + ((Timing->AddressHoldTime) << 4) |\ + ((Timing->DataSetupTime) << 8) |\ + ((Timing->BusTurnAroundDuration) << 16) |\ + (((Timing->CLKDivision)-1) << 20) |\ + (((Timing->DataLatency)-2) << 24) |\ + (Timing->AccessMode)); + + Device->BWTR[Bank] = tmpr; } else { @@ -299,16 +324,13 @@ HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeD return HAL_OK; } - - /** * @} */ - -/** @defgroup HAL_FSMC_NORSRAM_Group3 Control functions - * @brief management functions - * +/** @addtogroup FSMC_LL_NORSRAM_Private_Functions_Group2 + * @brief management functions + * @verbatim ============================================================================== ##### FSMC_NORSRAM Control functions ##### @@ -348,7 +370,6 @@ HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Devi return HAL_OK; } - /** * @} */ @@ -357,8 +378,8 @@ HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Devi * @} */ -/** @defgroup FSMC_PCCARD Controller functions - * @brief PCCARD Controller functions +/** @addtogroup FSMC_LL_NAND + * @brief NAND Controller functions * @verbatim ============================================================================== @@ -382,9 +403,9 @@ HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Devi * @{ */ -/** @defgroup HAL_FSMC_NAND_Group1 Initialization/de-initialization functions - * @brief Initialization and Configuration functions - * +/** @addtogroup FSMC_LL_NAND_Private_Functions_Group1 + * @brief Initialization and Configuration functions + * @verbatim ============================================================================== ##### Initialization and de_initialization functions ##### @@ -408,7 +429,7 @@ HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Devi */ HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDef *Init) { - uint32_t tmppcr = 0; + uint32_t tmpr = 0; /* Check the parameters */ assert_param(IS_FSMC_NAND_BANK(Init->NandBank)); @@ -419,29 +440,43 @@ HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDe assert_param(IS_FSMC_TCLR_TIME(Init->TCLRSetupTime)); assert_param(IS_FSMC_TAR_TIME(Init->TARSetupTime)); + if(Init->NandBank == FSMC_NAND_BANK2) + { + /* Get the NAND bank 2 register value */ + tmpr = Device->PCR2; + } + else + { + /* Get the NAND bank 3 register value */ + tmpr = Device->PCR3; + } + + /* Clear PWAITEN, PBKEN, PTYP, PWID, ECCEN, TCLR, TAR and ECCPS bits */ + tmpr &= ((uint32_t)~(FSMC_PCR2_PWAITEN | FSMC_PCR2_PBKEN | FSMC_PCR2_PTYP | \ + FSMC_PCR2_PWID | FSMC_PCR2_ECCEN | FSMC_PCR2_TCLR | \ + FSMC_PCR2_TAR | FSMC_PCR2_ECCPS)); + /* Set NAND device control parameters */ - tmppcr = (uint32_t)(Init->Waitfeature |\ - FSMC_PCR_MEMORY_TYPE_NAND |\ - Init->MemoryDataWidth |\ - Init->EccComputation |\ - Init->ECCPageSize |\ - ((Init->TCLRSetupTime) << 9) |\ - ((Init->TARSetupTime) << 13) - ); + tmpr |= (uint32_t)(Init->Waitfeature |\ + FSMC_PCR_MEMORY_TYPE_NAND |\ + Init->MemoryDataWidth |\ + Init->EccComputation |\ + Init->ECCPageSize |\ + ((Init->TCLRSetupTime) << 9) |\ + ((Init->TARSetupTime) << 13)); if(Init->NandBank == FSMC_NAND_BANK2) { /* NAND bank 2 registers configuration */ - Device->PCR2 = tmppcr; + Device->PCR2 = tmpr; } else { /* NAND bank 3 registers configuration */ - Device->PCR3 = tmppcr; + Device->PCR3 = tmpr; } return HAL_OK; - } /** @@ -454,7 +489,7 @@ HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDe */ HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank) { - uint32_t tmppmem = 0; + uint32_t tmpr = 0; /* Check the parameters */ assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime)); @@ -462,8 +497,23 @@ HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, F assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime)); + if(Bank == FSMC_NAND_BANK2) + { + /* Get the NAND bank 2 register value */ + tmpr = Device->PMEM2; + } + else + { + /* Get the NAND bank 3 register value */ + tmpr = Device->PMEM3; + } + + /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */ + tmpr &= ((uint32_t)~(FSMC_PMEM2_MEMSET2 | FSMC_PMEM2_MEMWAIT2 | FSMC_PMEM2_MEMHOLD2 | \ + FSMC_PMEM2_MEMHIZ2)); + /* Set FSMC_NAND device timing parameters */ - tmppmem = (uint32_t)(Timing->SetupTime |\ + tmpr |= (uint32_t)(Timing->SetupTime |\ ((Timing->WaitSetupTime) << 8) |\ ((Timing->HoldSetupTime) << 16) |\ ((Timing->HiZSetupTime) << 24) @@ -472,12 +522,12 @@ HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, F if(Bank == FSMC_NAND_BANK2) { /* NAND bank 2 registers configuration */ - Device->PMEM2 = tmppmem; + Device->PMEM2 = tmpr; } else { /* NAND bank 3 registers configuration */ - Device->PMEM3 = tmppmem; + Device->PMEM3 = tmpr; } return HAL_OK; @@ -493,7 +543,7 @@ HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, F */ HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank) { - uint32_t tmppatt = 0; + uint32_t tmpr = 0; /* Check the parameters */ assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime)); @@ -501,8 +551,23 @@ HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime)); + if(Bank == FSMC_NAND_BANK2) + { + /* Get the NAND bank 2 register value */ + tmpr = Device->PATT2; + } + else + { + /* Get the NAND bank 3 register value */ + tmpr = Device->PATT3; + } + + /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */ + tmpr &= ((uint32_t)~(FSMC_PATT2_ATTSET2 | FSMC_PATT2_ATTWAIT2 | FSMC_PATT2_ATTHOLD2 | \ + FSMC_PATT2_ATTHIZ2)); + /* Set FSMC_NAND device timing parameters */ - tmppatt = (uint32_t)(Timing->SetupTime |\ + tmpr |= (uint32_t)(Timing->SetupTime |\ ((Timing->WaitSetupTime) << 8) |\ ((Timing->HoldSetupTime) << 16) |\ ((Timing->HiZSetupTime) << 24) @@ -511,18 +576,17 @@ HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device if(Bank == FSMC_NAND_BANK2) { /* NAND bank 2 registers configuration */ - Device->PATT2 = tmppatt; + Device->PATT2 = tmpr; } else { /* NAND bank 3 registers configuration */ - Device->PATT3 = tmppatt; + Device->PATT3 = tmpr; } return HAL_OK; } - /** * @brief DeInitializes the FSMC_NAND device * @param Device: Pointer to NAND device instance @@ -555,15 +619,13 @@ HAL_StatusTypeDef FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank) return HAL_OK; } - /** * @} */ - -/** @defgroup HAL_FSMC_NAND_Group3 Control functions - * @brief management functions - * +/** @addtogroup FSMC_LL_NAND_Private_Functions_Group2 + * @brief management functions + * @verbatim ============================================================================== ##### FSMC_NAND Control functions ##### @@ -575,7 +637,6 @@ HAL_StatusTypeDef FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank) @endverbatim * @{ */ - /** * @brief Enables dynamically FSMC_NAND ECC feature. @@ -598,7 +659,6 @@ HAL_StatusTypeDef FSMC_NAND_ECC_Enable(FSMC_NAND_TypeDef *Device, uint32_t Bank return HAL_OK; } - /** * @brief Disables dynamically FSMC_NAND ECC feature. * @param Device: Pointer to NAND device instance @@ -639,8 +699,8 @@ HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, /* Get tick */ tickstart = HAL_GetTick(); - /* Wait untill FIFO is empty */ - while(__FSMC_NAND_GET_FLAG(Device, Bank, FSMC_FLAG_FEMPT)) + /* Wait until FIFO is empty */ + while(__FSMC_NAND_GET_FLAG(Device, Bank, FSMC_FLAG_FEMPT) == RESET) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) @@ -674,7 +734,7 @@ HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, * @} */ -/** @defgroup FSMC_PCCARD Controller functions +/** @addtogroup FSMC_LL_PCCARD * @brief PCCARD Controller functions * @verbatim @@ -698,9 +758,9 @@ HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, * @{ */ -/** @defgroup HAL_FSMC_PCCARD_Group1 Initialization/de-initialization functions - * @brief Initialization and Configuration functions - * +/** @addtogroup FSMC_LL_PCCARD_Private_Functions_Group1 + * @brief Initialization and Configuration functions + * @verbatim ============================================================================== ##### Initialization and de_initialization functions ##### @@ -724,19 +784,29 @@ HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, */ HAL_StatusTypeDef FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_InitTypeDef *Init) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FSMC_WAIT_FEATURE(Init->Waitfeature)); assert_param(IS_FSMC_TCLR_TIME(Init->TCLRSetupTime)); assert_param(IS_FSMC_TAR_TIME(Init->TARSetupTime)); + /* Get PCCARD control register value */ + tmpr = Device->PCR4; + + /* Clear TAR, TCLR, PWAITEN and PWID bits */ + tmpr &= ((uint32_t)~(FSMC_PCR4_TAR | FSMC_PCR4_TCLR | FSMC_PCR4_PWAITEN | \ + FSMC_PCR4_PWID)); + /* Set FSMC_PCCARD device control parameters */ - Device->PCR4 = (uint32_t)(Init->Waitfeature |\ - FSMC_NAND_PCC_MEM_BUS_WIDTH_16 |\ - (Init->TCLRSetupTime << 9) |\ - (Init->TARSetupTime << 13)); + tmpr |= (uint32_t)(Init->Waitfeature |\ + FSMC_NAND_PCC_MEM_BUS_WIDTH_16 |\ + (Init->TCLRSetupTime << 9) |\ + (Init->TARSetupTime << 13)); + + Device->PCR4 = tmpr; return HAL_OK; - } /** @@ -748,19 +818,28 @@ HAL_StatusTypeDef FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_Init */ HAL_StatusTypeDef FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime)); assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime)); assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime)); + /* Get PCCARD common space timing register value */ + tmpr = Device->PMEM4; + + /* Clear MEMSETx, MEMWAITx, MEMHOLDx and MEMHIZx bits */ + tmpr &= ((uint32_t)~(FSMC_PMEM4_MEMSET4 | FSMC_PMEM4_MEMWAIT4 | FSMC_PMEM4_MEMHOLD4 | \ + FSMC_PMEM4_MEMHIZ4)); /* Set PCCARD timing parameters */ - Device->PMEM4 = (uint32_t)((Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - (Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); - + tmpr |= (uint32_t)((Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + (Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + + Device->PMEM4 = tmpr; + return HAL_OK; } @@ -773,18 +852,27 @@ HAL_StatusTypeDef FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Devic */ HAL_StatusTypeDef FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime)); assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime)); assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime)); + /* Get PCCARD timing parameters */ + tmpr = Device->PATT4; + + /* Clear ATTSETx, ATTWAITx, ATTHOLDx and ATTHIZx bits */ + tmpr &= ((uint32_t)~(FSMC_PATT4_ATTSET4 | FSMC_PATT4_ATTWAIT4 | FSMC_PATT4_ATTHOLD4 | \ + FSMC_PATT4_ATTHIZ4)); + /* Set PCCARD timing parameters */ - Device->PATT4 = (uint32_t)((Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - (Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + Device->PATT4 = tmpr; return HAL_OK; } @@ -798,18 +886,28 @@ HAL_StatusTypeDef FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *De */ HAL_StatusTypeDef FSMC_PCCARD_IOSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing) { + uint32_t tmpr = 0; + /* Check the parameters */ assert_param(IS_FSMC_SETUP_TIME(Timing->SetupTime)); assert_param(IS_FSMC_WAIT_TIME(Timing->WaitSetupTime)); assert_param(IS_FSMC_HOLD_TIME(Timing->HoldSetupTime)); assert_param(IS_FSMC_HIZ_TIME(Timing->HiZSetupTime)); + /* Get FSMC_PCCARD device timing parameters */ + tmpr = Device->PIO4; + + /* Clear IOSET4, IOWAIT4, IOHOLD4 and IOHIZ4 bits */ + tmpr &= ((uint32_t)~(FSMC_PIO4_IOSET4 | FSMC_PIO4_IOWAIT4 | FSMC_PIO4_IOHOLD4 | \ + FSMC_PIO4_IOHIZ4)); + /* Set FSMC_PCCARD device timing parameters */ - Device->PIO4 = (uint32_t)((Timing->SetupTime |\ - ((Timing->WaitSetupTime) << 8) |\ - (Timing->HoldSetupTime) << 16) |\ - ((Timing->HiZSetupTime) << 24) - ); + tmpr |= (uint32_t)(Timing->SetupTime |\ + ((Timing->WaitSetupTime) << 8) |\ + ((Timing->HoldSetupTime) << 16) |\ + ((Timing->HiZSetupTime) << 24)); + + Device->PIO4 = tmpr; return HAL_OK; } @@ -833,7 +931,6 @@ HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device) return HAL_OK; } - /** * @} */ @@ -842,9 +939,11 @@ HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device) * @} */ +/** + * @} + */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ - -#endif /* HAL_FSMC_MODULE_ENABLED */ +#endif /* HAL_SRAM_MODULE_ENABLED || HAL_NOR_MODULE_ENABLED || HAL_NAND_MODULE_ENABLED || HAL_PCCARD_MODULE_ENABLED */ /** * @} @@ -853,5 +952,4 @@ HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device) /** * @} */ - /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.h index b09be1a71e3..e9a6f0965e3 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_fsmc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_ll_fsmc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of FSMC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,32 +43,25 @@ extern "C" { #endif -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) - /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal_def.h" /** @addtogroup STM32F4xx_HAL_Driver * @{ */ - -/** @addtogroup FSMC + +/** @addtogroup FSMC_LL * @{ - */ - -/* Exported typedef ----------------------------------------------------------*/ -#define FSMC_NORSRAM_TypeDef FSMC_Bank1_TypeDef -#define FSMC_NORSRAM_EXTENDED_TypeDef FSMC_Bank1E_TypeDef -#define FSMC_NAND_TypeDef FSMC_Bank2_3_TypeDef -#define FSMC_PCCARD_TypeDef FSMC_Bank4_TypeDef + */ -#define FSMC_NORSRAM_DEVICE FSMC_Bank1 -#define FSMC_NORSRAM_EXTENDED_DEVICE FSMC_Bank1E -#define FSMC_NAND_DEVICE FSMC_Bank2_3 -#define FSMC_PCCARD_DEVICE FSMC_Bank4 +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) +/* Private types -------------------------------------------------------------*/ +/** @defgroup FSMC_LL_Private_Types FSMC Private Types + * @{ + */ /** - * @brief FSMC_NORSRAM Configuration Structure definition + * @brief FSMC NORSRAM Configuration Structure definition */ typedef struct { @@ -123,7 +116,7 @@ typedef struct }FSMC_NORSRAM_InitTypeDef; /** - * @brief FSMC_NORSRAM Timing parameters structure definition + * @brief FSMC NORSRAM Timing parameters structure definition */ typedef struct { @@ -167,7 +160,7 @@ typedef struct }FSMC_NORSRAM_TimingTypeDef; /** - * @brief FSMC_NAND Configuration Structure definition + * @brief FSMC NAND Configuration Structure definition */ typedef struct { @@ -197,7 +190,7 @@ typedef struct }FSMC_NAND_InitTypeDef; /** - * @brief FSMC_NAND_PCCARD Timing parameters structure definition + * @brief FSMC NAND/PCCARD Timing parameters structure definition */ typedef struct { @@ -229,7 +222,7 @@ typedef struct }FSMC_NAND_PCC_TimingTypeDef; /** - * @brief FSMC_NAND Configuration Structure definition + * @brief FSMC NAND Configuration Structure definition */ typedef struct { @@ -245,74 +238,59 @@ typedef struct This parameter can be a number between Min_Data = 0 and Max_Data = 255 */ }FSMC_PCCARD_InitTypeDef; +/** + * @} + */ -/* Exported constants --------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup FSMC_LL_Private_Constants FSMC Private Constants + * @{ + */ -/** @defgroup FSMC_NOR_SRAM_Controller +/** @defgroup FSMC_LL_NOR_SRAM_Controller FSMC NOR/SRAM Controller * @{ */ - -/** @defgroup FSMC_NORSRAM_Bank +/** @defgroup FSMC_NORSRAM_Bank FSMC NOR/SRAM Bank * @{ */ #define FSMC_NORSRAM_BANK1 ((uint32_t)0x00000000) #define FSMC_NORSRAM_BANK2 ((uint32_t)0x00000002) #define FSMC_NORSRAM_BANK3 ((uint32_t)0x00000004) #define FSMC_NORSRAM_BANK4 ((uint32_t)0x00000006) - -#define IS_FSMC_NORSRAM_BANK(BANK) (((BANK) == FSMC_NORSRAM_BANK1) || \ - ((BANK) == FSMC_NORSRAM_BANK2) || \ - ((BANK) == FSMC_NORSRAM_BANK3) || \ - ((BANK) == FSMC_NORSRAM_BANK4)) /** * @} */ -/** @defgroup FSMC_Data_Address_Bus_Multiplexing +/** @defgroup FSMC_Data_Address_Bus_Multiplexing FSMC Data Address Bus Multiplexing * @{ */ - #define FSMC_DATA_ADDRESS_MUX_DISABLE ((uint32_t)0x00000000) #define FSMC_DATA_ADDRESS_MUX_ENABLE ((uint32_t)0x00000002) - -#define IS_FSMC_MUX(MUX) (((MUX) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \ - ((MUX) == FSMC_DATA_ADDRESS_MUX_ENABLE)) /** * @} */ -/** @defgroup FSMC_Memory_Type +/** @defgroup FSMC_Memory_Type FSMC Memory Type * @{ */ - #define FSMC_MEMORY_TYPE_SRAM ((uint32_t)0x00000000) #define FSMC_MEMORY_TYPE_PSRAM ((uint32_t)0x00000004) #define FSMC_MEMORY_TYPE_NOR ((uint32_t)0x00000008) - - -#define IS_FSMC_MEMORY(MEMORY) (((MEMORY) == FSMC_MEMORY_TYPE_SRAM) || \ - ((MEMORY) == FSMC_MEMORY_TYPE_PSRAM)|| \ - ((MEMORY) == FSMC_MEMORY_TYPE_NOR)) /** * @} */ -/** @defgroup FSMC_NORSRAM_Data_Width +/** @defgroup FSMC_NORSRAM_Data_Width FSMC NOR/SRAM Data Width * @{ */ - #define FSMC_NORSRAM_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000) #define FSMC_NORSRAM_MEM_BUS_WIDTH_16 ((uint32_t)0x00000010) #define FSMC_NORSRAM_MEM_BUS_WIDTH_32 ((uint32_t)0x00000020) - -#define IS_FSMC_NORSRAM_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_NORSRAM_MEM_BUS_WIDTH_8) || \ - ((WIDTH) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \ - ((WIDTH) == FSMC_NORSRAM_MEM_BUS_WIDTH_32)) /** * @} */ -/** @defgroup FSMC_NORSRAM_Flash_Access +/** @defgroup FSMC_NORSRAM_Flash_Access FSMC NOR/SRAM Flash Access * @{ */ #define FSMC_NORSRAM_FLASH_ACCESS_ENABLE ((uint32_t)0x00000040) @@ -321,232 +299,132 @@ typedef struct * @} */ -/** @defgroup FSMC_Burst_Access_Mode +/** @defgroup FSMC_Burst_Access_Mode FSMC Burst Access Mode * @{ */ - #define FSMC_BURST_ACCESS_MODE_DISABLE ((uint32_t)0x00000000) #define FSMC_BURST_ACCESS_MODE_ENABLE ((uint32_t)0x00000100) - -#define IS_FSMC_BURSTMODE(STATE) (((STATE) == FSMC_BURST_ACCESS_MODE_DISABLE) || \ - ((STATE) == FSMC_BURST_ACCESS_MODE_ENABLE)) /** * @} */ - -/** @defgroup FSMC_Wait_Signal_Polarity +/** @defgroup FSMC_Wait_Signal_Polarity FSMC Wait Signal Polarity * @{ */ #define FSMC_WAIT_SIGNAL_POLARITY_LOW ((uint32_t)0x00000000) #define FSMC_WAIT_SIGNAL_POLARITY_HIGH ((uint32_t)0x00000200) - -#define IS_FSMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \ - ((POLARITY) == FSMC_WAIT_SIGNAL_POLARITY_HIGH)) /** * @} */ -/** @defgroup FSMC_Wrap_Mode +/** @defgroup FSMC_Wrap_Mode FSMC Wrap Mode * @{ */ #define FSMC_WRAP_MODE_DISABLE ((uint32_t)0x00000000) #define FSMC_WRAP_MODE_ENABLE ((uint32_t)0x00000400) - -#define IS_FSMC_WRAP_MODE(MODE) (((MODE) == FSMC_WRAP_MODE_DISABLE) || \ - ((MODE) == FSMC_WRAP_MODE_ENABLE)) /** * @} */ -/** @defgroup FSMC_Wait_Timing +/** @defgroup FSMC_Wait_Timing FSMC Wait Timing * @{ */ #define FSMC_WAIT_TIMING_BEFORE_WS ((uint32_t)0x00000000) #define FSMC_WAIT_TIMING_DURING_WS ((uint32_t)0x00000800) - -#define IS_FSMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FSMC_WAIT_TIMING_BEFORE_WS) || \ - ((ACTIVE) == FSMC_WAIT_TIMING_DURING_WS)) /** * @} */ -/** @defgroup FSMC_Write_Operation +/** @defgroup FSMC_Write_Operation FSMC Write Operation * @{ */ #define FSMC_WRITE_OPERATION_DISABLE ((uint32_t)0x00000000) #define FSMC_WRITE_OPERATION_ENABLE ((uint32_t)0x00001000) - -#define IS_FSMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FSMC_WRITE_OPERATION_DISABLE) || \ - ((OPERATION) == FSMC_WRITE_OPERATION_ENABLE)) /** * @} */ -/** @defgroup FSMC_Wait_Signal +/** @defgroup FSMC_Wait_Signal FSMC Wait Signal * @{ */ #define FSMC_WAIT_SIGNAL_DISABLE ((uint32_t)0x00000000) #define FSMC_WAIT_SIGNAL_ENABLE ((uint32_t)0x00002000) - -#define IS_FSMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FSMC_WAIT_SIGNAL_DISABLE) || \ - ((SIGNAL) == FSMC_WAIT_SIGNAL_ENABLE)) - /** * @} */ -/** @defgroup FSMC_Extended_Mode +/** @defgroup FSMC_Extended_Mode FSMC Extended Mode * @{ */ #define FSMC_EXTENDED_MODE_DISABLE ((uint32_t)0x00000000) #define FSMC_EXTENDED_MODE_ENABLE ((uint32_t)0x00004000) - -#define IS_FSMC_EXTENDED_MODE(MODE) (((MODE) == FSMC_EXTENDED_MODE_DISABLE) || \ - ((MODE) == FSMC_EXTENDED_MODE_ENABLE)) /** * @} */ -/** @defgroup FSMC_AsynchronousWait +/** @defgroup FSMC_AsynchronousWait FSMC Asynchronous Wait * @{ */ #define FSMC_ASYNCHRONOUS_WAIT_DISABLE ((uint32_t)0x00000000) #define FSMC_ASYNCHRONOUS_WAIT_ENABLE ((uint32_t)0x00008000) - -#define IS_FSMC_ASYNWAIT(STATE) (((STATE) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \ - ((STATE) == FSMC_ASYNCHRONOUS_WAIT_ENABLE)) - /** * @} */ -/** @defgroup FSMC_Write_Burst +/** @defgroup FSMC_Write_Burst FSMC Write Burst * @{ */ - #define FSMC_WRITE_BURST_DISABLE ((uint32_t)0x00000000) #define FSMC_WRITE_BURST_ENABLE ((uint32_t)0x00080000) - -#define IS_FSMC_WRITE_BURST(BURST) (((BURST) == FSMC_WRITE_BURST_DISABLE) || \ - ((BURST) == FSMC_WRITE_BURST_ENABLE)) - /** * @} */ -/** @defgroup FSMC_Continous_Clock +/** @defgroup FSMC_Continous_Clock FSMC Continous Clock * @{ */ - #define FSMC_CONTINUOUS_CLOCK_SYNC_ONLY ((uint32_t)0x00000000) #define FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC ((uint32_t)0x00100000) - -#define IS_FSMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FSMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \ - ((CCLOCK) == FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC)) - -/** - * @} - */ - -/** @defgroup FSMC_Address_Setup_Time - * @{ - */ -#define IS_FSMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 15) /** * @} */ -/** @defgroup FSMC_Address_Hold_Time - * @{ - */ -#define IS_FSMC_ADDRESS_HOLD_TIME(TIME) (((TIME) > 0) && ((TIME) <= 15)) -/** - * @} - */ - -/** @defgroup FSMC_Data_Setup_Time - * @{ - */ -#define IS_FSMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 255)) -/** - * @} - */ - -/** @defgroup FSMC_Bus_Turn_around_Duration - * @{ - */ -#define IS_FSMC_TURNAROUND_TIME(TIME) ((TIME) <= 15) -/** - * @} - */ - -/** @defgroup FSMC_CLK_Division - * @{ - */ -#define IS_FSMC_CLK_DIV(DIV) (((DIV) > 1) && ((DIV) <= 16)) -/** - * @} - */ - -/** @defgroup FSMC_Data_Latency - * @{ - */ -#define IS_FSMC_DATA_LATENCY(LATENCY) (((LATENCY) > 1) && ((LATENCY) <= 17)) -/** - * @} - */ - -/** @defgroup FSMC_Access_Mode +/** @defgroup FSMC_Access_Mode FSMC Access Mode * @{ */ #define FSMC_ACCESS_MODE_A ((uint32_t)0x00000000) #define FSMC_ACCESS_MODE_B ((uint32_t)0x10000000) #define FSMC_ACCESS_MODE_C ((uint32_t)0x20000000) #define FSMC_ACCESS_MODE_D ((uint32_t)0x30000000) - -#define IS_FSMC_ACCESS_MODE(MODE) (((MODE) == FSMC_ACCESS_MODE_A) || \ - ((MODE) == FSMC_ACCESS_MODE_B) || \ - ((MODE) == FSMC_ACCESS_MODE_C) || \ - ((MODE) == FSMC_ACCESS_MODE_D)) /** * @} */ - /** * @} - */ + */ -/** @defgroup FSMC_NAND_Controller +/** @defgroup FSMC_LL_NAND_Controller FSMC NAND and PCCARD Controller * @{ */ - -/** @defgroup FSMC_NAND_Bank +/** @defgroup FSMC_NAND_Bank FSMC NAND Bank * @{ - */ + */ #define FSMC_NAND_BANK2 ((uint32_t)0x00000010) #define FSMC_NAND_BANK3 ((uint32_t)0x00000100) - -#define IS_FSMC_NAND_BANK(BANK) (((BANK) == FSMC_NAND_BANK2) || \ - ((BANK) == FSMC_NAND_BANK3)) - /** * @} */ -/** @defgroup FSMC_Wait_feature +/** @defgroup FSMC_Wait_feature FSMC Wait feature * @{ */ #define FSMC_NAND_PCC_WAIT_FEATURE_DISABLE ((uint32_t)0x00000000) #define FSMC_NAND_PCC_WAIT_FEATURE_ENABLE ((uint32_t)0x00000002) - -#define IS_FSMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FSMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \ - ((FEATURE) == FSMC_NAND_PCC_WAIT_FEATURE_ENABLE)) /** * @} */ -/** @defgroup FSMC_PCR_Memory_Type +/** @defgroup FSMC_PCR_Memory_Type FSMC PCR Memory Type * @{ */ #define FSMC_PCR_MEMORY_TYPE_PCCARD ((uint32_t)0x00000000) @@ -555,31 +433,25 @@ typedef struct * @} */ -/** @defgroup FSMC_NAND_Data_Width +/** @defgroup FSMC_NAND_Data_Width FSMC NAND Data Width * @{ */ #define FSMC_NAND_PCC_MEM_BUS_WIDTH_8 ((uint32_t)0x00000000) #define FSMC_NAND_PCC_MEM_BUS_WIDTH_16 ((uint32_t)0x00000010) - -#define IS_FSMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_NAND_PCC_MEM_BUS_WIDTH_8) || \ - ((WIDTH) == FSMC_NAND_PCC_MEM_BUS_WIDTH_16)) /** * @} */ -/** @defgroup FSMC_ECC +/** @defgroup FSMC_ECC FSMC ECC * @{ */ #define FSMC_NAND_ECC_DISABLE ((uint32_t)0x00000000) #define FSMC_NAND_ECC_ENABLE ((uint32_t)0x00000040) - -#define IS_FSMC_ECC_STATE(STATE) (((STATE) == FSMC_NAND_ECC_DISABLE) || \ - ((STATE) == FSMC_NAND_ECC_ENABLE)) /** * @} */ -/** @defgroup FSMC_ECC_Page_Size +/** @defgroup FSMC_ECC_Page_Size FSMC ECC Page Size * @{ */ #define FSMC_NAND_ECC_PAGE_SIZE_256BYTE ((uint32_t)0x00000000) @@ -588,154 +460,135 @@ typedef struct #define FSMC_NAND_ECC_PAGE_SIZE_2048BYTE ((uint32_t)0x00060000) #define FSMC_NAND_ECC_PAGE_SIZE_4096BYTE ((uint32_t)0x00080000) #define FSMC_NAND_ECC_PAGE_SIZE_8192BYTE ((uint32_t)0x000A0000) - -#define IS_FSMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_256BYTE) || \ - ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_512BYTE) || \ - ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \ - ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \ - ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \ - ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_8192BYTE)) /** * @} */ - -/** @defgroup FSMC_TCLR_Setup_Time - * @{ - */ -#define IS_FSMC_TCLR_TIME(TIME) ((TIME) <= 255) /** * @} - */ - -/** @defgroup FSMC_TAR_Setup_Time + */ + +/** @defgroup FSMC_LL_Interrupt_definition FSMC Interrupt definition * @{ - */ -#define IS_FSMC_TAR_TIME(TIME) ((TIME) <= 255) + */ +#define FSMC_IT_RISING_EDGE ((uint32_t)0x00000008) +#define FSMC_IT_LEVEL ((uint32_t)0x00000010) +#define FSMC_IT_FALLING_EDGE ((uint32_t)0x00000020) +#define FSMC_IT_REFRESH_ERROR ((uint32_t)0x00004000) /** * @} */ - -/** @defgroup FSMC_Setup_Time + +/** @defgroup FSMC_LL_Flag_definition FSMC Flag definition * @{ - */ -#define IS_FSMC_SETUP_TIME(TIME) ((TIME) <= 255) + */ +#define FSMC_FLAG_RISING_EDGE ((uint32_t)0x00000001) +#define FSMC_FLAG_LEVEL ((uint32_t)0x00000002) +#define FSMC_FLAG_FALLING_EDGE ((uint32_t)0x00000004) +#define FSMC_FLAG_FEMPT ((uint32_t)0x00000040) /** * @} */ -/** @defgroup FSMC_Wait_Setup_Time +/** @defgroup FSMC_LL_Alias_definition FSMC Alias definition * @{ */ -#define IS_FSMC_WAIT_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ +#define FSMC_NORSRAM_TypeDef FSMC_Bank1_TypeDef +#define FSMC_NORSRAM_EXTENDED_TypeDef FSMC_Bank1E_TypeDef +#define FSMC_NAND_TypeDef FSMC_Bank2_3_TypeDef +#define FSMC_PCCARD_TypeDef FSMC_Bank4_TypeDef -/** @defgroup FSMC_Hold_Setup_Time - * @{ - */ -#define IS_FSMC_HOLD_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ +#define FSMC_NORSRAM_DEVICE FSMC_Bank1 +#define FSMC_NORSRAM_EXTENDED_DEVICE FSMC_Bank1E +#define FSMC_NAND_DEVICE FSMC_Bank2_3 +#define FSMC_PCCARD_DEVICE FSMC_Bank4 -/** @defgroup FSMC_HiZ_Setup_Time - * @{ - */ -#define IS_FSMC_HIZ_TIME(TIME) ((TIME) <= 255) -/** - * @} - */ - -/** - * @} - */ - +#define FMC_NORSRAM_TypeDef FSMC_NORSRAM_TypeDef +#define FMC_NORSRAM_EXTENDED_TypeDef FSMC_NORSRAM_EXTENDED_TypeDef +#define FMC_NORSRAM_InitTypeDef FSMC_NORSRAM_InitTypeDef +#define FMC_NORSRAM_TimingTypeDef FSMC_NORSRAM_TimingTypeDef -/** @defgroup FSMC_NORSRAM_Device_Instance - * @{ - */ -#define IS_FSMC_NORSRAM_DEVICE(INSTANCE) ((INSTANCE) == FSMC_NORSRAM_DEVICE) +#define FMC_NORSRAM_Init FSMC_NORSRAM_Init +#define FMC_NORSRAM_Timing_Init FSMC_NORSRAM_Timing_Init +#define FMC_NORSRAM_Extended_Timing_Init FSMC_NORSRAM_Extended_Timing_Init +#define FMC_NORSRAM_DeInit FSMC_NORSRAM_DeInit +#define FMC_NORSRAM_WriteOperation_Enable FSMC_NORSRAM_WriteOperation_Enable +#define FMC_NORSRAM_WriteOperation_Disable FSMC_NORSRAM_WriteOperation_Disable -/** - * @} - */ +#define __FMC_NORSRAM_ENABLE __FSMC_NORSRAM_ENABLE +#define __FMC_NORSRAM_DISABLE __FSMC_NORSRAM_DISABLE -/** @defgroup FSMC_NORSRAM_EXTENDED_Device_Instance - * @{ - */ -#define IS_FSMC_NORSRAM_EXTENDED_DEVICE(INSTANCE) ((INSTANCE) == FSMC_NORSRAM_EXTENDED_DEVICE) +#define FMC_NAND_InitTypeDef FSMC_NAND_InitTypeDef +#define FMC_PCCARD_InitTypeDef FSMC_PCCARD_InitTypeDef +#define FMC_NAND_PCC_TimingTypeDef FSMC_NAND_PCC_TimingTypeDef -/** - * @} - */ - - /** @defgroup FSMC_NAND_Device_Instance - * @{ - */ -#define IS_FSMC_NAND_DEVICE(INSTANCE) ((INSTANCE) == FSMC_NAND_DEVICE) +#define FMC_NAND_Init FSMC_NAND_Init +#define FMC_NAND_CommonSpace_Timing_Init FSMC_NAND_CommonSpace_Timing_Init +#define FMC_NAND_AttributeSpace_Timing_Init FSMC_NAND_AttributeSpace_Timing_Init +#define FMC_NAND_DeInit FSMC_NAND_DeInit +#define FMC_NAND_ECC_Enable FSMC_NAND_ECC_Enable +#define FMC_NAND_ECC_Disable FSMC_NAND_ECC_Disable +#define FMC_NAND_GetECC FSMC_NAND_GetECC +#define FMC_PCCARD_Init FSMC_PCCARD_Init +#define FMC_PCCARD_CommonSpace_Timing_Init FSMC_PCCARD_CommonSpace_Timing_Init +#define FMC_PCCARD_AttributeSpace_Timing_Init FSMC_PCCARD_AttributeSpace_Timing_Init +#define FMC_PCCARD_IOSpace_Timing_Init FSMC_PCCARD_IOSpace_Timing_Init +#define FMC_PCCARD_DeInit FSMC_PCCARD_DeInit -/** - * @} - */ +#define __FMC_NAND_ENABLE __FSMC_NAND_ENABLE +#define __FMC_NAND_DISABLE __FSMC_NAND_DISABLE +#define __FMC_PCCARD_ENABLE __FSMC_PCCARD_ENABLE +#define __FMC_PCCARD_DISABLE __FSMC_PCCARD_DISABLE +#define __FMC_NAND_ENABLE_IT __FSMC_NAND_ENABLE_IT +#define __FMC_NAND_DISABLE_IT __FSMC_NAND_DISABLE_IT +#define __FMC_NAND_GET_FLAG __FSMC_NAND_GET_FLAG +#define __FMC_NAND_CLEAR_FLAG __FSMC_NAND_CLEAR_FLAG +#define __FMC_PCCARD_ENABLE_IT __FSMC_PCCARD_ENABLE_IT +#define __FMC_PCCARD_DISABLE_IT __FSMC_PCCARD_DISABLE_IT +#define __FMC_PCCARD_GET_FLAG __FSMC_PCCARD_GET_FLAG +#define __FMC_PCCARD_CLEAR_FLAG __FSMC_PCCARD_CLEAR_FLAG -/** @defgroup FSMC_PCCARD_Device_Instance - * @{ - */ -#define IS_FSMC_PCCARD_DEVICE(INSTANCE) ((INSTANCE) == FSMC_PCCARD_DEVICE) +#define FMC_NORSRAM_TypeDef FSMC_NORSRAM_TypeDef +#define FMC_NORSRAM_EXTENDED_TypeDef FSMC_NORSRAM_EXTENDED_TypeDef +#define FMC_NAND_TypeDef FSMC_NAND_TypeDef +#define FMC_PCCARD_TypeDef FSMC_PCCARD_TypeDef -/** - * @} - */ - -/** @defgroup FSMC_Interrupt_definition - * @brief FSMC Interrupt definition - * @{ - */ -#define FSMC_IT_RISING_EDGE ((uint32_t)0x00000008) -#define FSMC_IT_LEVEL ((uint32_t)0x00000010) -#define FSMC_IT_FALLING_EDGE ((uint32_t)0x00000020) -#define FSMC_IT_REFRESH_ERROR ((uint32_t)0x00004000) +#define FMC_NORSRAM_DEVICE FSMC_NORSRAM_DEVICE +#define FMC_NORSRAM_EXTENDED_DEVICE FSMC_NORSRAM_EXTENDED_DEVICE +#define FMC_NAND_DEVICE FSMC_NAND_DEVICE +#define FMC_PCCARD_DEVICE FSMC_PCCARD_DEVICE -#define IS_FSMC_IT(IT) ((((IT) & (uint32_t)0xFFFFBFC7) == 0x00000000) && ((IT) != 0x00000000)) -#define IS_FSMC_GET_IT(IT) (((IT) == FSMC_IT_RISING_EDGE) || \ - ((IT) == FSMC_IT_LEVEL) || \ - ((IT) == FSMC_IT_FALLING_EDGE) || \ - ((IT) == FSMC_IT_REFRESH_ERROR)) -/** - * @} - */ - -/** @defgroup FSMC_Flag_definition - * @brief FSMC Flag definition - * @{ - */ -#define FSMC_FLAG_RISING_EDGE ((uint32_t)0x00000001) -#define FSMC_FLAG_LEVEL ((uint32_t)0x00000002) -#define FSMC_FLAG_FALLING_EDGE ((uint32_t)0x00000004) -#define FSMC_FLAG_FEMPT ((uint32_t)0x00000040) +#define FMC_NAND_BANK2 FSMC_NAND_BANK2 -#define IS_FSMC_GET_FLAG(FLAG) (((FLAG) == FSMC_FLAG_RISING_EDGE) || \ - ((FLAG) == FSMC_FLAG_LEVEL) || \ - ((FLAG) == FSMC_FLAG_FALLING_EDGE) || \ - ((FLAG) == FSMC_FLAG_FEMPT)) +#define FMC_NORSRAM_BANK1 FSMC_NORSRAM_BANK1 +#define FMC_NORSRAM_BANK2 FSMC_NORSRAM_BANK2 +#define FMC_NORSRAM_BANK3 FSMC_NORSRAM_BANK3 -#define IS_FSMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000)) - +#define FMC_IT_RISING_EDGE FSMC_IT_RISING_EDGE +#define FMC_IT_LEVEL FSMC_IT_LEVEL +#define FMC_IT_FALLING_EDGE FSMC_IT_FALLING_EDGE +#define FMC_IT_REFRESH_ERROR FSMC_IT_REFRESH_ERROR +#define FMC_FLAG_RISING_EDGE FSMC_FLAG_RISING_EDGE +#define FMC_FLAG_LEVEL FSMC_FLAG_LEVEL +#define FMC_FLAG_FALLING_EDGE FSMC_FLAG_FALLING_EDGE +#define FMC_FLAG_FEMPT FSMC_FLAG_FEMPT /** * @} */ +/** + * @} + */ -/* Exported macro ------------------------------------------------------------*/ - +/* Private macro -------------------------------------------------------------*/ +/** @defgroup FSMC_LL_Private_Macros FSMC Private Macros + * @{ + */ -/** @defgroup FSMC_NOR_Macros +/** @defgroup FSMC_LL_NOR_Macros FSMC NOR/SRAM Exported Macros * @brief macros to handle NOR device enable/disable and read/write operations * @{ */ - /** * @brief Enable the NORSRAM device access. * @param __INSTANCE__: FSMC_NORSRAM Instance @@ -751,17 +604,14 @@ typedef struct * @retval none */ #define __FSMC_NORSRAM_DISABLE(__INSTANCE__, __BANK__) ((__INSTANCE__)->BTCR[(__BANK__)] &= ~FSMC_BCR1_MBKEN) - /** * @} */ - -/** @defgroup FSMC_NAND_Macros +/** @defgroup FSMC_LL_NAND_Macros FSMC NAND Macros * @brief macros to handle NAND device enable/disable * @{ */ - /** * @brief Enable the NAND device access. * @param __INSTANCE__: FSMC_NAND Instance @@ -770,7 +620,6 @@ typedef struct */ #define __FSMC_NAND_ENABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? ((__INSTANCE__)->PCR2 |= FSMC_PCR2_PBKEN): \ ((__INSTANCE__)->PCR3 |= FSMC_PCR3_PBKEN)) - /** * @brief Disable the NAND device access. @@ -780,17 +629,14 @@ typedef struct */ #define __FSMC_NAND_DISABLE(__INSTANCE__, __BANK__) (((__BANK__) == FSMC_NAND_BANK2)? ((__INSTANCE__)->PCR2 &= ~FSMC_PCR2_PBKEN): \ ((__INSTANCE__)->PCR3 &= ~FSMC_PCR3_PBKEN)) - - /** * @} */ -/** @defgroup FSMC_PCCARD_Macros - * @brief macros to handle SRAM read/write operations - * @{ - */ - +/** @defgroup FSMC_LL_PCCARD_Macros FSMC PCCARD Macros + * @brief macros to handle SRAM read/write operations + * @{ + */ /** * @brief Enable the PCCARD device access. * @param __INSTANCE__: FSMC_PCCARD Instance @@ -804,16 +650,14 @@ typedef struct * @retval none */ #define __FSMC_PCCARD_DISABLE(__INSTANCE__) ((__INSTANCE__)->PCR4 &= ~FSMC_PCR4_PBKEN) - /** * @} */ -/** @defgroup FSMC_Interrupt - * @brief macros to handle FSMC interrupts +/** @defgroup FSMC_LL_Flag_Interrupt_Macros FSMC Flag&Interrupt Macros + * @brief macros to handle FSMC flags and interrupts * @{ */ - /** * @brief Enable the NAND device interrupt. * @param __INSTANCE__: FSMC_NAND Instance @@ -845,8 +689,8 @@ typedef struct /** * @brief Get flag status of the NAND device. * @param __INSTANCE__: FSMC_NAND Instance - * @param __BANK__: FSMC_NAND Bank - * @param __FLAG__: FSMC_NAND flag + * @param __BANK__ : FSMC_NAND Bank + * @param __FLAG__ : FSMC_NAND flag * This parameter can be any combination of the following values: * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag. * @arg FSMC_FLAG_LEVEL: Interrupt level edge flag. @@ -889,14 +733,14 @@ typedef struct * This parameter can be any combination of the following values: * @arg FSMC_IT_RISING_EDGE: Interrupt rising edge. * @arg FSMC_IT_LEVEL: Interrupt level. - * @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge. + * @arg FSMC_IT_FALLING_EDGE: Interrupt falling edge. * @retval None */ #define __FSMC_PCCARD_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->SR4 &= ~(__INTERRUPT__)) /** * @brief Get flag status of the PCCARD device. - * @param __INSTANCE__: FSMC_PCCARD Instance + * @param __INSTANCE__: FSMC_PCCARD Instance * @param __FLAG__: FSMC_PCCARD flag * This parameter can be any combination of the following values: * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag. @@ -909,7 +753,7 @@ typedef struct /** * @brief Clear flag status of the PCCARD device. - * @param __INSTANCE__: FSMC_PCCARD Instance + * @param __INSTANCE__: FSMC_PCCARD Instance * @param __FLAG__: FSMC_PCCARD flag * This parameter can be any combination of the following values: * @arg FSMC_FLAG_RISING_EDGE: Interrupt rising edge flag. @@ -919,116 +763,202 @@ typedef struct * @retval None */ #define __FSMC_PCCARD_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->SR4 &= ~(__FLAG__)) +/** + * @} + */ + +/** @defgroup FSMC_LL_Assert_Macros FSMC Assert Macros + * @{ + */ +#define IS_FSMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FSMC_NORSRAM_BANK1) || \ + ((__BANK__) == FSMC_NORSRAM_BANK2) || \ + ((__BANK__) == FSMC_NORSRAM_BANK3) || \ + ((__BANK__) == FSMC_NORSRAM_BANK4)) + +#define IS_FSMC_MUX(__MUX__) (((__MUX__) == FSMC_DATA_ADDRESS_MUX_DISABLE) || \ + ((__MUX__) == FSMC_DATA_ADDRESS_MUX_ENABLE)) +#define IS_FSMC_MEMORY(__MEMORY__) (((__MEMORY__) == FSMC_MEMORY_TYPE_SRAM) || \ + ((__MEMORY__) == FSMC_MEMORY_TYPE_PSRAM)|| \ + ((__MEMORY__) == FSMC_MEMORY_TYPE_NOR)) + +#define IS_FSMC_NORSRAM_MEMORY_WIDTH(__WIDTH__) (((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_8) || \ + ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_16) || \ + ((__WIDTH__) == FSMC_NORSRAM_MEM_BUS_WIDTH_32)) + +#define IS_FSMC_ACCESS_MODE(__MODE__) (((__MODE__) == FSMC_ACCESS_MODE_A) || \ + ((__MODE__) == FSMC_ACCESS_MODE_B) || \ + ((__MODE__) == FSMC_ACCESS_MODE_C) || \ + ((__MODE__) == FSMC_ACCESS_MODE_D)) + +#define IS_FSMC_NAND_BANK(BANK) (((BANK) == FSMC_NAND_BANK2) || \ + ((BANK) == FSMC_NAND_BANK3)) + +#define IS_FSMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FSMC_NAND_PCC_WAIT_FEATURE_DISABLE) || \ + ((FEATURE) == FSMC_NAND_PCC_WAIT_FEATURE_ENABLE)) + +#define IS_FSMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_NAND_PCC_MEM_BUS_WIDTH_8) || \ + ((WIDTH) == FSMC_NAND_PCC_MEM_BUS_WIDTH_16)) + +#define IS_FSMC_ECC_STATE(STATE) (((STATE) == FSMC_NAND_ECC_DISABLE) || \ + ((STATE) == FSMC_NAND_ECC_ENABLE)) + +#define IS_FSMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_256BYTE) || \ + ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_512BYTE) || \ + ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_1024BYTE) || \ + ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_2048BYTE) || \ + ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_4096BYTE) || \ + ((SIZE) == FSMC_NAND_ECC_PAGE_SIZE_8192BYTE)) + +#define IS_FSMC_TCLR_TIME(TIME) ((TIME) <= 255) + +#define IS_FSMC_TAR_TIME(TIME) ((TIME) <= 255) + +#define IS_FSMC_SETUP_TIME(TIME) ((TIME) <= 255) + +#define IS_FSMC_WAIT_TIME(TIME) ((TIME) <= 255) + +#define IS_FSMC_HOLD_TIME(TIME) ((TIME) <= 255) + +#define IS_FSMC_HIZ_TIME(TIME) ((TIME) <= 255) + +#define IS_FSMC_NORSRAM_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_DEVICE) + +#define IS_FSMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FSMC_NORSRAM_EXTENDED_DEVICE) + +#define IS_FSMC_NAND_DEVICE(INSTANCE) ((INSTANCE) == FSMC_NAND_DEVICE) + +#define IS_FSMC_PCCARD_DEVICE(INSTANCE) ((INSTANCE) == FSMC_PCCARD_DEVICE) + +#define IS_FSMC_BURSTMODE(__STATE__) (((__STATE__) == FSMC_BURST_ACCESS_MODE_DISABLE) || \ + ((__STATE__) == FSMC_BURST_ACCESS_MODE_ENABLE)) + +#define IS_FSMC_WAIT_POLARITY(__POLARITY__) (((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_LOW) || \ + ((__POLARITY__) == FSMC_WAIT_SIGNAL_POLARITY_HIGH)) + +#define IS_FSMC_WRAP_MODE(__MODE__) (((__MODE__) == FSMC_WRAP_MODE_DISABLE) || \ + ((__MODE__) == FSMC_WRAP_MODE_ENABLE)) + +#define IS_FSMC_WAIT_SIGNAL_ACTIVE(__ACTIVE__) (((__ACTIVE__) == FSMC_WAIT_TIMING_BEFORE_WS) || \ + ((__ACTIVE__) == FSMC_WAIT_TIMING_DURING_WS)) + +#define IS_FSMC_WRITE_OPERATION(__OPERATION__) (((__OPERATION__) == FSMC_WRITE_OPERATION_DISABLE) || \ + ((__OPERATION__) == FSMC_WRITE_OPERATION_ENABLE)) + +#define IS_FSMC_WAITE_SIGNAL(__SIGNAL__) (((__SIGNAL__) == FSMC_WAIT_SIGNAL_DISABLE) || \ + ((__SIGNAL__) == FSMC_WAIT_SIGNAL_ENABLE)) + +#define IS_FSMC_EXTENDED_MODE(__MODE__) (((__MODE__) == FSMC_EXTENDED_MODE_DISABLE) || \ + ((__MODE__) == FSMC_EXTENDED_MODE_ENABLE)) + +#define IS_FSMC_ASYNWAIT(__STATE__) (((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_DISABLE) || \ + ((__STATE__) == FSMC_ASYNCHRONOUS_WAIT_ENABLE)) + +#define IS_FSMC_DATA_LATENCY(__LATENCY__) (((__LATENCY__) > 1) && ((__LATENCY__) <= 17)) + +#define IS_FSMC_WRITE_BURST(__BURST__) (((__BURST__) == FSMC_WRITE_BURST_DISABLE) || \ + ((__BURST__) == FSMC_WRITE_BURST_ENABLE)) + +#define IS_FSMC_ADDRESS_SETUP_TIME(__TIME__) ((__TIME__) <= 15) + +#define IS_FSMC_ADDRESS_HOLD_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 15)) + +#define IS_FSMC_DATASETUP_TIME(__TIME__) (((__TIME__) > 0) && ((__TIME__) <= 255)) + +#define IS_FSMC_TURNAROUND_TIME(__TIME__) ((__TIME__) <= 15) + +#define IS_FSMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FSMC_CONTINUOUS_CLOCK_SYNC_ONLY) || \ + ((CCLOCK) == FSMC_CONTINUOUS_CLOCK_SYNC_ASYNC)) + +#define IS_FSMC_CLK_DIV(DIV) (((DIV) > 1) && ((DIV) <= 16)) + +/** + * @} + */ /** * @} */ -/* Exported functions --------------------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +/** @defgroup FSMC_LL_Private_Functions FSMC LL Private Functions + * @{ + */ + +/** @defgroup FSMC_LL_NORSRAM NOR SRAM + * @{ + */ -/* FSMC_NORSRAM Controller functions ******************************************/ -/* Initialization/de-initialization functions */ +/** @defgroup FSMC_LL_NORSRAM_Private_Functions_Group1 NOR SRAM Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FSMC_NORSRAM_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_InitTypeDef *Init); HAL_StatusTypeDef FSMC_NORSRAM_Timing_Init(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FSMC_NORSRAM_Extended_Timing_Init(FSMC_NORSRAM_EXTENDED_TypeDef *Device, FSMC_NORSRAM_TimingTypeDef *Timing, uint32_t Bank, uint32_t ExtendedMode); HAL_StatusTypeDef FSMC_NORSRAM_DeInit(FSMC_NORSRAM_TypeDef *Device, FSMC_NORSRAM_EXTENDED_TypeDef *ExDevice, uint32_t Bank); +/** + * @} + */ -/* FSMC_NORSRAM Control functions */ +/** @defgroup FSMC_LL_NORSRAM_Private_Functions_Group2 NOR SRAM Control functions + * @{ + */ HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Enable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FSMC_NORSRAM_WriteOperation_Disable(FSMC_NORSRAM_TypeDef *Device, uint32_t Bank); +/** + * @} + */ +/** + * @} + */ -/* FSMC_NAND Controller functions *********************************************/ -/* Initialization/de-initialization functions */ +/** @defgroup FSMC_LL_NAND NAND + * @{ + */ +/** @defgroup FSMC_LL_NAND_Private_Functions_Group1 NAND Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FSMC_NAND_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_InitTypeDef *Init); HAL_StatusTypeDef FSMC_NAND_CommonSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FSMC_NAND_AttributeSpace_Timing_Init(FSMC_NAND_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing, uint32_t Bank); HAL_StatusTypeDef FSMC_NAND_DeInit(FSMC_NAND_TypeDef *Device, uint32_t Bank); +/** + * @} + */ -/* FSMC_NAND Control functions */ +/** @defgroup FSMC_LL_NAND_Private_Functions_Group2 NAND Control functions + * @{ + */ HAL_StatusTypeDef FSMC_NAND_ECC_Enable(FSMC_NAND_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FSMC_NAND_ECC_Disable(FSMC_NAND_TypeDef *Device, uint32_t Bank); HAL_StatusTypeDef FSMC_NAND_GetECC(FSMC_NAND_TypeDef *Device, uint32_t *ECCval, uint32_t Bank, uint32_t Timeout); +/** + * @} + */ +/** + * @} + */ -/* FSMC_PCCARD Controller functions *******************************************/ -/* Initialization/de-initialization functions */ +/** @defgroup FSMC_LL_PCCARD PCCARD + * @{ + */ +/** @defgroup FSMC_LL_PCCARD_Private_Functions_Group1 PCCARD Initialization/de-initialization functions + * @{ + */ HAL_StatusTypeDef FSMC_PCCARD_Init(FSMC_PCCARD_TypeDef *Device, FSMC_PCCARD_InitTypeDef *Init); HAL_StatusTypeDef FSMC_PCCARD_CommonSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing); HAL_StatusTypeDef FSMC_PCCARD_AttributeSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing); HAL_StatusTypeDef FSMC_PCCARD_IOSpace_Timing_Init(FSMC_PCCARD_TypeDef *Device, FSMC_NAND_PCC_TimingTypeDef *Timing); HAL_StatusTypeDef FSMC_PCCARD_DeInit(FSMC_PCCARD_TypeDef *Device); +/** + * @} + */ +/** + * @} + */ -/* FSMC APIs, macros and typedefs redefinition */ -#define FMC_NORSRAM_TypeDef FSMC_NORSRAM_TypeDef -#define FMC_NORSRAM_EXTENDED_TypeDef FSMC_NORSRAM_EXTENDED_TypeDef -#define FMC_NORSRAM_InitTypeDef FSMC_NORSRAM_InitTypeDef -#define FMC_NORSRAM_TimingTypeDef FSMC_NORSRAM_TimingTypeDef - -#define FMC_NORSRAM_Init FSMC_NORSRAM_Init -#define FMC_NORSRAM_Timing_Init FSMC_NORSRAM_Timing_Init -#define FMC_NORSRAM_Extended_Timing_Init FSMC_NORSRAM_Extended_Timing_Init -#define FMC_NORSRAM_DeInit FSMC_NORSRAM_DeInit -#define FMC_NORSRAM_WriteOperation_Enable FSMC_NORSRAM_WriteOperation_Enable -#define FMC_NORSRAM_WriteOperation_Disable FSMC_NORSRAM_WriteOperation_Disable - -#define __FMC_NORSRAM_ENABLE __FSMC_NORSRAM_ENABLE -#define __FMC_NORSRAM_DISABLE __FSMC_NORSRAM_DISABLE - -#define FMC_NAND_InitTypeDef FSMC_NAND_InitTypeDef -#define FMC_PCCARD_InitTypeDef FSMC_PCCARD_InitTypeDef -#define FMC_NAND_PCC_TimingTypeDef FSMC_NAND_PCC_TimingTypeDef - -#define FMC_NAND_Init FSMC_NAND_Init -#define FMC_NAND_CommonSpace_Timing_Init FSMC_NAND_CommonSpace_Timing_Init -#define FMC_NAND_AttributeSpace_Timing_Init FSMC_NAND_AttributeSpace_Timing_Init -#define FMC_NAND_DeInit FSMC_NAND_DeInit -#define FMC_NAND_ECC_Enable FSMC_NAND_ECC_Enable -#define FMC_NAND_ECC_Disable FSMC_NAND_ECC_Disable -#define FMC_NAND_GetECC FSMC_NAND_GetECC -#define FMC_PCCARD_Init FSMC_PCCARD_Init -#define FMC_PCCARD_CommonSpace_Timing_Init FSMC_PCCARD_CommonSpace_Timing_Init -#define FMC_PCCARD_AttributeSpace_Timing_Init FSMC_PCCARD_AttributeSpace_Timing_Init -#define FMC_PCCARD_IOSpace_Timing_Init FSMC_PCCARD_IOSpace_Timing_Init -#define FMC_PCCARD_DeInit FSMC_PCCARD_DeInit - -#define __FMC_NAND_ENABLE __FSMC_NAND_ENABLE -#define __FMC_NAND_DISABLE __FSMC_NAND_DISABLE -#define __FMC_PCCARD_ENABLE __FSMC_PCCARD_ENABLE -#define __FMC_PCCARD_DISABLE __FSMC_PCCARD_DISABLE -#define __FMC_NAND_ENABLE_IT __FSMC_NAND_ENABLE_IT -#define __FMC_NAND_DISABLE_IT __FSMC_NAND_DISABLE_IT -#define __FMC_NAND_GET_FLAG __FSMC_NAND_GET_FLAG -#define __FMC_NAND_CLEAR_FLAG __FSMC_NAND_CLEAR_FLAG -#define __FMC_PCCARD_ENABLE_IT __FSMC_PCCARD_ENABLE_IT -#define __FMC_PCCARD_DISABLE_IT __FSMC_PCCARD_DISABLE_IT -#define __FMC_PCCARD_GET_FLAG __FSMC_PCCARD_GET_FLAG -#define __FMC_PCCARD_CLEAR_FLAG __FSMC_PCCARD_CLEAR_FLAG - -#define FMC_NORSRAM_TypeDef FSMC_NORSRAM_TypeDef -#define FMC_NORSRAM_EXTENDED_TypeDef FSMC_NORSRAM_EXTENDED_TypeDef -#define FMC_NAND_TypeDef FSMC_NAND_TypeDef -#define FMC_PCCARD_TypeDef FSMC_PCCARD_TypeDef - -#define FMC_NORSRAM_DEVICE FSMC_NORSRAM_DEVICE -#define FMC_NORSRAM_EXTENDED_DEVICE FSMC_NORSRAM_EXTENDED_DEVICE -#define FMC_NAND_DEVICE FSMC_NAND_DEVICE -#define FMC_PCCARD_DEVICE FSMC_PCCARD_DEVICE - -#define FMC_NAND_BANK2 FSMC_NAND_BANK2 - -#define FMC_NORSRAM_BANK1 FSMC_NORSRAM_BANK1 -#define FMC_NORSRAM_BANK2 FSMC_NORSRAM_BANK2 -#define FMC_NORSRAM_BANK3 FSMC_NORSRAM_BANK3 - -#define FMC_IT_RISING_EDGE FSMC_IT_RISING_EDGE -#define FMC_IT_LEVEL FSMC_IT_LEVEL -#define FMC_IT_FALLING_EDGE FSMC_IT_FALLING_EDGE -#define FMC_IT_REFRESH_ERROR FSMC_IT_REFRESH_ERROR - -#define FMC_FLAG_RISING_EDGE FSMC_FLAG_RISING_EDGE -#define FMC_FLAG_LEVEL FSMC_FLAG_LEVEL -#define FMC_FLAG_FALLING_EDGE FSMC_FLAG_FALLING_EDGE -#define FMC_FLAG_FEMPT FSMC_FLAG_FEMPT - +/** + * @} + */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ /** diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.c index 1847520d254..96b71e7dd2b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_ll_sdmmc.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief SDMMC Low Layer HAL module driver. * * This file provides firmware functions to manage the following @@ -21,13 +21,6 @@ peripheral bus and MultiMedia cards (MMCs), SD memory cards, SDIO cards and CE-ATA devices. - [..] The MultiMedia Card system specifications are available through the MultiMedia Card - Association website at www.mmca.org, published by the MMCA technical committee. - SD memory card and SD I/O card system specifications are available through the SD card - Association website at www.sdcard.org. - CE-ATA system specifications are available through the CE-ATA work group web site at - www.ce-ata.org. - [..] The SDIO features include the following: (+) Full compliance with MultiMedia Card System Specification Version 4.2. Card support for three different databus modes: 1-bit (default), 4-bit and 8-bit @@ -67,7 +60,7 @@ peripheral. (+) Enable the Power ON State using the SDIO_PowerState_ON(SDIOx) - function and disable it using the function HAL_SDIO_PowerState_OFF(SDIOx). + function and disable it using the function SDIO_PowerState_OFF(SDIOx). (+) Enable/Disable the clock using the __SDIO_ENABLE()/__SDIO_DISABLE() macros. @@ -107,7 +100,7 @@ (#) First, user has to fill the data structure (pointer to SDIO_DataInitTypeDef) according to the selected data type to be received. The parameters that should be filled are: - (++) Data TimeOut + (++) Data Timeout (++) Data Length (++) Data Block size (++) Data Transfer direction: should be from card (To SDIO) @@ -127,7 +120,7 @@ (#) First, user has to fill the data structure (pointer to SDIO_DataInitTypeDef) according to the selected data type to be received. The parameters that should be filled are: - (++) Data TimeOut + (++) Data Timeout (++) Data Length (++) Data Block size (++) Data Transfer direction: should be to card (To CARD) @@ -145,7 +138,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -179,8 +172,8 @@ * @{ */ -/** @defgroup SDMMC - * @brief SDMMC HAL module driver +/** @defgroup SDMMC_LL SDMMC Low Layer + * @brief Low layer module for SD and MMC driver * @{ */ @@ -193,11 +186,11 @@ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -/** @defgroup SDIO_Private_Functions +/** @defgroup SDMMC_LL_Exported_Functions SDMMC_LL Exported Functions * @{ */ -/** @defgroup HAL_SDIO_Group1 Initialization/de-initialization functions +/** @defgroup HAL_SDMMC_LL_Group1 Initialization/de-initialization functions * @brief Initialization and Configuration functions * @verbatim @@ -245,13 +238,11 @@ HAL_StatusTypeDef SDIO_Init(SDIO_TypeDef *SDIOx, SDIO_InitTypeDef Init) return HAL_OK; } - - /** * @} */ -/** @defgroup HAL_SDIO_Group2 I/O operation functions +/** @defgroup HAL_SDMMC_LL_Group2 I/O operation functions * @brief Data transfers functions * @verbatim @@ -295,7 +286,7 @@ HAL_StatusTypeDef SDIO_WriteFIFO(SDIO_TypeDef *SDIOx, uint32_t *pWriteData) * @} */ -/** @defgroup HAL_SDIO_Group3 Peripheral Control functions +/** @defgroup HAL_SDMMC_LL_Group3 Peripheral Control functions * @brief management functions * @verbatim @@ -436,7 +427,7 @@ HAL_StatusTypeDef SDIO_DataConfig(SDIO_TypeDef *SDIOx, SDIO_DataInitTypeDef* SDI assert_param(IS_SDIO_TRANSFER_MODE(SDIO_DataInitStruct->TransferMode)); assert_param(IS_SDIO_DPSM(SDIO_DataInitStruct->DPSM)); - /* Set the SDIO Data TimeOut value */ + /* Set the SDIO Data Timeout value */ SDIOx->DTIMER = SDIO_DataInitStruct->DataTimeOut; /* Set the SDIO DataLength value */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.h index 915a55890bc..f664647014a 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_sdmmc.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_ll_sdmmc.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of SDMMC HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -50,13 +50,12 @@ * @{ */ -/** @addtogroup SDMMC +/** @addtogroup SDMMC_LL * @{ */ /* Exported types ------------------------------------------------------------*/ - -/** @defgroup SDIO_Exported_Types SDIO Exported Types +/** @defgroup SDMMC_LL_Exported_Types SDMMC_LL Exported Types * @{ */ @@ -143,12 +142,11 @@ typedef struct */ /* Exported constants --------------------------------------------------------*/ - -/** @defgroup SDIO_Exported_Constants +/** @defgroup SDMMC_LL_Exported_Constants SDMMC_LL Exported Constants * @{ */ -/** @defgroup SDIO_Clock_Edge +/** @defgroup SDIO_Clock_Edge Clock Edge * @{ */ #define SDIO_CLOCK_EDGE_RISING ((uint32_t)0x00000000) @@ -160,7 +158,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Clock_Bypass +/** @defgroup SDIO_Clock_Bypass Clock Bypass * @{ */ #define SDIO_CLOCK_BYPASS_DISABLE ((uint32_t)0x00000000) @@ -172,7 +170,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Clock_Power_Save +/** @defgroup SDIO_Clock_Power_Save Clock Power Saving * @{ */ #define SDIO_CLOCK_POWER_SAVE_DISABLE ((uint32_t)0x00000000) @@ -184,7 +182,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Bus_Wide +/** @defgroup SDIO_Bus_Wide Bus Width * @{ */ #define SDIO_BUS_WIDE_1B ((uint32_t)0x00000000) @@ -198,7 +196,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Hardware_Flow_Control +/** @defgroup SDIO_Hardware_Flow_Control Hardware Flow Control * @{ */ #define SDIO_HARDWARE_FLOW_CONTROL_DISABLE ((uint32_t)0x00000000) @@ -210,7 +208,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Clock_Division +/** @defgroup SDIO_Clock_Division Clock Division * @{ */ #define IS_SDIO_CLKDIV(DIV) ((DIV) <= 0xFF) @@ -218,7 +216,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Command_Index +/** @defgroup SDIO_Command_Index Command Index * @{ */ #define IS_SDIO_CMD_INDEX(INDEX) ((INDEX) < 0x40) @@ -226,7 +224,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Response_Type +/** @defgroup SDIO_Response_Type Response Type * @{ */ #define SDIO_RESPONSE_NO ((uint32_t)0x00000000) @@ -240,7 +238,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Wait_Interrupt_State +/** @defgroup SDIO_Wait_Interrupt_State Wait Interrupt * @{ */ #define SDIO_WAIT_NO ((uint32_t)0x00000000) @@ -254,7 +252,7 @@ typedef struct * @} */ -/** @defgroup SDIO_CPSM_State +/** @defgroup SDIO_CPSM_State CPSM State * @{ */ #define SDIO_CPSM_DISABLE ((uint32_t)0x00000000) @@ -266,7 +264,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Response_Registers +/** @defgroup SDIO_Response_Registers Response Register * @{ */ #define SDIO_RESP1 ((uint32_t)0x00000000) @@ -282,7 +280,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Data_Length +/** @defgroup SDIO_Data_Length Data Lenght * @{ */ #define IS_SDIO_DATA_LENGTH(LENGTH) ((LENGTH) <= 0x01FFFFFF) @@ -290,7 +288,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Data_Block_Size +/** @defgroup SDIO_Data_Block_Size Data Block Size * @{ */ #define SDIO_DATABLOCK_SIZE_1B ((uint32_t)0x00000000) @@ -328,7 +326,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Transfer_Direction +/** @defgroup SDIO_Transfer_Direction Transfer Direction * @{ */ #define SDIO_TRANSFER_DIR_TO_CARD ((uint32_t)0x00000000) @@ -340,7 +338,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Transfer_Type +/** @defgroup SDIO_Transfer_Type Transfer Type * @{ */ #define SDIO_TRANSFER_MODE_BLOCK ((uint32_t)0x00000000) @@ -352,7 +350,7 @@ typedef struct * @} */ -/** @defgroup SDIO_DPSM_State +/** @defgroup SDIO_DPSM_State DPSM State * @{ */ #define SDIO_DPSM_DISABLE ((uint32_t)0x00000000) @@ -364,11 +362,11 @@ typedef struct * @} */ -/** @defgroup SDIO_Read_Wait_Mode +/** @defgroup SDIO_Read_Wait_Mode Read Wait Mode * @{ */ -#define SDIO_READ_WAIT_MODE_CLK ((uint32_t)0x00000000) -#define SDIO_READ_WAIT_MODE_DATA2 ((uint32_t)0x00000001) +#define SDIO_READ_WAIT_MODE_DATA2 ((uint32_t)0x00000000) +#define SDIO_READ_WAIT_MODE_CLK ((uint32_t)0x00000001) #define IS_SDIO_READWAIT_MODE(MODE) (((MODE) == SDIO_READ_WAIT_MODE_CLK) || \ ((MODE) == SDIO_READ_WAIT_MODE_DATA2)) @@ -376,7 +374,7 @@ typedef struct * @} */ -/** @defgroup SDIO_Interrupt_sources +/** @defgroup SDIO_Interrupt_sources Interrupt Sources * @{ */ #define SDIO_IT_CCRCFAIL SDIO_STA_CCRCFAIL @@ -403,13 +401,11 @@ typedef struct #define SDIO_IT_RXDAVL SDIO_STA_RXDAVL #define SDIO_IT_SDIOIT SDIO_STA_SDIOIT #define SDIO_IT_CEATAEND SDIO_STA_CEATAEND - -#define IS_SDIO_IT(IT) ((((IT) & (uint32_t)0xFF000000) == 0x00) && ((IT) != (uint32_t)0x00)) /** * @} */ -/** @defgroup SDIO_Flags +/** @defgroup SDIO_Flags Flags * @{ */ #define SDIO_FLAG_CCRCFAIL SDIO_STA_CCRCFAIL @@ -436,124 +432,77 @@ typedef struct #define SDIO_FLAG_RXDAVL SDIO_STA_RXDAVL #define SDIO_FLAG_SDIOIT SDIO_STA_SDIOIT #define SDIO_FLAG_CEATAEND SDIO_STA_CEATAEND - -#define IS_SDIO_FLAG(FLAG) (((FLAG) == SDIO_FLAG_CCRCFAIL) || \ - ((FLAG) == SDIO_FLAG_DCRCFAIL) || \ - ((FLAG) == SDIO_FLAG_CTIMEOUT) || \ - ((FLAG) == SDIO_FLAG_DTIMEOUT) || \ - ((FLAG) == SDIO_FLAG_TXUNDERR) || \ - ((FLAG) == SDIO_FLAG_RXOVERR) || \ - ((FLAG) == SDIO_FLAG_CMDREND) || \ - ((FLAG) == SDIO_FLAG_CMDSENT) || \ - ((FLAG) == SDIO_FLAG_DATAEND) || \ - ((FLAG) == SDIO_FLAG_STBITERR) || \ - ((FLAG) == SDIO_FLAG_DBCKEND) || \ - ((FLAG) == SDIO_FLAG_CMDACT) || \ - ((FLAG) == SDIO_FLAG_TXACT) || \ - ((FLAG) == SDIO_FLAG_RXACT) || \ - ((FLAG) == SDIO_FLAG_TXFIFOHE) || \ - ((FLAG) == SDIO_FLAG_RXFIFOHF) || \ - ((FLAG) == SDIO_FLAG_TXFIFOF) || \ - ((FLAG) == SDIO_FLAG_RXFIFOF) || \ - ((FLAG) == SDIO_FLAG_TXFIFOE) || \ - ((FLAG) == SDIO_FLAG_RXFIFOE) || \ - ((FLAG) == SDIO_FLAG_TXDAVL) || \ - ((FLAG) == SDIO_FLAG_RXDAVL) || \ - ((FLAG) == SDIO_FLAG_SDIOIT) || \ - ((FLAG) == SDIO_FLAG_CEATAEND)) - -#define IS_SDIO_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFF3FF800) == 0x00) && ((FLAG) != (uint32_t)0x00)) - -#define IS_SDIO_GET_IT(IT) (((IT) == SDIO_IT_CCRCFAIL) || \ - ((IT) == SDIO_IT_DCRCFAIL) || \ - ((IT) == SDIO_IT_CTIMEOUT) || \ - ((IT) == SDIO_IT_DTIMEOUT) || \ - ((IT) == SDIO_IT_TXUNDERR) || \ - ((IT) == SDIO_IT_RXOVERR) || \ - ((IT) == SDIO_IT_CMDREND) || \ - ((IT) == SDIO_IT_CMDSENT) || \ - ((IT) == SDIO_IT_DATAEND) || \ - ((IT) == SDIO_IT_STBITERR) || \ - ((IT) == SDIO_IT_DBCKEND) || \ - ((IT) == SDIO_IT_CMDACT) || \ - ((IT) == SDIO_IT_TXACT) || \ - ((IT) == SDIO_IT_RXACT) || \ - ((IT) == SDIO_IT_TXFIFOHE) || \ - ((IT) == SDIO_IT_RXFIFOHF) || \ - ((IT) == SDIO_IT_TXFIFOF) || \ - ((IT) == SDIO_IT_RXFIFOF) || \ - ((IT) == SDIO_IT_TXFIFOE) || \ - ((IT) == SDIO_IT_RXFIFOE) || \ - ((IT) == SDIO_IT_TXDAVL) || \ - ((IT) == SDIO_IT_RXDAVL) || \ - ((IT) == SDIO_IT_SDIOIT) || \ - ((IT) == SDIO_IT_CEATAEND)) - -#define IS_SDIO_CLEAR_IT(IT) ((((IT) & (uint32_t)0xFF3FF800) == 0x00) && ((IT) != (uint32_t)0x00)) - /** * @} */ - -/** @defgroup SDIO_Instance_definition - * @{ - */ -#define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO) - /** * @} */ - /* Exported macro ------------------------------------------------------------*/ +/** @defgroup SDMMC_LL_Exported_macros SDMMC_LL Exported Macros + * @{ + */ + +/** @defgroup SDMMC_LL_Alias_Region Bit Address in the alias region + * @{ + */ /* ------------ SDIO registers bit address in the alias region -------------- */ #define SDIO_OFFSET (SDIO_BASE - PERIPH_BASE) /* --- CLKCR Register ---*/ /* Alias word address of CLKEN bit */ #define CLKCR_OFFSET (SDIO_OFFSET + 0x04) -#define CLKEN_BitNumber 0x08 -#define CLKCR_CLKEN_BB (PERIPH_BB_BASE + (CLKCR_OFFSET * 32) + (CLKEN_BitNumber * 4)) +#define CLKEN_BITNUMBER 0x08 +#define CLKCR_CLKEN_BB (PERIPH_BB_BASE + (CLKCR_OFFSET * 32) + (CLKEN_BITNUMBER * 4)) /* --- CMD Register ---*/ /* Alias word address of SDIOSUSPEND bit */ #define CMD_OFFSET (SDIO_OFFSET + 0x0C) -#define SDIOSUSPEND_BitNumber 0x0B -#define CMD_SDIOSUSPEND_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (SDIOSUSPEND_BitNumber * 4)) +#define SDIOSUSPEND_BITNUMBER 0x0B +#define CMD_SDIOSUSPEND_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (SDIOSUSPEND_BITNUMBER * 4)) /* Alias word address of ENCMDCOMPL bit */ -#define ENCMDCOMPL_BitNumber 0x0C -#define CMD_ENCMDCOMPL_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ENCMDCOMPL_BitNumber * 4)) +#define ENCMDCOMPL_BITNUMBER 0x0C +#define CMD_ENCMDCOMPL_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ENCMDCOMPL_BITNUMBER * 4)) /* Alias word address of NIEN bit */ -#define NIEN_BitNumber 0x0D -#define CMD_NIEN_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (NIEN_BitNumber * 4)) +#define NIEN_BITNUMBER 0x0D +#define CMD_NIEN_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (NIEN_BITNUMBER * 4)) /* Alias word address of ATACMD bit */ -#define ATACMD_BitNumber 0x0E -#define CMD_ATACMD_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ATACMD_BitNumber * 4)) +#define ATACMD_BITNUMBER 0x0E +#define CMD_ATACMD_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ATACMD_BITNUMBER * 4)) /* --- DCTRL Register ---*/ /* Alias word address of DMAEN bit */ #define DCTRL_OFFSET (SDIO_OFFSET + 0x2C) -#define DMAEN_BitNumber 0x03 -#define DCTRL_DMAEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (DMAEN_BitNumber * 4)) +#define DMAEN_BITNUMBER 0x03 +#define DCTRL_DMAEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (DMAEN_BITNUMBER * 4)) /* Alias word address of RWSTART bit */ -#define RWSTART_BitNumber 0x08 -#define DCTRL_RWSTART_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTART_BitNumber * 4)) +#define RWSTART_BITNUMBER 0x08 +#define DCTRL_RWSTART_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTART_BITNUMBER * 4)) /* Alias word address of RWSTOP bit */ -#define RWSTOP_BitNumber 0x09 -#define DCTRL_RWSTOP_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTOP_BitNumber * 4)) +#define RWSTOP_BITNUMBER 0x09 +#define DCTRL_RWSTOP_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTOP_BITNUMBER * 4)) /* Alias word address of RWMOD bit */ -#define RWMOD_BitNumber 0x0A -#define DCTRL_RWMOD_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWMOD_BitNumber * 4)) +#define RWMOD_BITNUMBER 0x0A +#define DCTRL_RWMOD_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWMOD_BITNUMBER * 4)) /* Alias word address of SDIOEN bit */ -#define SDIOEN_BitNumber 0x0B -#define DCTRL_SDIOEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (SDIOEN_BitNumber * 4)) +#define SDIOEN_BITNUMBER 0x0B +#define DCTRL_SDIOEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (SDIOEN_BITNUMBER * 4)) +/** + * @} + */ + +/** @defgroup SDMMC_LL_Register Bits And Addresses Definitions + * @brief SDMMC_LL registers bit address in the alias region + * @{ + */ /* ---------------------- SDIO registers bit mask --------------------------- */ /* --- CLKCR Register ---*/ @@ -577,41 +526,40 @@ typedef struct /* SDIO RESP Registers Address */ #define SDIO_RESP_ADDR ((uint32_t)(SDIO_BASE + 0x14)) -/* SDIO Intialization Frequency (400KHz max) */ +/* SDIO Initialization Frequency (400KHz max) */ #define SDIO_INIT_CLK_DIV ((uint8_t)0x76) /* SDIO Data Transfer Frequency (25MHz max) */ #define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x0) +/** + * @} + */ + +/** @defgroup SDMMC_LL_Interrupt_Clock Interrupt And Clock Configuration + * @brief macros to handle interrupts and specific clock configurations + * @{ + */ -/** @defgroup SDIO_Interrupt_Clock - * @brief macros to handle interrupts and specific clock configurations - * @{ - */ - /** * @brief Enable the SDIO device. - * @param None * @retval None */ #define __SDIO_ENABLE() (*(__IO uint32_t *)CLKCR_CLKEN_BB = ENABLE) /** * @brief Disable the SDIO device. - * @param None * @retval None */ #define __SDIO_DISABLE() (*(__IO uint32_t *)CLKCR_CLKEN_BB = DISABLE) /** * @brief Enable the SDIO DMA transfer. - * @param None * @retval None */ #define __SDIO_DMA_ENABLE() (*(__IO uint32_t *)DCTRL_DMAEN_BB = ENABLE) /** * @brief Disable the SDIO DMA transfer. - * @param None * @retval None */ #define __SDIO_DMA_DISABLE() (*(__IO uint32_t *)DCTRL_DMAEN_BB = DISABLE) @@ -798,102 +746,89 @@ typedef struct /** * @brief Enable Start the SD I/O Read Wait operation. - * @param None * @retval None */ #define __SDIO_START_READWAIT_ENABLE() (*(__IO uint32_t *) DCTRL_RWSTART_BB = ENABLE) /** * @brief Disable Start the SD I/O Read Wait operations. - * @param None * @retval None */ #define __SDIO_START_READWAIT_DISABLE() (*(__IO uint32_t *) DCTRL_RWSTART_BB = DISABLE) /** * @brief Enable Start the SD I/O Read Wait operation. - * @param None * @retval None */ #define __SDIO_STOP_READWAIT_ENABLE() (*(__IO uint32_t *) DCTRL_RWSTOP_BB = ENABLE) /** * @brief Disable Stop the SD I/O Read Wait operations. - * @param None * @retval None */ #define __SDIO_STOP_READWAIT_DISABLE() (*(__IO uint32_t *) DCTRL_RWSTOP_BB = DISABLE) /** * @brief Enable the SD I/O Mode Operation. - * @param None * @retval None */ #define __SDIO_OPERATION_ENABLE() (*(__IO uint32_t *) DCTRL_SDIOEN_BB = ENABLE) /** * @brief Disable the SD I/O Mode Operation. - * @param None * @retval None */ #define __SDIO_OPERATION_DISABLE() (*(__IO uint32_t *) DCTRL_SDIOEN_BB = DISABLE) /** * @brief Enable the SD I/O Suspend command sending. - * @param None * @retval None */ #define __SDIO_SUSPEND_CMD_ENABLE() (*(__IO uint32_t *) CMD_SDIOSUSPEND_BB = ENABLE) /** * @brief Disable the SD I/O Suspend command sending. - * @param None * @retval None */ #define __SDIO_SUSPEND_CMD_DISABLE() (*(__IO uint32_t *) CMD_SDIOSUSPEND_BB = DISABLE) - + +#if !defined(STM32F446xx) /** * @brief Enable the command completion signal. - * @param None * @retval None */ #define __SDIO_CEATA_CMD_COMPLETION_ENABLE() (*(__IO uint32_t *) CMD_ENCMDCOMPL_BB = ENABLE) /** * @brief Disable the command completion signal. - * @param None * @retval None */ #define __SDIO_CEATA_CMD_COMPLETION_DISABLE() (*(__IO uint32_t *) CMD_ENCMDCOMPL_BB = DISABLE) /** * @brief Enable the CE-ATA interrupt. - * @param None * @retval None */ #define __SDIO_CEATA_ENABLE_IT() (*(__IO uint32_t *) CMD_NIEN_BB = (uint32_t)0) /** * @brief Disable the CE-ATA interrupt. - * @param None * @retval None */ #define __SDIO_CEATA_DISABLE_IT() (*(__IO uint32_t *) CMD_NIEN_BB = (uint32_t)1) /** * @brief Enable send CE-ATA command (CMD61). - * @param None * @retval None */ #define __SDIO_CEATA_SENDCMD_ENABLE() (*(__IO uint32_t *) CMD_ATACMD_BB = ENABLE) /** * @brief Disable send CE-ATA command (CMD61). - * @param None * @retval None */ #define __SDIO_CEATA_SENDCMD_DISABLE() (*(__IO uint32_t *) CMD_ATACMD_BB = DISABLE) - +#endif /* !defined(STM32F446xx) */ /** * @} */ @@ -903,12 +838,12 @@ typedef struct */ /* Exported functions --------------------------------------------------------*/ -/** @addtogroup SDIO_Exported_Functions +/** @addtogroup SDMMC_LL_Exported_Functions * @{ */ /* Initialization/de-initialization functions **********************************/ -/** @addtogroup HAL_SDIO_Group1 +/** @addtogroup HAL_SDMMC_LL_Group1 * @{ */ HAL_StatusTypeDef SDIO_Init(SDIO_TypeDef *SDIOx, SDIO_InitTypeDef Init); @@ -917,7 +852,7 @@ HAL_StatusTypeDef SDIO_Init(SDIO_TypeDef *SDIOx, SDIO_InitTypeDef Init); */ /* I/O operation functions *****************************************************/ -/** @addtogroup HAL_SDIO_Group2 +/** @addtogroup HAL_SDMMC_LL_Group2 * @{ */ /* Blocking mode: Polling */ @@ -928,7 +863,7 @@ HAL_StatusTypeDef SDIO_WriteFIFO(SDIO_TypeDef *SDIOx, uint32_t *pWriteData); */ /* Peripheral Control functions ************************************************/ -/** @addtogroup HAL_SDIO_Group3 +/** @addtogroup HAL_SDMMC_LL_Group3 * @{ */ HAL_StatusTypeDef SDIO_PowerState_ON(SDIO_TypeDef *SDIOx); diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.c index 9902f0f34bc..8c64e027abf 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.c @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx_ll_usb.c * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief USB Low Layer HAL module driver. * * This file provides firmware functions to manage the following @@ -22,13 +22,13 @@ (#) Call USB_CoreInit() API to initialize the USB Core peripheral. - (#) The upper HAL HCD/PCD driver will call the righ routines for its internal processes. + (#) The upper HAL HCD/PCD driver will call the right routines for its internal processes. @endverbatim ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -167,7 +167,7 @@ HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx) * @param USBx : Selected device * @param mode : current core mode * This parameter can be one of the these values: - * @arg USB_OTG_DEVICE_MODE: Peripheral mode mode + * @arg USB_OTG_DEVICE_MODE: Peripheral mode * @arg USB_OTG_HOST_MODE: Host mode * @arg USB_OTG_DRD_MODE: Dual Role Device mode * @retval HAL status @@ -202,13 +202,27 @@ HAL_StatusTypeDef USB_DevInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef c uint32_t i = 0; /*Activate VBUS Sensing B */ +#if defined(STM32F446xx) + USBx->GCCFG |= USB_OTG_GCCFG_VBDEN; + + if (cfg.vbus_sensing_enable == 0) + { + /*Desactivate VBUS Sensing B */ + USBx->GCCFG &= ~USB_OTG_GCCFG_VBDEN; + + /* B-peripheral session valid override enable*/ + USBx->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN; + USBx->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL; + } +#else USBx->GCCFG |= USB_OTG_GCCFG_VBUSBSEN; if (cfg.vbus_sensing_enable == 0) { USBx->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; } - +#endif /* STM32F446xx */ + /* Restart the Phy Clock */ USBx_PCGCCTL = 0; @@ -779,12 +793,12 @@ HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uin * @param USBx : Selected device * @param src : source pointer * @param ch_ep_num : endpoint or host channel number - * @param len : Noumber of bytes to read + * @param len : Number of bytes to read * @param dma: USB dma enabled or disabled * This parameter can be one of the these values: * 0 : DMA feature not used * 1 : DMA feature used - * @retval pointer to desctination buffer + * @retval pointer to destination buffer */ void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len) { @@ -1121,11 +1135,15 @@ HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef /* Restart the Phy Clock */ USBx_PCGCCTL = 0; - /* no VBUS sensing*/ + /* Activate VBUS Sensing B */ +#if defined(STM32F446xx) + USBx->GCCFG |= USB_OTG_GCCFG_VBDEN; +#else USBx->GCCFG &=~ (USB_OTG_GCCFG_VBUSASEN); USBx->GCCFG &=~ (USB_OTG_GCCFG_VBUSBSEN); USBx->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; - +#endif /* STM32F446xx */ + /* Disable the FS/LS support mode only */ if((cfg.speed == USB_OTG_SPEED_FULL)&& (USBx != USB_OTG_FS)) @@ -1310,7 +1328,7 @@ uint32_t USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx) * @param ep_type : Endpoint Type * This parameter can be one of the these values: * @arg EP_TYPE_CTRL: Control type - * @arg EP_TYPE_ISOC: Isochrounous type + * @arg EP_TYPE_ISOC: Isochronous type * @arg EP_TYPE_BULK: Bulk type * @arg EP_TYPE_INTR: Interrupt type * @param mps : Max Packet Size @@ -1668,7 +1686,7 @@ HAL_StatusTypeDef USB_StopHost(USB_OTG_GlobalTypeDef *USBx) while ((USBx_HC(i)->HCCHAR & USB_OTG_HCCHAR_CHENA) == USB_OTG_HCCHAR_CHENA); } - /* Clear any pending Host interrups */ + /* Clear any pending Host interrupts */ USBx_HOST->HAINT = 0xFFFFFFFF; USBx->GINTSTS = 0xFFFFFFFF; USB_EnableGlobalInt(USBx); diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.h index fe1598efc40..b4cb4130dbb 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_ll_usb.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f4xx_ll_usb.h * @author MCD Application Team - * @version V1.1.0 - * @date 19-June-2014 + * @version V1.3.0 + * @date 09-March-2015 * @brief Header file of USB Core HAL module. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,9 @@ typedef struct uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */ - uint32_t low_power_enable; /*!< Enable or disable the low power mode. */ + uint32_t low_power_enable; /*!< Enable or disable the low power mode. */ + + uint32_t lpm_enable; /*!< Enable or disable Link Power Management. */ uint32_t vbus_sensing_enable; /*!< Enable or disable the VBUS Sensing feature. */ @@ -224,11 +226,11 @@ typedef struct /* Exported constants --------------------------------------------------------*/ -/** @defgroup PCD_Exported_Constants +/** @defgroup PCD_Exported_Constants PCD Exported Constants * @{ */ -/** @defgroup USB_Core_Mode_ +/** @defgroup USB_Core_Mode_ USB Core Mode * @{ */ #define USB_OTG_MODE_DEVICE 0 @@ -238,7 +240,7 @@ typedef struct * @} */ -/** @defgroup USB_Core_Speed_ +/** @defgroup USB_Core_Speed_ USB Core Speed * @{ */ #define USB_OTG_SPEED_HIGH 0 @@ -249,7 +251,7 @@ typedef struct * @} */ -/** @defgroup USB_Core_PHY_ +/** @defgroup USB_Core_PHY_ USB Core PHY * @{ */ #define USB_OTG_ULPI_PHY 1 @@ -258,7 +260,7 @@ typedef struct * @} */ -/** @defgroup USB_Core_MPS_ +/** @defgroup USB_Core_MPS_ USB Core MPS * @{ */ #define USB_OTG_HS_MAX_PACKET_SIZE 512 @@ -268,7 +270,7 @@ typedef struct * @} */ -/** @defgroup USB_Core_Phy_Frequency_ +/** @defgroup USB_Core_Phy_Frequency_ USB Core Phy Frequency * @{ */ #define DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ (0 << 1) @@ -279,7 +281,7 @@ typedef struct * @} */ -/** @defgroup USB_CORE_Frame_Interval_ +/** @defgroup USB_CORE_Frame_Interval_ USB CORE Frame Interval * @{ */ #define DCFG_FRAME_INTERVAL_80 0 @@ -290,7 +292,7 @@ typedef struct * @} */ -/** @defgroup USB_EP0_MPS_ +/** @defgroup USB_EP0_MPS_ USB EP0 MPS * @{ */ #define DEP0CTL_MPS_64 0 @@ -301,7 +303,7 @@ typedef struct * @} */ -/** @defgroup USB_EP_Speed_ +/** @defgroup USB_EP_Speed_ USB EP Speed * @{ */ #define EP_SPEED_LOW 0 @@ -311,7 +313,7 @@ typedef struct * @} */ -/** @defgroup USB_EP_Type_ +/** @defgroup USB_EP_Type_ USB EP Type * @{ */ #define EP_TYPE_CTRL 0 @@ -323,7 +325,7 @@ typedef struct * @} */ -/** @defgroup USB_STS_Defines_ +/** @defgroup USB_STS_Defines_ USB STS Defines * @{ */ #define STS_GOUT_NAK 1 @@ -335,7 +337,7 @@ typedef struct * @} */ -/** @defgroup HCFG_SPEED_Defines_ +/** @defgroup HCFG_SPEED_Defines_ HCFG SPEED Defines * @{ */ #define HCFG_30_60_MHZ 0 @@ -345,7 +347,7 @@ typedef struct * @} */ -/** @defgroup HPRT0_PRTSPD_SPEED_Defines_ +/** @defgroup HPRT0_PRTSPD_SPEED_Defines_ HPRT0 PRTSPD SPEED Defines * @{ */ #define HPRT0_PRTSPD_HIGH_SPEED 0 @@ -380,7 +382,9 @@ typedef struct #define USBx_HOST ((USB_OTG_HostTypeDef *)((uint32_t )USBx + USB_OTG_HOST_BASE)) #define USBx_HC(i) ((USB_OTG_HostChannelTypeDef *)((uint32_t)USBx + USB_OTG_HOST_CHANNEL_BASE + (i)*USB_OTG_HOST_CHANNEL_SIZE)) - +/** + * @} + */ /* Exported macro ------------------------------------------------------------*/ #define USB_MASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK &= ~(__INTERRUPT__)) #define USB_UNMASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK |= (__INTERRUPT__)) From 5b2d25f2019f0f051f608286070ab2f157db7184 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Sun, 26 Apr 2015 01:49:58 +0200 Subject: [PATCH 10/24] [STM32F4xx] update of STM32CubeF4 to version 1.5 - part 3 Adaption of gpio_api to new hal version: register to set/clear a pin is now a single 32bit register --- .../mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_api.c | 7 +++---- .../targets/hal/TARGET_STM/TARGET_STM32F4/gpio_object.h | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_api.c index df6fd9c1f79..7c9f260ba2a 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_api.c @@ -55,10 +55,9 @@ void gpio_init(gpio_t *obj, PinName pin) GPIO_TypeDef *gpio = (GPIO_TypeDef *)gpio_add; // Fill GPIO object structure for future use - obj->mask = gpio_set(pin); - obj->reg_in = &gpio->IDR; - obj->reg_set = &gpio->BSRRL; - obj->reg_clr = &gpio->BSRRH; + obj->mask = gpio_set(pin); + obj->reg_in = &gpio->IDR; + obj->reg_set_clr = &gpio->BSRR; } void gpio_mode(gpio_t *obj, PinMode mode) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_object.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_object.h index bebf7db0c72..ad118d8554e 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_object.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/gpio_object.h @@ -44,17 +44,16 @@ typedef struct { PinName pin; uint32_t mask; __IO uint32_t *reg_in; - __IO uint16_t *reg_set; - __IO uint16_t *reg_clr; + __IO uint32_t *reg_set_clr; } gpio_t; static inline void gpio_write(gpio_t *obj, int value) { MBED_ASSERT(obj->pin != (PinName)NC); if (value) { - *obj->reg_set = obj->mask; + *obj->reg_set_clr = obj->mask; } else { - *obj->reg_clr = obj->mask; + *obj->reg_set_clr = obj->mask << 16; } } From 03ff51f74a4ab09d16b75f462885ce8c54b5bf04 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Sun, 26 Apr 2015 01:52:07 +0200 Subject: [PATCH 11/24] [STM32F4xx] update of STM32CubeF4 to version 1.5 - part 4 Update of all files in target specific folders to new STM32CubeF4 version --- .../TOOLCHAIN_GCC_ARM/startup_stm32f401xc.s | 6 +- .../{stm32f401xe.h => stm32f401xc.h} | 65 ++- .../TARGET_DISCO_F401VC/stm32f4xx.h | 31 +- .../TARGET_DISCO_F401VC/stm32f4xx_hal_conf.h | 406 +++++++++++++++++ .../TARGET_DISCO_F401VC/system_stm32f4xx.h | 7 +- .../TOOLCHAIN_GCC_ARM/startup_stm32f429xx.s | 6 +- .../TARGET_DISCO_F429ZI/stm32f429xx.h | 274 ++++++++---- .../TARGET_DISCO_F429ZI/stm32f4xx.h | 30 +- .../TARGET_DISCO_F429ZI/stm32f4xx_hal_conf.h | 406 +++++++++++++++++ .../TARGET_DISCO_F429ZI/system_stm32f4xx.h | 7 +- .../TARGET_MTS_DRAGONFLY_F411RE/stm32f411xe.h | 53 ++- .../TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx.h | 27 +- .../stm32f4xx_hal_conf.h | 405 +++++++++++++++++ .../system_stm32f4xx.h | 7 +- .../TARGET_MTS_MDOT_F405RG/stm32f405xx.h | 261 +++++++---- .../TARGET_MTS_MDOT_F405RG/stm32f4xx.h | 30 +- .../stm32f4xx_hal_conf.h | 407 ++++++++++++++++++ .../TARGET_MTS_MDOT_F405RG/system_stm32f4xx.h | 7 +- .../TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s | 6 +- .../TARGET_MTS_MDOT_F411RE/stm32f411xe.h | 53 ++- .../TARGET_MTS_MDOT_F411RE/stm32f4xx.h | 27 +- .../stm32f4xx_hal_conf.h | 405 +++++++++++++++++ .../TARGET_MTS_MDOT_F411RE/system_stm32f4xx.h | 7 +- .../TOOLCHAIN_GCC_ARM/startup_stm32f401xe.s | 6 +- .../TARGET_NUCLEO_F401RE/stm32f401xe.h | 45 +- .../TARGET_NUCLEO_F401RE/stm32f4xx.h | 29 +- .../TARGET_NUCLEO_F401RE/stm32f4xx_hal_conf.h | 405 +++++++++++++++++ .../TARGET_NUCLEO_F401RE/system_stm32f4xx.h | 6 +- .../TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s | 6 +- .../TARGET_NUCLEO_F411RE/stm32f411xe.h | 53 ++- .../TARGET_NUCLEO_F411RE/stm32f4xx.h | 27 +- .../TARGET_NUCLEO_F411RE/stm32f4xx_hal_conf.h | 405 +++++++++++++++++ .../TARGET_NUCLEO_F411RE/system_stm32f4xx.h | 7 +- .../TOOLCHAIN_GCC_ARM/startup_stm32f407xx.s | 6 +- .../TARGET_STM32F407VG/stm32f407xx.h | 263 +++++++---- .../TARGET_STM32F407VG/stm32f4xx.h | 40 +- .../TARGET_STM32F407VG/stm32f4xx_hal_conf.h | 407 ++++++++++++++++++ .../TARGET_STM32F407VG/system_stm32f4xx.h | 7 +- .../TOOLCHAIN_GCC_ARM/startup_stm32f439xx.s | 8 +- .../TARGET_UBLOX_C029/stm32f439xx.h | 274 ++++++++---- .../TARGET_UBLOX_C029/stm32f4xx.h | 30 +- .../TARGET_UBLOX_C029/stm32f4xx_hal_conf.h | 406 +++++++++++++++++ .../TARGET_UBLOX_C029/system_stm32f4xx.h | 7 +- 43 files changed, 4842 insertions(+), 528 deletions(-) rename libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/{stm32f401xe.h => stm32f401xc.h} (98%) create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f4xx_hal_conf.h create mode 100644 libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f4xx_hal_conf.h diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/TOOLCHAIN_GCC_ARM/startup_stm32f401xc.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/TOOLCHAIN_GCC_ARM/startup_stm32f401xc.s index 1f5429b405f..a83a8c8c60d 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/TOOLCHAIN_GCC_ARM/startup_stm32f401xc.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/TOOLCHAIN_GCC_ARM/startup_stm32f401xc.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f401xc.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F401xCxx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f401xe.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f401xc.h similarity index 98% rename from libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f401xe.h rename to libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f401xc.h index 4d55bea7dd6..add80683f49 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f401xe.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f401xc.h @@ -1,10 +1,10 @@ /** ****************************************************************************** - * @file stm32f401xe.h + * @file stm32f401xc.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 - * @brief CMSIS STM32F401xExx Device Peripheral Access Layer Header File. + * @version V2.3.0 + * @date 02-March-2015 + * @brief CMSIS STM32F401xCxx Device Peripheral Access Layer Header File. * * This file contains: * - Data structures and the address mapping for all peripherals @@ -14,7 +14,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,12 +45,12 @@ * @{ */ -/** @addtogroup stm32f401xe +/** @addtogroup stm32f401xc * @{ */ -#ifndef __STM32F401xE_H -#define __STM32F401xE_H +#ifndef __STM32F401xC_H +#define __STM32F401xC_H #ifdef __cplusplus extern "C" { @@ -290,8 +290,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -536,7 +535,7 @@ typedef struct __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */ __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */ } WWDG_TypeDef; - + /** * @brief __USB_OTG_Core_register */ @@ -675,7 +674,7 @@ USB_OTG_HostChannelTypeDef; #define SRAM3_BB_BASE ((uint32_t)0x22020000) /*!< SRAM3(64 KB) base address in the bit-band region */ #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */ #define BKPSRAM_BB_BASE ((uint32_t)0x42024000) /*!< Backup SRAM(4 KB) base address in the bit-band region */ -#define FLASH_END ((uint32_t)0x0807FFFF) /*!< FLASH end address */ +#define FLASH_END ((uint32_t)0x0803FFFF) /*!< FLASH end address */ /* Legacy defines */ #define SRAM_BASE SRAM1_BASE @@ -1423,6 +1422,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */ #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */ #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */ +#define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */ +#define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */ +#define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */ /******************* Bit definition for EXTI_EMR register *******************/ #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */ @@ -1445,6 +1447,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */ #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */ #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */ +#define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */ +#define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */ +#define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */ /****************** Bit definition for EXTI_RTSR register *******************/ #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */ @@ -1467,6 +1472,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */ #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */ #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */ +#define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */ +#define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */ +#define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_FTSR register *******************/ #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */ @@ -1489,6 +1497,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */ #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */ #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */ +#define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */ +#define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */ +#define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_SWIER register ******************/ #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */ @@ -1511,6 +1522,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */ #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */ #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */ +#define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */ +#define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */ +#define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */ /******************* Bit definition for EXTI_PR register ********************/ #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */ @@ -1533,6 +1547,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */ #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */ #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */ +#define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */ +#define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */ +#define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */ /******************************************************************************/ /* */ @@ -1954,7 +1971,7 @@ USB_OTG_HostChannelTypeDef; #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000) #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000) -/****************** Bit definition for GPIO_LCKR register ********************/ +/****************** Bit definition for GPIO_LCKR register *********************/ #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001) #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002) #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004) @@ -2125,7 +2142,7 @@ USB_OTG_HostChannelTypeDef; #define PWR_CR_LPLVDS ((uint32_t)0x00000400) /*!< Low Power Regulator Low Voltage in Deep Sleep mode */ #define PWR_CR_MRLVDS ((uint32_t)0x00000800) /*!< Main Regulator Low Voltage in Deep Sleep mode */ #define PWR_CR_ADCDC1 ((uint32_t)0x00002000) /*!< Refer to AN4073 on how to use this bit */ -#define PWR_CR_VOS ((uint32_t)0x0000C000) /*!< VOS[1:0] bits (Regulator voltage scaling output selection) */ +#define PWR_CR_VOS ((uint32_t)0x0000C000) /*!< VOS[1:0] bits (Regulator voltage scaling output selection) */ #define PWR_CR_VOS_0 ((uint32_t)0x00004000) /*!< Bit 0 */ #define PWR_CR_VOS_1 ((uint32_t)0x00008000) /*!< Bit 1 */ @@ -4511,14 +4528,14 @@ USB_OTG_HostChannelTypeDef; ((INSTANCE) == I2C3)) /******************************** I2S Instances *******************************/ -#define IS_I2S_INSTANCE(INSTANCE) (((INSTANCE) == SPI2) || \ +#define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI2) || \ ((INSTANCE) == SPI3)) /*************************** I2S Extended Instances ***************************/ -#define IS_I2S_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ - ((INSTANCE) == SPI3) || \ - ((INSTANCE) == I2S2ext) || \ - ((INSTANCE) == I2S3ext)) +#define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ + ((INSTANCE) == SPI3) || \ + ((INSTANCE) == I2S2ext) || \ + ((INSTANCE) == I2S3ext)) /****************************** RTC Instances *********************************/ #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC) @@ -4728,6 +4745,14 @@ USB_OTG_HostChannelTypeDef; /****************************** WWDG Instances ********************************/ #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG) +/****************************** SDIO Instances ********************************/ +#define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO) + +/****************************** USB Exported Constants ************************/ +#define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8 +#define USB_OTG_FS_MAX_IN_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_MAX_OUT_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */ /** * @} @@ -4745,7 +4770,7 @@ USB_OTG_HostChannelTypeDef; } #endif /* __cplusplus */ -#endif /* __STM32F401xE_H */ +#endif /* __STM32F401xC_H */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx.h index ab25d6e092d..0c7d396d03e 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File. * * The file is the unique include file that the application programmer @@ -18,7 +18,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,13 +63,20 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ @@ -80,9 +87,11 @@ STM32F439NI, STM32F429IG and STM32F429II Devices */ /* #define STM32F439xx */ /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, STM32F439NI, STM32F439IG and STM32F439II Devices */ - /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ -#define STM32F401xE /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ - /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + #define STM32F401xC /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ + /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ + /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -94,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -139,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..7d4cec5f8b7 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/stm32f4xx_hal_conf.h @@ -0,0 +1,406 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.2.1 + * @date 13-March-2015 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/TOOLCHAIN_GCC_ARM/startup_stm32f429xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/TOOLCHAIN_GCC_ARM/startup_stm32f429xx.s index e4036386c60..c431df8da02 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/TOOLCHAIN_GCC_ARM/startup_stm32f429xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/TOOLCHAIN_GCC_ARM/startup_stm32f429xx.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f429xx.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F429xx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f429xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f429xx.h index 52f89604b33..647565dfc17 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f429xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f429xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f429xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F429xx Device Peripheral Access Layer Header File. * * This file contains: @@ -14,7 +14,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -598,8 +598,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1940,72 +1939,128 @@ USB_OTG_HostChannelTypeDef; #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!
© COPYRIGHT(c) 2014 STMicroelectronics
+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,27 +63,35 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ - #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ /* #define STM32F417xx */ /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */ /* #define STM32F427xx */ /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG and STM32F427II Devices */ /* #define STM32F437xx */ /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */ -#define STM32F429xx /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG, + #define STM32F429xx /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG, STM32F439NI, STM32F429IG and STM32F429II Devices */ /* #define STM32F439xx */ /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ - /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -95,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -140,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..8f67be411c0 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/stm32f4xx_hal_conf.h @@ -0,0 +1,406 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.2.1 + * @date 13-March-2015 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f411xe.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f411xe.h index 0615611891c..9ba378ecc86 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f411xe.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f411xe.h @@ -2,19 +2,19 @@ ****************************************************************************** * @file stm32f411xe.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F411xExx Device Peripheral Access Layer Header File. * * This file contains: * - Data structures and the address mapping for all peripherals * - Peripheral's registers declarations and bits definition - * - Macros to access peripheral’s registers hardware + * - Macros to access peripheral’s registers hardware * ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,12 +45,12 @@ * @{ */ -/** @addtogroup stm32f411xe +/** @addtogroup stm32f401xe * @{ */ -#ifndef __STM32F411xE_H -#define __STM32F411xE_H +#ifndef __STM32F401xE_H +#define __STM32F401xE_H #ifdef __cplusplus extern "C" { @@ -291,8 +291,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1427,6 +1426,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */ #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */ #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */ +#define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */ +#define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */ +#define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */ /******************* Bit definition for EXTI_EMR register *******************/ #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */ @@ -1449,6 +1451,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */ #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */ #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */ +#define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */ +#define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */ +#define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */ /****************** Bit definition for EXTI_RTSR register *******************/ #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */ @@ -1471,6 +1476,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */ #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */ #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */ +#define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */ +#define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */ +#define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_FTSR register *******************/ #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */ @@ -1493,6 +1501,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */ #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */ #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */ +#define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */ +#define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */ +#define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_SWIER register ******************/ #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */ @@ -1515,6 +1526,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */ #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */ #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */ +#define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */ +#define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */ +#define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */ /******************* Bit definition for EXTI_PR register ********************/ #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */ @@ -1537,6 +1551,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */ #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */ #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */ +#define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */ +#define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */ +#define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */ /******************************************************************************/ /* */ @@ -4531,17 +4548,17 @@ USB_OTG_HostChannelTypeDef; ((INSTANCE) == I2C3)) /******************************** I2S Instances *******************************/ -#define IS_I2S_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \ +#define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \ ((INSTANCE) == SPI2) || \ ((INSTANCE) == SPI3) || \ ((INSTANCE) == SPI4) || \ ((INSTANCE) == SPI5)) /*************************** I2S Extended Instances ***************************/ -#define IS_I2S_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ - ((INSTANCE) == SPI3) || \ - ((INSTANCE) == I2S2ext) || \ - ((INSTANCE) == I2S3ext)) +#define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ + ((INSTANCE) == SPI3) || \ + ((INSTANCE) == I2S2ext) || \ + ((INSTANCE) == I2S3ext)) /****************************** RTC Instances *********************************/ @@ -4754,6 +4771,14 @@ USB_OTG_HostChannelTypeDef; /****************************** WWDG Instances ********************************/ #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG) +/****************************** SDIO Instances ********************************/ +#define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO) + +/****************************** USB Exported Constants ************************/ +#define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8 +#define USB_OTG_FS_MAX_IN_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_MAX_OUT_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx.h index ad048acd249..f0f9aebae25 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File. * * The file is the unique include file that the application programmer @@ -18,7 +18,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,13 +63,20 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ @@ -82,7 +89,9 @@ STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ -#define STM32F411xE /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + #define STM32F411xE /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -94,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -139,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..9d286f18ffa --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/stm32f4xx_hal_conf.h @@ -0,0 +1,405 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.1.0 + * @date 26-December-2014 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f405xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f405xx.h index 77fe4deebfd..9c8273bd952 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f405xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f405xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f405xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F405xx Device Peripheral Access Layer Header File. * * This file contains: @@ -14,7 +14,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -454,8 +454,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1688,72 +1687,128 @@ USB_OTG_HostChannelTypeDef; #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!
© COPYRIGHT(c) 2014 STMicroelectronics
+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,15 +63,21 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ - #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) -#define STM32F405xx /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) + #define STM32F405xx /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ /* #define STM32F417xx */ /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */ @@ -83,7 +89,9 @@ STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ - /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -95,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -140,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..637cd7ce76d --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/stm32f4xx_hal_conf.h @@ -0,0 +1,407 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.2.1 + * @date 13-March-2015 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 0 /* The prefetch will be enabled in SystemClock_Config(), depending on the used + STM32F405/415/07/417 device: RevA (prefetch must be off) or RevZ (prefetch can be on/off) */ +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s index c4efa431ccc..8950a21b6b1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f411xe.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F411xExx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f411xe.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f411xe.h index 0615611891c..9ba378ecc86 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f411xe.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f411xe.h @@ -2,19 +2,19 @@ ****************************************************************************** * @file stm32f411xe.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F411xExx Device Peripheral Access Layer Header File. * * This file contains: * - Data structures and the address mapping for all peripherals * - Peripheral's registers declarations and bits definition - * - Macros to access peripheral’s registers hardware + * - Macros to access peripheral’s registers hardware * ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,12 +45,12 @@ * @{ */ -/** @addtogroup stm32f411xe +/** @addtogroup stm32f401xe * @{ */ -#ifndef __STM32F411xE_H -#define __STM32F411xE_H +#ifndef __STM32F401xE_H +#define __STM32F401xE_H #ifdef __cplusplus extern "C" { @@ -291,8 +291,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1427,6 +1426,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */ #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */ #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */ +#define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */ +#define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */ +#define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */ /******************* Bit definition for EXTI_EMR register *******************/ #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */ @@ -1449,6 +1451,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */ #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */ #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */ +#define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */ +#define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */ +#define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */ /****************** Bit definition for EXTI_RTSR register *******************/ #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */ @@ -1471,6 +1476,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */ #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */ #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */ +#define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */ +#define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */ +#define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_FTSR register *******************/ #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */ @@ -1493,6 +1501,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */ #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */ #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */ +#define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */ +#define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */ +#define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_SWIER register ******************/ #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */ @@ -1515,6 +1526,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */ #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */ #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */ +#define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */ +#define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */ +#define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */ /******************* Bit definition for EXTI_PR register ********************/ #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */ @@ -1537,6 +1551,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */ #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */ #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */ +#define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */ +#define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */ +#define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */ /******************************************************************************/ /* */ @@ -4531,17 +4548,17 @@ USB_OTG_HostChannelTypeDef; ((INSTANCE) == I2C3)) /******************************** I2S Instances *******************************/ -#define IS_I2S_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \ +#define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \ ((INSTANCE) == SPI2) || \ ((INSTANCE) == SPI3) || \ ((INSTANCE) == SPI4) || \ ((INSTANCE) == SPI5)) /*************************** I2S Extended Instances ***************************/ -#define IS_I2S_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ - ((INSTANCE) == SPI3) || \ - ((INSTANCE) == I2S2ext) || \ - ((INSTANCE) == I2S3ext)) +#define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ + ((INSTANCE) == SPI3) || \ + ((INSTANCE) == I2S2ext) || \ + ((INSTANCE) == I2S3ext)) /****************************** RTC Instances *********************************/ @@ -4754,6 +4771,14 @@ USB_OTG_HostChannelTypeDef; /****************************** WWDG Instances ********************************/ #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG) +/****************************** SDIO Instances ********************************/ +#define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO) + +/****************************** USB Exported Constants ************************/ +#define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8 +#define USB_OTG_FS_MAX_IN_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_MAX_OUT_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx.h index ad048acd249..f0f9aebae25 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File. * * The file is the unique include file that the application programmer @@ -18,7 +18,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,13 +63,20 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ @@ -82,7 +89,9 @@ STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ -#define STM32F411xE /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + #define STM32F411xE /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -94,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -139,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..9d286f18ffa --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/stm32f4xx_hal_conf.h @@ -0,0 +1,405 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.1.0 + * @date 26-December-2014 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/TOOLCHAIN_GCC_ARM/startup_stm32f401xe.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/TOOLCHAIN_GCC_ARM/startup_stm32f401xe.s index 16f18883be4..75415e42b6e 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/TOOLCHAIN_GCC_ARM/startup_stm32f401xe.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/TOOLCHAIN_GCC_ARM/startup_stm32f401xe.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f401xe.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F401xExx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f401xe.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f401xe.h index 4d55bea7dd6..c8678951093 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f401xe.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f401xe.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f401xe.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F401xExx Device Peripheral Access Layer Header File. * * This file contains: @@ -14,7 +14,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -290,8 +290,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1423,6 +1422,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */ #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */ #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */ +#define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */ +#define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */ +#define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */ /******************* Bit definition for EXTI_EMR register *******************/ #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */ @@ -1445,6 +1447,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */ #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */ #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */ +#define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */ +#define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */ +#define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */ /****************** Bit definition for EXTI_RTSR register *******************/ #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */ @@ -1467,6 +1472,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */ #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */ #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */ +#define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */ +#define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */ +#define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_FTSR register *******************/ #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */ @@ -1489,6 +1497,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */ #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */ #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */ +#define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */ +#define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */ +#define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_SWIER register ******************/ #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */ @@ -1511,6 +1522,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */ #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */ #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */ +#define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */ +#define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */ +#define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */ /******************* Bit definition for EXTI_PR register ********************/ #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */ @@ -1533,6 +1547,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */ #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */ #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */ +#define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */ +#define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */ +#define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */ /******************************************************************************/ /* */ @@ -4511,14 +4528,14 @@ USB_OTG_HostChannelTypeDef; ((INSTANCE) == I2C3)) /******************************** I2S Instances *******************************/ -#define IS_I2S_INSTANCE(INSTANCE) (((INSTANCE) == SPI2) || \ +#define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI2) || \ ((INSTANCE) == SPI3)) /*************************** I2S Extended Instances ***************************/ -#define IS_I2S_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ - ((INSTANCE) == SPI3) || \ - ((INSTANCE) == I2S2ext) || \ - ((INSTANCE) == I2S3ext)) +#define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ + ((INSTANCE) == SPI3) || \ + ((INSTANCE) == I2S2ext) || \ + ((INSTANCE) == I2S3ext)) /****************************** RTC Instances *********************************/ #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC) @@ -4728,6 +4745,14 @@ USB_OTG_HostChannelTypeDef; /****************************** WWDG Instances ********************************/ #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG) +/****************************** SDIO Instances ********************************/ +#define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO) + +/****************************** USB Exported Constants ************************/ +#define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8 +#define USB_OTG_FS_MAX_IN_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_MAX_OUT_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx.h index ab25d6e092d..96f69184ac4 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File. * * The file is the unique include file that the application programmer @@ -18,7 +18,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,13 +63,20 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ @@ -81,8 +88,10 @@ /* #define STM32F439xx */ /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ -#define STM32F401xE /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ - /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + #define STM32F401xE /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ + /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -94,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -139,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..3a7ecf5313a --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/stm32f4xx_hal_conf.h @@ -0,0 +1,405 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.2.0 + * @date 26-December-2014 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/system_stm32f4xx.h index a015696a76c..0b2ce8103d1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s index c4efa431ccc..8950a21b6b1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/TOOLCHAIN_GCC_ARM/startup_stm32f411xe.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f411xe.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F411xExx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f411xe.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f411xe.h index 0615611891c..9ba378ecc86 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f411xe.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f411xe.h @@ -2,19 +2,19 @@ ****************************************************************************** * @file stm32f411xe.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F411xExx Device Peripheral Access Layer Header File. * * This file contains: * - Data structures and the address mapping for all peripherals * - Peripheral's registers declarations and bits definition - * - Macros to access peripheral’s registers hardware + * - Macros to access peripheral’s registers hardware * ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,12 +45,12 @@ * @{ */ -/** @addtogroup stm32f411xe +/** @addtogroup stm32f401xe * @{ */ -#ifndef __STM32F411xE_H -#define __STM32F411xE_H +#ifndef __STM32F401xE_H +#define __STM32F401xE_H #ifdef __cplusplus extern "C" { @@ -291,8 +291,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1427,6 +1426,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */ #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */ #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */ +#define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */ +#define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */ +#define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */ /******************* Bit definition for EXTI_EMR register *******************/ #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */ @@ -1449,6 +1451,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */ #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */ #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */ +#define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */ +#define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */ +#define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */ /****************** Bit definition for EXTI_RTSR register *******************/ #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */ @@ -1471,6 +1476,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */ #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */ #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */ +#define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */ +#define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */ +#define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_FTSR register *******************/ #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */ @@ -1493,6 +1501,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */ #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */ #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */ +#define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */ +#define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */ +#define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */ /****************** Bit definition for EXTI_SWIER register ******************/ #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */ @@ -1515,6 +1526,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */ #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */ #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */ +#define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */ +#define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */ +#define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */ /******************* Bit definition for EXTI_PR register ********************/ #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */ @@ -1537,6 +1551,9 @@ USB_OTG_HostChannelTypeDef; #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */ #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */ #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */ +#define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */ +#define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */ +#define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */ /******************************************************************************/ /* */ @@ -4531,17 +4548,17 @@ USB_OTG_HostChannelTypeDef; ((INSTANCE) == I2C3)) /******************************** I2S Instances *******************************/ -#define IS_I2S_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \ +#define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \ ((INSTANCE) == SPI2) || \ ((INSTANCE) == SPI3) || \ ((INSTANCE) == SPI4) || \ ((INSTANCE) == SPI5)) /*************************** I2S Extended Instances ***************************/ -#define IS_I2S_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ - ((INSTANCE) == SPI3) || \ - ((INSTANCE) == I2S2ext) || \ - ((INSTANCE) == I2S3ext)) +#define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \ + ((INSTANCE) == SPI3) || \ + ((INSTANCE) == I2S2ext) || \ + ((INSTANCE) == I2S3ext)) /****************************** RTC Instances *********************************/ @@ -4754,6 +4771,14 @@ USB_OTG_HostChannelTypeDef; /****************************** WWDG Instances ********************************/ #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG) +/****************************** SDIO Instances ********************************/ +#define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO) + +/****************************** USB Exported Constants ************************/ +#define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8 +#define USB_OTG_FS_MAX_IN_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_MAX_OUT_ENDPOINTS 4 /* Including EP0 */ +#define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */ /** * @} diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx.h index ad048acd249..f0f9aebae25 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File. * * The file is the unique include file that the application programmer @@ -18,7 +18,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,13 +63,20 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ @@ -82,7 +89,9 @@ STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ -#define STM32F411xE /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + #define STM32F411xE /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -94,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -139,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..9d286f18ffa --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/stm32f4xx_hal_conf.h @@ -0,0 +1,405 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.1.0 + * @date 26-December-2014 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2014 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/TOOLCHAIN_GCC_ARM/startup_stm32f407xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/TOOLCHAIN_GCC_ARM/startup_stm32f407xx.s index 0017727af74..d1dda571705 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/TOOLCHAIN_GCC_ARM/startup_stm32f407xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/TOOLCHAIN_GCC_ARM/startup_stm32f407xx.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f407xx.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F407xx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f407xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f407xx.h index ea75f73abdf..b557dd26fe1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f407xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f407xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f407xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F407xx Device Peripheral Access Layer Header File. * * This file contains: @@ -14,7 +14,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -549,8 +549,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -1790,72 +1789,128 @@ USB_OTG_HostChannelTypeDef; #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!
© COPYRIGHT(c) 2014 STMicroelectronics
+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,17 +63,23 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ - #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ - #define STM32F407xx /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ + #define STM32F407xx /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ /* #define STM32F417xx */ /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */ /* #define STM32F427xx */ /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG and STM32F427II Devices */ /* #define STM32F437xx */ /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */ @@ -83,7 +89,9 @@ STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ - /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -95,20 +103,20 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0RC2 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x02) /*!< [7:0] release candidate */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\ - |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\ - |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\ - |(__CMSIS_DEVICE_HAL_VERSION_RC)) +#define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ + |(__STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 << 16)\ + |(__STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 << 8 )\ + |(__STM32F4xx_CMSIS_DEVICE_VERSION)) /** * @} @@ -140,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..637cd7ce76d --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/stm32f4xx_hal_conf.h @@ -0,0 +1,407 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.2.1 + * @date 13-March-2015 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 0 /* The prefetch will be enabled in SystemClock_Config(), depending on the used + STM32F405/415/07/417 device: RevA (prefetch must be off) or RevZ (prefetch can be on/off) */ +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/system_stm32f4xx.h index af7e4497ad1..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0RC2 - * @date 14-May-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/TOOLCHAIN_GCC_ARM/startup_stm32f439xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/TOOLCHAIN_GCC_ARM/startup_stm32f439xx.s index d87c5c9d7eb..e295ef58495 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/TOOLCHAIN_GCC_ARM/startup_stm32f439xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/TOOLCHAIN_GCC_ARM/startup_stm32f439xx.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32f439xx.s * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief STM32F439xx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP @@ -16,7 +16,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT 2014 STMicroelectronics

+ *

© COPYRIGHT 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -567,4 +567,4 @@ Infinite_Loop: - \ No newline at end of file + diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f439xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f439xx.h index 41b6e65e070..d9b251092bb 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f439xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f439xx.h @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f439xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS STM32F439xx Device Peripheral Access Layer Header File. * * This file contains: @@ -14,7 +14,7 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -599,8 +599,7 @@ typedef struct __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ - __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ - __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ + __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */ } GPIO_TypeDef; @@ -2015,72 +2014,128 @@ USB_OTG_HostChannelTypeDef; #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!
© COPYRIGHT(c) 2014 STMicroelectronics
+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,14 +63,20 @@ /** @addtogroup Library_configuration_section * @{ */ + +/** + * @brief STM32 Family + */ +#if !defined (STM32F4) +#define STM32F4 +#endif /* STM32F4 */ /* Uncomment the line below according to the target STM32 device used in your application */ - #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \ !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \ - !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) + !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx) /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */ /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */ /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */ @@ -79,11 +85,13 @@ /* #define STM32F437xx */ /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */ /* #define STM32F429xx */ /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG, STM32F439NI, STM32F429IG and STM32F429II Devices */ -#define STM32F439xx /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, + #define STM32F439xx /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, STM32F439NI, STM32F439IG and STM32F439II Devices */ /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */ /* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */ - /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */ + /* #define STM32F446xx */ /*!< STM32F446MC, STM32F446ME, STM32F446RC, STM32F446RE, STM32F446VC, STM32F446VE, STM32F446ZC, + and STM32F446ZE Devices */ #endif /* Tip: To avoid modifying this file each time you need to switch between these @@ -95,14 +103,14 @@ In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers */ -#define USE_HAL_DRIVER + #define USE_HAL_DRIVER #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.1.0 + * @brief CMSIS Device version number V2.3.0 */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ -#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */ +#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\ @@ -140,6 +148,8 @@ #include "stm32f401xe.h" #elif defined(STM32F411xE) #include "stm32f411xe.h" +#elif defined(STM32F446xx) + #include "stm32f446xx.h" #else #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" #endif diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f4xx_hal_conf.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f4xx_hal_conf.h new file mode 100644 index 00000000000..8d902c90840 --- /dev/null +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/stm32f4xx_hal_conf.h @@ -0,0 +1,406 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @author MCD Application Team + * @version V1.2.1 + * @date 13-March-2015 + * @brief HAL configuration file + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 1 +#define DATA_CACHE_ENABLE 1 + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0 +#define MAC_ADDR2 0 +#define MAC_ADDR3 0 +#define MAC_ADDR4 0 +#define MAC_ADDR5 0 + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) + +#define PHY_READ_TO ((uint32_t)0x0000FFFF) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/system_stm32f4xx.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/system_stm32f4xx.h index a015696a76c..ea2f070a6b7 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/system_stm32f4xx.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/system_stm32f4xx.h @@ -2,13 +2,13 @@ ****************************************************************************** * @file system_stm32f4xx.h * @author MCD Application Team - * @version V2.1.0 - * @date 19-June-2014 + * @version V2.3.0 + * @date 02-March-2015 * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© COPYRIGHT(c) 2015 STMicroelectronics

* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc extern void SystemInit(void); extern void SystemCoreClockUpdate(void); extern void SetSysClock(void); - /** * @} */ From 0074b34e34514f966d5b7658cade0055d69c9b6c Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Tue, 28 Apr 2015 11:18:16 +0100 Subject: [PATCH 12/24] Silabs - Fix unblock/block declaration, implement gpio_is_connected --- .../TARGET_EFM32/gpio_api.c | 1 + .../TARGET_EFM32/gpio_irq_api.c | 1 + .../TARGET_EFM32/gpio_object.h | 4 +++ .../TARGET_EFM32/i2c_api.c | 1 + .../TARGET_EFM32/rtc_api.c | 1 + .../TARGET_EFM32/serial_api.c | 5 +-- .../TARGET_Silicon_Labs/TARGET_EFM32/sleep.c | 1 + .../TARGET_EFM32/sleepmodes.h | 32 +++++++++++++++++++ .../TARGET_EFM32/spi_api.c | 1 + .../TARGET_EFM32/us_ticker.c | 1 + 10 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleepmodes.h diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_api.c index c403072c468..48e5c06a99b 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_api.c @@ -17,6 +17,7 @@ #include "pinmap.h" #include "em_cmu.h" #include "mbed_assert.h" +#include "sleepmodes.h" uint8_t gpio_get_index(gpio_t *obj) { diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_irq_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_irq_api.c index 2d1bc7d0521..cfeef109866 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_irq_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_irq_api.c @@ -25,6 +25,7 @@ #include "em_int.h" #include "em_cmu.h" #include "sleep_api.h" +#include "sleepmodes.h" #define NUM_GPIO_CHANNELS (16) #define GPIO_LEAST_ACTIVE_SLEEPMODE EM3 diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h index 836f9274c2a..556050518b9 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_object.h @@ -48,6 +48,10 @@ static inline int gpio_read(gpio_t *obj) } } +static inline int gpio_is_connected(const gpio_t *obj) { + return obj->pin != (PinName)NC; +} + #ifdef __cplusplus } #endif diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c index e9969ff32db..114027348af 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c @@ -24,6 +24,7 @@ #include "i2c_api.h" #include "PeripheralPins.h" #include "pinmap_function.h" +#include "sleepmodes.h" #include "em_i2c.h" #include "em_cmu.h" diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/rtc_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/rtc_api.c index 08003b8f9bb..611be66d0c8 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/rtc_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/rtc_api.c @@ -22,6 +22,7 @@ #include "em_cmu.h" #include "em_rtc.h" #include "sleep_api.h" +#include "sleepmodes.h" static bool rtc_inited = false; static time_t time_base = 0; diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c index 184c45c220b..9f5d73166be 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c @@ -36,6 +36,7 @@ #include "dma_api.h" #include "sleep_api.h" #include "buffer.h" +#include "sleepmodes.h" #define SERIAL_LEAST_ACTIVE_SLEEPMODE EM1 #define SERIAL_LEAST_ACTIVE_SLEEPMODE_LEUART EM2 @@ -227,7 +228,7 @@ inline IRQn_Type serial_get_rx_irq_index(serial_t *obj) default: MBED_ASSERT(0); } - return 0; + return (IRQn_Type)0; } /** @@ -270,7 +271,7 @@ inline IRQn_Type serial_get_tx_irq_index(serial_t *obj) default: MBED_ASSERT(0); } - return 0; + return (IRQn_Type)0; } /** diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c index 4d2cde67eec..015da0cf0ac 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c @@ -18,6 +18,7 @@ #if DEVICE_SLEEP #include "sleep_api.h" +#include "sleepmodes.h" #include "cmsis.h" #include "em_emu.h" #include "em_int.h" diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleepmodes.h b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleepmodes.h new file mode 100644 index 00000000000..2dafe153afe --- /dev/null +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleepmodes.h @@ -0,0 +1,32 @@ +/* mbed Microcontroller Library + * Copyright (c) 2015 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef MBED_SLEEPMODES_H +#define MBED_SLEEPMODES_H + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void blockSleepMode(sleepstate_enum minimumMode); +void unblockSleepMode(sleepstate_enum minimumMode); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c index 471570cbd2b..67a4dd5be6c 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c @@ -30,6 +30,7 @@ #include "em_cmu.h" #include "em_dma.h" #include "sleep_api.h" +#include "sleepmodes.h" static uint16_t fill_word = SPI_FILL_WORD; #define SPI_LEAST_ACTIVE_SLEEPMODE EM1 diff --git a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c index c2c84c7c7c7..0667adef50b 100644 --- a/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c +++ b/libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c @@ -23,6 +23,7 @@ #include "device.h" #include "clocking.h" #include "sleep_api.h" +#include "sleepmodes.h" #define TIMER_LEAST_ACTIVE_SLEEPMODE EM1 /** From c741044c6ed5d2dce4dbc62ff107db9d75209a67 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Wed, 29 Apr 2015 09:03:18 +0100 Subject: [PATCH 13/24] Nucleo L053R8 - multiple definition error for PLLMulTable fix --- .../cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c index f48f17eb5a2..84df4bb76e8 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c @@ -118,8 +118,8 @@ /** @defgroup RCC_Private_Vatiables RCC Private Data * @{ */ -const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; -const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; +static const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +static const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @} From 06501a428582f2c344effaea0944ef6f6e439cb3 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Thu, 9 Apr 2015 07:51:10 +0100 Subject: [PATCH 14/24] update to s130 alpha --- .../TARGET_MCU_NORDIC_16K/nRF51822.sct | 6 +- .../TARGET_MCU_NORDIC_32K/nRF51822.sct | 6 +- .../TARGET_MCU_NORDIC_16K/NRF51822.ld | 4 +- .../TARGET_MCU_NORDIC_32K/NRF51822.ld | 4 +- .../s130_nrf51_1.0.0-3.alpha_softdevice.hex | 6851 +++++++++++++++++ 5 files changed, 6861 insertions(+), 10 deletions(-) create mode 100644 libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct index 62638400f2a..799bc9f68d0 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct @@ -12,13 +12,13 @@ ; ;WITH SOFTDEVICE: -LR_IROM1 0x18000 0x0028000 { - ER_IROM1 0x18000 0x0028000 { +LR_IROM1 0x1D000 0x0023000 { + ER_IROM1 0x1D000 0x0023000 { *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } - RW_IRAM1 0x20002000 0x00002000 { + RW_IRAM1 0x20002800 0x00001800 { .ANY (+RW +ZI) } } diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct index 6dd0642fd1e..adf992cc7dd 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct @@ -12,13 +12,13 @@ ; ;WITH SOFTDEVICE: -LR_IROM1 0x18000 0x0028000 { - ER_IROM1 0x18000 0x0028000 { +LR_IROM1 0x1D000 0x0023000 { + ER_IROM1 0x1D000 0x0023000 { *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } - RW_IRAM1 0x20002000 0x00006000 { + RW_IRAM1 0x20002800 0x00005800 { .ANY (+RW +ZI) } } diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld index cb472e56404..af6c21698e1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld @@ -2,8 +2,8 @@ MEMORY { - FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000 - RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x2000 + FLASH (rx) : ORIGIN = 0x0001D000, LENGTH = 0x23000 + RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x1800 } OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld index 812a86d4e3c..eea7ec83891 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld @@ -2,8 +2,8 @@ MEMORY { - FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000 - RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x6000 + FLASH (rx) : ORIGIN = 0x0001D000, LENGTH = 0x23000 + RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x5800 } OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex new file mode 100644 index 00000000000..859c9e344b0 --- /dev/null +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex @@ -0,0 +1,6851 @@ +:020000040000FA +:10000000C0070000D1060000D1000000B1060000CA +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000005107000078 +:100030000000000000000000DB000000E500000000 +:10004000EF000000F9000000030100000D010000B6 +:1000500017010000210100002B0100003501000004 +:100060003F01000049010000530100005D01000054 +:1000700067010000710100007B01000085010000A4 +:100080008F01000099010000A3010000AD010000F4 +:10009000B7010000C1010000CB010000D501000044 +:1000A000DF010000E9010000F3010000FD01000094 +:1000B00007020000110200001B02000025020000E0 +:1000C0001FB5C046C04600F0EFFA04B00FB41FBD24 +:1000D00008205A49096809580847382057490968CB +:1000E000095808473C2055490968095808474020E5 +:1000F0005249096809580847442050490968095875 +:10010000084748204D490968095808474C204B4981 +:10011000096809580847502048490968095808479C +:100120005420464909680958084758204349096836 +:10013000095808475C204149096809580847602068 +:100140003E4909680958084764203C49096809582C +:100150000847682039490968095808476C20374919 +:100160000968095808477020344909680958084740 +:100170007420324909680958084778202F490968CE +:10018000095808477C202D490968095808478020EC +:100190002A490968095808478420284909680958E4 +:1001A0000847882025490968095808478C202349B1 +:1001B00009680958084790202049096809580847E4 +:1001C00094201E4909680958084798201B49096866 +:1001D000095808479C201949096809580847A02070 +:1001E0001649096809580847A4201449096809589C +:1001F0000847A8201149096809580847AC200F4949 +:10020000096809580847B0200C4909680958084787 +:10021000B4200A49096809580847B82007490968FD +:1002200009580847BC2005490968095808470000D3 +:1002300003480449024A034B7047000000000020B5 +:10024000C0070000C00700000122D84B5A6000BF61 +:10025000D74A1268002AFBD0016000BFD44A126856 +:10026000002AFBD00022D14B5A6000BFD04A12684E +:10027000002AFBD07047F0B505460E46174600240D +:1002800006E0A200B158A2005019FFF7DDFF641C80 +:10029000BC42F6D30020F0BD0120C043C549086030 +:1002A000401048607047014601229204086890425D +:1002B00001D9102070470020FCE7F0B505460C4638 +:1002C0001646002706E028462168FFF7BDFF2D1DD2 +:1002D000241D7F1CB742F6D3F0BD70B505460C4611 +:1002E0002E460BE0304600F075F9FF2C01D80024B3 +:1002F00001E0FF3C013C012080023618002CF1D1C6 +:1003000070BD0146012212044868904201D90920BB +:100310007047A9484069401C01D10F20F8E7002030 +:10032000F6E7FEB504462068030000F037FA05043E +:100330002B4249598B00201DFFF7E3FF0546002D96 +:1003400001D02846FEBDFFF7A7FF0120C00200F044 +:1003500041F9042221469948FFF78DFF002801D07A +:100360000320EFE708222146944800F06DF90028A9 +:1003700006D1002192480068FFF766FF00F00CF9F3 +:100380000320DFE7A768E6686068019031463846D9 +:10039000FFF7A3FF324638460199FFF78EFFB20000 +:1003A0003846019900F050F9002800D1CAE703202F +:1003B000C8E700F0E3F9834800688349086041E03A +:1003C00060680190E668A0680090B200009901980A +:1003D00000F03AF90746002F00D1B3E70E20B1E74D +:1003E000201DFFF760FF0546002D01D02846A9E734 +:1003F0006068002807D1FFF74FFF0320800200F05C +:10040000E9F800F0C9F8FFF747FF0120C00200F04B +:10041000E1F8042221466948FFF72DFF002801D0AA +:1004200003208FE708222146644800F00DF90028D8 +:1004300006D1002162480068FFF706FF00F0ACF823 +:1004400003207FE700BF00207CE770B505460C461F +:10045000182D04D12068FFF764FF206002E001201E +:10046000206000BF00BF70BDF0B589B05248406940 +:1004700003905248806881000398081802900398FE +:10048000000B01900121090302984018401E000B47 +:1004900000900124002520462946019A00F0C4F866 +:1004A0000022401E91410791069001260027304608 +:1004B0003946009A00F0B8F80022401E914105919B +:1004C0000490049BDB43059AD2430698184307998E +:1004D00011430791069037490698086007984860CD +:1004E00009B0F0BD70B53448446934488568466841 +:1004F000AA003146204600F0A7F8002801D00020CD +:1005000070BD0120FCE72D484068002801D0012083 +:1005100000E000200546FFF7E5FF002807D0FFF7C1 +:10052000BBFE0320800200F055F800F035F8FFF71D +:100530009BFF002D0ED020484669204884684768FC +:1005400021463046FFF7C9FE224639463046FFF7BE +:10055000B4FE00BF00F020F810B5184844681A48EF +:100560000460204600F0DCF810BD15480068006803 +:10057000401C01D100BFFEE710480068002802D0EF +:10058000042806D101E0FFF7BEFFFFF7E5FF00BF3B +:10059000FEE700BF00BFFEE7BFF34F8F0B480C49DB +:1005A000C860BFF34F8F00BFFEE7000000E50140C9 +:1005B00000E40140000600400010001000080000A8 +:1005C000B8070000BC070000000000200400FA0586 +:1005D00000ED00E010B50146104B1A6808460223F2 +:1005E0000F4C636000BF0F4B1B68002BFBD0531CEC +:1005F00004D0904202D20A4B186101E0084B986087 +:1006000000BF084B1B68002BFBD00023044C636029 +:1006100000BF044B1B68002BFBD010BD0010001066 +:1006200000E5014000E4014010B5202A04DB01464A +:10063000203A9140002010BD914020239C1A03468F +:10064000E3401943904010BD034610B50B439B0790 +:100650000FD1042A0DD308C810C9121FA342F8D025 +:1006600018BA21BA884201D9012010BD0020C04328 +:1006700010BD002A03D0D30703D0521C07E000208E +:1006800010BD03780C78401C491C1B1B07D1037854 +:100690000C78401C491C1B1B01D1921EF1D118463D +:1006A00010BD70477047704710B500F007F810BDD7 +:1006B000014B1B68DB6818470000002019481A49E5 +:1006C0007047FFF7FBFFFFF7FBFC00BD20BFFDE716 +:1006D0001649174C24688C420BD1164B1B68994263 +:1006E0000CD1154B154A1360186810498842EDD09B +:1006F0000AE0134880F30888124B18470F4A13602A +:1007000018680A498842E1D080F308880E49884277 +:1007100004DD0E48026802210A4302605B68184744 +:100720000346DFE7C0070000C0070000FFFFFFFF30 +:10073000000C000014100010001000000000002049 +:10074000000400206B05000000200020240500406C +:100750000D48704502D1EFF3098101E0EFF3088104 +:10076000886902380078182802D1C046074A104725 +:10077000074A12682C3212681047000000B5054B7A +:10078000054A9B58984700BDFDFFFFFF4B04000042 +:1007900000000020001000000400000030B4744687 +:1007A000641E2578641CAB4204D3635D5B00E318D0 +:1007B00030BC18471D46F8E7000C00000010000090 +:10100000F021002065B101005D220000CBB001009D +:1010100000000000000000000000000000000000D0 +:10102000000000000000000000000000D5B1010039 +:1010300000000000000000005D2200005D220000B2 +:1010400041B2010047B201005D2200005D220000B4 +:101050005D2200005D2200005D2200005D22000094 +:101060004DB201005D2200005D22000053B201007C +:101070005D22000059B201005FB2010065B20100BB +:101080005D2200005D2200005D2200005D22000064 +:101090005D2200005D2200005D2200005D22000054 +:1010A0006BB2010071B201005D2200005D22000000 +:1010B0005D2200005D2200005D2200005D22000034 +:1010C00000F002F81AF02FF80CA030C808382418E5 +:1010D0002D18A246671EAB4654465D46AC4201D170 +:1010E0001AF021F87E460F3E0FCCB6460126334259 +:1010F00000D0FB1AA246AB4633431847E4A20100D6 +:1011000014A30100103A02D378C878C1FAD8520764 +:1011100001D330C830C101D504680C6070470000AD +:101120000023002400250026103A01D378C1FBD803 +:10113000520700D330C100D50B6070471FB5C046C1 +:10114000C04619F092FF04B00FB41FBDF0B4404682 +:10115000494652465B460FB402A0013001B506482D +:10116000004700BF01BC86460FBC804689469246B8 +:101170009B46F0BC70470000C11000008269024924 +:101180008161024810447047911100000100000085 +:1011900001B41EB400B501F000FF01B40198864609 +:1011A00001BC01B01EBD0000401E00BF00BF00BF5B +:1011B00000BF00BF00BF00BF00BF00BF00BF00BF37 +:1011C00000BFF1D17047000070B505460C461646C9 +:1011D00002E00FCC0FC5103E102EFAD2082E02D31B +:1011E00003CC03C5083E042E07D301CC01C5361F2E +:1011F00003E021782970641C6D1C761EF9D270BD45 +:101200008307FF22DB0E9A408907090E99400028C8 +:101210000BDA0007000F0838830828489B001818CD +:10122000C36993430B43C3617047830824489B0001 +:101230001B181868904308431860704710B504469F +:1012400000210120FFF7DCFF00211820FFF7D8FF65 +:1012500000210B20FFF7D4FF02211920FFF7D0FF58 +:1012600002210D20FFF7CCFF02210E20FFF7C8FF5F +:1012700002210F20FFF7C4FF0221C81FFFF7C0FFA4 +:1012800003211620FFF7BCFF03211520FFF7B8FF4D +:10129000204600F019F8002010BD6621018070473B +:1012A00010B500F020F810BD0648704710B500F0EA +:1012B00022F810BD704770477047000000ED00E055 +:1012C00000E400E003F9004370B505462D4C08200A +:1012D0002070A01CFFF7E1FF5920A080294620467E +:1012E00000F0B3FB70BD10B500F0B8FB254900203D +:1012F000891E087010BDF8B5224E0446B61E30781F +:1013000001270D46002807D0204660380B2808D852 +:10131000204600F059FF2BE0602CF9D01A480860F5 +:10132000F8BD20466C38032803D8204600F08DFF16 +:101330001EE0204670381F2803D8204600F047F9E9 +:1013400016E0204690380F2803D8204600F0EAF82F +:101350000EE02046A0380F2803D8204600F076F88B +:1013600006E02046B0380F2804D8204600F0E2F905 +:10137000286000E02F60602CD2D128680028CFD1EF +:101380003770F8BD1A000020013000000120254907 +:10139000C003086024490020087007202349C005C5 +:1013A0008860704770B5204D04462878A04207D069 +:1013B000002C05D0002803D01DA14D2019F07FFE80 +:1013C0002878A0420ED000211E4A18482C70002C0C +:1013D0001BD01D4B012C06D0022C0DD014A168206F +:1013E00019F06DFE70BD116002211160536103217F +:1013F00009068160416070BD116003211160536175 +:101400000121C9058160416070BD11601160072133 +:10141000C905816070BD10B505A1712019F04FFE9E +:1014200010BD000080E100E02000002000F5014038 +:101430007372635C68616C5F63636D5F6161722E80 +:101440006300000000F500408401002010B5A038C2 +:10145000030019F055FF0B070E172028313A414BB6 +:10146000525C65004B6808788A68194603F0D9F920 +:1014700010BD88888A6883B20888194680B203F054 +:10148000DFF910BD08884C68CB688A6880B22146B5 +:1014900003F0DAF910BD08884B688A6880B21946F3 +:1014A00003F0EEF910BD88888A6883B2088819466F +:1014B00080B203F0FAF910BD88888A6883B2088880 +:1014C000194680B203F034FA10BD08884A6880B229 +:1014D000114603F073FA10BD088982B2888883B27E +:1014E0000888194680B203F074FA10BD08884A686B +:1014F00080B2114603F091FA10BD08894C6882B29F +:101500000888CB6880B2214603F00AFB10BD08882A +:101510004C68CB688A6880B2214603F01BFC10BD82 +:10152000012010BD10B59038030019F0E9FE09063E +:101530000F161D242C363F464E0088888A6883B2D9 +:101540000888194680B204F01DF910BD08884A6861 +:1015500080B2114604F051F910BD08884A6880B283 +:10156000114604F056F910BD08884A6880B2114649 +:1015700004F05CF910BD08884B688A6880B219468F +:1015800004F067F910BD088982B2888883B20888A0 +:10159000194680B204F066F910BD08894B6882B222 +:1015A0000888194680B204F07CF910BD08884A68A2 +:1015B00080B2114604F087F910BD888882B208888D +:1015C000114680B204F0DBF910BD012010BD10B54A +:1015D0007038030019F094FE1B0F15192125282FD0 +:1015E000363B4044484C53585F68707881889095EA +:1015F000999CA2A5AC004A680878114607F017FC30 +:1016000010BD086807F064FC10BD0C790B7B8A687C +:101610000868214607F06DFC10BD086807F0FEFC65 +:1016200010BD07F08AF910BD08884A6880B21146DB +:1016300007F032FE10BD0A790888114680B207F023 +:10164000C2FE10BD087840B207F0CBFE10BD08887E +:1016500080B207F0DFFE10BD086807F0EDFE10BD98 +:10166000086801F0ECFB10BD086801F016FC10BD25 +:10167000088982B209C9194607F0F6FE10BD05C9EE +:10168000114607F040FF10BD08884A6880B2114635 +:1016900009F002FA10BD0C790888CB688A6880B21C +:1016A000214609F0C4FA10BD0B7908888A6880B217 +:1016B000194609F074FC10BD08884B688A6880B22E +:1016C000194609F0E5FC10BD08884C68CB688A68AB +:1016D00080B2214609F04AFD10BD08884A6880B2F0 +:1016E000114609F083FD10BD0B7908880A7A80B293 +:1016F000194607F02BFF10BD088880B207F02BFFBA +:1017000010BD086807F02EFF10BD07F0FAF810BDF5 +:101710008A6809C9194607F08AFF10BD07F0DAF890 +:1017200010BD08884A6880B2114608F059F810BD0B +:10173000012010BD10B5B02805D0B12808D0B228BE +:101740000BD0012010BD088880B20AF04EF910BD00 +:10175000088880B20AF068F910BD08884B688A686A +:1017600080B219460AF071F910BD000010B50300EF +:1017700019F0C6FD0A0609060C0C0F0F0606061224 +:1017800007F003F910BD09F01FFF10BD01F042FA88 +:1017900010BD06F075FA10BDFAA1FE4819F08FFCD5 +:1017A00010BD7FB5FC49054603C901900291132085 +:1017B000800169468881F94A0F2310460A2128389A +:1017C0000AF03BFE0024F6480AF055FE641CE4B221 +:1017D0000A2CF8D304200090F04801231A4603A9EC +:1017E000F0300AF055FA002804D0FF20E5A153306C +:1017F00019F065FC686800F024FC00211E220846F0 +:1018000004F040F907F0C4FA02222421E54801F06F +:101810007FFBE44801222C214C3001F079FBE149A7 +:101820000B20B03901F000FA002804D0FF20D5A128 +:10183000673019F044FC09F097FE02F075F901AB2E +:1018400000220821D8A007F083F9002804D0FF2047 +:10185000CCA16D3019F033FC284602F0C2FC002800 +:1018600004D0FF20C7A16F3019F029FCDB218900CB +:10187000D04819F0F9FACF48012141710221817154 +:101880000621C1717FBD10B5CA4CA078092804D3C8 +:10189000FF20BCA1A73019F012FC2078602148433A +:1018A000001900210173417BF722C908C900C91C36 +:1018B0001140EF22114041730121E1700C3010BD45 +:1018C00070B50E4600211C4619801546030019F01C +:1018D00017FD0723050B1711231D23002246294658 +:1018E000304609F08EFE70BD22462946304606F08D +:1018F00096FE70BD22462946304601F0C2FF70BDFB +:1019000022462946304603F0C0FD70BD22462946D6 +:10191000304600F010FC70BD9E489AA1D53819F0F1 +:10192000CEFB032070BD70B5A24CE078002818D023 +:101930002078602148430019407B00254007400F74 +:1019400001190879401E08712078401CC0B220702F +:10195000092800D12570A078401CA0700AF011FF62 +:10196000E57070BD9348C079002800D08BE77047C0 +:1019700070B5904DA86800280CD0FFF7F3FF002841 +:1019800062D06022A968FFF71FFCFFF7CCFF0020A0 +:10199000A860EFE76879002856D0FFF774FF044687 +:1019A00080484C3001F0C4FA6060002804D1C9209E +:1019B00074A1800019F083FB60680AF0E2F8002847 +:1019C0000DD0204606F00FFD6078010703D5C00852 +:1019D000C000401C2BE0734861684C302DE071481A +:1019E00061684C3001F0ADFA00F05AFB00282BD1B1 +:1019F000FFF749FF04466B4801F09AFA606000283F +:101A000004D164485FA16D3019F059FB60680AF099 +:101A1000BCF8002814D0606800886080204609F077 +:101A200023FE6078010706D5C008C000801C6070E6 +:101A3000FFF779FF9EE75B48616801F082FA99E75A +:101A40005848616801F07DFA70BD10B55A4CE160EC +:101A5000A0605A4800F034FC607010BD5649002068 +:101A60000870704770B5564E0546706A94B00C46C3 +:101A7000401C04D1B06AC0430004000C0BD0306A93 +:101A8000C007C00F2870706A19F0F0F9B06A2071B1 +:101A9000000A607114E02B206946087009A96846A5 +:101AA0000AF043F8002804D0972036A1800019F0EE +:101AB00006FB0120287006220AA9204619F075F9B4 +:101AC0002878002803D06079C0210843607114B0E1 +:101AD00070BDF0B53A4C0646206895B00D463746C5 +:101AE0000837401C08D16068401C05D1A068401C24 +:101AF00002D1E068401C11D02068314619F0B6F9D7 +:101B00006068311D19F0B2F9A068394619F0AEF9D4 +:101B1000E06831460C3119F0A9F925E02B2069461F +:101B2000087009A968460AF000F8002804D019488E +:101B300014A1553819F0C3FA08220AA9304619F041 +:101B400034F92B206946087009A9684609F0EDFFB1 +:101B5000002804D0A3200BA1800019F0B0FA0822BD +:101B60000AA9384619F021F920692E460836401C8A +:101B700029D16069401C26D1A069401C23D1E069AD +:101B8000401C1FE07372635C686F73745F636F72F5 +:101B9000652E6300DA0200001CB30100D8010020AA +:101BA0006D170000A40B00206E52463531383232DA +:101BB00000000000880700202400002071190000A8 +:101BC0008000001012D02069294619F04FF9606991 +:101BD000291D19F04BF9A069314619F047F9E06960 +:101BE00029460C3119F042F915B0F0BD2B24684696 +:101BF000047009A909F099FF002803D0F649F748B5 +:101C000019F05DFA082209AF28460AA919F0CDF8A3 +:101C10006846047009A909F088FF002804D0EF483D +:101C2000ED49C01D19F04BFA0822391D304619F054 +:101C3000BCF8D9E770B5EA4C0546A068002804D086 +:101C40000320E549000219F03AFAA56070BD10B50D +:101C50000146E44801F075F9E1498879401CC0B2B9 +:101C60008871012803D1E048407800F04DFB10BD99 +:101C700070B50446DD4816460D46814204D1D7486A +:101C8000D549CB3019F01BFA012E05D0E120D249FD +:101C9000800019F014FA70BD6620207000202072B8 +:101CA000A5810120A07370BD70B515460C4606468F +:101CB000FFF758FE00280CD06621017046800121F4 +:101CC000017221680161A18881820573FFF72BFEF3 +:101CD00070BD1321304607F076FB70BDC2494968DC +:101CE000884201D210207047032101700020704704 +:101CF00070B5BD4C05462078002694B0002801D070 +:101D00000820E4E6BA4A6260954201D21020DEE67D +:101D10006868002809D00921D82804D3C31C9B086F +:101D20009B00834205D00846D1E60320400268604C +:101D30000EE0012109074B6B896B4B43AD49511AEA +:101D40000122591AD202891A814201D20421EAE7FA +:101D500000F052FF6178A0680CF042FBE068401E82 +:101D600007280BD8302269460A70887068460DF043 +:101D700044FF002802D009A80CF0EFFC2846FFF72A +:101D800010FD012020703046A1E6F8B504469648C3 +:101D90000F464068814208D3002C01D0844204D30E +:101DA000E01C80088000A04201D01020F8BD8C48C3 +:101DB0008178002911D039880091417860225143FF +:101DC0000D18287B0C350007000F3B4600222946E2 +:101DD000FFF776FD060004D015E0002038800520CE +:101DE000F8BD002C13D039880098814201D90C2607 +:101DF0000DE028783B460007000F22462946FFF7F2 +:101E00005FFD060005D00C2E01D000203880304642 +:101E1000F8BD734C6078401CC0B26070092801D1D5 +:101E200000206070A078401EA07068784107490FBC +:101E300001290ED0022906D003291AD066496E481E +:101E400019F03DF9E3E7C006E1D46868FFF7FFFE4B +:101E5000DDE7644869684C3001F073F86079401C34 +:101E6000C0B260710128D2D15F48407800F04CFACE +:101E7000CDE7E079401CE071C9E7604A10B59042B7 +:101E800009D3594A0124A4045268A04201D39042C4 +:101E900001D3914201D2102010BD00F0FEFE10BD12 +:101EA000564B10B5994209D34F4B0124A4045B68EB +:101EB000A14201D3994201D39A4201D2102010BD10 +:101EC000022803D0102801D0092010BD00F00BFF1C +:101ED0000028FAD0052010BD484B10B598420DD30C +:101EE000414B0124A4045B68A04201D3984205D36E +:101EF000994203D3002A03D09A4201D2102010BD88 +:101F000000F017FF0028FAD0072010BD10B50446D6 +:101F1000354894B04068844202D2102014B010BDFD +:101F20000F2008A9087369460BA809F0FEFD0028D8 +:101F3000F4D16846007A207068464089608068461F +:101F40008089A0800020E9E710B500290BD0264A3F +:101F50005268914202D30B68934201D2102010BD07 +:101F60008A88002A02D001F037FE10BD092010BD7A +:101F700010B5224A94B091420ED31B4A01239B0410 +:101F80005268994201D3914206D3441E1E2C41D877 +:101F9000994203D3914201D21020BFE7012837D1E3 +:101FA00008780024C007C00F002803D0032069462A +:101FB000887001E06846847038206946087009A975 +:101FC000684609F0B2FD002804D004480CA18B3803 +:101FD00019F075F82046A1E7841B0000AA02000052 +:101FE00088070020A40B002024000020FFFF000031 +:101FF00000220020000000202104000000D0010089 +:102000007372635C686F73745F636F72652E6300D5 +:10201000072083E70246203A1F2AF9D806F0FFFD81 +:102020007CE710B5604A5268914201D2102010BD81 +:102030000246203A1F2A02D806F066FE10BD07208D +:1020400010BD70B50546594C002020702046461939 +:1020500055484660E01C80088000A04204D0FF2064 +:102060005349293019F02BF801200007C06AC043FA +:102070000006000E03D14F480068401C03D04E48B4 +:102080004E49301AC862A8B20422214604F00DF964 +:10209000002804D0FF204649393019F010F870BDEF +:1020A000F0B595B03B2008A9087369460BA809F064 +:1020B0003CFD002804D0FF203D49813018F0FFFF8F +:1020C0003F4E00246D4630E02F19B87DC10706D081 +:1020D000400704D460004019C08809F0E1FB39488A +:1020E000807900281FD0B87D80071CD5600040197A +:1020F000C0880022062109F0EFFB002813D03C2104 +:1021000008A8017360004019C1886846C185694606 +:102110000BA809F00AFD06000BD0FF2024499630D9 +:1021200018F0CDFF05E0641CE4B268460079A042D7 +:10213000CAD8304658E5F7B50546007800270009AB +:102140000C463E46062804D0FF201949BF3018F03F +:10215000B6FF287A00280ED0012814D0FF20144999 +:10216000E03018F0ACFF0298002C068001D02780E8 +:1021700066800020FEBD02270926002C10D0A88909 +:10218000A080A87B0AE003271426002C08D06888CA +:10219000A0802869E060A88A2082287B2072E2E77C +:1021A00002980680E5E700002400002000220020BD +:1021B000002000000010001000000020000500407A +:1021C000043000008807002010B56038030019F0C3 +:1021D00097F80A060A0F13181F252930353A0868A0 +:1021E000FFF786FD10BD05C91146FFF7CEFD10BDF6 +:1021F0000868FFF773FD10BD05C91146FFF73DFEE6 +:1022000010BD4B6808788A681946FFF749FE10BD73 +:102210008A6809C91946FFF75FFE10BD0868FFF715 +:1022200075FE10BD08884A6880B21146FFF78CFE23 +:1022300010BD05C91146FFF79BFE10BD05C911462B +:10224000FFF7EFFE10BD012010BD01207047000018 +:102250000E4A12680C498A420AD118470B4A126882 +:10226000094B9A4204D101B500F08EFE03BC8E46A4 +:10227000074909680958084706480749054A064BAF +:102280007047000000000000BEBAFECA64000020D3 +:1022900004000020F0210020F021002001203F490F +:1022A000400608603E4908603E490A68FF231B0259 +:1022B0009A4383121A430A6038498039086070478C +:1022C00010B502460420384904E0C3005B181B79AE +:1022D000002B0AD00346401EC0B2002BF5D133A11B +:1022E000432018F0ECFEFF2010BDC300CA500022AE +:1022F00059184A718A7101220A7110BD2A4A0021B7 +:10230000C00080180171704710B50446042803D33B +:1023100026A1522018F0D3FE2348E1000C182079A2 +:10232000012803D021A1532018F0C9FE6079A179BA +:10233000401CC0B2814200D06071012017494006A4 +:102340008031086010BD70B5164804250068164E2F +:102350000004800F1B4C02281AD014A1692018F029 +:10236000AEFE15E02078C10088190279012A07D154 +:10237000427983799A4203D04279827170588047BA +:102380002078401CC0B22070042801D300202070A7 +:1023900028466D1EEDB20028E4D170BD80E100E05A +:1023A00080E200E018E400E0200C00207372635C1F +:1023B000736F635F7369676E616C6C696E672E63C0 +:1023C000000000003400002010B5EFF31080C407B7 +:1023D000E40F72B6D2484178491C41704078012818 +:1023E00001D10AF0F3F9002C00D162B610BD70B52E +:1023F000CB4CE07800280AD10125E570FFF7E4FF17 +:102400000AF0ECF9002804D000200AF0BFF90020FF +:1024100070BDC44865714560F9E770B5EFF3108091 +:10242000C507ED0F72B6BE4C6078002803D1BEA17F +:102430008F2018F044FE6078401E6070607800289D +:1024400001D10AF0C7F9002D00D162B670BD10B5F8 +:10245000B348C178002904D000214171C170FFF751 +:10246000DCFF002010BD10B504460AF0B7F9AC49F6 +:10247000C978084000D001202060002010BDF8B5C8 +:102480000246A74C0026A67108200421012510272A +:10249000130018F035FF0D080A0C0E101214161E4A +:1024A000262123252800257122E0022001E0217148 +:1024B0001EE020711CE027711AE02020F9E70126B8 +:1024C00016E0FFF781FF0AF089F90028FBD0022609 +:1024D0000EE02171A5710BE02771FBE7202000E0E1 +:1024E00040202071F6E7FF208FA1763018F0E7FD3D +:1024F0000AF080F9002809D00AF082F9B04205D12B +:1025000030460AF080F90028FAD02CE0012080073C +:10251000C560894900224A60884A9661814B02223F +:102520005A60856086480269D243D206D51702698F +:1025300010231A4302610F466D1C00E020BF78682B +:102540000028FBD030460AF05EF90028FAD0002DB2 +:1025500004D17B48026910218A430261714902203B +:10256000886000207860A07900280CD00AF036F945 +:1025700005460AF093F8734A002D02D0A260E0608D +:1025800001E0E260A060002E01D100F0A5F8F8BDE6 +:1025900010B504460AF028F9002805D0604901204A +:1025A000C8704A78521C4A702046FFF768FF10BD79 +:1025B000F8B5614DA8680026012802D1AE600AF086 +:1025C000E5F86868012800D16E6028680127544C3E +:1025D000012812D12E606079002803D000200AF073 +:1025E000D5F866712078002807D00AF0F7F800289F +:1025F00003D0012080070761A770286901282AD12C +:102600002E6100F05FF8012080074761A079002863 +:1026100015D00AF0E3F800900AF040F8009900297C +:1026200001D0E16800E0A168411A022901DA8A1CA0 +:1026300011DC0099002901D0E06000E0A060FFF704 +:10264000C3FE0AF0CBF8002804D001208007076100 +:10265000A77000E02770E868012812D100F032F876 +:1026600000F030F800F02EF8A078002804D1FF2008 +:102670002DA1033018F023FDEE60A6702670FFF741 +:10268000CCFEF8BD10B5264CE078002801D10AF048 +:10269000A1F801208107886100F014F8A0780028D3 +:1026A0000BD0254CE068002803D10AF0ACF80028D4 +:1026B000F8D10020E06000F005F800201949C0437F +:1026C000886010BD08B55020694608806A461088A9 +:1026D000411E1180FAD208BDF8B51248192787604B +:1026E000154900200860C8600AF078F8BE07012488 +:1026F0000B4D002802D03461AC7000E02C70FFF765 +:1027000063FE084847600D4928798863FFF7DAFFC0 +:10271000B461FFF7D7FF0849002008617461F8BD74 +:1027200038000020000300407372635C736F635FC6 +:10273000636C6F636B2E6300000100400005004076 +:1027400000ED00E0FFFFFF7F8107C90E002808DAD7 +:102750000007000F083880082E4A80008018C069E2 +:1027600004E080082C4A800080180068C8400006F9 +:10277000800F704710B50D20FFF7E6FFC4B20420AC +:10278000C043FFF7E1FFC0B2844203D023A11A2067 +:1027900018F095FC26490120486010BD0121254A0A +:1027A00048031060244B00221A60244A5160244AD6 +:1027B0001060244A11601F49803908607047012168 +:1027C0001C4A480310601F4A51601B4A00211160D7 +:1027D0001B490860704710B517490868012804D0E4 +:1027E0000EA1572018F06BFC10BD11488068002224 +:1027F000C0B20A6009F0B6FC10BD10B50E48016801 +:102800000029FCD0FFF7E7FF01200D4940030860D5 +:1028100010BD000000ED00E000E400E07372635CB6 +:10282000736F635F68616C5F726E672E6300000098 +:1028300000D5004080E100E000D1004000D300401E +:1028400080E200E000D0004030B40121BC48C90261 +:102850000160CD1005604A030260BA4803681B029C +:102860001B0A036004680023240A24020460B6489B +:102870000468240A24020460B4480124446084608B +:10288000B34C23606360A360B24B19601D601A6093 +:10289000B14B19601A600121016030BC704710B45F +:1028A0000121A748CA0202600B0203600C06046003 +:1028B000A64841608160A94841680029FCD1A4492B +:1028C0000020086048608860A248026003600460DD +:1028D00010BC704701219F48C9020160C910016006 +:1028E0007047002805D0012805D0022805D19C4852 +:1028F00070479C4870479C48704710B59BA18B203F +:1029000018F0DDFB002010BD70B500219E4C9F4DDE +:102910009F4A8F4B002808D001281DD0022822D0C2 +:1029200092A1B32018F0CBFB70BD01200004A06081 +:10293000A86011601960974BC2039A60964A906034 +:102940007F4A0012106095480160864801609448F3 +:1029500001609448017070BD01204004A060A8602F +:102960005160596070BD01208004A060A860916032 +:10297000996070BDF8B59446834A8B4F834D00240F +:102980000126002808D0012832D0022840D077A1A3 +:10299000E82018F094FBF8BD891E0902090A0120FD +:1029A000000490603C6468606C4A1164012B1DD087 +:1029B00000217C4A7D4B51706146DC63DE637C4BB9 +:1029C0005C6002249C6004241C61744B3D311960DE +:1029D00073490E605F4B891519606F4B58605E48F4 +:1029E00001606C49C00548601670F8BD0121E0E740 +:1029F0000120704E4004704F012B04D134645060AC +:102A000068603964F8BD9060346468603964F8BD0A +:102A100001206A4E80046A4F012BF4D1EEE74F4843 +:102A20004068704770B54A4D28680026564C01280A +:102A300006D1A068C00303D501200004A0602E6069 +:102A40006868012809D1A068800306D501204004E8 +:102A5000A0606E6001200AF0AAFEA868012809D1D2 +:102A6000A068400306D501208004A060AE6002206B +:102A70000AF09DFE70BD10B54A490878002818D0AC +:102A80000120444AC0079060434AC00B90602C4A22 +:102A900000121060414A00201060324A1060404A23 +:102AA000106008704A78002A02D048700AF07FFE51 +:102AB00010BD0320FAE70120424900060860704774 +:102AC0000120244900060860704701203D49400567 +:102AD0000860704701201F4940050860704733496E +:102AE0000020C86388151B4908607047410A364AB0 +:102AF000C005C00D5043801C5143400A0818704760 +:102B000010B4324C430B63431B0C5C020C602E4C24 +:102B10006343C31A2E485C0258432B4B400D43437A +:102B2000E31A0124DB0324041B191B1613700A6823 +:102B30001018086010BC704710B50AF00BFF10BDEC +:102B400080E100E008E400E018E400E000B00040AC +:102B500040B1004080E200E000E100E000B500404C +:102B600048B100404081004044B100407372635C52 +:102B700072656D5F68616C5F6576656E745F7469C0 +:102B80006D65722E6300000000B3004040B300404A +:102B900040B5004000F50140008300404085004002 +:102BA000008200404800002000B10040C08F00407B +:102BB0000085004004B1004004B5004008B1004069 +:102BC00008B5004000E200E0093D00003786000043 +:102BD0006F0C010010B50AF0A9FE10BD00200449D9 +:102BE000C863012001218140024A116000BF704783 +:102BF000C01F004080E200E010B50DF05FF909F061 +:102C0000EFF9FEF7C3FB0FF0F7FA0DF091FF0DF0AF +:102C10001DFF10BD70B50C46054603F0A7FA21460E +:102C200028460EF0C4FF70BD70B50D46040012D0EA +:102C3000002D10D02101284618F014F91022544913 +:102C4000284618F0B2F85248012108380180448023 +:102C50004560002070BD012070BD70B54C4E002451 +:102C60000546083E11E0716820014018817BAA7B6F +:102C7000914209D1C17BEA7B914205D10C222946C0 +:102C800018F066F8002806D0641C30888442EADB1D +:102C90000020C04370BD204670BD70B50D460600D3 +:102CA0000AD0002D08D03A4C083C20886188401C8E +:102CB000884203D9042070BD102070BD3046FFF754 +:102CC000CCFF002801DB401C0AE02088616800017D +:102CD00040181022314618F068F82088401C2080E7 +:102CE0002870002070BD70B514460D001FD0002C58 +:102CF0001DD00021A170022802D0102817D108E0B1 +:102D0000687829780002084311D00121A170108051 +:102D10000BE02846FFF7A1FF002808DB401CA0704D +:102D2000687B297B000208432080002070BD0120C1 +:102D300070BD70B5054614460E000AD000203070F4 +:102D4000A878012807D004D9114908390A88904287 +:102D50000BD9012070BD002C04D028782070288861 +:102D6000000A50700220087010E0002C0CD0496856 +:102D70000001411810222046103918F016F8287862 +:102D800020732888000A607310203070002070BD06 +:102D9000540000205A4910B5884207D30121890404 +:102DA000884205D357490968884201D2102010BDD6 +:102DB0000146012005F0C9F810BD30B5044693B0B6 +:102DC00000200D46079014210BA818F04DF81C2187 +:102DD000684618F049F86A461120107700205077AD +:102DE000107802210843107007A80C90012008AA4F +:102DF000907245486A4610850AA80B902088108476 +:102E000060885084A0889084E088D084907FF921E5 +:102E10000840801C4008400090770820908610876A +:102E200008A80F9010AA0BA9684600F05CFF0028C4 +:102E300003D110A800882880002013B030BD3EB513 +:102E400004460820694608802D48844207D30120A3 +:102E50008004844205D32B480068844201D21020AC +:102E60003EBD2146012005F070F80028F8D12088E9 +:102E7000694688806088C880A0880881E088488189 +:102E800005F063FE01AB6A46002101F0BBFB694619 +:102E900009880829E4D003203EBD1FB50446002060 +:102EA000029008206946088115480391844207D39F +:102EB00001208004844206D312480068844202D272 +:102EC000102004B010BD05F040FE014602AA0F48D4 +:102ED00001F02EFD0028F4D169460989082901D0A6 +:102EE0000320EEE7694609882180694649886180A8 +:102EF00069468988A1806946C988E180E1E70000C8 +:102F000000D0010028000020042A0000FFFF00007C +:102F100010B5031D03600020521E04E05C181C6005 +:102F2000401C2346C0B29042F8DB0020186010BD60 +:102F300001460A680020002A02D0104612680A6082 +:102F4000704702680A6001607047000010B50146D2 +:102F50002022094817F029FF07490020C8770846B2 +:102F600010BD0649012048610548064A01689142A2 +:102F700001D1002101607047B00E00200005004023 +:102F800064000020BEBAFECA0C4908784A78401C8A +:102F9000C0B2904200D008707047094A074820BF6D +:102FA00040BF20BF4178037843701368002B02D1E3 +:102FB00003788B42F3D00020704700006B000020A4 +:102FC00000E200E00A4A022151600A490B68002B26 +:102FD000FCD0906008680028FCD000205060086891 +:102FE0000028FCD0704701200007406970470000AE +:102FF00000E5014000E401407047704770477047AA +:1030000010FFFFFFDBE5B15100D001006600FFFFBC +:1030100003B40148019001BD09000020002803D03D +:103020008178012939D101E0102070470188FE4ADA +:10303000881A914233D01BDCFC4A881A91422ED068 +:103040000BDC00292BD00320C002081A27D001284E +:1030500025D001210903401A07E001281FD00228CA +:103060001DD0FF281BD0FF380138002815D116E0ED +:10307000FF220132811A904211D008DC01280ED0C3 +:1030800002280CD0FE280AD0FF2806D107E001292B +:1030900005D0022903D0032901D0002070470F205A +:1030A000704700B50B2826D009DC030018F028F97A +:1030B0000B1D2125251B25292325271F1B00112832 +:1030C0001BD008DC0C2816D00D281CD00F2814D0DB +:1030D000102808D10FE0822809D084280FD0852835 +:1030E0000FD0872811D0032000BD002000BD05208F +:1030F00000BDCF4800BD072000BD0F2000BD04204B +:1031000000BD062000BD0C2000BD0D20800200BDCA +:1031100070B500290BD0CB1FFA3B81241E46CDB2DF +:10312000112B1BD2012805D0022806D009E000206F +:1031300010701DE0FF20043001E0FF2003308142C9 +:1031400018D0330018F0DCF81116131316131616E6 +:103150001316161613131313161316000846FF380A +:1031600081381F2803D9FF39FE39022902D815708A +:10317000002070BD1470072070BD00B5030018F06A +:10318000BFF8060406040C080A0C002000BD11203C +:1031900000BD072000BD082000BD032000BD007851 +:1031A0000207120F04D0012A05D0022A0AD10EE02C +:1031B000000907D108E00009012805D0022803D042 +:1031C000032801D0072070470870002070470620B0 +:1031D0007047002807D0012807D0022807D003280D +:1031E00007D007207047002004E0112002E02120D2 +:1031F00000E0312008700020704738B50C4605000B +:103200004FD06946FFF7CBFF002822D12088032149 +:1032100089028843694609788907090D0843208097 +:103220006946681CFFF7BBFF002812D121880320E4 +:1032300000038143684600788007800C01432180A9 +:10324000A8784007820F2020012A03D0022A03D049 +:10325000072038BD814300E00143218088B2010589 +:10326000890F08D0012189038843A9780907C90F6C +:1032700089030843208080B28104890F0AD0A9788D +:103280004004C906C90F400CC903084320808004CC +:10329000800F02D12088400403D5208840210843B4 +:1032A0002080002038BD70B50446002008801546F7 +:1032B0006068FFF7A2FF002815D12189A08981420B +:1032C00010D861688978C90708D00121490288426D +:1032D00008D8491C17F0D2FD298009E0FF21FF31F1 +:1032E000884201D90C2070BDFF30FF3003302880A8 +:1032F000002070BD10B5137804785B08E4075B000C +:10330000E40F23431370FD2423400478A407E40F43 +:10331000640023431370FB24234004786407E40F04 +:10332000A40023431370F724234004782407E40FF8 +:10333000E40023431370EF2423400478E406E40FF1 +:10334000240123431370DF2423400478A406E40FF0 +:103350006401234313700078BF244006C00F23404C +:10336000800103431370002906D00878C10701D1FA +:10337000800701D5012000E00020C0015906490E58 +:103380000843107010BD30B50A8803239B020488DF +:103390009A4323059D0F02D1A3049C0F01D09B0FDC +:1033A00000E001239B021A4303230A801B039A4374 +:1033B00003889804840F02D11805830F01D0800F71 +:1033C00000E00120000302430A8030BDF3B593B052 +:1033D0000D000FD0139800280FD01221284617F0A7 +:1033E00041FD03AAFF21012003F0D5F80024264661 +:1033F00037467AE0102015B0F0BD0720FBE768469D +:10340000807D01280BD16846818A0520C002081AF8 +:1034100010D0012810D0022812D0032812D0042C7A +:1034200014D0052C15D113E002290000012800005A +:1034300003300000012400E002246846468A08E0C8 +:10344000032406E068460424478A02E0052400E0DD +:1034500006246846418A1398814246D12C74002E76 +:1034600041D00DAA0EA905200292019100901023CF +:103470000022FF21304603F02FF9002823D16846AF +:10348000808E2A46C0B20EA9FFF72DFC00281AD163 +:10349000AE81002F27D00DA9052008AE0291009023 +:1034A000132300220196FF21384603F015F9002866 +:1034B00009D16846808EF11CC01EC0B22A1DFFF7DC +:1034C00012FC002801D0032095E708A881784278F3 +:1034D00008021043E881062C05D16846807DA87259 +:1034E0006846808A2881002085E703A803F05CF8FD +:1034F000002884D0FFF7D5FD7DE7002805D0FE4ADF +:10350000012903D0022903D003207047518800E02D +:103510009188814201D1002070470720704770B523 +:103520000C4605461C21204617F09CFC00202080FC +:10353000002D08D0012D04D0F0A1F54817F0BFFDF3 +:1035400070BD062000E00520A07070BD70B592B07F +:103550001546064601206A461071107453740846D9 +:1035600008300395029048889082FEF7FBF904002A +:1035700019D06580172069468883203600940AABED +:103580007178023307AA01A80EF019F9064660788F +:10359000000701D5FEF7C7F9002E0AD03046FFF725 +:1035A000ECFD12B070BD1321284605F00CFF03207E +:1035B000F7E708A800906846838B0422012128467B +:1035C00007F0ABFEEDE770B506468AB000200D4669 +:1035D00007900590069003A90490052402460291E5 +:1035E0000190102300942946304603F075F8002816 +:1035F0000DD108A804A9009102900194684683891E +:1036000000222946304602F083FE002801D0FFF751 +:1036100048FD0AB070BD10B50EF0D7FA10BDF0B578 +:1036200089B000260546059600780C460827030059 +:1036300017F066FE0CFD070C390B75759BBEFCD3AD +:10364000E3FD68680A38FEF702FB07E1A88800225C +:1036500080B20421009008F05FFB0290002C04D09F +:10366000AB48A6A16E3017F02AFD0298002804D1BD +:10367000A748A2A16F3017F022FD029800990830E8 +:103680000DF0D2FCFEF76EF9040007D060783843E5 +:10369000607000986080FEF746F9E1E01321009821 +:1036A00005F091FEEAE0002C04D1BD2093A180003A +:1036B00017F005FD60880022042108F02DFB009022 +:1036C000002804D192488DA1883017F0F8FC0099A9 +:1036D000002008802A7994461EE0C3005B199B688D +:1036E00007936B469B8B1A0708D5DA0606D560460A +:1036F000C20050194038C08F088006E05B0409D52D +:103700000871C2005019C0884880607838436070E2 +:103710000226A3E0401CC0B28445DED89EE0E888C3 +:10372000694608800090002C04D1794873A1983034 +:1037300017F0C5FC2878062813D10098C00B10D0CC +:1037400060880022042108F0E7FA060004D17048DE +:103750006AA1A23017F0B3FC00203071A8887080F5 +:1037600039E060783843607078E0002C04D1684814 +:1037700062A1B43017F0A3FC60880022042108F095 +:10378000CBFA0090002804D161485CA1B73017F053 +:1037900096FC009808300EF06AFA0121484002D1E8 +:1037A000E888C00B5AD0009861880226C180D8E70B +:1037B000002C04D1564851A1D03017F080FC60880D +:1037C0000022042108F0A8FA002804D150484BA197 +:1037D000D33017F074FC0226C3E7002C04D14C4808 +:1037E00046A1DC3017F06BFC0226618801222046DE +:1037F000FEF73EFA01200590B3E7A889002280B2C7 +:103800000421009008F088FA0746002C04D04048B4 +:103810003AA1EE3017F053FC002F04D13C4837A1F9 +:10382000EF3017F04CFC6868029001E009E010E00E +:10383000288969468881012202A90098FEF734FA96 +:103840000CE0002C8DD16D202CA1C00017F037FCAE +:1038500087E72F4829A1FE3017F031FC002C0DD04E +:10386000607800070AD50598002807D184202070C9 +:103870002046582229460830FDF7A6FC304609B0FC +:10388000F0BDF7B50C460546007A224688B00A32EC +:103890000492921C01920027811E16323E4602922B +:1038A0000B0017F02DFD08F405F348488ED0F2F315 +:1038B00068880022042108F02FFA0190002803D123 +:1038C0000EA1144817F0FBFB01980088002802D0D5 +:1038D0005227072600E151271E26002C70D0688849 +:1038E000A0800120A071019804990079C0004019BE +:1038F000C089FFF76BFD0FE0400C00207372635C22 +:1039000067617474735F636F72652E6300000000FB +:103910006F0200008603000000287DD10198007925 +:10392000C0004019C089208101980079C000401969 +:10393000408AA083F0E0698A0091062820D1E889B6 +:10394000C00B1DD008462230512786B2002CC5D0AE +:10395000A8890199FFF73AFD002872D16888A080F4 +:103960000220A071A88920810120A072288AE0830A +:10397000009820846969009A029817F016FACBE043 +:1039800008462030502786B2002CA7D0A889049979 +:10399000FFF71CFD002854D16888A080A889E0802A +:1039A000287A06280AD002202072288AA08300984C +:1039B000E083204669692030009ADEE70120F3E7C2 +:1039C0008FE068880022042108F0A6F90690688A32 +:1039D00000900698002803D1FD49FE4817F06FFBC0 +:1039E000069808300EF043F90121484002D1E889D9 +:1039F000C00B25D000985127223086B2002C7AD0F7 +:103A00006888A080A8890199FFF7E0FC002818D1F8 +:103A10000220A071A88900E013E020810420A07298 +:103A2000288AE083009820846969009A029817F038 +:103A3000BCF90699002008710698A98941806BE0BD +:103A400003200BB0F0BD688804F0DBF900906888B3 +:103A50000022042108F060F901900098002804D1A8 +:103A6000DC48DB492C3017F02AFB0198002804D1F0 +:103A7000D848D7492D3017F022FB0198D649C08885 +:103A8000884205D05127222604E01EE03FE035E0C1 +:103A900050272026002C2ED06888A080502F07D0D9 +:103AA0000220A0712146287B0831FFF738FD33E062 +:103AB000287BA11DFFF733FD6A8800230199009838 +:103AC000FFF744FD0028BCD126E0C449A889C98875 +:103AD000814207D154270626002C0CD06888A0808C +:103AE0001AE008E053270826002C04D06888A0803C +:103AF000A889E08010E00A98068013E05527072681 +:103B0000002CF8D0A889A0800020A07104E08D20AE +:103B1000AF49C00017F0D3FA0A98002C068001D0F4 +:103B20002780668000208CE7AC4900200870704731 +:103B300030B585B00C4601F0DBF90546FF2804D10D +:103B4000A448A349953017F0BAFA002020802071CC +:103B50006080401EE0802046294608300DF058FA6B +:103B60006A462946012002F016FD102412E068463C +:103B7000808800070ED56846C0882946FFF723FDD8 +:103B800068468188FF2321438180C0882946019AA5 +:103B900002F02CFE684602F007FD0028E7D005B0D1 +:103BA00030BD0A46014610B5104608300DF044FA03 +:103BB00010BD70B505460022042108F0ADF80400E0 +:103BC00004D184488249B73017F079FA2046294653 +:103BD00008300DF029FA70BDF0B591B00C460746DB +:103BE00004F00FF9050005D02878222804D2082017 +:103BF00011B0F0BD7A48FBE700220421384608F0F6 +:103C00008BF80646002C02D0A08800280CD001209A +:103C1000694608710220087400204874002C05D001 +:103C2000A0880883206802E00920E1E70883059066 +:103C30003046083003970290FDF794FE040018D038 +:103C40006780172069468883203500940AAB69781D +:103C5000023307AA01A80DF0B2FD054660780007FF +:103C600001D5FDF760FE002D09D02846FFF785FA43 +:103C7000BEE71321384605F0A6FB0320B8E708A8E5 +:103C800000906846838B04220121384607F045FBEB +:103C90000021C943F180ABE7FFB585B00E9E778860 +:103CA000384604F0AEF8054600220421384608F0F4 +:103CB00033F80446002D03D145494A4817F0FFF96F +:103CC000002C04D147484249401C17F0F8F9083449 +:103CD000089869460394C1C105A80DC820356978C4 +:103CE0000DF0DCF9CBE5F0B50446002099B00D46A7 +:103CF00001460D9010A88181164601818180374AC6 +:103D000068469180018510A80180684601878185F9 +:103D100081841078012808D0022806D0032804D016 +:103D2000042802D0082019B0F0BD2F4A944273D362 +:103D30002E4F0121890438688C4201D3844278D304 +:103D4000294A954275D3012189048D4201D38542C8 +:103D50006FD36168002913D0234A914269D30122AD +:103D60009204914201D3814263D3608921898842C0 +:103D700003D801225202914201D90C20D3E70D90C1 +:103D800016AA0EA92846FFF78EFA0028CBD168683C +:103D900080784007800F02280AD16846008F80048F +:103DA000800F05D02869002802D03968884240D3A6 +:103DB0000AA92069FFF721FA0028B4D12069002858 +:103DC0001CD0607880076846008D14D580040FE011 +:103DD000FC380000EE030000FFFF0000400C002054 +:103DE000023000000C05000000D001002800002077 +:103DF000800F68D002E08004800F64D16846008D97 +:103E0000810618D58004800F606806D0002812D083 +:103E1000396888420DD302E00BE000280BD0FE4940 +:103E2000884206D301218904884204D33968884234 +:103E300001D2102077E709A96069FFF7DEF90028B1 +:103E40009CD16069002808D06846808C0105890FE4 +:103E5000012938D18004800F35D00BA9A069FFF764 +:103E6000CCF900288AD16846808C80062BD468461D +:103E7000808D810627D4A169002906D00105890F0C +:103E8000012920D18004800F1DD0E068002804D0D3 +:103E90000078002817D01C2815D204AA611C2046DF +:103EA000FFF728FA0121890210A80180012768463E +:103EB0008773DA49818104AA033217A92868FEF7BB +:103EC00038FF002801D007202DE710A8007F15A992 +:103ED000C01CC2B200200C920190FF320090034639 +:103EE0000291FF3203A80332109902F0ACFA0028C5 +:103EF00026D110A9888A0F902A892969C84801917A +:103F00000092029010A90A8B6B8928680E9902F022 +:103F10009AFA01007ED1C2480025001F81886846B8 +:103F20004174090A8174052104A86A4623C210A8B5 +:103F30002A46FF21808A0C9B02F0EAF9002802D071 +:103F4000FFF7AFF8EFE66846007C0322C1090020C6 +:103F5000920290430122920280181490002928D0E6 +:103F6000014610A8018068462921877309028181D2 +:103F7000058608A8007C0023410860784900C00736 +:103F8000C00F014308A80174FD2001406078A54AD4 +:103F90008007C00F4000014308A801740CA902204B +:103FA00001910090029503A8109902F04CFA0100CB +:103FB00030D16068002828D0206900280DD10AA9D6 +:103FC0000EA8FFF7E0F96078800706D46946088DEF +:103FD0000321090388436946088590496846877329 +:103FE000FE3181818F492089891E16F047FF626862 +:103FF0000D9811AB0192009002930A46002303A88A +:104000000A9902F020FA010004D12078C10603D4F5 +:10401000800600E085E02AD56846058660690028AC +:104020000DD109A90EA8FFF7AEF96846818C0320CF +:104030008002814301208002091868468184694614 +:10404000888CC82108436946888474488F73FF3080 +:10405000888112AA0CA902200292019100900023EB +:10406000704A03A8099902F0EEF9010059D12078AD +:10407000C00729D068460586A06900280DD10BA984 +:104080000EA8FFF780F96846818D032080028143E6 +:10409000012080020918684681856846818D40208C +:1040A00001436846818587735F49818113AA0CA902 +:1040B000022002920191009000235A4A03A80B9912 +:1040C00002F0C1F901002CD1E06800282DD010A821 +:1040D00014990180544968468773491C8181E168BD +:1040E00008A80A78027449784174E068412241883E +:1040F00068464186E0680023017908A80175E068F8 +:10410000D200C18808A84175090A81750CA8072149 +:1041100001900091029503A8109902F094F9010012 +:1041200003D00F9800F0E8FEFDE53D480321001F95 +:104130000170002E0AD08088308010A8808870809E +:1041400010A80089B08010A88089F0800020EAE5DE +:1041500030B501248BB015460B46012802D0022849 +:104160001CD104E0684605218473C90203E02B4991 +:1041700068468473891E8181002B12D003210020A0 +:10418000890288430121890240186946888405AA6A +:1041900004A91846FEF7CDFD002804D007200BB077 +:1041A00030BD1020FBE76A46127C1D480092801E3D +:1041B00005A9FF3201910290FF32002303A80332C8 +:1041C000099902F040F9002802D0FEF76AFFE6E7FD +:1041D0001348001F002D01D0418829800470002061 +:1041E000DDE770B592B00446012608A886700F4935 +:1041F0006846018410AA08A93046FFF7A9FF0028E5 +:104200004ED12078064DC00700242D1F002849D02C +:104210001C2168460CE0000000D0010003280000CB +:10422000440C0020030200000329000001180000D4 +:1042300016F01AFE68460178202001436846017096 +:1042400008A88670F9496846018411940794817F13 +:10425000F92001406846891C8177002001466846A4 +:104260000177002001466846417704218185C48595 +:10427000018607A80A9011A80D9008A809900EAA17 +:1042800009A96846FFF72FFD002809D16846008F6D +:10429000E8806846808F2881401C68812C7000204F +:1042A00012B070BDEC802C8110A80088F4E7F7B53F +:1042B000DF4900260A789EB0012A04D0022A02D0E3 +:1042C000082021B0F0BD4A88824201D00620F8E7DC +:1042D0001F98824201D10720F3E7012210A98A75B5 +:1042E000D4488882002003239B020146994393020D +:1042F000CB1810A90B8669468A81CF4ACA8118A9B2 +:10430000887110A9888419A904916946CA82069007 +:10431000FF20087503A802F06AF900242546274605 +:1043200008AA052103A802F065F9002810D0822808 +:104330006FD1002C6FD0002D6DD010A88480C58067 +:104340000021017418A8807B11AC012865D06DE0B4 +:1043500008A88079002F21D0012857D16846818C88 +:10436000B44881421CD113AA0DA905206B4607C38E +:104370006846408C10230022FF2102F0ADF900288E +:1043800068D110A88089042801D006284CD168463D +:10439000818E1F98814239D10F2092E7012835D1B3 +:1043A0006846808C0521C902884202D0491C884297 +:1043B0002CD19F4841886846408C814201D1012719 +:1043C00000E00027002C01D0002D10D01F9988425A +:1043D0001CD113AB0DAA05216E460EC60446102350 +:1043E0000022FF2102F078F9002833D101E03546A0 +:1043F0000CE010A88089022801D0102814D1C0B286 +:104400001BAA0DA9FEF76FFC00280DD16846468C4B +:1044100086E71FE0FFE7052053E714A91BA8221D2C +:10442000FEF787FC002801D003204AE710A8007C93 +:104430000023001DC2B210A80274209802900194BB +:10444000009215A81C9901F0FEFF002802D17849BE +:1044500002220A70FEF725FE33E710B50B46401E18 +:1044600086B084B203AA00211846FEF743FF04AACF +:10447000052103A802920191009001230022FF214F +:10448000204601F045FF04466846008A012804D012 +:104490006D206A49000116F012FE2046FEF701FE6B +:1044A00006B010BDF0B5624F0446387887B00E46AE +:1044B000032804D0042802D0082007B0F0BD04AAC5 +:1044C00003A92046FEF7EFFE0500F6D1606880786C +:1044D0004007800F02280DD1684680898004800F34 +:1044E00008D02069002805D055490968884201D2C2 +:1044F0001020E2E7208905AA6B46216907C36946B7 +:104500000A8A63892068039901F09DFF002802D080 +:10451000FEF7C7FDD1E7002E02D06846808A3080C2 +:10452000042038702846C8E738B50C00054609D085 +:1045300000236A46FF2102F031F9002804D0FEF77B +:10454000B0FD38BD102038BD69462046FEF755FE47 +:104550000028F8D1A078FF21C307DB0F2846009A76 +:1045600002F044F9EBE73EB50C0009D002AB6A4615 +:10457000FF2102F013F9002804D0FEF792FD3EBDA2 +:1045800010203EBD0321204616F06CFC68460088D2 +:1045900001A90005800FFEF71CFE00280BD168461C +:1045A000007920706846008801A98004800FFEF71A +:1045B00010FE002801D003203EBD684600796070DF +:1045C000A278EF20024068460088C10B09010A4327 +:1045D000F7210A404104C90FC9000A43A270F9211A +:1045E0000A40800601D5022000E001204000694613 +:1045F0000243097A50084000C907C90F0843A07058 +:1046000000203EBD7FB514460522019203AD029500 +:1046100000930A462388FF2101F07AFE69468989C2 +:104620002180FEF73EFD04B070BD0000052A0000A9 +:10463000400C002002280000FFFF0000FC380000B2 +:1046400028000020F3B5002799B068460C4607877C +:104650003D4600291DD0E068002806D0A06800284B +:1046600017D001886A4611870780199803F0C9FBA3 +:10467000002811D0007822287ED3199800F038FC49 +:10468000009000220421199807F046FB060009D18A +:1046900004E010201BB0F0BDFC48FBE7FC49FD48DE +:1046A00016F00DFDA078012803D0022801D00720C4 +:1046B000F0E72088002808D0401E80B203AA0099A5 +:1046C00001F069FF002859D11DE0F048401CE1E7E6 +:1046D0006946498A228891420BD26846807D00252E +:1046E000012810D16846808AEB4988420BD1012508 +:1046F00009E0914203D1002D2AD06D1C01E0022D6A +:104700000BD0032D04D203A801F04EFF0028DFD008 +:1047100082281BD0002831D11DE06946897D0129FE +:10472000F1D16946DC4B8A8A5B1ED11A9A420FD0BE +:1047300005DCDA48101A0BD00128E4D108E0012981 +:1047400006D0FF390129DED10325E1E7022D15D17D +:104750000D2080029EE7E068002816D00EA90522F1 +:1047600002910192009069460B8FA2882088FF2158 +:1047700001F0CEFD002800E01DE002D0FEF791FC24 +:1047800088E76846A168008F08806846008AC006EE +:1047900001D5C3487EE70798002803D06846008B00 +:1047A000022801D0032075E70798A1780078012935 +:1047B00003D0800710D408206CE7C007FBD000228C +:1047C0000721199807F088F8002802D00725022051 +:1047D00004E0AE48801C5DE70225032008A90870AC +:1047E000218868468185199808360A90099617210C +:1047F0006846818712AB02330FAA052108A80097EB +:104800000CF0DDFF002802D0FEF7B7FC42E710A84D +:1048100000906846838F04222946199806F07DFD92 +:1048200038E770B5064615460C460846FEF7F6FB17 +:10483000002804D12A4621463046FFF789FCF3E6DA +:1048400010B5FFF734FD10BD70B51E4614460D00BF +:1048500014D0002C12D0616800290FD00121FEF77E +:104860004CFE002809D12068FEF7D8FB002804D1AF +:10487000324621462846FFF736FAD5E61020D3E621 +:1048800070B515460C000ED00221FEF736FE00284A +:1048900008D12068FEF7C2FB002803D12946204634 +:1048A000FFF700FEC0E61020BEE6F8B506467D48DC +:1048B0000D46016814468A4231D36068002808D04A +:1048C000794A90422BD301229204904201D388422C +:1048D00025D37648864204D0304603F092FA002869 +:1048E0000CD0304600F004FB0646284600F0BDFA26 +:1048F000002804D16068002802D012E06348F8BDA7 +:1049000000236A463146284601F048FF002802D0BD +:10491000FEF7C7FBF8BD68460088800601D410206A +:10492000F8BD6188224628466368FFF76BFEF8BD34 +:10493000F7B55C4E0746306886B01446824202D214 +:10494000102009B0F0BD384600F0D2FA05465748AD +:10495000874201D0FF2D08D0002304AA29460798DA +:1049600001F01CFF002826D101E04848E9E768462D +:10497000008AC00601D54A48E3E703A90020029156 +:104980000527019000976288484B2946079801F057 +:10499000A3FE00280FD161683268914208D30191CB +:1049A00002900097238862882946079801F094FEB8 +:1049B000694689892180FEF774FBC2E7002907D088 +:1049C0003B4B0A881B899A4202D83048401C7047EA +:1049D00038E610B586B004236C46A382344BDC88DD +:1049E000002C07D01B898B4201D2914204D9274861 +:1049F000401C55E5062053E56B4619825A8200217A +:104A0000009101911C800221997005A9029104A9CD +:104A100003916946FFF716FE42E5F3B50C4685B0F3 +:104A2000812069460873002C1AD0059803F0E9F933 +:104A3000070017D03878222868D3059800F058FA74 +:104A4000049000220121059806F046FF00280BD0B3 +:104A500000220421059807F05FF905000AD105E05E +:104A600010202AE5094828E5112026E508491148C3 +:104A700016F025FB284608300CF0F8FA0646207898 +:104A8000012819D0022838D0072016E5023000008E +:104A9000FC380000E10800000328000000280000A6 +:104AA000013400002800002000D00100FFFF0000BA +:104AB000400C0020840A0000A18803AAFEF728FB0E +:104AC0000028CED1B00721D56846007B00281FD131 +:104AD000A079C0071CD0E068002205216B4607C3FF +:104AE000638922896888049901F012FC6946087379 +:104AF00000280DD0FEF7D5FADFE4A18803AAFEF75F +:104B000007FB0028ADD13420064201D10820D4E4AF +:104B10006846037B29463846059AFEF717FDCCE424 +:104B2000FFB597B0002001901F4615460C460E4673 +:104B3000179803F066F9002804D00078222803D2E1 +:104B40000820A7E5F348A5E5B80801D00720A1E5AE +:104B5000032F00D10027179800F0CAF90890002C05 +:104B60001BD0022D77D3EC48006884427CD36119B6 +:104B70000091012902D0491E814275D3AD1EAAB20F +:104B80002146E6480DF0F2F800991E394A7F0B7F66 +:104B900011021943884267D1ADB2E148B90702D585 +:104BA0000189491C00E0012189B20091F90701D077 +:104BB000078900E0D94F03AA0899009801F0EBFC9F +:104BC0000DE0F078B1780002084310284CD8019924 +:104BD000091D401880B20190A84245D82618002E21 +:104BE00060D0707831780002084300998842E8D399 +:104BF00058E06946098A0A0754D5002C3FD0019A2B +:104C0000A618121D92B20992F278B37812021A43D2 +:104C10009446102A28D8099A6244AA4224D8727865 +:104C2000337812021A4390421ED1C8061ED5099845 +:104C30000AAA052120186B4607C370783178000254 +:104C4000084363460022089901F062FB002803D064 +:104C5000FEF727FA1EE507E0F078B1780002084376 +:104C60006946098D884201D00B2013E5F078B178B0 +:104C7000000208430999401880B2019006E0C90675 +:104C800004D50899FEF79FFC0028E3D16946088AFD +:104C90001021884369460882488AFF23049A0899AC +:104CA00001F0A4FD03A801F07FFC002803D16846B1 +:104CB000408AB8429DD900220421179807F02CF8A9 +:104CC000040003D19749984816F0F9F92088002884 +:104CD000C0D0012108A80170017300264673218805 +:104CE0006846018620460830099017980A90FCF71C +:104CF00039FE05001BD01798688017206946888008 +:104D000010AB023301AA052108A800950CF057FD4D +:104D100007466878000704D583488249223016F098 +:104D2000CEF9002F09D03846FEF727FAB2E4132156 +:104D3000179804F048FB0320ACE40EA800906846E6 +:104D4000838804220121179806F0E7FA00288CD105 +:104D500026809FE4F0B500248DB01F4615460E4610 +:104D6000002A04D0B90804D007200DB0F0BD1020EF +:104D7000FBE7032F00D1002700F0BAF80390FF28CB +:104D800004D06749B80703D5488902E06148ECE7D9 +:104D90000120FA0702D04989491E00E05F4906AAAE +:104DA0008FB2039901F0F7FB38E06946898B090758 +:104DB00034D504AB05210022029300910192574B98 +:104DC000039901F089FC002821D1002E21D06A46E8 +:104DD000128A2988A2183019121D914234D36946CB +:104DE000CA8B0270120A42700A8A8270120AC2705A +:104DF00004A90522001D0092029101906946C88B0A +:104E00000B8A0022039901F067FC002801D00320DF +:104E1000ABE76846008A2018001D84B206A801F09E +:104E2000C3FB002804D0822806D0FEF73AF99CE79D +:104E30006846C08BB842B8D9002C07D0002E10D0DD +:104E40002988A01C814203D20C208EE705208CE724 +:104E50002246314631480CF089FF31190870000AAA +:104E60004870A41C2C8000207FE700B585B06946FF +:104E7000FEF7ACFA00280AD16846007C030016F061 +:104E80003FFA08052F2F2F2F08080531032005B002 +:104E900000BD68468078012807D168460088032154 +:104EA000C902401A1CD001281AD06846807901280E +:104EB00006D16846808815214902401A05280FD975 +:104EC0006846807A012811D16846018929200002AC +:104ED000081A05D0022803D0032801D0042805D1E0 +:104EE0000F20D4E711A1164816F0E9F80020CEE70C +:104EF00010B506F007FF10BD10B50C4601F01EFB03 +:104F0000002803D009A10F4816F0D9F82046FEF773 +:104F1000C8F810BD0230000028000020FFFF00008C +:104F2000400C0020FC3800003F0B00007372635CF3 +:104F300067617474735F636F72652E6300000000B5 +:104F400022020000BB060000F8B500780C461646A9 +:104F500010340E36069F022809D0032836D00528C3 +:104F60007ED0FF20F6A1E53016F0A9F8F8BDCD8976 +:104F70000A2068430E30188031203880002AF5D08E +:104F8000087B9581801FC7B21AE020886168308055 +:104F900048780A7800021043F080C8788A780002C6 +:104FA00010433081B21C3846091DFDF79CFE002FCE +:104FB00001D0002802D000203071708008340A36F9 +:104FC00028466D1EADB20028DFD1F8BDCD890A207C +:104FD00068430E30188032203880002AF5D0087BD4 +:104FE0009581401FC7B243E0616822880878F2804B +:104FF0003279C30752085200DB0F1A43FD231A40CF +:105000008307DB0F5B001A43FB231A404307DB0FC8 +:105010009B001A43F7231A400307DB0FDB001A43F8 +:10502000EF231A40C306DB0F1B011A43DF231A408C +:105030008306DB0F5B011A43BF231A404306DB0FD5 +:105040009B011A433271C00970718A784B78100243 +:105050001843308132463846C91CFDF744FE00E053 +:105060000CE0002802D00020B070308008340A36EE +:1050700028466D1EADB20028B6D1F8BD087BCD899B +:10508000801E86B2304608306843103018803420C5 +:105090003880002AF1D0174695811037E800D68174 +:1050A000C01900900DE02088388000987860324662 +:1050B0006168009815F079FE009808348019083767 +:1050C000009028466D1EADB20028ECD1F8BDFFB5AA +:1050D00081B00A9D1E460C46002A05D0607AFF303A +:1050E0000130D080E089108101980E2700780300FC +:1050F00016F006F90B7E0719293541536C7878783C +:105100007E000092087B082805D0032803D091A1D7 +:10511000954815F0D4FF378030200FE0009900202B +:10512000888105B0F0BD0092087B042804D08E4829 +:1051300088A1143015F0C3FF3780312028800098F3 +:105140000028EBD1EDE70092087B042804D09320DF +:1051500080A1800015F0B3FF37803220EEE7009287 +:10516000087B022804D080487AA13A3015F0A7FFC6 +:1051700037803320E2E7087B1746042804D07A48BA +:1051800074A14C3015F09BFF102030803420288013 +:10519000002FC6D00020B88116E0207B17460528D6 +:1051A00006D0062804D070486AA1603015F087FF49 +:1051B0001220308035202880002FB2D0E089B881BD +:1051C0000020388201984088F881AAE70092087B85 +:1051D000072804D064485FA1713015F070FF378054 +:1051E0003620ABE733460095019800F00AFC98E7BB +:1051F0002F2053A1000115F062FF92E770B50C4615 +:10520000054602F0FEFD002804D00078222803D2D3 +:10521000082070BD554870BD00220521284606F0C3 +:105220007BFD2060002801D0002070BD032070BDF0 +:10523000FFB58BB00D4607461720694608850E98C6 +:1052400003261446002805D10EA93846FFF7D6FFDD +:10525000002834D1002D0BD000220321384606F05F +:105260003BFB002834D00E980078002830D108E0AD +:105270002078092819D00F2823D031A13C4815F0F7 +:105280001EFF0E98A760801D03AA606002320AA963 +:10529000204600F00CFC002827D0030016F030F860 +:1052A000071A182323211C1E23000726002231463B +:1052B000384606F011FB0028E3D12C48801C0FB0C3 +:1052C000F0BD00220321384606F006FB0028D8D1A5 +:1052D0001120F4E70020F2E70820F0E72348401C03 +:1052E000EDE70720EBE70320E9E701A80090684617 +:1052F000038D04223146384606F00FF80028DED12F +:10530000002DDCD00E990D70D9E730B587B01D4661 +:105310000C46002A11D0042369460B7013888B8138 +:105320005288CA81A2788A7422880A8200236A4637 +:105330002946FFF77DFF07B030BD1020FBE70000D6 +:105340007372635C67617474635F636F72652E630D +:10535000000000007372635C67617474635F636F65 +:1053600072652E630000000025020000023000007C +:105370004F030000F3B581B001980C460078082671 +:10538000030015F0BDFF125E46461B134A0A0A0AC7 +:105390000A0A0A0A0A0A0A0A0A5E002C02D1F64917 +:1053A000F64808E06078304360703BE0002CF9D1AB +:1053B000F248F149083015F082FEF3E70198002227 +:1053C0008088052187B2384606F0A6FC0546002CE9 +:1053D00004D07520E849C00015F071FE002D04D1FD +:1053E000E648E549143015F06AFE3946A81D00F07C +:1053F00055FBFCF7B7FA040006D0607830436070C4 +:105400006780FCF790FA0FE01321384603F0DBFFCA +:1054100015E0DA48D849283002E0D848D6492D307E +:1054200015F04DFE002C0AD06078000707D59320B8 +:1054300020702046582208300199FBF7C5FE002055 +:10544000FEBDCE48CC493130EAE710B500210170ED +:10545000801D00F020FB10BD0A4610B50146901DCE +:1054600000F024FB10BD70B505460022052106F0B2 +:1054700053FC040004D1F920BF49800015F01FFE41 +:105480002946A01D00F00AFB70BDF7B5054684B0A3 +:105490000C4600206946088188806F8802460521F5 +:1054A000384606F039FC060004D1FD20B2498000E0 +:1054B00015F005FE002C03D0A7800020E08020819D +:1054C000297A20461230C91E142700900B0015F0CF +:1054D00017FF0FFDFCFB3809A95E657A2FB2C9E9F9 +:1054E0009191FB003078012804D0A3497020143139 +:1054F00015F0E5FDA9896A46C8000E30908030207D +:105500001081002C13D0A18100200DE0C100327960 +:1055100009190A747288CA8182005319DA894A8289 +:105520001A8A401C8A8280B2A1898142EED8F1E0B9 +:1055300002A8009001AB22462946304600F02AFA24 +:10554000E8E03078042804D08B49BD20143115F0F0 +:10555000B6FDA8890622014650436A460E30908067 +:1055600033201081002CE2D0A18100200BE0062125 +:1055700041434F190919FA89CA81BA7C8A743A8A57 +:10558000401C0A8280B2A1898142F0D8C2E0307802 +:1055900006280BD078491431D72005E0307806284A +:1055A00004D07549EB20143115F089FDE88969466E +:1055B0001230888035200881002CB8D0A989A181BB +:1055C0007188E18126E03078072804D06A49FF20FD +:1055D000143115F074FDA8896A4601460E3090809A +:1055E00036201081002CA2D0A1812046AA890E303D +:1055F000296954E0E8896946123080B238228880EF +:105600000A81002C7ED0A989A181287A102807D090 +:105610000221A173E9892182EA89296900983EE083 +:105620000121F6E702A8009001AB22462946304648 +:10563000FFF78AFC6EE03078082805D04E49FF203D +:105640001431EE3015F03BFD68463721878001812B +:10565000002C5FD0A989A1810020608220820120D6 +:10566000A07357E03078092805D04349FF20143152 +:10567000FF3015F024FD288A6946143088803720D1 +:105680000881002C46D00421A173A989A181E98950 +:105690002182298A618220462A8A1430696915F09C +:1056A00084FB37E030780A2804D033493448143179 +:1056B00015F005FD6846372187800181002C29D02F +:1056C0000521A173002002E01FE004E00DE0A081AD +:1056D000208260821EE002A8009001AB224629468B +:1056E0003046FFF7F4FC15E00CE00D206946392246 +:1056F00088800A81002C05D00120E08000202081D4 +:10570000207307E00699088019E01C481A49A43064 +:1057100015F0D5FC6846069980880880002C0ED0CC +:10572000684600892080684680886080287A03283F +:1057300005D0102803D0112801D00020307000209F +:1057400007B0F0BDF7B5568815460F4682B0002267 +:105750000521304606F0E0FA040004D10748064966 +:10576000C43015F0ACFCA41D33462A4639460094DB +:10577000029800F022FBD4E440530000950300009F +:1057800013020000F7B58CB00D46144607A90C981B +:10579000FFF734FD002812D1B64E0127002C0FD0A0 +:1057A0000321684601701021818208A802460690F4 +:1057B000204605A9FDF7BDFA00280BD007207EE59D +:1057C0000821684601708581C68105218774C90258 +:1057D00001820BE00798A178017121884180684619 +:1057E00005218774C90201828581C6810246012193 +:1057F000079B0C98FFF71CFD61E508B501236A467D +:1058000093709D4B13800A4602236946FFF77DFD86 +:1058100008BD08B501236A469370974B5B1C138043 +:105820000A4603236946FFF770FD08BD00B587B03F +:1058300000290CD002236A4613700B889381498893 +:10584000D18100230421FFF7F3FC07B000BD102035 +:10585000FBE710B5002903D00523FFF756FD10BD67 +:10586000072010BD70B588B00D461446064607A93E +:10587000FFF7C4FC00280DD1002C0DD0062168468E +:1058800001708581C481079B02465C8006213046F9 +:10589000FFF7CEFC08B070BD052168460170858118 +:1058A000F1E710B588B000290BD007246B461C70B7 +:1058B0009A81049100236A462146FFF7B9FC08B09B +:1058C00010BD1020FBE770B50024172288B0002916 +:1058D00014D00D782B0015F013FD062305051904CF +:1058E0001B231522D21E93B2CA88002A02D08E68CA +:1058F000002E03D09A4203D90C20CBE71020C9E731 +:10590000042D05D08A88002A0AD101E00620C1E7CB +:10591000012D11D0022D05D0042D18D0052D23D036 +:105920000720B7E709236A4613704B889381CB8819 +:10593000D381896804911DE00C236A4613704B885B +:105940009381CB88D38189680824049112E00D23C8 +:105950006A4613704B8893818B88D381CB881382DE +:1059600089680924059105E00E236A461370497879 +:1059700011730A2400232146FFF75AFC8AE700B579 +:1059800087B00F236A461370918100231946FFF7F1 +:105990004FFC5AE7FEB50078089D1C4616460F4698 +:1059A000012803D03549912015F089FBF889C00002 +:1059B0000E30208030202880387B001FC0B201903C +:1059C000002E1DD0F889B081002516E0E80084196A +:1059D000C0190090224641690E320198FDF783F903 +:1059E000002802D000202074E08100986D1C008AFD +:1059F00060820098ADB2408AA082B089A842E5D802 +:105A0000FEBD70B514461425049A1D8037231380FB +:105A1000002C0ED0CA89A281002262820078082858 +:105A200008D0092810D00A2819D01449144815F0B4 +:105A300046FB70BD087B0C2804D011480F490C3878 +:105A400015F03DFB012008E0087B0D2804D00C4830 +:105A50000A49083815F033FB0420A07370BD087B99 +:105A60000E2804D006480549001F15F028FB052024 +:105A7000F3E70000FFFF000002280000545300007D +:105A8000BB02000010B5FE4B586019721A80C900A5 +:105A900015F0EAF910BD00210180704710B5002211 +:105AA000D2430280032006F09EFD10BD7047F0B582 +:105AB0000E460446017801208840F24999B008401A +:105AC0000090616815460888EF4A904206D0009A17 +:105AD000002A06D0EB4A521E104202D0012019B013 +:105AE000F0BD009A10430880002D12D000202870CD +:105AF0002178EA1C0027681C01920B0015F000FCBD +:105B000010F30E16233A59616F3CB4B08AB8F2F123 +:105B1000F0F320780B28EBD00420E0E70221297075 +:105B2000A1890170090A4170032097E004212970BE +:105B3000A1890170090A41700198E1890170090A7F +:105B4000417005208AE006212970A1890170090AA7 +:105B500041700199E2890A70120A4A70218A017122 +:105B6000090A4171A28AE81DA16915F01EF9A08AEF +:105B7000C01D73E0082129702178082901D1102166 +:105B80002970A1890170090A41700198E1890170A9 +:105B9000090A41700520308020466A1D02A9103094 +:105BA000FDF7C7F800287DD169463088097A40188A +:105BB00054E00A212970A1890170090A417003206B +:105BC0000BE00C212970A1890170090A417001982C +:105BD000E1890170090A4170052030809CE0A089AC +:105BE00084464000401C81B2308888425AD305293F +:105BF00058D30E202870002008E0236942009B5AE9 +:105C0000521953701B0A401C937080B26045F4D344 +:105C10003180B9E09A48417A002973D0491E417217 +:105C2000217B4068C9004518A988286808224018C7 +:105C30000838216915F0B9F8022168460171002180 +:105C4000417128680390A98868460181002101A854 +:105C5000FFF790FB0020A880002E00D0308093E05A +:105C60002978802211432970297840221143297014 +:105C700029788909890112312970A1890170090ADD +:105C80004170E289E81C216915F08FF8E089C01C99 +:105C90003080287841063FD5C00975D0012168467B +:105CA000017200E02CE0002141723188091D8181E0 +:105CB0000495E189019808180590001D0690704828 +:105CC000017A68460177002102A8FFF753FB0746D7 +:105CD00030880C303080022F06D0002F54D065E081 +:105CE0003DE033E01CE05EE065486946097F4268BC +:105CF000CB00D218037A994202D29188002902D0AF +:105D0000042753E02FE0417A491C41721560308826 +:105D100090800020308049E06168A089888033E06D +:105D200029788909890116312970A1890170090A28 +:105D300041700198E1890170090A4170228A681D49 +:105D4000616915F032F8208A401D46E728788009FD +:105D5000800118302870207B687002207EE7606820 +:105D60000188090401D4052720E0C088A189884260 +:105D700001D006271AE01E202870012030806068BC +:105D800001884904490C0180009800280ED03C4845 +:105D900000220088A1688300032006F07FFB616871 +:105DA0002078887007E00020308003276068009921 +:105DB00002888A430280384691E6FFB59FB0289D4D +:105DC0000E46002805D0172803D82A882E4B9A4261 +:105DD00002D1072023B0F0BD3278530601D4D20996 +:105DE00001D00820F6E700226B461A715A7114465A +:105DF0003278431E1D939BB2189303AB1A939706F8 +:105E0000CB1CBF0E1B93821E711C3B0015F078FA51 +:105E1000209011EE66EE74EEB0EED4EEEDEEECEE08 +:105E2000EBEEEAEEE9EEEEEEE8EEE7EEE6EEE5EEBC +:105E300090EE05287CD1042168460171A978017291 +:105E4000F078B2780102114368464181317941719D +:105E500070788006800E0C282ED009DC801E03008E +:105E600015F04EFA0919661C66216624662766003D +:105E700012282AD00ADC0E2821D01028DAD121E0FD +:105E80004C0C0020FF710000FFFF000016281FD0FF +:105E90001828CFD11FE02878800701E02878400734 +:105EA000002845DA45E128780007F9E72878C00698 +:105EB000F6E728788006F3E728784006F0E72878A8 +:105EC0000006EDE72888C005EAE72888C004E7E770 +:105ED00028888004E4E728884004E1E72A789207CC +:105EE00026D50328A6D105206A461071487809787E +:105EF0000002084310811CE129784907F0D50628E3 +:105F000016D3717890B2012902D0022992D101E012 +:105F1000022100E01021189106216A46117100212A +:105F2000118102AF189AB11C0237921C1B921AE021 +:105F3000B3E04A780B7812021A433A80801E891C1B +:105F40001790BA1C1A911898FCF7CDFE1A99189858 +:105F5000189A091817986B46801A1A8980B2521C31 +:105F60001A811B9ABF1D8242E3D9002886D1E0E046 +:105F700028780007B4D51D98694682B207200871B9 +:105F800000200881701C0A3111E0437807781B0259 +:105F90003B430B80C37887781B023B434B806F46A3 +:105FA0003B89121F5B1C001D92B23B81091D042A14 +:105FB000EBD2002A71D1BCE02978C9066DD5022840 +:105FC0006BD30820694608710020488170780872F8 +:105FD000844692B2B01C1A9919E089E090E07EE004 +:105FE00067E05BE030E025E019E013E0BCE04378D7 +:105FF00007781B023B430B80831C4B606346D21A1D +:106000006F467B8960445B1C92B27B81083194456A +:10601000EDD9CEE7287880063FD5092203E028781D +:1060200040063AD50A2268460271AA880281189A67 +:10603000428107E0287800062FD50B206A461071B0 +:1060400018981081039174E02988C90525D5022884 +:1060500023D30C20694608710020488170780872AB +:10606000844692B2B01C1A9914E0437807781B0258 +:106070003B430B80C37887781B023B434B80031D57 +:106080004B606346D21A6F467B8960445B1C92B2B8 +:106090007B8108319445E8D98BE763E02988C904FE +:1060A00060D501285ED10D2168460171A988018162 +:1060B0003FE02988890455D5052853D30E22694627 +:1060C0000A71AA880A811B99401F4A78097812022E +:1060D0000A4369464A818881701D049029E0298815 +:1060E00049043FD501283DD10F206946087120E0C1 +:1060F0002A88120436D44A780B7812021A43EA80AE +:1061000003282FD332789206920E1B2A26D0112212 +:106110006B461A712A880123DB031A432A804A78C6 +:10612000097812020A4369460A81C01E48811B98F9 +:10613000039030788006800E1B2809D01D2807D0D8 +:106140000320229906F04FFA2888C00BC00328804C +:1061500001A82199FFF70EF920463BE610226B4675 +:106160001A71DCE70724F7E70824F5E700B597B0D4 +:10617000032806D16A461070019100216846FFF796 +:10618000F9F817B000BD000010B58B78002B11D0C6 +:1061900082789A4207D10B88002B0BD003E08B79D1 +:1061A000091D002B08D08B789A42F8D103880C88FF +:1061B000A342F4D1002010BD812010BD052826D0B7 +:1061C000002A02D0012A0DD102E00988090501E068 +:1061D00009888904890F07D0012918D0022909D01C +:1061E00003290ED081207047002A01D00320704778 +:1061F0000220704703280AD0042808D0002804D0C1 +:1062000007E0042803D0022803D0052070470020AF +:1062100070470F20704770B51388054614460B80F1 +:1062200018061DD5FE481022807AA84203D81343D1 +:106230000B80002070BDA06893430078E840C00741 +:10624000C00E03430B802078A1788007800D08439F +:10625000F44914F013FEA06869430818401C70BD8F +:10626000906870BD37B569468B88138019061BD5B9 +:10627000EB4C0125A47A9168844209D8FE280FD1FD +:10628000D80602D5A5406D1E00E000250D7007E080 +:1062900085400C78DB06DB0FAC4383401C430C705D +:1062A00010881021884310803EBDF8B50746C81CF1 +:1062B00080080E468000B04201D08620F8BD082A32 +:1062C00001D90E20F8BDD64D00202E60AF80288168 +:1062D000AA723446E88016E0E988491CE980810604 +:1062E00010D48007A178800D0843CE4914F0C6FD74 +:1062F000206800F0BAFA2989401880B22881381A3B +:106300008019A0600C3420884107E5D40020F8BD36 +:10631000FFB589B09F041646139DBF0C01930998E1 +:1063200000F095FA04000AD02078000609D5BC4890 +:10633000817A0A98814204D887200DB0F0BD0120EF +:10634000FBE7224669460A98FFF765FF06900020A2 +:1063500069460872052D14D0012221462846FFF710 +:106360002DFF0028E9D1207840060AD50221684691 +:106370000172099981810188C18106824782129840 +:1063800005900198000404D500273E460125079793 +:1063900009E02078A1788007800D0843A149079083 +:1063A00014F06CFD0D46019840040AD50798A842E8 +:1063B00007D12088E1788005800F00020843B042B1 +:1063C00001D3AE4201D90720B7E7B81980B20190D6 +:1063D000A84201D90D20B0E76846007A002804D011 +:1063E00002A8FDF718F90028A7D10798A8420BD1F9 +:1063F000208803210902884301998905890F090230 +:10640000084320800198E0701498002800D007808D +:106410001298002815D006983A468019129914F05F +:10642000C4FC224669460A98FFF7F5FE69460888CB +:106430001021884369460880224600990A98FFF790 +:1064400011FF002079E7FFB5754D0C22E888296817 +:10645000504383B00C180D9F7249059814F00EFD3F +:106460000091049800F001FA29682A898E46611A81 +:106470000C310918944651188AB2A988914202D861 +:10648000842007B0F0BD6A46168A320603D5B206EC +:1064900001D58520F5E7EA88521C92B2EA800E9B6E +:1064A000002B00D01A80B20601D5A76006E0604438 +:1064B00080B22881091A70460818A0602246FE2082 +:1064C0000499FFF7CFFE0598A0700098E07020882F +:1064D0000599800889058000890F08430321090276 +:1064E000884300998905890F09020843042108435C +:1064F000208003988078A07103980088A0800020F5 +:106500002073310601D5AC7A00E00124B10600D534 +:10651000002700260EE0052100200191029000973F +:10652000E88831460C9B069AFFF7F2FE0028A8D1B6 +:10653000761CF6B2A642EED30020A2E7F1B5009891 +:1065400000F085F9060002D00025009C14E001202F +:10655000F8BD204600F07BF90746007831498007F6 +:10656000820DB878104314F089FC386800F07DF98A +:106570004019641C85B2A4B22948C188601E8142BA +:10658000E7DC00992648491EC1800189491B018129 +:1065900000203070F8BD002804D0401E108091709B +:1065A000002070470120704710B5044601881C4840 +:1065B000C288914201D3822010BD00680C22514351 +:1065C00042189079A072908820811088D178800537 +:1065D000800F00020843A081A078211DFFF71BFE59 +:1065E00020612088401C2080E080002010BD012117 +:1065F00001827047F7B50546002084B0C043108083 +:1066000068681746817868468170686801886846BE +:10661000018000218171288A2C88A04205D303E0E3 +:10662000580C00200102000004462C8235E0288A24 +:10663000401C2882301D6968FFF7A6FD00282AD17A +:1066400039889248814201D1601E38806888A04212 +:1066500028D33088F1788005800F0002084302902B +:106660006946301DFFF790FD002814D169898748DD +:1066700081421BD0002231460598FFF79FFD00287C +:1066800009D16A890298824205D1E968B06814F09C +:106690005FFB00280AD0641CA4B2204600F0D7F8A3 +:1066A0000600C4D1641E2C828220EAE67C80B07988 +:1066B000B871B088B8803078B1788007800D084311 +:1066C00078810298B8813946287A32460831FFF736 +:1066D000A2FD38610020D4E6FFB585B01C460F4608 +:1066E000059800F0B4F8050009D02878000608D510 +:1066F0006748807AB84204D8872009B0F0BD0120ED +:10670000FBE707982A468605B60D69463846FFF727 +:1067100082FD07460E98052816D000222946FFF76D +:106720004DFD0028E9D1287840060DD501216846A5 +:10673000017105990181018841818681C48101A887 +:10674000FCF769FF0028D8D12888AA788107890D2D +:1067500011438005800FEA7800021043079A9642A1 +:1067600007D04C4A914204D3611E814201DD0B20C7 +:10677000C3E7864201D90720BFE7801B82B2A2424D +:1067800000D922461098002800D002800F980028D7 +:1067900002D0B91914F009FB0020AEE7F8B51D4688 +:1067A00017460E4600F053F8040008D02078000683 +:1067B00007D53748807AB04203D88720F8BD01203A +:1067C000F8BD224639463046FFF725FD002D0BD097 +:1067D0002078A1788007800D08432E49884201D295 +:1067E000012000E0002028700020F8BDF8B51E460A +:1067F00017460D4600F02BF8040008D0207800065C +:1068000007D52348807AA84203D88720F8BD012005 +:10681000F8BD224639462846FFF724FDFF2E14D046 +:106820002588A178A807800D08431A4914F026FB93 +:10683000002E03D1FF31FF31033189B2A170A808C6 +:1068400080008905890F084320800020F8BD104989 +:10685000CA88824207D3002805D00C220968504319 +:106860000C38081870470020704703B50846694681 +:1068700009888A0607D4090604D50549897A41435F +:10688000491C88B20CBD00200CBD0000FFFF0000B9 +:10689000580C002001020000F8B507780D460446A8 +:1068A000012F19D0072F02D00C2F19D114E0A068A6 +:1068B000216906780B2E0BD0052005F094FE052EDD +:1068C0000ED0782300220520216905F0E7FD07E0BE +:1068D000782300220620F8E70520216905F083FED1 +:1068E000002D0ED0002028702946204603F0DFF945 +:1068F000FE482978C05D884201D10320F8BD0220FE +:10690000F8BD0021204603F0D2F90020F8BD70B593 +:106910000E460C462036317901208AB015460029F2 +:1069200009D0012905D12978042902D10520107048 +:1069300000200AB070BD6068019005A802900D218A +:10694000C01C14F08FFA032205A8A16814F02DFAD8 +:1069500001203071062069460870206A049029469B +:106960006846FFF799FFE4E770B50C4615462031FD +:106970000A790120062686B0002A2CD0012A28D1C7 +:106980002978042925D169681022A06801F0B4F99A +:106990006868C07B000606D5D44AA0681023103A68 +:1069A000014601F09EF91022A168E06801F0A4F907 +:1069B000A068C07B000606D5CC4AE0681023103AD8 +:1069C000014601F08EF92E70A0686860E068A8604A +:1069D000002006B070BD60680190C4482038029065 +:1069E0000120087168460670206A049029466846AE +:1069F000FFF752FFEDE7027B032A06D00022242393 +:106A00005A540B78092B02D003E0042070470A7611 +:106A1000CA61027B9300521C0273C150032070476D +:106A2000F0B50E4615460C46203602463179012057 +:106A3000072393B000290CD0012924D002292ED09D +:106A4000032904D12978042901D12B70002013B027 +:106A5000F0BD01203071606800280DD0A1690B7075 +:106A600060684860206988606069C860206A086260 +:106A70001046FFF7C0FFEAE706202870206968602B +:106A80006069A86009E029780629E0D10220307108 +:106A9000042028709548203868600320D7E72978BB +:106AA0000429D4D1A08910280AD9103880B2A08135 +:106AB000A1681023091805A86A6801F012F923E0FB +:106AC00010282FD0C2B21020801AA1680DAF1190EB +:106AD000C01914F06AF911980006000E06D0401E85 +:106AE000C1B280207854384614F0BCF96269102392 +:106AF0000DA909A801F0F5F8102309A905A86A68ED +:106B000001F0EFF8032030716068019005A8029051 +:106B1000062069460870206A049029466846FFF7F7 +:106B2000BBFE94E710232269A168E2E7F0B50E46A8 +:106B30000C4620363179012006278FB015460029F2 +:106B40000BD0012932D0022905D12978042902D19C +:106B50000820107000200FB0F0BD217D08A8CA07E2 +:106B6000D20F02718807C10F08A801716846027030 +:106B700041700722801CE16814F017F902A807226F +:106B80000130216914F011F9606805900AA8069097 +:106B900010236A46A16801F0A4F80120307168460C +:106BA0000774206A0890294604A820E0297804295F +:106BB000D1D1062205A8E16914F0F7F806A806224B +:106BC0000230A16914F0F1F800200890606801908B +:106BD00009A80290102305AA696801F082F8022032 +:106BE000307168460770206A049029466846FFF7AE +:106BF00053FEB0E770B50D460C46203529790120CB +:106C00008CB01646002909D0012905D13178042914 +:106C100002D10920107000200CB070BD6068019096 +:106C200006A802900822E16814F0BFF8082208A81C +:106C3000A16814F0BAF8012028710620694608708E +:106C4000206A049031466846FFF726FEE4E770B5F7 +:106C50000D460C462035297901208CB016460029B6 +:106C600008D00129D8D131780429D5D10A20107053 +:106C70000020D1E76068019006A802900822A16870 +:106C800014F093F800200890099001202871062044 +:106C900069460870206A049031466846FFF7FCFD9B +:106CA000BAE730B50B4620331C7901208BB0002C9D +:106CB00009D0012C05D11178042902D10B201070C4 +:106CC00000200BB030BD4868019005A802908C6888 +:106CD00068462578057564784475CC68257885758F +:106CE0006478C47500200690079001E04CB3010061 +:106CF000089001201871062368460370086A049002 +:106D000011466846FFF7C8FDDBE770B50C46203436 +:106D1000034625790120002D0AD0012D14D0022D23 +:106D200005D111780A2902D10C201070002070BD05 +:106D300001202071C868052202704A684260F84A42 +:106D40008260921CC2600BE015780B2DEFD10220FF +:106D50002071C86804240470526842608A688260A6 +:106D6000096A016201461846FFF745FE70BD30B55D +:106D7000011D02463132947803258379ED432C437B +:106D800023408371DB070DD04B79547923404B713D +:106D90000B79127913400B718278C9788A4200D935 +:106DA000817030BD00224A710A71F5E7F7B50C46D3 +:106DB00086B00020694626460870203631790127C2 +:106DC0001E2015461F2977D24B007B449B885B0011 +:106DD0009F441E0017023E025602690288029A0270 +:106DE000D102F5022E03590371037F03AE03C303DF +:106DF000CC03F7031A0464049A04AB04DF04FE0412 +:106E000010052A0565059B05C605830587058B05C5 +:106E10006069002802D0007813287DD0A068059012 +:106E2000002849D0012168460170206A049003219E +:106E3000684601710A214171E069029020790028B9 +:106E4000EFD0059909780029E7D00C2964D20B000E +:106E500014F056FA0CFD1A4B90B5E8FCFBFAF9F861 +:106E600007FD022828D16069002802D00078082890 +:106E700052D1022168460170206A04900598417839 +:106E8000684601710021B9E20620216A05F0ABFBDA +:106E900020790728E6D1606900F050FF02280CD065 +:106EA000606900F04BFF042807D060690028B8D063 +:106EB00000780128D6D103E01BE261690120087047 +:106EC00005980079C11F0A2901D30A2050E06169A1 +:106ED0000722887060690599303013F066FF012041 +:106EE000307161690320087034E00728BAD1606905 +:106EF000002896D001780929B4D10599C978890765 +:106F000007D1059949790029DFD1059989790029A7 +:106F1000DBD105994A7900E04EE2014620314B7DF4 +:106F20009A43D2D1059A8B7D92799A43CDD1059A15 +:106F30001279D31F0A2BC8D20979914236D8072279 +:106F4000C01C059913F031FF0120307161690A20DE +:106F50000870032069460870206A04906069313027 +:106F600001906069001D029060691C300390A1E2ED +:106F70002076F2E311288DD1606900F0DFFE04284D +:106F800004D0606900F0DAFE0B2893D1606905999E +:106F900010223730491C13F008FF6069017804297A +:106FA0007CD12421095C8278914201D90620DFE757 +:106FB000052101700320307168460170E2E3112859 +:106FC00094D1606900F0BAFE062804D0606900F030 +:106FD000B5FE0C288AD1E068002813D0206900286B +:106FE00010D060690178062910D00D210170606908 +:106FF000059910225730491C13F0D7FE60695730AD +:1070000009218CE100206946087072E107210170B6 +:107010006069059910224730491C13F0C6FE60696B +:107020004730EDE70228F0D1606900F087FE0028C4 +:10703000EBD0606900F082FE0128E6D0606900F0C4 +:107040007DFE05E0B1E08DE06CE02AE00AE0D6E0EC +:107050000828DAD00521684601710598417868460C +:10706000417146E11128D0D160690028CDD0017866 +:107070000E29CAD1C16A4078022810D000201422FB +:1070800050431430085805991022491C13F08DFE06 +:107090000520216A00F040FE0F205EE0F1E10120B2 +:1070A000EDE70B28B1D160690028AED001780F2937 +:1070B000ABD1C16A4078022826D000201422504368 +:1070C0000C300958059842780A70807848706069D9 +:1070D000C16A4078022819D0002014225043103091 +:1070E000085805990822C91C13F05FFE0520216A83 +:1070F00000F012FE60694178022909D000220832AE +:10710000825C5208520073E00120D7E70120E4E7D7 +:107110000122F4E7012100E0002108314254BCE3E0 +:1071200026B3010011289CD16069002899D001780C +:10713000102996D1C16A4078022811D0002014226B +:1071400050431830085805991022491C13F02DFEA1 +:107150000520216A00F0E0FD112061690870B4E3A8 +:107160000120ECE7082884D1606900289DD00178CF +:10717000112997D10599C06A49780170606905990C +:10718000C06A0622401C891C13F00FFE0520216AEC +:1071900000F0C2FD60694178022904D00022083263 +:1071A000825CFD2323E00122F9E71128BBD160694D +:1071B0000028BBD001781229B5D1C16A40780228D5 +:1071C00019D00020142250431C3008580599102271 +:1071D000491C13F0EAFD0520216A00F09DFD60695D +:1071E0004178022909D000220832825CFB231A4030 +:1071F000022991D18EE70120E4E70122F4E707207C +:10720000B6E6287801288ED16069696814221C309E +:10721000F9F7DAFF6069017F002901D02176ACE33C +:107220000178032901D0032037E00227C770817954 +:107230004907490F8171017A4907490F0172417A63 +:107240004907490F41726069FFF791FD377196E276 +:1072500028780F28E3D1072069460870216A049135 +:10726000916802916946087161690722C91C0298F8 +:1072700013F09BFD61690420087000203071BBE0B1 +:1072800028780328CBD1606901780529696807D07F +:107290000822473013F089FD0420307105206FE289 +:1072A00008225730F6E728780328B8D160690178BA +:1072B0000529696811D008224F3013F076FD0520AA +:1072C00030716069006A00280AD00220287000200E +:1072D00028716069006AA860F9E008225F30ECE775 +:1072E00004204DE22878022899D12879002801D07D +:1072F000207642E36069A96801626069002901D1D2 +:10730000F949016206200BE228780F2887D1A86886 +:10731000E0616069017805292BD047300721317180 +:10732000E16802220A706269126A4A6088606069D4 +:107330003030C8606069C01C08616269087D926A6B +:10734000400812784000D207D20F104308756269D6 +:10735000926A521C8A61FD2210406269D26A1278D8 +:10736000D207920F104308756069C06A401CC8615B +:1073700053E25730D2E728780828BAD160690178FB +:1073800005291AD00B210170072069460870206A70 +:107390000490E069029011200871029803210170A5 +:1073A00051681022401C13F000FD00216846FFF7D1 +:1073B00073FA00203071E06187E20621E3E7287864 +:1073C0000F2896D1072069460870206A0490A868A3 +:1073D00002901120087102980421017061690A78F5 +:1073E000072A0ED0002232710C220A706169102225 +:1073F000401C473113F0D9FC00216846FFF74CFAD6 +:1074000063E21022401C573113F0CFFC0021684684 +:10741000FFF742FA0A203071E168032008706069C2 +:10742000006A486060695730886060694730F3E1FE +:1074300028780828A1D1606969681022373013F0D4 +:1074400087FC002801D0042092E5606900780728B5 +:1074500017D00A203071E168032008706069006A63 +:10746000486060695730886060694730C860206A4A +:1074700008620698FFF7BFFA07466069FFF777FCD6 +:107480006BE208207AE1287809289AD10B20307124 +:1074900061696868897810224018511A13F0E2FC7B +:1074A000082069460870206A049068680190606945 +:1074B0008078087268E129780D29BBD161698979E2 +:1074C000C90703D00C20307109203EE0307103273A +:1074D00070E228780E28ADD160691422291D1C3075 +:1074E000F9F772FE6069018DC06A4172090A817202 +:1074F00060698178C06AC1716169CA6A081D117AC0 +:10750000C909C90111724379626919438378D26A42 +:107510009B079B0F012B00D0002300799B01C0002B +:1075200003431943117260694078012876D0B4E1B1 +:1075300060694178022901D0012100E00021083171 +:10754000405CC00707D00E20EAE069460870206A58 +:107550001146049019E11320B8E728780F2894D138 +:10756000A868E0610F2030710520EEE72878032835 +:107570008BD16069C16A4078022801D0012000E007 +:10758000002014225043103008580822696813F074 +:107590000CFC10203071E1680620226908706069D7 +:1075A000406A48606069C36A4078022801D00120BF +:1075B00000E000201427784310301858CA60886013 +:1075C0002BE128780C2886D16069C26A40780228AD +:1075D00001D0012000E00020142148430C30105855 +:1075E00002230932696800F07CFB11203071E168E8 +:1075F000052008706069006A48606069C06A0930E7 +:1076000088603948001F07E128780B28A7D16169F5 +:107610004878CA6A022802D0012001E059E100201E +:1076200014235843143010588A78696813F0BDFB4E +:1076300060694178C26A022901D0012100E000217D +:107640001423594314315258817850181022511A7A +:1076500013F008FC072069460870206A0490E0696E +:107660000290112008710298062101706169CA6AAE +:107670004978022901D0012100E000211423594357 +:10768000143151581022401C13F08FFB0021684622 +:10769000FFF702F90020E06112206FE028780F2840 +:1076A00091D1072168460170206A04909068029089 +:1076B0000B2268460271029801706169CA6A4978B2 +:1076C000022901D0012100E00021142359430C318B +:1076D00051580A784270497881706169CA6A49785C +:1076E000022903D0012102E02CB301000021142360 +:1076F0005943103151580822C01C13F056FB002189 +:107700006846FFF7C9F826E760694178022901D089 +:10771000012100E000210831405C800703D51420DE +:1077200030710A2011E71620D0E628780F287AD188 +:10773000A868E061072069460870206A0490E06943 +:107740000290112008710298082101706169CA6ACB +:107750004978022902D0012101E011E1002114231E +:107760005943183151581022401C13F01EFB0021C0 +:107770006846FFF791F80020E061152030710A207B +:1077800069460870206A049029466846FFF784F825 +:107790002BE028780F2846D1072069460870206A18 +:1077A00004909068029008200871029809210170E5 +:1077B00061690622C969097841706169801CC969DB +:1077C000491C13F0F2FA00216846FFF765F8AAE7B2 +:1077D00060694178022901D0012200E000220832CC +:1077E000805C400703D51720C8E70746B5E00129AC +:1077F00053D070E028780F2815D1A868E0611820D0 +:107800003071E168052008706069006A486060694D +:10781000C06A09308860F848C860206A0862069823 +:10782000FFF7E9F8E1E76FE028780B286CD1606991 +:10783000C16A4078022801D0012000E00020142213 +:1078400050431C3008581022696813F0AEFA072024 +:1078500069460870206A0490E0690290112008715E +:1078600002980A2101706169CA6A4978022901D027 +:10787000012100E00021142359431C3151581022EA +:10788000401C13F092FA00216846FFF705F800202B +:10789000E0616069407801281DD1192016E6606911 +:1078A0004278022A09D000210831411809780029BC +:1078B0000DD0CA0703D00E2106E00121F4E78907A5 +:1078C00001D5102100E012210170002772E0012A89 +:1078D00001D00D20FAE51C20F8E51D2030710B20A9 +:1078E00033E62978102948D1F0E56069017801294B +:1078F00043D0082941D00021317100F019FA0C2041 +:1079000069460870206A049037E028780F2805D06F +:107910001020107003271B2030714BE007216846B0 +:107920000170206A0490A8680290022168460171E3 +:10793000029805210170217E417000216846FEF702 +:10794000ABFF0B2168460170206A04902946684607 +:10795000FEF7A2FF07461B203071012F0DD029E052 +:10796000012168460170206A049004216846017173 +:10797000217E41710020207612E0207E00280FD069 +:107980006169132008701A2030710A206946087056 +:10799000206A049029466846FEF77EFF074609E004 +:1079A0006069002801D01421017068460078002821 +:1079B00000D021E5384609B0F0BDF7B50F462037B5 +:1079C0003879012686B00C46002804D0012828D03A +:1079D00002281CD197E02079012804D0022811D078 +:1079E000032814D10AE0A068407801280ED10620AF +:1079F000216A04F0D2FD00287FD10CE0A168132099 +:107A0000087008E0A0684178022901D0052674E0DA +:107A10000078082871D1012038710A206946087061 +:107A200033E0089800780F2867D107216846017075 +:107A3000206A049008988568029522790220012A1C +:107A400004D0022A29D0032A57D10FE006466846FF +:107A500006710B202870207B00214007400F6870C2 +:107A60006846FEF719FFA068067045E006466846BE +:107A7000067105202870207B687000216846FEF79B +:107A80000BFF3E710B2168460170206A0490684626 +:107A90000899FEF701FF06462FE0684601710120B4 +:107AA0002870207C6870607CC007C00FA870A07C24 +:107AB0004007400FE870E17C2971C0071FD0207D8E +:107AC0004007400F6871607D4007400FA87100219A +:107AD0006846FEF7E1FEA06807222946303013F021 +:107AE00064F9E068017AA06820300171A168287902 +:107AF0008870A16809200870002630465BE70020E6 +:107B0000A8716871E3E7A168142008700121684634 +:107B10000170206A0490042168460171217B417143 +:107B20000021FEF7B9FEE7E7F0B585B00F46054640 +:107B30000124287B800040198038C66F3078411EB0 +:107B40000A290AD22C498000323140188038C36F8C +:107B50003A463146284698470446002C01D0012C6D +:107B600011D1287B401E0006000E287301D003248B +:107B7000DFE70D2069460870306A04900021019605 +:107B80006846FEF789FE032CD3D0204605B0F0BD31 +:107B900070B515460A46044629461046FFF7C4FF4D +:107BA0000646002C0FD0207814280CD1207E002807 +:107BB00006D000202870204629460C30FFF7B4FF7D +:107BC000204600F0B5F8304670BD704710B5012969 +:107BD00003D0022901D0052010BD417000F0A8F8A3 +:107BE000002010BD002809D0027E002A06D00A46D7 +:107BF00001460C31CCE700002AB301000120704798 +:107C000030B5044687B00D46062004F0ECFC29464A +:107C1000052004F0E8FC2078142805D000206946EF +:107C200008702046FFF7DEFF07B030BD7FB50E4677 +:107C300000216A4611730178092903D00A2903D06B +:107C4000002407E0446900E08468002C02D0217E13 +:107C5000002912D0154601462846FEF7CCFE03281F +:107C600009D1324629462046FFF792FF6946097B33 +:107C7000002900D0042004B070BD25460C35EAE789 +:107C800000B50023012285B005280CD0062808D1B4 +:107C90006846027004910221017143710021FEF7D0 +:107CA000FBFD05B000BD6846027004910271F4E767 +:107CB00010B590B00C4605216A461170019022481B +:107CC0000290001D03900AA96846FFF7AFFF002845 +:107CD00005D1102220460B9913F067F8002010B050 +:107CE00010BD30B505E05B1EDBB2CC5CD55C6C40F2 +:107CF000C454002BF7D130BD10B5002409E00B7837 +:107D0000521E5B00234303700B78401CDC09D2B287 +:107D1000491C002AF3D110BD70B50C46054604F08D +:107D200062FC782300222146284604F0B7FB70BD90 +:107D30004178012900D0082101707047002801D046 +:107D4000007870470820704724B3010070B5F84DE3 +:107D5000040008D0012C10D0022C07D0032C05D031 +:107D6000F4A1752007E0F3A16C2004E02878012835 +:107D700003D0F0A1722013F0A2F92C7070BD70B581 +:107D8000EB4D044610280AD0112C16D028468178D5 +:107D9000122C07D0132C0AD0E6A1A4200BE0E5A1F9 +:107DA000992008E0112908D0E2A19E2003E01129C2 +:107DB00003D0E0A1A12013F082F9AC7070BD10B522 +:107DC000DB4894B0007B002819D017206946087062 +:107DD000D74900A806220D31023012F0E6FF09A9AA +:107DE000684603F0A2FE0446112805D0002C03D0FB +:107DF000D0A1C02013F063F9204614B010BD32208A +:107E0000E4E710B50022022103F086FF10BDFFB5A4 +:107E100095B01D460E460746FFF7F3FF04000AD053 +:107E20002078222804D3A07F8006C00FA84204D166 +:107E3000082019B0F0BDC348FBE737216846017040 +:107E40004780002D05D0012101714671179981717C +:107E500002E000206946087109A9684603F065FE42 +:107E6000A07FDF21084069010843A0770020E0E7F8 +:107E700070B50446084620380D46030013F040FA5A +:107E80000A060A11232C334249505761FF20A9A149 +:107E90000D3052E02078202851D1FF20A5A11030CC +:107EA0004BE0A3480178032949D08078132846D0B5 +:107EB0002078242843D0252841D023283FD0FF20F4 +:107EC0009CA1133039E02078222838D0232836D8D6 +:107ED000FF2098A11A3030E0207822282FD0FF20F0 +:107EE00094A11E3029E02078222828D0242826D0EA +:107EF000262824D0272822D0292820D0FF208DA171 +:107F000021301AE02078252819D0FF2089A12830B7 +:107F100013E02078252812D0FF2086A12B300CE01A +:107F2000207825280BD0FF2082A12E3005E0207874 +:107F3000282804D0FF207FA1313013F0C0F825702D +:107F400070BDFF207BA13430F7E730B57E4C0B8845 +:107F50007E4A022801D0934204D09D1FA54225D21B +:107F6000022802D04D88954203D04D88AD1FA5420E +:107F70001CD24C88A34219D88B88FF25F435AB421C +:107F800014D8022802D0C888904205D0C8886E4D07 +:107F90000A382D1FA84209D2C888904208D09442BE +:107FA00006D05B1C63438000834201DB072030BDA9 +:107FB000002030BDF0B56649884245D3654A0125A9 +:107FC000AD041368A84201D398423DD30279002A38 +:107FD00006D0082A02D8067B082E05D90720F0BD56 +:107FE000047B002CFAD0F6E7002A06D004688C4205 +:107FF0002AD3AC4201D39C4226D3002E06D08468FB +:108000008C4221D3AC4201D39C421DD300240CE00E +:108010000568A700ED598D4216D30127BF04BD4264 +:1080200001D39D4210D3641CE4B2A242F0D80022D6 +:108030000125AD040CE084689700E4598C4203D319 +:10804000AC4203D39C4201D21020F0BD521CD2B2EC +:108050009642F0D80020F0BD10B502893E4B111FAA +:10806000994213D24189042910D3DB1C99420DD8BF +:1080700091420BD80178890706D54068002803D0C3 +:10808000FFF798FF002800D1002010BD072010BD89 +:10809000FFB50022099B002802D0994205DC6EE062 +:1080A000002902D1002004B0F0BD0920FBE7845C68 +:1080B000002C12D087187D78112D59D010DC2B00A0 +:1080C00013F01EF90A561726262C2C2E2E4C4C5631 +:1080D000835C002B46D1521CD2B28A42F8DBE1E726 +:1080E0001C2D45DA123D2B0013F00AF9044242120E +:1080F0001A42022CD9D1BB78039C072B237001D2E2 +:108100005B0701D40A20CEE7029B01241B782CE0F8 +:10811000E343DB0708E0012C08D029E00620C2E792 +:108120000F2523072D075B19002BF4D03046BAE743 +:10813000640C00207372635C6761705F636F7265CB +:108140002E630000023000007B0C0000FFFF0000E7 +:1081500000D0010028000020FD3F0000029B1B789A +:108160009C0701D50B209EE702242343029C237029 +:10817000835C521C9A18D2B28A4202DD95E7192616 +:1081800076028A4293DB8DE710B504780B46002C0B +:1081900008D00121F94A012C07D0022C0BD0032C66 +:1081A00013D10EE00021197011E01970817989094D +:1081B00003290AD10BE0197081798909012904D1B9 +:1081C00005E019708179890901D0104610BD411C64 +:1081D0000622581C12F0E9FD002010BD08B5134618 +:1081E000002806D0E6A00068009048796A46800919 +:1081F000105C18700622581C12F0D7FD08BD30B56F +:108200000C46097895B0222902D2082015B030BD5D +:10821000282369460B704880132A03D03B2A01D0DB +:108220000720F3E708460A7109A903F07EFC050060 +:1082300003D121212046FFF71BFE2846E6E700B5C3 +:1082400095B0232369460B70488010888880508839 +:10825000C880D08848819088088100208881C881A2 +:1082600009A9684603F061FC15B000BD70B50C00AB +:10827000064610D0FFF7C5FD050003D1C149C2482D +:1082800012F01DFFA6802889E08028892081688956 +:108290006081A889A08170BD70B50E46050003D02D +:1082A0000021092004F09FF90120B84C022E207310 +:1082B00024D0032E04D0D320B249800012F0FFFE58 +:1082C000B24806210D3003F027FFA07C8006800E07 +:1082D000A074FFF774FDA08B00280ED0002D0CD0E9 +:1082E000830001220021092004F0D8F8092804D0D5 +:1082F000A548A449283012F0E2FE70BDA34803212E +:10830000103003F009FFA07C40218006800E084356 +:10831000A0749E480C3002F052FBDAE77FB501A949 +:10832000022003F068FD002851D097489549673036 +:1083300012F0C5FE4BE0029C2078212847D0A07F98 +:1083400001072BD520462230009068462346628ED6 +:1083500080882146343301F083FC050005D01128C4 +:108360002ED089488749843028E0A07FF721084033 +:10837000A077E17F480889074000C90F0843202102 +:10838000095D4007400FC9000843E077207828289E +:1083900024D129212046FFF76BFD1FE0400716D5A9 +:1083A00068462246808821460E32FFF748FF0500C6 +:1083B00008D0112804D074487249933012F07FFE1F +:1083C00000250BE0A07FFB210840A07706E001A874 +:1083D00003F01FFD0500AED0052D02D0284604B0E5 +:1083E00070BD0020FBE7F8B5040004D1664865497C +:1083F000A13012F064FE72202070606808260178B7 +:10840000091F0B0012F07CFF11FD0A4668FC460EA6 +:10841000FCFC4746464646FD92FD46007B205949F6 +:10842000C00035E087883846FFF7EBFC050004D133 +:108430001F205449400112F042FE6078042130436D +:108440006070524CA07F0843A07721212846FFF797 +:108450000FFDA87F8007800F012801D1801EA0801A +:10846000384603F0ABF83846FCF7FDFF3846FBF71B +:10847000A0FB3946022004F0B6F8A87FEF2108409F +:10848000A877FFF74BFF002804D03F483D49C9308B +:1084900012F015FEF8BD85882846FFF7B2FC0028CB +:1084A00004D139483749D33012F009FE606880782A +:1084B000012804D034483349D53012F000FE6068FA +:1084C0008179284603F096F90028E3D0617831439A +:1084D00061706168C880F8BD87883846FFF791FCF5 +:1084E000050004D128482749E63012F0E8FD6078FD +:1084F0003946304360706068C088288160680089B0 +:10850000688160684089A881022004F06CF800202E +:10851000A875A87F8007800F0228DCD1FFF7FEFE38 +:108520000028D8D0212017494001B1E780783C28A5 +:1085300003D00025022814D000E0012500270028E0 +:1085400008D03C2806D0022804D00F480D49FF303F +:1085500012F0B5FD002F06D00226304601F06CF96E +:10856000F8BD0127EBE76078304360700748817FF2 +:1085700031438177002D0BD00126EEE70232000057 +:108580000302FF01348100002E030000640C002070 +:1085900060688788384601F07BF905466068807915 +:1085A000012832D00226A87F0622800880003043AE +:1085B000A8776068C08A28816068008B68816068DD +:1085C000408BA8816068C079E875616828461830DA +:1085D000083112F0EAFB60680622807B68706168EF +:1085E000A81C0F3112F0E1FBA87F8107890F3846E4 +:1085F00002F0CEFFA87F8007800F0128ADD101E0F7 +:1086000005E008E0FE488780A7E70126CBE7204683 +:1086100001F02DFEF8BD607830436070F8BDF7B50D +:1086200005460078002700090C463E4601287DD00B +:108630000022F44902287AD0072804D00A2877D0EB +:10864000F149F24839E1686803780D2B35D006DC32 +:10865000042B6ED0072B3AD00A2B69D106E0122BDF +:108660003CD0132B44D0142BF7D1BEE011270726A2 +:10867000002C7CD08088A0806968FB238979A17157 +:10868000DF4905468A7F1A408A77042103F06BFB95 +:108690000521284603F067FB0021284603F063FB11 +:1086A0000121284603F05FFB0321284603F05BFB12 +:1086B0000221284603F057FB01E101270926002C7F +:1086C000D7D08088A080686880792072F7E0122770 +:1086D0000E2680882146FFF7C9FDF0E01A270726FD +:1086E000002CC6D04088A08068680079A071E6E0C0 +:1086F00081783C293ED010271E26002CB9D08088D6 +:10870000A0806868C08A20836868C08AE082686840 +:10871000008B60836868408BA0836968607D497FB7 +:1087200040084000C907C90F084303E06CE097E028 +:10873000BAE029E060756968C007497FC00F490841 +:108740004900084360756968A21DC8790831FFF7C0 +:1087500045FD69682246887B0D320F31FFF73EFDEB +:1087600068688079002803D00120207507E076E052 +:108770000220FAE719270726002C70D0A271A04822 +:10878000F722817F11407DE01B272E26002C66D02A +:10879000A1806968A21D0879491DFFF71FFD68685F +:1087A0002030C07A60736868C0780428A07B19D034 +:1087B00040084000A073F921084069681F22C97869 +:1087C0008907490F0843A07369684007C97A400FB9 +:1087D000C9000843A073696820460F300C3112F0BD +:1087E000E4FA6CE001210843E4E71E270E26002C82 +:1087F0006DD0A1806868E21D407AA07169688878B0 +:10880000C91CFFF7EBFC5AE0287A012805D00228A2 +:1088100015D07E487C4932384FE01D270E26002CAB +:1088200055D06888A080A889E080E8892081288ABE +:108830006081688AA0817248DF22817FA2E71227C7 +:108840000E266888FFF712FD002C40D0687840079C +:10885000400F032833D16A48FD22817F92E736E03A +:10886000287A030012F04CFD060410102020202668 +:1088700019270726002C2AD0A1806148A271817F88 +:108880004908490081771AE019270726002C1ED0D5 +:10889000A180287A012805D00320A0715848EF2232 +:1088A000817F6FE70220F8E721462846029A01F00F +:1088B0006BFEFEBD55485449801F12F000FC029823 +:1088C000002C068001D0278066800020FEBD029823 +:1088D0000680FAE710B54A4894B08078132802D091 +:1088E000082014B010BD22206946087009A9684606 +:1088F00003F01BF904460021072003F074FE204614 +:10890000EFE700B53E4895B08078122801D00820E6 +:10891000AAE41E216846017000218170C17009A976 +:1089200003F003F90028F3D10021072003F05BFED8 +:108930001120FFF724FA002096E400B5304895B0E6 +:108940000078022801D0032818D11B2108A8017340 +:108950000021817369460BA803F0E7F8002804D1D1 +:10896000684640781B2801D003207DE4002108469A +:1089700003F039FE68468078002801D0082073E4AF +:108980000120FFF7E3F900206EE4F8B51C4C03006A +:1089900012F0B6FC0A067917797979794435677946 +:1089A000FFF7CBFF00282AD1F8F7DCFF002826D0FC +:1089B0002221017000210172F8F7B5FFA07F01218B +:1089C0004BE08EB23046FFF71CFA050004D10F4889 +:1089D0000D492E3012F073FB287821280FD0F8F7BC +:1089E000C1FF002814D012210170022707724680AF +:1089F0000020A875F8F797FFA07F3843A077F8BD4F +:108A0000640C0020FFFF0000348100005F050000BF +:108A1000132229463046FFF7F2FBF0E7A578122D26 +:108A200006D0132D07D0F849F84812F048FBE6E7C6 +:108A3000FFF767FF01E0FFF74DFF0028DFD1F8F7F0 +:108A400091FF0028DBD022210170122D07D00221D6 +:108A50000172F8F768FFA07F10210843CEE70121DB +:108A6000F6E7A07C810901290BD0800904D0E748F2 +:108A7000E549223012F023FB03210020FFF70CFC14 +:108A8000BDE70221F9E7E148DF492930CDE7F7B535 +:108A900014460D0004D1DD48DB49313012F00FFBE4 +:108AA00028780827012807D002281FD0D748D649A0 +:108AB000623012F004FBFEBD0098FFF7A2F9060039 +:108AC00004D1D248D049383012F0F9FA0220B075FA +:108AD0001030207060783843607007CD083407C4C8 +:108AE000CB482022817F11438177FEBD0098FFF79C +:108AF00088F9060004D1C548C349463012F0DFFAB0 +:108B0000A988C448814208D1EA88824205D113224B +:108B100031460098FFF773FBFEBD814202D1E88821 +:108B2000002809D01220207060783843607007CD8B +:108B3000083407C4002006E07823002202200099B0 +:108B400003F0ACFC0120B075FEBDB1484089704710 +:108B5000FFB591B01498FAF71DF900285DD10124F2 +:108B6000684603218471C9028180002201A9204640 +:108B7000FBF7EEFA002850D16846152184714902AE +:108B8000818000261C2102A8009612F06DF90120B8 +:108B90000146684610310170002001466846417068 +:108BA0008178F9273940891C21438170017A022597 +:108BB0002943017212998186C6861F2101870C9074 +:108BC00011980F9001A80B9009AA0BA902A8FBF716 +:108BD0008AF8002821D168468D4E808CF080684646 +:108BE00084718D498180807809AA3840801C4108B1 +:108BF0004900684681708586058713A80F900BA9E8 +:108C000002A8FBF770F8002807D16846808C3081F5 +:108C100031460A311498FAF7D0F815B0F0BD30B5E6 +:108C20000C467E4995B08C423CD37D49012292048A +:108C30000968944201D38C4234D3203800220125A4 +:108C4000030012F05DFB06042A44484E575F0021E2 +:108C5000082003F0A2FC002802D0112015B030BD7E +:108C600024206946087000A80522A11C023012F0D9 +:108C70009CF809A9684602F058FF05002FD1082387 +:108C800000221146184603F009FC082827D05F4847 +:108C90005D49D63012F013FA21E06068002803D055 +:108CA000884201D21020D9E73D2168460170218811 +:108CB00041806188818009A902F037FF05000ED14B +:108CC000606800280BD06946098D018007E02068A4 +:108CD00001F0BCFE02E0204600F024FE05462846D6 +:108CE000BCE73E2007E0857000E0827009A902F031 +:108CF0001CFFF3E73420694608702078C0076846F7 +:108D0000F3D0F0E70720A9E730B50C46444995B009 +:108D100009688C4201D21020A0E72038030012F02D +:108D2000EFFA05042121232132002088FFF769F89A +:108D3000002804D00078222803D208208EE7394882 +:108D40008CE72521684601702188418009A902F03D +:108D5000ECFE050015D10AA905220231A01C12F073 +:108D600024F80EE006250CE02068002805D0884293 +:108D700001D2102505E001F057FE25480025808B23 +:108D8000A08028466AE7072068E72148133070472B +:108D900010B520211E4812F065F80120FEF7D6FF1D +:108DA0001120FEF7ECFF00211948C9438180002102 +:108DB0008176E1218900818301460C300D31044622 +:108DC000F8F750FE124807222146133011F0EDFF4C +:108DD000FEF7F5FF002803D00B49134812F06FF996 +:108DE00001F0F6F910BD10B504463C2112F03AF836 +:108DF000A07F80088000A077202020700020A07530 +:108E00002034607010BD000034810000B505000002 +:108E1000640C0020FFFF0000012A000000D00100C8 +:108E200028000020023000001C0700007047FEB53B +:108E30000546FF480C46814207D301208004844246 +:108E400005D3FC480068844201D21020FEBD002DED +:108E500002D0012D32D126E0F74908220F4668469C +:108E600011F0A3FF39462046FFF78EF90028EDD117 +:108E7000FEF7A5FF060006D007226946384611F026 +:108E800094FF3046FEBD2078002801D0012805D18E +:108E9000E94807223946C01D11F087FF002109204B +:108EA00003F0A1FB0FE00978002907D0012905D0C4 +:108EB000022905D0032903D0E048FEBD0720FEBDEE +:108EC0000120FFF7E9F9DC480C3885760020FEBD6B +:108ED00010B5D8490968884201D2102092E7D649D6 +:108EE00002460C390B7B0D311846FFF777F900204D +:108EF00088E7FFB599B00546002008A908746946BF +:108F0000087108A908730875CA4814460121C84A9F +:108F1000890400681E46002D05D095420BD38D4272 +:108F200001D3854207D3002C08D0944203D38C424E +:108F300004D3844202D210201DB0F0BD2846204345 +:108F400018D01F270BAB0CAA009728461A99FFF7D9 +:108F50009FF80028F0D10DAB01AA314620460097BA +:108F6000FFF796F80028E7D168460079C00703D0DC +:108F70000A20E1E70720DFE702AF002D0FD01A201B +:108F8000694608721A9888722946F81C1A9A11F0D4 +:108F90000CFF0EA902A802F0C8FD0028CCD1002CBD +:108FA0000ED0202168460172867232462146F81C96 +:108FB00011F0FBFE0EA902A802F0B7FD0028BBD1FC +:108FC0009D4908A8007B0C3948700020B4E770B5B3 +:108FD00006460A200C46087015461146204602F047 +:108FE000A4FD002807D1392121702046294602F02E +:108FF0009CFD002804D0082801D19048401C70BD79 +:109000002A462146304600F0B9FC0446082803D120 +:109010008B498C4812F053F8204670BDF0B50446D9 +:1090200089A003C897B0824D002715911490AC42D7 +:1090300011D380480121890403688C4201D39C42EA +:1090400009D32078012809D16268AA4203D38A4251 +:1090500004D39A4202D2102017B0F0BD76490C39E1 +:109060000A78012A0CD18A88794B9A4203D00028C9 +:1090700006D0012804D08A7F13079B0F06D101E098 +:109080000820E9E7D30701D1910701D51120E3E7D3 +:10909000218A704B0A46203A9A4207D3012877D199 +:1090A000002975D1628A002A72D111E0022801D00C +:1090B000032801D1A0296BD3012809D05E4A0C3ABC +:1090C0005278D20704D0628A002A61D0B42A5FD8CD +:1090D000002806D0012808D0022804D0032857D140 +:1090E00017E0002518E0022516E0002902D1608A69 +:1090F00000280CD004256068007800280CD00128D6 +:1091000009D0022807D0032805D04C48A4E7012540 +:10911000F1E7032500E00127207A002806D0012886 +:1091200006D0022806D0032867D105E0002604E017 +:10913000012602E0022600E00326002D01D0022DC8 +:1091400016D1002E14D0E068002803D0FEF732FFBD +:10915000002881D138480C384078800702D0374841 +:10916000401E79E7022D03D1022E46D0032E44D0B3 +:10917000182168460170218A4180218A8180857189 +:109180002D480C38007B002803D001286FD104E063 +:1091900033E000216846C17102E001206946C871D0 +:1091A0006846077221780930012920D0062111F084 +:1091B00059FE69460E74207D8207C107D20F400711 +:1091C000C90F5200C00F11438000014314A8405C36 +:1091D0006946C873002810D009A9684602F0A5FCAA +:1091E000002893D1002D0AD0022D08D012E061682A +:1091F0000622491C11F0D9FDDBE707202CE7002EE1 +:1092000008D0E068002805D009AA6946FFF7DFFE0C +:109210000028A6D11B20694608700120887009A982 +:10922000684602F082FC00289BD108A8407913E030 +:1092300000D0010028000020700C00200232000045 +:10924000348100002708000007060504030201001E +:10925000FFFF0000E13F00001B2819D12B0012F096 +:109260004FF80504040707040A00032001E00FE09B +:109270000220FEF76BFD012D0CD0608A002809D07A +:10928000002283001146104603F008F9002801D09F +:109290000320E1E60020DFE6F3B5032687B00D46A4 +:1092A00000290AD0FE4885426FD301208004854200 +:1092B00003D3FC480068854267D30798FEF7A1FDF9 +:1092C000040005D02078222804D2082009B0F0BD7F +:1092D000F548FBE7A07F8707BF0F002D05D0294683 +:1092E0003846FEF732FE0600F0D139460027EF4837 +:1092F000012907D0022931D0ED49EE4811F0DFFEF7 +:109300003046E3E7A27D2946012A02D0827F9207F8 +:1093100001D51120DAE700291BD108216A460497FC +:1093200011820592418904AAE348FBF701FB00285A +:10933000CCD16846008A082801D00320C6E76846D9 +:10934000018801814188418181888181C188C181F1 +:1093500002A9079802F0E1F90646D1E7A17D0229AA +:1093600016D1807F800613D4002D04D0A07F400743 +:109370000CD4002100E00121079802F00EFA06004B +:10938000BED1A775002DBBD004E01AE01126B7E7C7 +:10939000002D16D02A4621460798FEF750FF0646B4 +:1093A0001128ADD1A07F4007AAD420460822294623 +:1093B0000E3011F0FAFCA07F04210843A0770026AC +:1093C0009EE7102082E770B50C460546FEF719FDB2 +:1093D000010004D022462846FEF711FF70BDB248B6 +:1093E00070BD00B50146143195B0192901D281072D +:1093F00007D001461E3104D00A3102D0072015B033 +:1094000000BD312269460A70887009A9684602F0D9 +:109410008CFBF4E701B582B0022069460880A348BE +:1094200002AB00896A460021FBF7ECF8694609881F +:10943000022900D003200EBD1CB50021009102219D +:109440006A461180974901900968884201D210202C +:109450001CBD964801899848FBF76AFA6946098855 +:109460000229F5D003201CBDF0B50E468C4985B00D +:10947000174605468E4207D38A48012292040068A7 +:10948000964204D3864202D2102005B0F0BD1F2FB1 +:1094900001D90C20F9E7854C8D4226D3954201D3A2 +:1094A000854222D3E08803A9FBF75DF80028ECD1C0 +:1094B000287869464873E08803A9FBF735F8002847 +:1094C000E3D1694600900878022108436946087094 +:1094D000497B090703D00821084369460870E088E2 +:1094E0006946FAF7BAFF0028CFD169468F80E08835 +:1094F000334601AA0021FBF785F869468988B942FD +:10950000C3D00320C1E71CB50C4600210091019196 +:10951000228869460A80634901900968002801D0C1 +:10952000884201D38C4201D210201CBD002801D0FA +:10953000002A09D05D486A46C1885F48FBF7F8F900 +:109540006946098821801CBD0C201CBD10B5012373 +:10955000FEF75DFC56E4002310B51A461946FEF7E7 +:1095600056FC4FE470B504464D4894B0844207D38E +:1095700001208004844206D34A480068844202D213 +:10958000102014B070BD2046FEF766FD0028F8D10B +:1095900046488178112901D00820F2E7817FC90669 +:1095A00001D51120EDE71D2269460A7021780025BA +:1095B000CA07D20F69468A7022898A806289CA8066 +:1095C000217801268907CA0F69464A72007B002864 +:1095D00003D0012804D00320D3E708460D7201E030 +:1095E00008460E7209A902F0A0FA0028C9D1207815 +:1095F000800708D56068002805D009AA6946FFF7EA +:10960000E6FC0028BDD11E21684601708670C57039 +:1096100009A902F08AFA0028B3D1A08900F073F9F1 +:109620000400AED11220FEF7AAFB2046A9E7F0B550 +:1096300016461C4A0C46050019482049126899B084 +:1096400005D085420FD38D4201D395420BD384427E +:1096500009D38C4201D3944205D3864203D38E4270 +:1096600004D3964202D2102019B0F0BD0F4FB87F3C +:10967000C106890F01D1400701D51120F4E720462A +:10968000FEF7EAFC0028EFD120788107C90F2943B3 +:1096900003D0800714D5002D12D00720E4E7000086 +:1096A00000D001002800002002300000640C0020DF +:1096B00034810000F3090000FFFF000000000400F7 +:1096C00031460220FEF741FC0028CDD1C948807800 +:1096D000112803D0122801D00820C5E70220002756 +:1096E00014A9189002F087FB00280DD0C2A1C6482B +:1096F00011F0E5FC08E01598807F81071898890F24 +:10970000814201D17F1CFFB214A802F082FB002825 +:10971000F1D0032F01D30420A6E7B64880781228A1 +:1097200003D1FFF7EEF800289ED12078800708D5F6 +:109730006068002805D009AA6946FFF748FC0028A0 +:1097400092D12121684601702189418061898180FF +:10975000207800278007C10F684681712078800734 +:10976000002815DB2878002807D0012808D0022817 +:1097700006D0032804D0A54876E76846C77102E002 +:1097800001206946C8710622691C02A811F00DFB70 +:109790009848007B002803D0012804D0032063E709 +:1097A0006846877302E001206946887331886846FD +:1097B000018271884182B1888182F188C1820783E8 +:1097C000478309A902F0B1F9002886D1A08900F0E9 +:1097D0009AF80400A0D11320FEF7D1FA204643E7FF +:1097E00030B505468A4895B000680C46814202D2E1 +:1097F000102015B030BD2846FEF703FB002807D027 +:109800000178222902D3807F800603D40820F0E764 +:109810008048EEE7132168460170458009A902F0EF +:1098200084F90028E5D108AA0A2151567F2901D0E0 +:109830002170DEE70520DCE710B56E49012807D06E +:10984000022815D0FF206CA14D3011F038FC81E6C4 +:109850000878032804D0FF2067A1433011F02FFCC3 +:109860000021084602F0BFFE0120FEF76FFA71E604 +:109870008878132804D0FF205FA1483011F01FFC26 +:109880000021072002F0AFFE1120FEF778FA61E612 +:10989000F8B504460122022102F03EFA07460122F1 +:1098A0000321204602F038FA06460122052120460F +:1098B00002F032FA054601220421204602F02CFA79 +:1098C0000446002F04D1AF204BA1800011F0F7FB1C +:1098D000002E04D14C4848A11A3811F0F0FB002D9D +:1098E00004D1494844A1193811F0E9FB002C04D1F6 +:1098F000454841A1183811F0E2FB22213846FEF715 +:10990000B7FA3846F8BD10B5002809D08300002208 +:109910001146072002F0C2FD072801D0032019E6F6 +:10992000002017E610B50446006800280CD03A491C +:10993000884207D301218904884205D33449096844 +:10994000884201D2102005E601F062F8A088294C77 +:10995000A083A07E01280DD10021092002F01DFE68 +:10996000002800D00120A17C8909012904D003210D +:10997000FEF792FC0020EDE50221F9E7F7B500269D +:109980000C4605460B271AE02968B00009580978EB +:10999000002903D0012901D00720FEBDA17029684C +:1099A00006220958E01C491C11F0FFF927702046D7 +:1099B000029902F0BAF80028EFD1761CF6B22879A5 +:1099C000B042E1D800263A270FE0A868B10041581C +:1099D0001022A01C11F0E9F927702046029902F02C +:1099E000A4F80028D9D1761CF6B2287BB042ECD876 +:1099F0000020FEBD640C00207372635C6761705FC1 +:109A0000636F72652E630000D7020000023200000F +:109A1000280000200230000000D0010030B5F94BD2 +:109A20009A4207D301239B049A4205D3F64B1B6845 +:109A30009A4201D2102030BD1578EB065B0F042B43 +:109A400007D85478072C04D39378102B01D8A3425D +:109A500001D2072030BDD3785B0702D413795B07AE +:109A600001D5062030BDC37FAC075B085B00E40F67 +:109A70002343C3770878EF23184013789B06DB0F46 +:109A80001B0118430870F12318401378DB065B0FA5 +:109A90005B001843087050780873002030BD30B563 +:109AA00000240C70C378DB07DB0F0B70C578AD07A3 +:109AB000ED0F6D002B430B70C5786D07ED0FAD00FA +:109AC0002B430B7014700179C907C90F117003790A +:109AD0009B07DB0F5B001943117000794007C00F33 +:109AE00080000143117030BD70B514460D46064626 +:109AF000F7F738FF002809D0A2210170142221466F +:109B00000830F7F761FBF7F70EFF70BD1322294607 +:109B10003046FEF774FB70BD70B514460E46054620 +:109B2000F7F720FF002809D0222101704580217815 +:109B3000017261784172F7F7F6FE70BD132231466B +:109B40002846FEF75CFB70BD10B5B04C207C0028A9 +:109B50000CD1204621461038FEF7AAF8002803D081 +:109B6000ABA1F12011F0ABFA0120207410BDFFB5BC +:109B700081B00A9D06461C4617461421284611F05E +:109B800073F90B9800210160F8070ED09E492068F8 +:109B90000968884239D31230286020681430686020 +:109BA0002068A8600B9821680160B80726D5606816 +:109BB000002803D094490968884226D302990029D5 +:109BC0000AD0FC3600280ED031461030FEF7DCFA01 +:109BD00000281BD1606810E0002816D0E8608036AD +:109BE0006068B0670AE0FFF7D0F801460722304608 +:109BF00011F0DBF8FFF7A8FF8448E860780708D584 +:109C00008149A0680968884202D2102005B0F0BDE1 +:109C100028610020FAE770B5054611200C4608704F +:109C2000002161702121495D002908D003290ED04F +:109C3000042910D0FF2076A1523011F040FA20788C +:109C40000009012802D9E87FC008607070BD0007D4 +:109C5000000F203002E00007000F30302070EEE7E8 +:109C600070B594B015460C462C226946189E0A70B1 +:109C70004880002B17D00822194601A811F095F84A +:109C800068468581102231460E3011F08EF809A900 +:109C9000684601F04AFF002803D1A17F102211433A +:109CA000A17714B070BD002001900290E8E7F0B5F4 +:109CB0000646008A97B080B20D460190FEF7A1F8E3 +:109CC0000446524831784838554F09900B0011F03E +:109CD00017FB0EF2F148085F87ABCAF3EFEEEDEC2D +:109CE000EBF2A07F8007800F012807D0002100221F +:109CF000019802F011F8050007D101E00121F6E713 +:109D0000FF2043A1943011F0DAF9387CC00904D067 +:109D100043484038406DA86112E02B206946087224 +:109D20000BA902A801F001FF002804D0FF2038A1F0 +:109D30009F3011F0C4F93B490C9811F09FF8A961CC +:109D40007068A862B068E862A07F8007800F012871 +:109D500020780DD0252804D0FF202DA1B03011F09F +:109D6000AEF9324621460198FFF7BEFE17B0F0BDAE +:109D70002528F6D0222806D0242804D0FF2024A1AC +:109D8000A93011F09CF925212046FEF771F8E8E78B +:109D9000A07F8007800F012807D0002100220198B2 +:109DA00001F0BAFF060007D101E00121F6E7FF202C +:109DB00017A1BB3011F083F92078252804D0307822 +:109DC000012108433070D1E702202870B068A860F4 +:109DD000B068002802D000202871C7E70120FBE707 +:109DE0002B2069460870094968464C3901F09DFEF0 +:109DF000002804D0FF2006A1DA3011F060F903201A +:109E00002DE0000000D0010028000020300D0020CF +:109E10007372635C6761705F7365632E630000003B +:109E2000500E002040420F002A206946087000A80A +:109E300010220230716810F0B8FF04A8102202301E +:109E4000B16810F0B2FFFE49684601F06EFE0028CE +:109E500004D0FF20FB49EB3011F031F904202870C9 +:109E60000998686082E7B068002804D1FF20F549AE +:109E7000F73011F024F9E07F400704D5FF20F149C5 +:109E8000F83011F01CF9B06806220A3800903379D6 +:109E90000421019801F041FA002894D0FF20E949FB +:109EA000FD3011F00CF961E774E1D5E0CBE0A8E0FA +:109EB0004BE001E083E087E1002C04D18120E149FF +:109EC000800011F0FCF8204622301022054671680F +:109ED00010F06BFF28212046FDF7CAFFA07F800706 +:109EE000800F02280CD100231A46214600950198C4 +:109EF000FFF7B6FE11280BD029212046FDF7B8FF49 +:109F0000E07F317A4007400FC9000843E0772DE732 +:109F1000A07F000703D5CB49CB4811F0D0F8A07F34 +:109F200008210843A077002060862046343010F0D6 +:109F300099FFE07FFD220146C9071040890F0843C1 +:109F4000E077307A2034207010E7A07F8007800F00 +:109F5000012807D000210022019801F0DDFE040055 +:109F600007D101E00121F6E7B748B6491D3011F0ED +:109F7000A6F82B2069460872B14902A801F0D5FD68 +:109F8000002804D0B048AF49223011F098F8AC480E +:109F90008188204621300176090A41760E212970F8 +:109FA0002146FC316960017E2974407E6874A448B2 +:109FB0002C30A860103030346C61E860D6E6002C9C +:109FC00004D1A1489F49363011F079F82078212832 +:109FD0009DD93079012802D0022808D103E0E07F22 +:109FE00004210843E077387C012108433874324665 +:109FF00021460198FFF778FD23212046FDF738FF21 +:10A00000B4E601220421019801F066FC00289BD0EF +:10A01000A07F8007800F012807D00021002201982F +:10A0200001F07AFE040007D101E00121F6E786483D +:10A030008449543011F043F80F20287017202871FC +:10A040006E34AC6092E60421019801F094FC002883 +:10A05000B4D11020287089E6A07F8007800F0128E6 +:10A0600007D000210022019801F056FE050007D11B +:10A0700001E00121F6E7744872496D3011F01FF8D4 +:10A080002E462036307E41064DD5A17F8F07BF0F6B +:10A09000C00713D02A468032516F00290ED0087CA9 +:10A0A000F37DC007C00F5B0018430874516FE27F57 +:10A0B00040084000D207D20F10430874307E0007DA +:10A0C00013D528468030026F002A0ED0117CF37D14 +:10A0D000C907C90F5B0019431174E27F49084900A1 +:10A0E000D207006FD20F11430174307E80070BD569 +:10A0F000F8204259002A07D0012F05D02946307C8C +:10A1000031311032FEF76AF8307EC0060BD5F820E8 +:10A110004259002A07D0012F05D12946307C313120 +:10A120001032FEF75BF8052368460370357E4570F4 +:10A13000434822216038019A01704178C908C9005A +:10A14000C91C4170428003724572F7F773FD207895 +:10A15000252809D021280BD00B203A49800110F086 +:10A16000AEFF2078222803D922212046FDF780FE69 +:10A17000A07F8007800F01280AD00021019801F0FC +:10A18000F2FD002800D1F1E559202E49C00088E6F3 +:10A190000121F3E774682A4D20786035092802D040 +:10A1A0000A28F0D10BE0E168002902D02846F8F730 +:10A1B000C8FE2169002902D02846F8F7C2FE2146D0 +:10A1C0002846F8F7BEFED1E51F481E49DC3068E698 +:10A1D0001B4810B5072228216030F8F799FE1B486C +:10A1E0000024017C4906490E017440384465FDF79E +:10A1F000ECFC13493C3108461038F7F76AFC10486C +:10A200004C30047410BD70B50D46FDF7FAFD040026 +:10A2100004D1C3200B49800010F051FFFF2105310C +:10A22000284610F021FEA07F8007800F012814D05F +:10A23000022128468830FDF7C9FC00280CD007E031 +:10A24000E40C0020109E000011020000500E0020BF +:10A25000FA49FB4810F033FF70BD0121E9E70A46D7 +:10A26000014610B510468830FDF7CAFC10BDF0B5A8 +:10A2700005464068082601789BB008290DD00B29B7 +:10A2800003D00C2940D10121817168688788384644 +:10A29000FDF7B7FD040042D13CE047883846FDF7A2 +:10A2A000B0FD040004D1E648E449153010F007FF82 +:10A2B0002078212828D0282828D1686802210C304D +:10A2C00000F0A7FF002821D068680821001D00F0D9 +:10A2D000A0FF00281AD02D21684601704780214632 +:10A2E0001022223101A810F060FD0FA9684601F08C +:10A2F0001CFC002804D06720D049C00010F0DFFE0D +:10A3000029212046FDF7B4FD1BB0F0BD687830432D +:10A310006870F9E7CA48C949423010F0D0FEA07F02 +:10A320008107890F022902D1EF210840A077207808 +:10A33000212810D068688179002902D0807800280F +:10A3400018D0A07F8007800F022864D0E320BB498B +:10A35000800010F0B4FEA07F8007800F0228D3D1C8 +:10A36000FDF7DCFF0028CFD0B548B449883010F0A5 +:10A37000A6FEC9E7687830436870E07FC00701D067 +:10A38000042100E00321212001552078292818D03C +:10A390002428E0D13946062002F025F92221204662 +:10A3A000FDF766FDA07F8007800F012831D00021D6 +:10A3B000384601F0D8FC0028CDD0A1489F496D3027 +:10A3C000C7E7A07F8007800F012807D00021002267 +:10A3D000384601F0A1FC050007D101E00121F6E7B4 +:10A3E000DB209649800010F06AFE25212046FDF70B +:10A3F0003FFD0D2008A90871284609A98830FDF7FE +:10A40000F1FB0228A7D00028A5D08D488B496230E7 +:10A410009FE70121CCE76878304368709BE7F7B588 +:10A420008AB015460646FDF7ECFC002844D00178BA +:10A43000222941D323293FD0C17F49073CD4807FC3 +:10A440008007800F01280ED0002201280DD00021A6 +:10A45000304601F061FC07467A480290F8F768FD43 +:10A46000040009D103E00122EFE70121F0E7ED202C +:10A470007249800010F023FE002F1FD088376761DB +:10A480000298F8F755FD07460298F8F751FD0921A3 +:10A490002170266225710B99E760A160206103A9F4 +:10A4A0002046FDF7C3FB022806D0002804D03D203B +:10A4B0006249000110F003FE0DB0F0BD0020074618 +:10A4C0006061E4E730B587B00446FDF79AFC0546C5 +:10A4D000807F8007800F01280BD0002100222046BA +:10A4E00001F01AFC0446287822281ED9002C07D136 +:10A4F00001E00121F2E7F7205049800010F0DFFD74 +:10A500000F21684601701721017120466E300290BC +:10A5100069461A30FDF766FB022806D0002804D0F1 +:10A5200047484649D03010F0CAFD07B030BD30B5BD +:10A5300087B00446FDF765FC0546807F8007800FE5 +:10A5400001280BD000210022204601F0E5FB044643 +:10A5500028782228E9D9002C07D101E00121F2E76F +:10A5600037483649DD3010F0AAFD102069460870E2 +:10A5700020468830FDF736FB0028D6D030482F49DA +:10A58000E03010F09CFDD0E7F7B5054600780027D5 +:10A59000000982B00C463E4602287DD0072802D032 +:10A5A0000A2849D152E068680178082906D00B29A9 +:10A5B0002FD00C292DD02149234866E114271A26D3 +:10A5C000002C6AD04088A080FDF71BFC009000287A +:10A5D00004D11D481949243810F071FD00980099E4 +:10A5E000C07DA21D1831FDF7F9FD68680822808939 +:10A5F000E081696820461030091D10F0D6FB207EEE +:10A6000001210843F9210840207600984021807FED +:10A6100050E018270826002CD3D08088A080FDF7B2 +:10A62000F0FB050004D108480449401F10F047FD25 +:10A63000A11D2846FFF7EFFA29E10000109E000057 +:10A6400011030000440D00202E040000002C01D056 +:10A65000288BA080287A01287ED0022804D00328E5 +:10A660002FD0F649F64810E11C270726002CA8D069 +:10A67000A088FDF7C6FB0090002804D1F048EF4900 +:10A68000723810F01CFD287B8007800F0128A0790C +:10A6900014D04008400001E0E9E0E3E0A071FD21B2 +:10A6A0000840297B4907C90F49000843A071009859 +:10A6B0008021807F084300998877E8E001210843E2 +:10A6C000E9E713270B26002CA6D0A088FDF799FBFD +:10A6D0000090807F8007800F012807D00021A0888C +:10A6E000002201F019FB050007D101E00121F6E786 +:10A6F000D348D2495F3810F0E2FC0098807F800791 +:10A70000800F012850D0E86A81788907890F0129D4 +:10A71000A1794BD049084900A1718278FD255207E3 +:10A72000D20F294052001143A171E3221140027857 +:10A730005207D20E1143A171DF2211404278D20795 +:10A74000920E1143A1710021E171C1782172427909 +:10A750000179607A400800E02BE0D3074000DB0F6E +:10A7600018439307DB0F28405B0018435207FB2375 +:10A77000D20F1840920010436072A07ACA074008B6 +:10A780004000D20F10438A07D20F284052004907D9 +:10A790001043C90F184089000843A0720098007840 +:10A7A000232874D92621C4E0A86AADE70122114309 +:10A7B000B2E7297BA348022911D017270C26002CC9 +:10A7C00050D0012912D003291FD0042920D00529F7 +:10A7D0001ED09B489949143810F071FC23E01927CA +:10A7E0000726002C53D00121A17105E00121A171A0 +:10A7F000E17989088900E171017CCA094906D20121 +:10A80000890E49000A4302740DE00220A07106E09F +:10A81000687B0007000F8030A07105291DD0E0790A +:10A8200080088000E071A088FDF7EBFA054600780B +:10A8300021282CD0232804D081488049083810F0E2 +:10A840003EFCA87F8007800F01280ED00021A08841 +:10A8500001F089FA222128466CE0E0798008800026 +:10A86000401CDFE70498068017E00121EFE7002C89 +:10A8700001D06888A080287A032832D004280FD01D +:10A8800005285AD06E486D49513010F018FC0498D4 +:10A89000002C068001D027806680002005B0F0BD26 +:10A8A00015270C26002CDDD0A088FDF7AAFA807FA2 +:10A8B0008007800F012807D00021A088002201F026 +:10A8C0002BFA050007D101E00121F6E75C485B495E +:10A8D000173010F0F4FB0622A11DA86907F036FA24 +:10A8E000D5E716270726002CBCD0A088FDF789FAEB +:10A8F0000090807F8007800F012807D00021A0886A +:10A90000002201F009FA050007D101E00121F6E774 +:10A910009B204A49C00010F0D2FB2878C00601D520 +:10A92000022000E00120A071009800782328AED911 +:10A9300027210098FDF79CFAA9E717270C26002C81 +:10A9400090D0A088FDF75DFA00906D7A002804D1C0 +:10A950003B483A49383010F0B2FB0621A01D10F0F8 +:10A9600081FA0020A071207A032108432072FB2184 +:10A9700008400099C97FC907490F0843207268063B +:10A9800085D5E07904210843E071A07AE907400801 +:10A990004000C90F0843E17A2A0749084900D20F4D +:10A9A0001143FD22AB07DB0F10405B001843A07280 +:10A9B000E806C00F114040000143E17267E710B59F +:10A9C0000446807990B08009012804D01C481B49B6 +:10A9D0006A3010F074FBFFF7B7F801206946087081 +:10A9E00019480190201D0290601C0B900AA968462E +:10A9F000FDF71CF9002804D011481049743010F0FC +:10AA00005EFB0322601C0B9910F0CFF910B010BD53 +:10AA100010B50D4C002805D001461022204610F03C +:10AA2000C4F90120207410BD10B50446FFF78CF85E +:10AA300010220549204610F0B8F910BD109E000004 +:10AA4000B3040000500E0020300D002070B500252A +:10AA5000FE4C00281CD0FE49884207D301218904FE +:10AA6000884205D3FB490968884201D210250DE0D0 +:10AA7000062107F055F9411C07D0F44940394865D3 +:10AA8000207C80210843207400E00725284670BD03 +:10AA9000207C4006400EF6E7F3B5002089B00D4655 +:10AAA000029000290AD0EA4885421CD30120800484 +:10AAB000854203D3E7480068854214D30998FDF71F +:10AAC000A0F9060003D03078222815D102E0E24830 +:10AAD0000BB0F0BD002D08D1B07FC10903D08007B5 +:10AAE000800F022801D01020F2E7B07FC10601D408 +:10AAF000010703D5002D01D00820E9E7D349097CDF +:10AB0000C90717D1F17F490701D50D20E0E780077C +:10AB1000800F01280CD000210122099801F0FCF8D7 +:10AB2000070007D0B07F8007800F022804D00DE017 +:10AB30000121F1E71120CBE7002D07D02A46394645 +:10AB40003046FEF76BFF02900028C1D1C348F8F7EA +:10AB5000EFF9040003D1C249C24810F0B0FA0A204C +:10AB600020700998206238468830A060B07FFB21B1 +:10AB70008007800F012829D0002D3DD002202071B0 +:10AB8000381DE06038780007400F20743878C00620 +:10AB9000C00F6074A07C2A788008D2078000D20F92 +:10ABA0001043A0740840F17F01AAC907490F084368 +:10ABB000A074A878E07469462846FEF770FF6846DE +:10ABC0000079207568460078607519E001202071D1 +:10ABD000207B2A788008D2078000D20F1043207390 +:10ABE000084029788907C90F890008432073242168 +:10ABF0003046FDF73DF90BE003202071052020735E +:10AC000025213046FDF734F9B07F4006400EB0777D +:10AC100003A92046FDF70AF8022806D0002804D030 +:10AC200090488F492B3010F04AFA029850E7FFB550 +:10AC30008D4A0E4607CA97B002AB07C3002701979B +:10AC40000C971798FDF7DDF8050005D02878262821 +:10AC500004D008201BB0F0BD7F48FBE7A87F800729 +:10AC6000800F012807D000210022179801F054F826 +:10AC7000040007D101E00121F6E77A487849623003 +:10AC800010F01DFAA87F8007800F1690012814D0BD +:10AC9000022824D0734872497B3010F010FA012149 +:10ACA0000022852E31D01EDC002E26D0812E26D00B +:10ACB000822E26D0832E1ED125E0002EEFD12146F4 +:10ACC0002846199AFEF7AAFE0028C3D11998807861 +:10ACD000019019980078C007C00F0C90DFE7199811 +:10ACE000002808D1DBE7862E11D0882E11D0892EBE +:10ACF00011D08A2E11D00720ACE710460EE008468E +:10AD00000CE002200AE0032008E0052006E006200F +:10AD100004E0082002E0092000E00A20002222715D +:10AD200001216A461176211D0791002801D020716A +:10AD30000BE1169801280CD0A66AE06A02220121D4 +:10AD400011900020A0602846173002291AD0012156 +:10AD500019E0E66AA06A1190032030702078FB2386 +:10AD6000C006C00F7070B07801221840019BF370CC +:10AD700080080C9B800018430221B0700020707185 +:10AD80003071DEE70021890009190861681C022A78 +:10AD900001D0012100E00021890009190861B07883 +:10ADA0008007800F01286FD1119880788007800F6D +:10ADB000012869D11198007901901198407900908B +:10ADC000169801281DD0317908A801747179017590 +:10ADD00008A8027C01980099024008A8007D08405C +:10ADE0001490104350D01A491A98884207D3012171 +:10ADF0008904884215D317490968884211D2102066 +:10AE000028E70CAA0DA91998FEF749FE08A8007CAE +:10AE100001990840307108A8007D009908407071C0 +:10AE2000D6E720463C3021460090F031169801913B +:10AE3000022845D000211A9B20460C33FEF797FECE +:10AE40000028DDD12146F43120460FE0500E0020CD +:10AE500000D001002800002002300000440D002036 +:10AE6000109E0000AF05000084B301005030009038 +:10AE700016980191012825D0002120461A9B149A8A +:10AE8000FEF775FE0028BBD111988078400702D4E8 +:10AE9000E87FC0072BD0169902A8012914D0119978 +:10AEA00009784900405A21780907490F4900C840EC +:10AEB0008707BF0F2AD0012F14D0022F0FD113E024 +:10AEC0000121B8E70121D8E721780907490F490096 +:10AED000405A119909784900C8408707BF0F032FCE +:10AEE00004D004E0022711E001270FE002271698A2 +:10AEF00001280BD1B078FB210840E97FC907490F31 +:10AF00000843B07020780007400F3070207810227E +:10AF10004008400020701199D2434978C907C90EF2 +:10AF2000114308402070C00622D4022F20D0012FE8 +:10AF300020D00020A061E0612062606220461830CD +:10AF4000A060E87F40084000E877204606A98830E6 +:10AF5000FCF748FE002805D0022803D0B449B548C4 +:10AF600010F0ADF825212846FCF782FF002071E69D +:10AF7000032008E020460D211B300FF073FF204610 +:10AF80001830A060042069460875E87F0121084355 +:10AF9000E87705AA29461798FEF7BEFDD5E7F0B574 +:10AFA00087B015460F0004460DD0A348854207D34D +:10AFB00001208004854206D3A0480068854202D261 +:10AFC000102007B0F0BD2046FCF71BFF060004D0A0 +:10AFD0003078272803D00820F3E79948F1E7B07FBD +:10AFE0008007800F012807D000210022204600F0B2 +:10AFF00093FE040007D101E00121F6E78D488C495A +:10B000001F3010F05CF80020002F05D0022F08D070 +:10B01000012F11D00720D4E701216A461171A060E9 +:10B0200018E0234618336946A360087110222946A8 +:10B0300018460FF0BAFE0DE021461831A1606946AE +:10B040000871A061E061206260620621284606F076 +:10B0500067FEA0612078C10714D04008400020702E +:10B060000220694608702046183002907030FCF7C4 +:10B07000B9FD022806D0002804D06E486C49423041 +:10B0800010F01DF825213046FCF7F2FE002098E76D +:10B09000F8B515460E460746FCF7B3FE040004D08B +:10B0A0002078222803D00820F8BD6548F8BDA07F8D +:10B0B0008007800F022802D06148C01CF8BD5E489E +:10B0C00086420ED3012189045C4A8E4202D3136862 +:10B0D0009E4206D3854204D38D4204D31068854234 +:10B0E00001D21020F8BD00953288B31C21463846A5 +:10B0F000FEF7B6FD112816D00028F3D1E17F2A7C97 +:10B100004908D2074900D20F1143E1772A7C490749 +:10B110009206490FD20ED2001143E177A17F490672 +:10B12000490EA177F8BDA17F0907FBD4204608226C +:10B13000B11C34300FF039FE308860862046102272 +:10B14000294622300FF031FEE07FFD210840297CA6 +:10B15000C907890F0843E077287C41082020015562 +:10B16000A07F08210843A0770020D7E770B594B0EE +:10B170000D460646002B02D0072014B070BDFCF728 +:10B1800040FE040007D02078222802D3A07F40068A +:10B1900003D40820F1E72A48EFE7002D19D02D212C +:10B1A0006846017046801022294601A80FF0FDFD77 +:10B1B000E07F297C4008C9074000C90F0843E077B9 +:10B1C000297C40078906400FC90EC9000843E07773 +:10B1D00003E02E2168460170468009A9684600F008 +:10B1E000A4FCA17FBF221140A177C6E710B50C4691 +:10B1F000FCF707FE002805D0104909688C4203D2ED +:10B20000102010BD0E4810BD2146FEF704FD0020A1 +:10B2100010BD05E00278401C002A01D000207047D4 +:10B220000A46491E89B2002AF4D101207047000065 +:10B23000109E0000F306000000D00100280000204E +:10B240000230000030B50346072903D00620DA7823 +:10B250001C7916E00320FAE707290BD05500ED18FA +:10B260006D79072D01D0401EC0B2521CD2B2092AFE +:10B2700007D105E05500ED186D79072DF3D0F4E7FF +:10B2800000222546641EE4B2002DE5D130BDFFB595 +:10B2900081B00C461646114620460A9F0B9DFFF7CB +:10B2A000D1FF00280AD02079092803D3FEA1A020CD +:10B2B0000FF005FFA078C00907D019E0072E02D0D3 +:10B2C000112005B0F0BDFD48FBE701982880381D2E +:10B2D0006880002068712871EF80049828812846D2 +:10B2E00000F04BFC002803D1EFA1AD200FF0E7FEEA +:10B2F000E07821794018491CC0B22171092801D396 +:10B300000938C0B24000001946718179F12249081C +:10B310004900114081710020D3E7FFB583B0164684 +:10B320000F461C46002203210C9D039800F0F4FCFC +:10B33000010008D033463A46019500940398FFF780 +:10B34000A6FF07B0F0BDDD48801EFAE7F0B5054660 +:10B3500016460F4650888DB00022032100F0DCFC19 +:10B36000040003D1D0A1DF200FF0A9FE0020694620 +:10B370000871A078400603D1CBA1E3200FF09FFE17 +:10B38000042F5ED32A78D007C017401C06D16178FD +:10B390006B78994255D12178090752D00121142A9E +:10B3A00046DA012A42D0122A02D0132A40D128E0DC +:10B3B0000C2F3DD1A2785206520E012A38D02078A7 +:10B3C00000090001401C20706878607068460171B7 +:10B3D00068792A790102114368460181E879AA79DE +:10B3E0000102114368464181687A2A7A01021143B9 +:10B3F00068468181E87AAA7A010211436846C181D0 +:10B400001AE0062F14D120780009000120707188FD +:10B41000012001F0E8F8022168460171C91E01818E +:10B4200068792A790102114368461FE0062F0AD085 +:10B430006A461279002A1BD07088324601A9FDF7AE +:10B4400026FB0DB0F0BD2078000900012070718846 +:10B45000012001F0C8F802216846017168792A7953 +:10B4600001021143684601810021C9434181E3E79C +:10B470000028E6D07488684681766978C176022112 +:10B4800081830021C18304A8052200900623114670 +:10B490002046FFF742FF0028D3D089A1D6200FF025 +:10B4A0000EFECEE7F7B58CB015460C990D98FAF75D +:10B4B00049F9C0B2082850D10020694688856888BB +:10B4C0000022032100F028FC040004D1FF2076A113 +:10B4D00063300FF0F4FD01230021E07822790BE0C6 +:10B4E0004600361976799E4201D1491CC9B2401CEA +:10B4F000C0B2092800D100201646521ED2B2002E3A +:10B50000EED1002902D117206946888504AB0233A9 +:10B510000BAA00950C990D98F8F7BEFB0006000EDB +:10B5200007D002281BD0032817D0FF205EA1893046 +:10B5300011E06846808D00280FD002A9019100908B +:10B540006888042301222146FFF7A1FE002804D0C9 +:10B55000FF2055A176300FF0B2FD0FB0F0BD687836 +:10B56000102108436870F8E700205A49024643005A +:10B57000401CCA520828FAD3704700218170017814 +:10B5800009090901017000214170C1700171704702 +:10B5900070B50D460022032100F0BEFB040004D16B +:10B5A000FF2041A1CF300FF08AFDA0786906C009C5 +:10B5B000C001490E0843A07070BD704710B5014628 +:10B5C000012001F010F810BD3EB58DB2002203211C +:10B5D000284600F0A1FB040004D1FF2032A1E43092 +:10B5E0000FF06DFD207869460009000120700220EF +:10B5F000087039488880C88000222846FDF747FA3D +:10B600003EBDF7B505460078002700090C463E46CA +:10B61000012804D0FF2024A1F3300FF050FD287A38 +:10B6200003280CD0412020A1C0000FF048FD029853 +:10B63000002C068001D0278066800020FEBDEA89AC +:10B64000702710460A3086B2002C0AD06888A08085 +:10B65000A8892081E28020460A3029690FF0A5FBE5 +:10B66000E5E702980680E8E7F8B543680246D9792D +:10B670009C79090221435C7A1E7A25025C88981D18 +:10B680003543241FA14238D11B79022B35D1042D1B +:10B6900034D0052D3DD0062D34D0402D2DD3061DA0 +:10B6A0000F461446284619E07372635C6C3263617E +:10B6B000705F636F72652E6300000000043000004D +:10B6C0007372635C6C326361705F636F72652E636B +:10B6D00000000000680E0020FFFF000000F0E3F90A +:10B6E00008280AD01120207003202072A581E7814C +:10B6F00026616078082108436070F8BD001DFFF7DF +:10B70000D1FEF8BD031D50880A461946FEF787FE94 +:10B71000F8BD001DFFF71AFEF8BD70B50D468CB0E0 +:10B7200006460022032100F0F7FA040031D0207809 +:10B730000007000F01282ED0122069468874607817 +:10B740000523801CC874082088822888C8826888DD +:10B750000883A8884883E888888302A90C2001917F +:10B7600000901A4621463046FFF791FD00280ED181 +:10B77000F02300223146012000F090FE20780009DD +:10B780000001401C20706078801C607000200CB0AC +:10B7900070BDCB48FBE71120F9E770B50D468CB0C2 +:10B7A00006460022032100F0B7FA040006D02078F4 +:10B7B0000007000F012803D00820E8E7C048E6E7AB +:10B7C0001321684681746178C17402218182C58227 +:10B7D00002A906200523019100901A462146304611 +:10B7E000FFF755FD0028D2D1207800090001207014 +:10B7F0000020CCE7F3B581B00D460022032101986B +:10B8000000F08AFA00260446002803D1AD49AE486C +:10B810000FF055FC2079A8423BD2AB48A949401C07 +:10B820000FF04DFC35E0E07841000F19401C7979AC +:10B83000C0B20091E070092801D10020E0702079A9 +:10B84000401E2071B879C00708D0009801990428DB +:10B8500015D09C49822018310FF031FCB8790007CF +:10B86000410F08D0400F019904280CD095498F2032 +:10B8700018310FF024FC009807280AD107E0084689 +:10B88000FEF755FEEAE70846FEF71CFEF3E7761CD6 +:10B89000F6B228466D1EEDB20028C4D13046FEBD7A +:10B8A00010B50022032100F037FA040004D1B520BE +:10B8B000844980000FF003FCE07821794018C0B281 +:10B8C000E070092801D30938E07000202071A078C9 +:10B8D00080210843A07010BDF8B517460D46002220 +:10B8E000032100F019FA040005D0002D0CD0002F20 +:10B8F00007D0062006E0072D01D00620F8BD032062 +:10B90000F8BD0820A84204D86F486E4942300FF0B5 +:10B91000D6FB29462046FFF795FC0646002F28D087 +:10B92000002E26D1E07821791CE0420012195379CB +:10B93000072B03D093791B075B0F04D0401CC0B2C8 +:10B9400009280CD00CE0400000198079F123184040 +:10B950006B071B0F1843907100290AD104E00020E7 +:10B96000491EC9B20029E0D1574856495A300FF054 +:10B97000A6FB3046F8BDF8B50D460022032100F0C5 +:10B98000CBF9040004D150484E4968300FF097FBC2 +:10B99000681E052804D34C484A4969300FF08FFBD4 +:10B9A0000921E2782079002310E0560036197779D2 +:10B9B000AF4206D1B17949084900B1715B1CDBB2D5 +:10B9C0001146521CD2B2092A00D100220646401E5E +:10B9D000C0B2002EE9D1092905D2480000198179A9 +:10B9E0000122114381711846F8BD10B50446402864 +:10B9F00001D2072010BD00F056F8082802D03120EF +:10BA0000000210BD0021314802E0491C082903D280 +:10BA10004A00825A002AF8D1082903D0490044522A +:10BA2000002010BD042010BD10B5402801D2072011 +:10BA300010BD00F038F8082805D00021234A400046 +:10BA40001152084610BD052010BDF0B58BB016464A +:10BA50000C00074607D0002E05D06188402904D28B +:10BA600007200BB0F0BD1020FBE72088002801D094 +:10BA7000172801D90C20F4E7084600F014F808282C +:10BA80000FD0258803A82A46314602300FF08DF9E1 +:10BA900001A8009062882B4607213846FFF73DFC3D +:10BAA000DFE70520DDE701460020084A02E0401CF0 +:10BAB000082803D24300D35A8B42F8D170470000C4 +:10BAC00002300000A8B60000AD020000680E0020A1 +:10BAD00000B51E2827D00FDC0C2820D008DC03007E +:10BAE0000FF00EFC0913211521211B1B1719210032 +:10BAF000122818D1072000BD302814DD3A38030081 +:10BB00000FF0FEFB030F11091100002000BD2148BA +:10BB100000BD042000BD0D2000BD0F2000BD082089 +:10BB200000BD112000BD032000BD10B50C4604F07F +:10BB300064F800281ED0204602F00FFE002816D020 +:10BB400022780E2A0DD00F2A0BD0022A09D0032A00 +:10BB500007D0102A09D010A17E200FF0B0FA0020E3 +:10BB600010BDA078FFF7B4FF10BD112010BD0AA1D1 +:10BB70008420F2E708A18A20EFE710B502F09EFCCE +:10BB800010BD10B502F0E9FD10BD10B502F016FDB4 +:10BB900010BD0000023000007372635C686F737444 +:10BBA0005F6863692E630000F8B5054606ACC1CC3A +:10BBB000E44C21706270A370E070681C4208277129 +:10BBC0005200E14B66710021880000198446026230 +:10BBD000605C40008218002D0AD0002005E0664617 +:10BBE0004700366A401CF353C0B2665C8642F6D802 +:10BBF000491CC9B20629E7D30026D21C9708B00019 +:10BC0000BF0000198760304600F02AF9A15D761C5C +:10BC10004843C219F6B2062EEFD3501B80B2F8BDCE +:10BC2000F0B504468C46C7490020A500FF23024614 +:10BC30006D18C54E0C5D0BE02F6A5100795AB14268 +:10BC400004D1401CC0B2FF2B00D11346521CD2B20B +:10BC50009442F1D8002801D061460B70F0BD70B558 +:10BC6000B84C0023655CA678B54200D10346890034 +:10BC700009199D420AD90C6A5E00A45B844202D174 +:10BC80001370012070BD5B1C9BB2F2E7002070BDF9 +:10BC9000FFB583B00C9C1F460D46060009D0002D51 +:10BCA00007D0F01C80088000B04204D0102007B0FC +:10BCB000F0BD0E20FBE70598A04201D8A74201D9AC +:10BCC0000720F4E701460094019423463A460020F9 +:10BCD0000294FFF769FF2988814207D0814201D28F +:10BCE000042100E0092128800846E0E7009401943F +:10BCF00023463A46029430460599FFF755FF2880BF +:10BD00000020D4E710B5044600F0B4F8002801D0B4 +:10BD1000E0B210BDFF2010BDF8B505468A481646B2 +:10BD20000C46854201D0062C01D30020F8BD002727 +:10BD300069460F7028466A462146FFF790FF0028A3 +:10BD40000DD068460178204600F09CF8002EEDD01A +:10BD50000028EBD12146284600F0A0F8F8BD38466F +:10BD6000002EF7D1F8BDF8B505460C460020764EFA +:10BD70006946764F0870B5423BD0062C01D30720A8 +:10BD8000F8BD0A4621462846FFF769FF002830D053 +:10BD900068460178204600F075F823000FF0B0FAED +:10BDA000060404090C11161B01462846FEF757FA33 +:10BDB00015E0FDF73BF812E001462846FFF7FDFBD2 +:10BDC0000DE001462846F7F7ECFE08E0014628465C +:10BDD000F9F742FB03E05EA17C200FF070F9594AAD +:10BDE0006846A10000788918096A40000E520020B8 +:10BDF000F8BD3846F8BD5A4A1268914201D2102067 +:10BE00007047062801D30720704708720020487247 +:10BE10007047F8B5044652480068844201D21020A9 +:10BE2000F8BD207A474A83009B18617A464D125C20 +:10BE300011E01E6A4F00F65BAE420AD04A1C6272E5 +:10BE40001A6A4B00D25A228000F01CF86060002071 +:10BE5000F8BD491CC9B28A42EBD861720520F8BD11 +:10BE60000EB5404B40000ECB009102930192694603 +:10BE7000085A0EBD33498978814201D901207047A3 +:10BE80000020704770B50C460546FFF7E9FF2D4AC4 +:10BE9000A900891889686043401870BDF8B5044648 +:10BEA0000E4600206946087005462046FFF7E2FF6F +:10BEB000002803D126A1F3200FF001F92148214BDE +:10BEC000815D8278B000C718914209D1E0B269461D +:10BED0000870396A4000085A1B49884206D02EE093 +:10BEE00069463046FFF79CFE002828D06846007857 +:10BEF000396A40000C52684601783046FFF7C2FFAD +:10BF0000054633000FF0FCF9060404090C0F141762 +:10BF100029462046FEF777F911E0FCF764FF0EE0B2 +:10BF2000FFF72BFB0BE029462046F7F701FE06E062 +:10BF3000F9F78BFA03E006A162200FF0C0F828465B +:10BF4000F8BD0000780E0020FFFF00000230000066 +:10BF50007372635C686F73745F636D2E63000000BF +:10BF60002800002090B301008107C90E002808DADC +:10BF70000007000F08388008C24A80008018C06996 +:10BF800004E08008C04A800080180068C8400006AD +:10BF9000800F7047BD4948788978884201D3401A9C +:10BFA00002E02122511A0818C0B27047B749233164 +:10BFB00048788978884201D3401A02E02122511A38 +:10BFC0000818C0B27047B14946314878897888422C +:10BFD00001D3401A02E02122511A0818C0B270475A +:10BFE000A94910B50C310868FF22120290430122C2 +:10BFF000D20310430860A54900202331487088709F +:10C00000233948708870463148708870A04806F01F +:10C01000C6F89F48401C06F0C2F8F6F7ABFB00F0EC +:10C0200028F910BD20207047B4E770B50C460546CE +:10C030000026FFF7AFFF9549A04214D30A46203AE5 +:10C0400000232046641EE4B200280BD08878105CE0 +:10C05000287088786D1C401CC0B288702128F0D1EF +:10C060008B70EEE7012600F004F9304670BD202009 +:10C0700070479BE770B50C4605460026FFF796FF14 +:10C0800082492331A04214D30A46203A0023204695 +:10C09000641EE4B200280BD08878105C2870887881 +:10C0A0006D1C401CC0B288702128F0D18B70EEE767 +:10C0B000012600F0DEF8304670BD2021017000201E +:10C0C000704710B50446FFF77EFF2070002010BDBA +:10C0D00070B50C460546FFF776FF6C494631A04225 +:10C0E00015D30A46203A00232046641EE4B20028F5 +:10C0F0000BD08878105C287088786D1C401CC0B20A +:10C1000088702128F0D18B70EEE7002400E0614CAC +:10C1100000F0AFF8204670BD70B50C4605462129E9 +:10C1200004D9FF205CA147300EF0C9FF5548406894 +:10C13000103840B2FFF718FFC6B20D20FFF714FF0A +:10C14000C0B2864207D2FF2053A14D300EF0B7FF98 +:10C1500001E0F6F752FB21462846FFF766FF00286C +:10C16000F7D070BDF8B507464948484C401E474EC9 +:10C170000078254646362335002806D1A978687808 +:10C18000212200F06BF800280ED0A17860782122DF +:10C1900000F064F8002814D0B1787078212200F003 +:10C1A0005DF8002828D033E038496878C91C0F545E +:10C1B0006878401CC0B26870212829D100206870BE +:10C1C00026E03249607820390F546078401CC0B2B4 +:10C1D0006070212801D1002060702D4F7F1E3878BB +:10C1E000002815D0A1786078212200F037F80028C7 +:10C1F0000ED0002038700BE02449707826310F549F +:10C200007078401CC0B27070212801D1002070707D +:10C21000A9786878212200F021F800281DD0A178A3 +:10C220006078212200F01AF8002816D0B1787078D2 +:10C23000212200F013F800280FD0F6F7C0FA1448B6 +:10C2400005F0B5FF01214903884203D016A1C120A2 +:10C250000EF035FF0E4805F0C2FFF8BD401C8842C5 +:10C2600005D0904201D1002901D000207047012063 +:10C27000704710B5064805F09AFF002801D1F6F77F +:10C280008DFA10BD00ED00E000E400E0F00E0020AB +:10C2900069000020072000007372635C736F635FA6 +:10C2A00072616E642E6300007372635C736F635F10 +:10C2B00072616E642E630000FEB5F34C0746606841 +:10C2C000FF213E0181552178FF2913D00901083152 +:10C2D00041583246491E083209020192090A805823 +:10C2E00000F0C8F9002802D02478254615E06168DE +:10C2F000207888552770FEBDE348426801981158A0 +:10C30000280100900830105800F0B4F9002806D138 +:10C31000DD482C46416800980D5CFF2DECD1DA48D1 +:10C320002101406885554754FEBD70B5D64A044684 +:10C330000020157A53680AE00201561C9E5DA64251 +:10C3400003D10C329A588A4204D0401CC0B28542B4 +:10C35000F2D8FF2070BDF8B5CB4F3E7801F006FE55 +:10C360000146FF2E68D034012546786808354059CB +:10C3700000F080F9022802D9786840595AE0C24991 +:10C380004868025D0A70A11C425C002A0CD0521E53 +:10C39000425441590122D20589180902090A415122 +:10C3A0003046FFF789FF30E0631CC25C0092221D1B +:10C3B00094468258002A10D001239B029A420FD93A +:10C3C0009205920D43595703DB191B021B0A435177 +:10C3D0006346C3589A1A920A09E0FF21C1540AE041 +:10C3E000435952039A181202120A4251002242542F +:10C3F0003046FFF761FFA4480C344168C2680098DA +:10C40000095980001258009890479F4C2078FF28C7 +:10C4100012D001F0ABFD01462078626800010830BF +:10C42000105800F027F9012896D92078616800019A +:10C430000830085801F08DFDF8BDF8B51C461546CA +:10C440000E460746FF2B03D390A1D3200EF037FEF4 +:10C450008D48FF21C7604560047206740170002298 +:10C460004270104604E00201521C401CA954C0B2A4 +:10C47000A042F8D3F8BD70B5834C06466578207CA1 +:10C48000854203D381A1E6200EF019FEE068A900E1 +:10C4900046506078401C6070284670BDFFB581B082 +:10C4A0001D46FF2401F062FD774F0646797801981A +:10C4B000814203D875A1F4200EF001FE72480021DC +:10C4C000037A406810E00A019446521C825CFF2AFD +:10C4D00024D0019FBA4205D162460C328758029A95 +:10C4E00097421DD0491CC9B28B42ECD8FF2C17D003 +:10C4F00021014B1C019AC2540B33029AC250039B78 +:10C50000614F0022012B0ED00B1DC25001239B0254 +:10C510009D4216D9AA05920D08D008E00C46E1E725 +:10C52000FF2005B0F0BD0B1DC550EFE71A465303C1 +:10C530009B190E461B0208361B0AAA1A8351920A3F +:10C5400009E0002D00D101256B039B191D022D0A66 +:10C550000B460833C550891C42543D463E78204660 +:10C56000FFF7AAFE2878B04215D001F0FFFC014683 +:10C5700028786A6800010830105800F07BF801281C +:10C5800007D92878696800010830085801F0E1FCF3 +:10C5900001E0FFF7E0FE0198C3E770B50C460546E1 +:10C5A00001F0E4FC064621462846FFF7BEFEFF28C0 +:10C5B00017D0354D040120466968083008583146C7 +:10C5C00000F058F80121090340186968A41C095DAE +:10C5D000400B002901D089020818002800D1012051 +:10C5E00070BD002070BDF3B581B00F460198FFF714 +:10C5F0009CFEFF282AD0244D2E78696832463446A6 +:10C6000004E0844205D026462301CC5CFF2CF8D1FF +:10C610001CE0FF2C1AD0A6421FD11001085C287024 +:10C62000FF2818D001F0A2FC2A78014612016868A0 +:10C630000832805800F01EF8012809D92878696866 +:10C6400000010830085801F084FC06E00020FEBD1F +:10C65000FFF781FE01E001F084FC39460198FFF705 +:10C660009CFF22016968FF23541C0B558A5C33012F +:10C67000CA54FEBD401A00020121000AC9058842C1 +:10C6800000D90020704700003C0F00207372635CEB +:10C69000736F635F74696D65722E6300F0B500247B +:10C6A0001C4A01211C4B0803546018601B4B1C6082 +:10C6B0001B4C20601B480469E443E406E617046948 +:10C6C00010252C430461184C6160184D2960761CBC +:10C6D00000E020BF1F68002FFBD0002E03D10769A8 +:10C6E0001026B743076190688005906801D5104A0D +:10C6F00010436960A160002119600121084A090303 +:10C700001160F0BD10B50446FFF7C8FF206000209F +:10C7100010BD000000C5004080E100E000C1004005 +:10C7200080E200E000ED00E000C3004000C00040F7 +:10C7300000FCFFFF70B51F490A68002A17D00023CC +:10C740001D4601244A68521C4A60092A00D34D60E4 +:10C750000E792246B2400E6816420AD072B60B68B5 +:10C7600093430B6062B649680160002070BD0520EC +:10C7700070BD5B1C092BE5D30FA136200EF09FFC8A +:10C78000F5E701201049800508607047EFF310813C +:10C79000CA07D20F72B601218140064803681943C7 +:10C7A0000160002A00D162B6EBE702480021016077 +:10C7B00041607047700000207372635C736F635F49 +:10C7C0006576742E6300000000E200E0012081071E +:10C7D0000860704701208107486070471048C068B2 +:10C7E000C00700D0012070470D488068C00700D006 +:10C7F000012070470A484069C00700D001207047F7 +:10C800000748C069704706498A69D20306D5896915 +:10C810008907890F814201D10120704700207047AC +:10C8200000040040F8B5F74C207EE17D88421CD022 +:10C830000126F54D0027E07D215C14200A46424385 +:10C840005019037C052B11D0037C062B1CD0037CD4 +:10C85000072B28D0437C012B33D0ECA1EE480EF0FF +:10C860002EFC207EE17D8842E5D1F8BD0674E07D96 +:10C87000162807D0E07D401CE075491CC8B2AA58B4 +:10C8800002210CE00020F7E70674E07D162808D0AE +:10C89000E07D401CE075491CC8B2AA5803219047AE +:10C8A000DFE70020F6E70674E07D162807D0E07D7C +:10C8B000401CE075491CC8B2AA580821EFE70020C7 +:10C8C000F7E74774E07D162807D0E07D401CE0754F +:10C8D000491CC8B2AA580721E1E70020F7E770B564 +:10C8E0000024CE4E0C207072CD482546447304734C +:10C8F00028300476C475CB4805F051FCCA4805754C +:10C90000F572CA49601E88607571B570F570357131 +:10C910007570C748E83905704570142060434018A9 +:10C920000574641CE4B20B2CF7D30120F5F7ECFF7F +:10C930000020F5F7E9FF0120B071F5F7AFFCBD4825 +:10C94000F5F7BEFCBC4C2070BC48F5F7B9FC607034 +:10C95000F5F77AFF70BD10B5F5F7A1FFB64C20785A +:10C96000F5F7CCFC6078F5F7C9FCAC4C207A0028D0 +:10C9700003D0F5F752FD0020207210BD70B5A74C12 +:10C98000A079002804D0A1A1AD480EF098FB70BD9D +:10C99000E07A002803D19DA1AA480EF090FB012661 +:10C9A000A6710025E572607A042114225043964A4C +:10C9B000801801749D488168491C04D0691E8160FB +:10C9C0000120F5F7A1FF0020F5F79EFFF5F782FFA4 +:10C9D00005F026FDF6F783F89B4805600560012009 +:10C9E0009A49C0030860F6F7F9F8914800780228E0 +:10C9F00004D0032804D1E078002801D0A67000E01C +:10CA0000A570F6F758F870BD03467F490B20142235 +:10CA100042435218203A127F002A04D0401E0006DA +:10CA2000000EF4D170471422424351180A46803A4E +:10CA3000D366012220390A777047012805D00328E0 +:10CA400005D1002903D1002070470029FBD010B484 +:10CA5000724C00236370764A002890700CD0022834 +:10CA60000AD007291AD208007844007900188744B0 +:10CA70001505070D0F111300D37003E01B2000E014 +:10CA80003A20D0700120607010BC70475820F8E741 +:10CA90007720F6E79620F4E7B520F2E710BC0020F7 +:10CAA000704710B562484078F6F720F880B210BDA4 +:10CAB000411E1422504310B5534A8418203C0A29C1 +:10CAC00002D8207F002803D150A161480EF0F7FA68 +:10CAD000207F012804D0B3204CA180000EF0EFFA93 +:10CAE0000020207710BD70B54D4C607B217B8842C3 +:10CAF00001D1012500E00025F5F791FFF5F7F6FFDC +:10CB0000617B227B914201D1012100E00021A942F9 +:10CB1000EBD170BDF7B50646481E84468EB0C0B254 +:10CB2000142205905043384A85180495287C2D1D01 +:10CB300007282AD1334C0027E07D227E824221D073 +:10CB4000235C059A934201D1012701E0002F04D014 +:10CB5000162811D0421CA25C225416280ED0401C6C +:10CB6000227EC0B28242EBD1002F0BD0207E002863 +:10CB700006D0207E401E04E00022ECE70020EFE714 +:10CB8000162020760498012202746046234C0A285D +:10CB900013D8142041431C4808182038007F00286F +:10CBA0000BD00498007C01280BD00498007C01284D +:10CBB00003D01098807A012807D014A125480EF0E0 +:10CBC0007EFA1098807A01286DD104980E4B007C73 +:10CBD000022843D00B4C207E162870D0207EE17DA9 +:10CBE000401C884203D109A11B480EF068FA049941 +:10CBF00001204874217E05986054207E162862D05A +:10CC000063E0000038110020541100207372635C4F +:10CC100072656D2E63000000CF0500005C120020DD +:10CC20001011002068120020201100203C1200206A +:10CC30007A00002057C300007800002025C80000BB +:10CC40007D0200005E02000000F5004080E200E08E +:10CC5000CB0200001503000022030000607A059A51 +:10CC60000146904206D0014614277843C018807CC4 +:10CC70009042F8D1627A824208D1617A14225143FB +:10CC8000C918897C61720121A17207E01422424314 +:10CC9000D21814277943927CC9188A7414220C2163 +:10CCA0005043C01881741098007A06281DD20100E4 +:10CCB0007944097949188F440C161412100EE07D3E +:10CCC000002890D093E7002001E0207E401C2076D1 +:10CCD000B5E000210FE0B4210DE073210BE032211B +:10CCE00009E00A2107E0062105E0FF20FDA1E03070 +:10CCF0000EF0E5F90021109802910068401A2860B2 +:10CD00001099097A002912D00221401A0102090A59 +:10CD1000296010980268406810180002000A6860D4 +:10CD20001098807A0228109803D0007B71E00421CB +:10CD3000EBE7007A002812D002220298121810980D +:10CD400043681046103018180A90E948029B407852 +:10CD5000984202D9E378002B03D00A9805E0042218 +:10CD6000EBE7029BC31A0A981818637A10300C2B51 +:10CD70001CD0637A14277B43DE4FDB195B68994232 +:10CD800014D0DD4F617ABC4614235943D94BC918DE +:10CD90004B6889689B1B891B1B0209021B0A090A35 +:10CDA000984237D8634535D8614533D831180A9849 +:10CDB0000123081A0002000A286010998018C96827 +:10CDC0000002000A471ACD4A9B05BC469F4201D289 +:10CDD000384610E00F1A9F4201D260460BE094459E +:10CDE00003D9511A0818401C05E0974206D9101AB9 +:10CDF0004018401C404200285FDC03E0B9A1C04855 +:10CE00000EF05DF929680A9808180002000A6860A7 +:10CE1000002028726868102710300002000A68603D +:10CE20001098407AA8721098007A687203280ED27F +:10CE300000280CD0FFF7D2FC002803D007E0002028 +:10CE400011B0F0BD029842210F1A32200290A84979 +:10CE50000878012801D0032809D14878029988422E +:10CE600005D9E178002902D10299401AC7196B68E7 +:10CE700028689B1B801B9C4601021B029E4A090AD4 +:10CE80001B0A8F4219D81746914216D8BB4214D8B4 +:10CE9000617A0C2915D0677A61460C2203920092C0 +:10CEA0001422944B7A43D21893689B1B834216D862 +:10CEB0000397977C0C2FF3D173E0059801F04CF9A0 +:10CEC000BDE70498022205990274627A0C2A00D008 +:10CED000627A827461720120A07211B0F0BD0C2FD1 +:10CEE0005FD00022384694461422824B4243D21827 +:10CEF00053689B1B8B4225D2907BAB7A98421BD800 +:10CF000004980521059D01747E4C207E16280FD0C3 +:10CF1000207EE17D401C884203D172A17A480EF048 +:10CF2000CEF8207E2554207E162800D0CDE6CAE615 +:10CF3000E07D0028F1D0F4E701208446907C0C28A5 +:10CF4000D2D102E0614600292AD03D46009014204B +:10CF50002A46424367480621161831741C38007E61 +:10CF60001628684816D0017EC07D491C814203D135 +:10CF70005CA166480EF0A3F86248017E4554017E2C +:10CF800016290BD0017E491C0176B57C0098A84279 +:10CF9000DDD106E0C07D0028EAD0EDE70021F3E70F +:10CFA000009704990220534D0874607AB84207D163 +:10CFB000049900988874059860720120A07221E09D +:10CFC00003980C2F0FD00C2803D146A150480EF027 +:10CFD00076F80398142250434019059981740499F6 +:10CFE000009888740EE00C2803D13EA149480EF049 +:10CFF00066F80398142250434019059981740499E6 +:10D000000C208874012011B0F0BD70B50D46424A65 +:10D01000441900210B46101A8B4103D231A13F481D +:10D020000EF04DF83E48854203DD2EA13D480EF03E +:10D0300046F83D48854203DA2AA13C480EF03FF805 +:10D040003B48844205DA002C01DB204670BD38489D +:10D0500000E03848201870BD401E70B5C0B21421E1 +:10D06000484324494418607B062813D201007944C0 +:10D07000097949188F44020C0A080604002067E069 +:10D08000B42010E073200EE032200CE00A200AE009 +:10D09000062008E0FF2013A1E0300EF010F8617BBD +:10D0A0000020002954D00221401861684018000275 +:10D0B000000AF5F71BFD0C256557174A4419002196 +:10D0C0000B46101A8B4103D206A114480DF0F7FF4E +:10D0D0001348854203DD03A112480DF0F0FF12480A +:10D0E000854229E07372635C72656D2E63000000F7 +:10D0F0007A00002054110020FFFF3F00FFFFFF00D7 +:10D100000E0700003811002007020000C5030000D0 +:10D11000DD030000E3030000FF7F841EF503000031 +:10D120000020A107F603000000E05EF8F70300000E +:10D130000080841E00807BE103DAF749F7480DF098 +:10D14000BEFFF748844207DA002C03DB204670BD9F +:10D150000421A9E7F24800E0F248201870BDF0B5BC +:10D16000064683B0F0480190457A029534687068AD +:10D17000001B0702ED483F0A001B00900C2D2DD02C +:10D18000142029464143EA48012208188446416890 +:10D19000E64892058646081B904210D3631A9342D4 +:10D1A0000DD302467046724503D900984018401CC2 +:10D1B00005E073450ED9411A0819401C4042002869 +:10D1C0000CDA60460295857C0198C0790028D5D09C +:10D1D00003B0F0BDD049D7480DF071FF02988542E9 +:10D1E00026D014214843D249012340180290806878 +:10D1F000CE499B058C46011B8646994210D3221AC4 +:10D200009A420DD36346614503D900997144491C84 +:10D2100006E0194662452DD9091A0819401C4142F9 +:10D22000002905DD0298B17A807B814200D37446E3 +:10D230000C2D15D0BE491420454368184268121BB6 +:10D240001202120ABA420BD2B37A827B934200D303 +:10D250008468857C0198C0790028B9D10C2DEAD169 +:10D260003068A042B4D0E0190002000A3460706057 +:10D2700003B0F0BDA849AF480DF021FFD8E7F0B5E5 +:10D28000AD490446486885B0C005C00D1CD01038B3 +:10D2900040B200280CDA0207120F083A92089200F6 +:10D2A0005118C9698007C00EC1400806800F09E007 +:10D2B0008108A24A8900891809688007C00EC14008 +:10D2C0000806800F002808D000272078002806D004 +:10D2D000012804D0002005B0F0BD0127F5E7207932 +:10D2E000062813D201007944097949188F44020CA9 +:10D2F0000A080604002018E0B42010E073200EE0B5 +:10D3000032200CE00A200AE0062008E0FF208249D3 +:10D31000E0300DF0D4FE21790020002905D0022153 +:10D320004618814D002F02D003E00421F8E70020C9 +:10D33000E871694602AAA068F5F7E2FB694608228F +:10D340008A56E06801A980180122C01C1F2801DA52 +:10D35000019209E003AAF5F7D3FB6846007B002899 +:10D3600002D00198401C019000990198401810309B +:10D370000002000A0190881B0002000A00906079F8 +:10D380006946887200980390F5F749FB009A019B63 +:10D39000121A181A6A4912020002120A000A8A4274 +:10D3A00016D8884214D86846FFF7D9FE009903982A +:10D3B000814205D088190002000AF5F797FBA060AA +:10D3C0000120E979002986D0002FB0D005B0F0BD4A +:10D3D0000020F6E7F3B58FB05A480C460B9004F0E6 +:10D3E000E6FE594A0F99504F5618584D203E0028D6 +:10D3F0000BD05748007D002803D056A158480DF0A7 +:10D400005EFE207801287CD05AE1687B16280CD07B +:10D41000687B297B401C884203D14EA151480DF006 +:10D420004EFE2078012804D00CE0287B0028F4D0A0 +:10D43000F7E7F07F002803D046A14B480DF03FFEF0 +:10D440000120F077697B0F981422484E51438919C7 +:10D4500008742078022822D0687B1421484386195A +:10D46000207930726079707232460C323146A06891 +:10D47000F5F746FB0C2030560F2804DD1F383073BB +:10D480003068401C30600C217156301DE2680190FC +:10D490005018C01C1F283EDA01200199F7E02649E8 +:10D4A0004868C005C00D21D0103840B200280CDA01 +:10D4B0000207120F083A920892005118C9698007B2 +:10D4C000C00EC1400806800F09E081081B4A890090 +:10D4D000891809688007C00EC1400806800F00281F +:10D4E00004D105201BA100020DF0E9FD687B142189 +:10D4F000484386190021E0686A460691117006A922 +:10D5000000E0D3E0F5F7FCFA6A46002010560F2839 +:10D510002EDD01202DE0AEE0E4D00000F703000096 +:10D520000080841E00807BE15C120020FFFFFF0072 +:10D53000541100200E07000000ED00E000E400E0C0 +:10D54000FFFF3F0068120020301200201011002061 +:10D55000201100207372635C72656D2E6300000001 +:10D5600011050000EF040000F4040000500F00203B +:10D5700000200699401807900220B072207930727E +:10D5800060797072A068311DC01C06911F2801DAF5 +:10D59000012009E0F5F7B4FA68460078002804D0C5 +:10D5A000069806990068401C0860307A062813D255 +:10D5B00001007944097949188F44020C0A080604CD +:10D5C00000200FE0B4200DE073200BE0322009E0D2 +:10D5D0000A2007E0062005E0FF20FE49E0300DF0BC +:10D5E0006EFD00202179002943D0022140180690C9 +:10D5F0007168103008180799089009180698081AD9 +:10D600000C900020F871F5F70AFA0446306007988C +:10D6100020180002000AF060787A0C2825D0797A68 +:10D6200014204143EC4808184068089902904018BB +:10D630000002000A0390707A6946887402A8FFF716 +:10D640008EFD0299039A091B121B09021202E34B79 +:10D65000090A120A0C98994207D8824205D8029901 +:10D66000069808180002000A3060F8790028C8D12E +:10D6700010E00421BAE704AA0199F5F741FA6846D7 +:10D68000007C002804D0019801990068401C0860C3 +:10D690002078B072687B162806D0687B401C6873BF +:10D6A0000B9804F09CFD47E00020F8E7F07F00288D +:10D6B00004D0A320CAA1C0000DF001FD0120F07725 +:10D6C000CA490F9808742078022803D1C4A1C84819 +:10D6D0000DF0F5FCC54E20793072607970723246DB +:10D6E0000C323146A068F5F70BFA0C2030560F28A3 +:10D6F00004DD1F3830733068401C30600C22B25695 +:10D70000301DE16801908818C01C1F2802DA012032 +:10D7100001990BE003AA0199F5F7F2F96846007B3D +:10D72000002804D0019801990068401C0860207806 +:10D73000B072AE4901200875687B297B884224D0ED +:10D740007C7A0C2C23D0F5F76AF914214C43A249BA +:10D7500061180A7C042A18D00A7C032A15D04B6869 +:10D7600089681B1A081A1B0200029C4A1B0A000A3D +:10D77000102B0AD31146934207D8884205D8687BFC +:10D78000297B884201D0F5F796F911B0F0BD687B8E +:10D79000297B8842F7D111B0F0BD10B50020F5F714 +:10D7A000A0F810BD10B50120F5F79BF810BDF1B53C +:10D7B000009802281ED08F4C607A0C2803D188A1D3 +:10D7C0008D480DF07CFC0026A6710125E572607A7B +:10D7D00003211422804F5043C0190174F5F770F9EA +:10D7E000009800280BD0012829D0032879D07CA1EB +:10D7F000824844E082480078F4F786FDF8BD81480D +:10D80000007F002803D076A17F480DF058FC657199 +:10D810007C4D00202E60F5F777F8A968481C04D0ED +:10D82000012300221846F5F7A5F8607A617A401CBA +:10D83000C0B2142251437A5801219047F8BD01200B +:10D84000F5F762F8607900280DD06E488068401CBA +:10D8500009D0607A617A401CC0B2142251437A58D0 +:10D8600006219047F8BD6748007F01280AD00228AA +:10D8700012D0032822D0042834D059A163480DF0D7 +:10D880001EFCF8BD2079002803D02671F5F71DF99C +:10D89000E5705C480677F8BD207A002802D1F4F7DD +:10D8A00093FD2572607A617A401CC0B21422514304 +:10D8B0007A580021904753480677F8BD514F01230D +:10D8C000397B78680022411A1846F5F753F8207919 +:10D8D000002803D02671F5F7F8F8E57002203877B4 +:10D8E000F8BD19E0474E217870680123411A0022E3 +:10D8F0001846F5F73FF8207A002802D1F4F764FDC6 +:10D900002572607A617A401CC0B2142251437A5861 +:10D91000002190473577F8BD607A617A401CC0B22B +:10D92000142251437A5805219047F8BD10B5314C67 +:10D93000607A0C2803D12AA135480DF0C0FB607A2B +:10D94000617A401CC0B214225143234A5258042128 +:10D95000904710BDF0B583B00C200290F5F75FF84A +:10D96000244C0090617A2B4801900C2920D0617AD8 +:10D970001420414318480918097C042918D0617AF9 +:10D98000142251430818007C03287DD00199009887 +:10D990000B6849681B1A081A1B0200020F4A1B0A6F +:10D9A000000A102B70D3114693426DD888426BD871 +:10D9B00014488068401C03D009A117480DF07FFB74 +:10D9C00000206071607A0C282ED1607800282BD05E +:10D9D000124825E0E4D0000054110020FFFF3F0072 +:10D9E0007372635C72656D2E63000000201100206D +:10D9F0001E0500005C1200204F050000A20500007B +:10DA0000780000203C1200205B0500009605000015 +:10DA1000A90500004C120020E50500007A00002056 +:10DA2000C178417081780170607A0C2815D0607AD5 +:10DA30001421FF4A48438018007C04280DD1607AE5 +:10DA40000290607A01211423584380180174607A8F +:10DA500058438018807C6072A172F64D687B297BE8 +:10DA6000F54F884233D0F54E287B14214843801966 +:10DA7000007CC05D0128287B07D048438019007CCA +:10DA8000C05D02282FD044E0FDE1142148438019F5 +:10DA9000807A01280AD0287B022114225043801961 +:10DAA000007CC155287B162808D009E0287B00217E +:10DAB000142250438019007CC1552AE0002001E067 +:10DAC000287B401C2873687B297B8842CCD1DC4DA5 +:10DAD000287D00284CD0287CC15D012928D0C05D5C +:10DAE000022830D03AE0287B142148438019807AFC +:10DAF000012803D0D3A1D6480DF0E1FA297B0020FC +:10DB00001422514389198872297B51438919097C50 +:10DB1000C855287B142148438219287B4843801923 +:10DB2000017C0098FEF7F6FF287B1628C8D1C5E7D0 +:10DB3000A97A012904D00221C155002028750DE0E1 +:10DB40000021C1550AE0A87A012803D0BDA1C1482F +:10DB50000DF0B5FA0020A872297CC855287D002850 +:10DB600006D0297CB64A0098FEF7D4FF002028751D +:10DB700002980C281ED014214843AD494018017C5E +:10DB8000012917D107210174B34D287E16283CD0F6 +:10DB9000287EE97D401C884203D1AAA1AF480DF040 +:10DBA0008EFA297E02986854287E162831D0287E65 +:10DBB000401C2876607A0C287ED0A07A00287CD081 +:10DBC0000020A072617A1420414399480E18A4499C +:10DBD000B56873680A46F6687C32CB679660556014 +:10DBE000A04D697E002916D00226617A1422904841 +:10DBF00051430818407B06281BD20100794409795B +:10DC000049188F440A1412100E0CE87D0028C4D065 +:10DC1000C7E70020CDE70426E7E700210FE0B421A5 +:10DC20000DE073210BE0322109E00A2107E0062113 +:10DC300005E0FF208C49E0300DF041FA0021297306 +:10DC4000687E022801D0012810D12869009A401866 +:10DC5000821A1202120A422A08D93238032100021B +:10DC60006976000A28613220287308E0322906D23A +:10DC7000207A00280AD1F4F7A7FB012005E0207ADA +:10DC8000002803D0F4F7C9FB002020727749102246 +:10DC9000487820700978012901D0032906D1012193 +:10DCA0002171297B884201D9421A1032A378002BB6 +:10DCB00000D0921C217901E08CE09AE0002901D18A +:10DCC000002B5DD094466A4A00990092019A176829 +:10DCD00052687F1A511A3F0209023F0A090ABC45DD +:10DCE0001BD8634A974218D8009A914215D8297BCD +:10DCF000884223D92B69421A9A1A1202120A101862 +:10DD000080190002000A2A616860002914D00320EB +:10DD100028770006000E3ED14CE000202071A07054 +:10DD2000297B002925D02869401880190002000AA3 +:10DD30006860022028772EE00120E9E781420BD9B4 +:10DD40002A69511889190902090A6960002801D055 +:10DD50000420DDE70220DBE7002B03D139A1454891 +:10DD60000DF0ADF9286980190002000A68600020F2 +:10DD700004E0296989190902090A6960287719E00C +:10DD8000287B00280FD02969081880190002000A92 +:10DD9000686002202877286901238119002218462B +:10DDA000F4F7E8FD09E0286980190002000A6860BC +:10DDB000002028770120F4F7A7FD607A142148435A +:10DDC0001B490C2240188256012300206968F4F791 +:10DDD000D1FD0EE00120F4F797FD0020F4F794FD4B +:10DDE000F4F778FD207A002803D0F4F716FB002022 +:10DDF0002072A078002804D0F4F767FE0020E070BD +:10DE0000A0706078002804D01848C17841708178EB +:10DE100001702079002806D000201449E0700978AC +:10DE2000002900D120710C48017EC07D814223E091 +:10DE300054110020101100202F120020500F00203C +:10DE4000201100207372635C72656D2E6300000008 +:10DE500007060000230600003811002035060000E8 +:10DE6000D01100203C120020E4D000007A000020F5 +:10DE7000FFFF3F008706000003D0C9484078F4F751 +:10DE800043FA0120E07103B0F0BDF0B5C54C074680 +:10DE9000607A83B00C2803D1C3A1C6480DF00FF9F6 +:10DEA000607A1421C44E48438019007C032803D0B3 +:10DEB000BDA1C2480DF003F9C14DA868401C03D0B4 +:10DEC000B9A1C0480DF0FBF8607A142148438119CC +:10DED0000C20085600216A4600911171C01901AA50 +:10DEE0006946F4F70DFE6A46042010560F2801DD3E +:10DEF000012000E0002000994018696840180102E4 +:10DF0000090AA9606079002804D00123002218467C +:10DF1000F4F730FD03B0F0BD70B5AC4CAA4A0B1A53 +:10DF2000A34214D3451AA54211D3934203D9101A20 +:10DF300043185B1C0BE0954204D9511A0818401C89 +:10DF4000434204E0A249A3480DF0B9F80023184663 +:10DF500070BD10B50146012300220220F4F70AFD2E +:10DF600010BD10B50220F4F7CFFC10BD10B5F4F7CA +:10DF700056FD10BDF0B58B4D0446E87A83B00028FD +:10DF800003D189A194480DF09AF8642C4DD393499C +:10DF900000200246091B824147D39148417B007B08 +:10DFA000814242D18F48007D00283ED1687A1421F9 +:10DFB000814F4843824EC519306801AA001969464D +:10DFC000F4F79EFD694604200856002802DD0098FB +:10DFD000401C0090A96800986B680A18D21A1202B7 +:10DFE000814B120A9A4220D8AA7C0C2A08D014230A +:10DFF0005A43D2195268511A0902090A814214D3AC +:10E00000B068401C05D00120F4F77EFC0020C0431E +:10E01000B060306800193060A868009940180002AC +:10E02000000A7061012003B0F0BD002003B0F0BD14 +:10E03000F8B50646401EC5B214205F49684344182F +:10E04000207C002803D158A168480DF038F86448B6 +:10E05000017B407B81420CD0654A14234B439B18C3 +:10E060001B7CB3420CD016290CD0491CC9B281428A +:10E07000F3D15C48017D002964D0007CB04261D1BD +:10E080000020F8BD0021F1E7217C052905D0217C85 +:10E09000062902D0217C072928D101212174C17DC4 +:10E0A0000023027E8A4221D00246565CAE4201D154 +:10E0B000012301E0002B04D0162911D04E1C965DDF +:10E0C000565416290ED0491C167EC9B28E42ECD188 +:10E0D000002B0BD0117E002906D0117E491E04E0D2 +:10E0E0000026ECE70021EFE716211176617C00297C +:10E0F0002AD06774C17D0023027E8A4224D0425C0C +:10E10000AA4201D1012301E0002B04D0162912D02C +:10E110004A1C825C425416290FD0491C027EC9B2A7 +:10E120008A42ECD1002B0FD0027E0146002A06D095 +:10E130000A7E521E04E00022EBE70021EEE71622E1 +:10E140000A7601E02B480027217C01299CD1617CC3 +:10E15000002999D10120F8BD70B505461420164A52 +:10E160000521684380180174224C207E162811D0A6 +:10E17000207EE17D401C884203D115491E480CF0E9 +:10E180009EFF207E2554207E162807D0207E401C2E +:10E19000207670BDE07D0028EFD0F2E70020F7E7A1 +:10E1A000780000205C1200207372635C72656D2E33 +:10E1B00063000000EA06000054110020EB06000096 +:10E1C0003C120020EC060000FF7F841E0020A10707 +:10E1D000E4D000000E0700002D070000FF1FA1077C +:10E1E0001011002020110020FFFF3F006A070000EF +:10E1F000500F0020381100200702000010B509F070 +:10E2000065FC042803D009F061FC052803D106F061 +:10E21000DFFE00280BD104F015F9032803D004F029 +:10E2200017F9032805D109F0B2FD002801D001201B +:10E2300010BD002010BDF0B585B007460026684629 +:10E240000D4606726946384605F069FA00287DD108 +:10E250006846007800280BD009F00BFDB84275D055 +:10E260000022294638460AF0D0FE00283ED120E0A0 +:10E2700006F085FCB842F2D000222946384607F065 +:10E28000FBFE00287DD1019C9020005D28340028F1 +:10E2900004D1607E002801D0012000E0002004901D +:10E2A000204660300390807806F098FB002804D068 +:10E2B00008E0019C2834607EF1E7FF20FDA1DA3000 +:10E2C0000CF0FDFE20462030417B00290FD0817BE1 +:10E2D00089070CD56E7001212970AE70AF80C17BAB +:10E2E000A971218E2981618E6981467349E0039865 +:10E2F00002A9807806F03EFA002804D1FF20EDA1A3 +:10E30000EE300CF0DCFE6846007A002809D06E7012 +:10E310000D202870AF806846007AE8800120A87040 +:10E320002FE0049800282FD006F0C3FB00282BD044 +:10E3300068460078002806D101988030406A4188FC +:10E34000B94200D106700398807800E01CE006F026 +:10E35000D8F8002803D1D7A1DA480CF0B0FE6E70CF +:10E360000A202870AE70AF80A07EA87166766846DD +:10E3700005F08BFA002804D0D248CEA10E300CF064 +:10E380009EFE012005B0F0BD0020FBE77CB5CEA1CC +:10E3900003C9CF4D002401910090AC7001F02FFD16 +:10E3A0002946EC7004204039088710204887C81D92 +:10E3B000C84AF93042800471C280E03844740C705D +:10E3C00084730475C03004771D3005226946044605 +:10E3D0000CF0EBFC28462146BC3007F0FFFF7CBD6B +:10E3E000F8B5BD4C0D466060217006F065F805F08B +:10E3F000DEF8FFF7CBFF207809F03CF9B44984310F +:10E40000084681380F46064606F09AFC606807F019 +:10E41000E0FE284604F07CFC3946304609F059FC01 +:10E4200060680AF08EFE01F0EAFCA9480021C17084 +:10E43000F8BDFEB50E461D46144601A905F06FF95C +:10E44000002839D102988030807A06F087F80028B9 +:10E450000CD0684606F095F8002806D0002C03D0B2 +:10E4600006F02BF8A04206D20020FEBD91A19B48E9 +:10E470000CF025FEF8E7009805F0B8FB314600984F +:10E4800005F0B9FBE2B22946009805F071FD06F0EF +:10E490009DF8002804D1914886A11E300CF00FFE93 +:10E4A00068460079012807D101A801F0AFFC8A482D +:10E4B00000218068803041820120FEBD30B40179A6 +:10E4C000002904D0012907D030BC00207047831DEB +:10E4D00042880488022103E042880488831D0121C8 +:10E4E000204630BCA5E7FFB5794C85B00E460746FF +:10E4F000C034608869460880154602A905F00FF906 +:10E50000002811D00021684605F066F9002823D1C3 +:10E51000684602A9008805F002F9002804D06F4877 +:10E5200064A13C300CF0CBFD68460088388068461A +:10E530000088608066480021C23005F04DF900284F +:10E5400002D00020C043608003988030807A06F0BB +:10E5500045FA002803D007E0002009B0F0BD5F486D +:10E5600054A156300CF0ABFD04A806F04AFA00287E +:10E57000F3D0049805F076FB3070022807D001280C +:10E5800005D056484BA172300CF099FDE4E708998C +:10E59000049805F004FD2880002804D14F4845A1C7 +:10E5A00065300CF08CFD06F053FA002804D1E92008 +:10E5B00040A180000CF083FD0120CEE73EB504466B +:10E5C000831D02AA694601A8FFF78DFF002813D01A +:10E5D00068468088208068460089608000206071DD +:10E5E00068460078012808D0022806D03B4831A1AF +:10E5F00092380CF064FD01203EBD2071FBE7FEB5B2 +:10E60000040004D135482BA17E380CF058FD304D64 +:10E610000026203D687C002808D0667010202070FD +:10E62000A87CA070E87CE0706E7430E0284F403F1A +:10E630003878002808D02C22B91C20460CF0B5FBF5 +:10E640000E2020703E7022E0A87B002809D0012017 +:10E65000E070E87BA070287C60700F202070AE73A3 +:10E6600015E01B480221C630029005F0B5F80028DD +:10E6700071D1174FC037F8880190F888042808D066 +:10E68000052831D02146FFF7D6FD002859D00120BA +:10E69000FEBD0021204606F027FA0028F7D1287D8C +:10E6A00000284ED06670132020701C21A01C0CF096 +:10E6B000D9FB15E07372635C6C6C5F6374726C2ED3 +:10E6C000630000000D020000FFFFFFFF1F000000BD +:10E6D000AC120020FFFF0000800000203903000082 +:10E6E0000220A0702E75D2E70021204609F09AFA88 +:10E6F000002826D020781328C9D1A0783C28C6D17C +:10E70000A088694604F089FF002803D0FD49FE482F +:10E710000CF0D5FC00988030807A05F0F2FE0028DD +:10E7200004D1F948F749001D0CF0C9FC009804F029 +:10E73000ACFF0028ABD0F448F24908300CF0BFFC25 +:10E74000A5E70221029805F047F8002803D1F988CF +:10E750000198814291D10020FEBD50E710B508F02C +:10E7600013FF002804D0E848E649BE300CF0A7FCAF +:10E7700007F027FD06F0A8FA04F089FA002804D073 +:10E780007920E049C0000CF09AFC0AF0D2FC002885 +:10E7900004D03D20DB4900010CF091FC09F072FA35 +:10E7A000002804D0F520D74980000CF088FCFFF742 +:10E7B000EDFD04F0B9FE002804D0F720D149800017 +:10E7C0000CF07DFC05F02AFE01F019FBCF4800217A +:10E7D000C17040380171012141710222C270017083 +:10E7E00010BD10B5C94C403C2078002804D00A2147 +:10E7F0000E2001F0CAFA10BDFFF700FD002801D07D +:10E800000C2002E001F0FBFA002020710120607171 +:10E810000A21E170207010BD70B5BC4C0646403C2A +:10E820002078002804D03A210E2001F0AEFA70BD05 +:10E83000FFF7E4FC002801D00C2010E0B34DE8788D +:10E8400008280BD20001001910223146443001F093 +:10E85000A6FAE878401CE870002000E0072020714C +:10E86000012060713A21E170207070BD70B5A74C35 +:10E870000646403C2078002804D00B210E2001F0F1 +:10E8800084FA70BD3078002803D0012801D012200E +:10E8900015E09E4D80352879082817D2FFF7AEFC89 +:10E8A000002801D00C200AE0984833782979721C9E +:10E8B000883001F0A6FB2879401C287100202071C7 +:10E8C000012060710B21E170207070BD0720F6E718 +:10E8D00010B58E4C403C2078002804D039210E2001 +:10E8E00001F053FA10BDFFF789FC002801D00C207D +:10E8F00002E086490020C870207101206071392132 +:10E90000E170207010BD814810B5403801780029B1 +:10E9100004D00F210E2001F038FA10BD0021017142 +:10E920000E2181700F21C170FF2181710021C94327 +:10E930000181774949680A7882728A888281498888 +:10E94000C18101214171017010BD704910B540397C +:10E950000A78002A04D03C210E2001F016FA10BDDE +:10E960006A4A0088C03250800120107100220A716A +:10E9700048713C22CA70087010BD10B5634C403C11 +:10E980002078002804D02B210E2001F0FEF910BDC4 +:10E990000821A01DFDF7C0FB00202071012060713F +:10E9A0002B21E170207010BD10B5584C403C2078F0 +:10E9B000002804D005210E2001F0E7F910BD05F074 +:10E9C0007CFDE08005F0D4FE207200202071012043 +:10E9D00060710521E170207010BD10B54B4C403CBA +:10E9E0002178002904D031210E2001F0CEF910BD8C +:10E9F00000214156042911D000290FD0081D0DD047 +:10EA0000001D0BD0001D09D0001D07D0001D05D032 +:10EA10000A3003D00A3001D0122003E0084601F08A +:10EA200041FB002020713120E070012060712070D6 +:10EA300010BD30B5354D0446403D28788DB00028D6 +:10EA400005D02A210E2001F0A0F90DB030BD102212 +:10EA50002146684601F0A3F91022A11804A801F08C +:10EA60009EF9684603F019FC10222C46A81D08A93F +:10EA700001F095F9002020710E20A0702A20E0708E +:10EA8000012060712070E0E7F0B5204C85B0403C7B +:10EA90002078002804D03B210E2001F076F971E4A3 +:10EAA0000020A07119486946C0304088888002A9BA +:10EAB00004F035FE002805D0002101A804F08CFEEA +:10EAC000002865D16846114D81880180283D68463F +:10EAD00002A9008804F023FE002803D009490D484C +:10EAE0000CF0EDFA039E04A937468837B87828362B +:10EAF00005F059FE002804D106480249401D0CF0DB +:10EB0000DEFA09E0B4E60000FF020000AC120020CB +:10EB10008000002014050000767EB87805F05EFFC6 +:10EB2000002803D1FB49FC480CF0C9FA05F0C1FFED +:10EB300001214840314601431FD06A461188A2791D +:10EB4000FD23520012191181A2794000515D49083C +:10EB5000490031435155A2791940014351556A4644 +:10EB6000107C002802D00420014301E0FB2001407A +:10EB7000A0794155A079401CA0710021684604F09D +:10EB80002BFE002804D168460188808881429ED1EE +:10EB900000202071012060713B21E17020707EE730 +:10EBA00070B5DE4C05462078002804D034210E20B4 +:10EBB00001F0EBF870BD08F089FF052804D0284665 +:10EBC00008F041FD002000E00C2020710120607160 +:10EBD0003421E170207070BD10B5D04C2078002831 +:10EBE00004D00E21084601F0D0F810BD0622CC4911 +:10EBF000A01D0CF0DAF800202071012060710E21B8 +:10EC0000E170207010BD70B5C44C06462078251DFB +:10EC1000002804D032210E2001F0B7F870BD314633 +:10EC2000002009F034F9287000280CD10021324668 +:10EC3000084606F08EF92870002804D106223146D5 +:10EC4000B7480CF0B2F8012060713221E1702070F9 +:10EC500070BD70B5B14C05462078002804D0302135 +:10EC60000E2001F092F870BD08F075FD002803D168 +:10EC700004F0ECFA00280DD0287804F098F82878F1 +:10EC800006F0CEF900202071012060713021E17082 +:10EC9000207070BD0C20F6E7F8B5A04C0646207831 +:10ECA000251D002804D017210E2001F06EF8F8BDB4 +:10ECB0003146012009F0EBF80127287000280FD118 +:10ECC0003246012106F045F92870002808D1934802 +:10ECD000062231463C300CF068F89048403087708E +:10ECE00067711720E0702770F8BDFEB58B4C0546A4 +:10ECF0002034A07B002804D028210F2001F045F803 +:10ED0000FEBDA8781A2824D00EDC03000CF0F8FA17 +:10ED100016333333333321333333333333333333F2 +:10ED200033333333212121332A2824D00ADC1E38FF +:10ED300003000CF0E5FA0C202020202020202020C9 +:10ED400020200E203A3803000CF0DAFA04150315DF +:10ED500003152888734988420DD81F21E1732821A3 +:10ED600021740120A0732888694604F0D8FC00288B +:10ED700003D0022014E0122012E068460078019FC0 +:10ED800000280FD0C637019E00280DD0C736684630 +:10ED900001F024F8002802D03878002806D00C2092 +:10EDA000E073FEBD9C37EEE79D36F0E7012038703A +:10EDB000A87830700020E073684601F027F8FEBDA7 +:10EDC000F0B5564C0746207885B0002804D02521A0 +:10EDD0000E2000F0DAFF62E6388802A904F09FFCFA +:10EDE0004E4E0021083600280CD0022020713160E0 +:10EDF0003171E1800E20A0702520E070012060714B +:10EE000020704CE6039D28460A30483501900020CA +:10EE1000A8750522304601990BF0C7FFA87D002890 +:10EE2000F5D13888E080E5E7FEB53C4C0646203455 +:10EE3000A07B002804D010210F2000F0A6FFFEBD0B +:10EE40001F20E073102020740127A77330886946C3 +:10EE500004F065FC002810D1684600F0BFFF0028D0 +:10EE60000BD06846019D007828350028019806D00F +:10EE7000CA300178002909D104E0022007E080307F +:10EE8000406AF6E72035697B002902D03A20E0731A +:10EE9000FEBDA97B89070DD1062101706846007867 +:10EEA000002804D1019831888030406A418068464A +:10EEB00000F0ACFF0020E0736F73FEBD70B5174D1E +:10EEC00004462878002804D038210E2000F05DFF89 +:10EED00070BD1F202871012068713821E9702870E9 +:10EEE0002078002808D0012806D0022804D0032862 +:10EEF00002D01220287170BD002606F05FF820783D +:10EF000007F069FA207808F0E8FF20780AF0AEFAF6 +:10EF10002E7170BDB4E600001F0500006C120020C9 +:10EF20008C000020FF0E0000F8B5FF4D0646287843 +:10EF3000002804D01D210E2000F027FFF8BD1F205F +:10EF40002871012068711D21E970287008F0BEFD4C +:10EF50000C27042857D0052855D0B0791224012851 +:10EF600001D000281DD13078002801D0012818D107 +:10EF7000F079002801D0012813D17088EB49021FD5 +:10EF800030248A420DD2B288121F8A4209D22887C1 +:10EF9000B0886887B0790024012804D000280CD0FC +:10EFA00016E02C71F8BDE0484030807800282AD067 +:10EFB000DD4A3C320121084602E0DD4A0021012001 +:10EFC00005F0C7FF040003D0DA49DB480CF077F8FE +:10EFD000F079012801D0002802D105F0D6FF0446BF +:10EFE000002C01D01F2011E03078012802D0002829 +:10EFF00003D00AE00021022001E00021012005F0F9 +:10F00000D4FF002801D02F71F8BD00202871F8BD71 +:10F0100070B5C54C2178002904D01E210E2000F0C7 +:10F02000B4FE76E71F212171012161711E22E27079 +:10F03000217002781221012A01D0002A04D14078DF +:10F04000002803D0012801D0217162E700260C2599 +:10F05000012A09D008F03AFD052803D008F044FA47 +:10F06000002806D0257154E7618F208F08F085FBBA +:10F07000F6E726714DE7F0B5AE490546143103C9F0 +:10F0800087B0A94C059120340490A07B002805D0BE +:10F0900021210F2000F079FE07B0F0BD1F20E073A2 +:10F0A000212020740127A773284600F0BDFE002808 +:10F0B00010D108F00BFD05280BD008F007FD04283F +:10F0C00007D0207D002804D105F059FD9B498842D6 +:10F0D00001D00C20BDE0684604F0EFFA002801D012 +:10F0E0000920B6E001220321009805F028F8009ECF +:10F0F000042170880F3603903046FDF70DF8304636 +:10F10000039905F004F98EA0009E00680690032183 +:10F1100006A81336FCF789FF002006A90A5C3254C2 +:10F12000401CC0B20328F9D30098298A8180698ADB +:10F13000C180A98A01810146002620318E73CE73D9 +:10F140006979002902D0012903D101E0C67600E0E7 +:10F15000C7760622A91D1C300BF027FE0098052259 +:10F1600004A90A300BF021FE0098A030077369460D +:10F170000E72012102A8FCF758FF6946087A410780 +:10F18000C206490F920F80068918C00F08186946F9 +:10F190000872401D009B0928987601D208309876A5 +:10F1A00001220021184604F0CAFF00988A3005F0B9 +:10F1B00086F9002804D160485E49FF300BF07FFFDC +:10F1C000287B002806D0012808D05A495D480BF05A +:10F1D00076FF40E00021564A012008E052484030C6 +:10F1E000807800280FD0504A01213C32084605F0B3 +:10F1F000B0FE00282FD000988030807A05F081F989 +:10F20000002816D01AE000988030807A05F079F94D +:10F21000002804D14B4847490D380BF050FF0098A7 +:10F2200004F01BFB002800D153E746484149093848 +:10F2300041E044483F49C01D0BF041FF009804F0F5 +:10F240000CFB002804D03F483A490B300BF037FF45 +:10F250001F20E07320E72879012801D0002803D17E +:10F2600005F093FE00280CD10320009905F09DFEC7 +:10F27000002806D16A882988009808F02BFA00280F +:10F2800007D000988030807A05F03BF9002805D03F +:10F2900009E00098A0300670E673FDE68520254958 +:10F2A00000010BF00CFF009804F0D7FA0028BBD047 +:10F2B0002448204935300BF002FF0AE738B51A4CD4 +:10F2C0002078002804D022210E2000F05EFD38BDF9 +:10F2D0001F202071012565712220E070257008F043 +:10F2E000F5FB052802D00C20207138BD00202071CC +:10F2F000684608F0A1FA0028F7D100988030807A9B +:10F3000005F0FFF8002804D10E480A4963300BF0DD +:10F31000D6FE009804F0A1FA002804D00948054957 +:10F3200067300BF0CCFE0FE06C120020FD3F0000B8 +:10F330008C000020B4E6000006070000FFFF00007C +:10F34000112233001F080000F8480575F8480078BE +:10F35000F2F7DAFF38BDF8B5F44D0446A87B002873 +:10F3600004D023210F2000F010FDF8BD1F20E8730A +:10F37000232028740120A8736288EE4B911F30204F +:10F3800099424CD2A1888E1F9E4248D28A4246D8CA +:10F39000E288FF23F4339A4241D82289E54E13468E +:10F3A0000A3B361FB3423AD2C9088A4237D961892B +:10F3B000A289914233D800262088694604F0A1F939 +:10F3C000022700280BD1009800F0F6FC002806D098 +:10F3D00000988030416A0A78002A06D101E0EF7374 +:10F3E000F8BD826B1278002A01D03A2017E005227E +:10F3F0008A71416A0E81426AA1885181426AE1881C +:10F400009181426A2189D181406A01894289914270 +:10F4100004D88179082901D8914202D31220E873D7 +:10F42000F8BD2188418000988030406A0770EE73F3 +:10F43000F8BDFEB5BD4C0646203C2078002804D01F +:10F4400024210E2000F0A1FCFEBD012565712420C1 +:10F45000E0702570304604F07CFF002801D00020C9 +:10F4600000E0122020710028EED1B04F0522C037F5 +:10F4700038463D7731461D300BF097FC00263E772D +:10F48000701E69460880684604F073F9002818D198 +:10F4900068460788684601A9008804F032F9002808 +:10F4A00003D0A549A5480BF00AFE0198A0300573CA +:10F4B000684604F05EF9002803D168460088874258 +:10F4C000E8D12671FEBD38B5984C0546A07B0028D2 +:10F4D00004D026210F2000F058FC38BD1F20E07317 +:10F4E000262020740120A0732888694604F009F9B9 +:10F4F00000280BD1009800F05FFC002806D000988F +:10F500008030416A0A78002A06D101E002200DE02D +:10F51000806B0078002801D03A2007E007200870AF +:10F52000009829888030406A41800020E07338BD0F +:10F5300010B57E4C203C2078002804D006210E20F7 +:10F5400000F023FC10BD002020710E20A0700620CA +:10F55000E0700821A01D0BF085FCA179012001437A +:10F56000A1716071207010BD38B5704C0546A07B4C +:10F57000002804D02C210F2000F007FC38BD1F20EC +:10F58000E0732C2020740120A0732888694604F0C1 +:10F59000B8F800280CD1009800F00EFC002807D025 +:10F5A0000098014680314B6A1A78002A06D101E0A2 +:10F5B000022025E0896B0978002901D03A201FE05C +:10F5C0004030007F00281DD00822A91C181D0BF018 +:10F5D000ECFB00986A898030416A8A81406A29463A +:10F5E00010220C310E300BF0E0FB0098032180302C +:10F5F000406A0170009829888030406A418000206C +:10F60000E07338BD0C20FBE770B5484E0446203E41 +:10F6100030780C25002804D018210E2000F0B5FB0E +:10F6200077E402F00FFF03285BD002F011FF0328FC +:10F6300057D06079002801D001282DD1A079002869 +:10F6400001D0012828D1A07B002805D0012803D0B3 +:10F65000022801D003281FD1607B00281CD0C008DD +:10F660001AD1628801208003824202D82188814217 +:10F6700003D9207901280FD119E02079002806D07C +:10F68000012814D0022805D0032805D102E0202A41 +:10F690000BD30CE0A0290AD22079042805D12088B8 +:10F6A000202802D36188884201D9122519E01F4819 +:10F6B000217981756079002802D0012805D010E0F9 +:10F6C0001B4A20460C32002108E018482030807880 +:10F6D000002806D0154A01211C32204608F05DFBA7 +:10F6E00005460120357170711821F170307010E4F9 +:10F6F00010B50E4C203C2178002904D01A210E2090 +:10F7000000F043FB10BD01781F2919D8411C17D008 +:10F71000002121710278411C104608F0E1FB012014 +:10F7200060711A21E170207010BD00008C12002061 +:10F73000800000207B0C0000B4E6000011090000EE +:10F7400012202071EBE710B5FE4C2178002904D07F +:10F7500020210E2000F019FBE6E701781F290ED8C2 +:10F76000411C0CD0002121710278411C104608F088 +:10F77000A6FB012060712021E1702070D4E71220E7 +:10F780002071F6E7F8B5EF4C2178002904D01B2151 +:10F790000E2000F0FAFAF8BD012666710C212171E5 +:10F7A00000780025012804D000285BD012202071A9 +:10F7B00087E002F047FE002834D102F049FE00281D +:10F7C00030D108F056FAE04988422BD108F0AFFA60 +:10F7D000002876D0684603F006FFDC4A0099916065 +:10F7E000002803D0DA49DB480BF069FC0122032131 +:10F7F000009804F04AFC009808F003FC00988A3056 +:10F8000004F05DFE002804D1D248D14908300BF045 +:10F8100056FC009803F0CEFA002851D0CD48CC49D0 +:10F820000C301CE002F00EFE02284AD102F010FE5D +:10F83000002846D1C3482030807D002841D00128CF +:10F840003FD004283DD008F072FA002839D00020BB +:10F8500003F0B0FA002833D0BE48BD4924300BF085 +:10F860002EFC2DE002F0EEFD032804D002F0F0FDA6 +:10F87000032820D025E002F0E8FD0090002003F0EE +:10F8800092F900281DD1257100988030807A04F00B +:10F8900038FE002804D1AF48AD493E300BF00FFCD4 +:10F8A000009803F0F2FE00280BD0A720A849000121 +:10F8B0000BF005FC05E0002003F075F9002800D1ED +:10F8C00025711B20E0702670F8BD38B59D4C0546AB +:10F8D0002078002804D02D210E2000F056FA38BDE3 +:10F8E0002888694603F099FE002801D002200FE025 +:10F8F0000098CA21095C002909D13321095C0F292C +:10F9000001D0102903D1FC21095C00290BD00C2067 +:10F9100020710E20A0702D20E0702888E08001204A +:10F920006071207038BD1022A91CD8300BF03DFA50 +:10F9300000980421C03081720020E9E738B5814C7D +:10F9400005462078002804D02E210E2000F01DFA54 +:10F9500038BD2888694603F060FE002801D00220E7 +:10F960000CE000980146C030827A002A05D120318F +:10F97000C97C0F290DD010290BD00C2020710E202E +:10F98000A0702E20E0702888E08001206071207037 +:10F9900038BD052181720020F0E77CB5694C054631 +:10F9A0002078002804D037210E2000F0EEF97CBD2D +:10F9B0002888694603F0B3FE002807D00220207192 +:10F9C000012060713721E17020707CBD01987F2299 +:10F9D000014628300272427200228272A8782231D7 +:10F9E0008870E878C870287908712271E8E71CB53A +:10F9F000544C2178002904D013210E2000F0C5F9C1 +:10FA00001CBD0088694603F08AFE002801D0022050 +:10FA100006E001982421095C801C012902D00C20F9 +:10FA2000207107E00022019922712831097A2172A0 +:10FA30000088E080012060711321E1700E21A17027 +:10FA400020701CBDF8B53F4C05462078002804D036 +:10FA500035210E2000F099F9F8BDA878002801D0D2 +:10FA6000012804D1A888FF21F531884201D912204C +:10FA700020712888694603F0D0FD0126002806D0B1 +:10FA80000220207166713520E0702670F8BD009864 +:10FA900000270246C0300770AB88014643801046FD +:10FAA00080300677AA78012A00D000220A70407FB1 +:10FAB000002801D003F06EFA2771E3E7F8B5214E74 +:10FAC00004463078002804D03D210E2000F05DF976 +:10FAD000F8BD2088694603F0A0FD002801D002206F +:10FAE00028E0009F6488FD883A896800B988401C36 +:10FAF000844218D317486A384143800050430BF0C2 +:10FB0000BDF9401EFF2180B2F531884200D9084678 +:10FB1000844200D22046691C401C0BF0AFF96D1CDA +:10FB20006843401E85B2E820C05D002800D17D8476 +:10FB3000F58000203071012070713D21F17030702E +:10FB4000F8BD00006C120020FFFF000080000020C4 +:10FB5000B4E600002E0A000070B5D54C05462078AA +:10FB6000002804D033210E2000F00FF958E502F0F0 +:10FB700069FC002801D00C2018E02978002911D058 +:10FB80000A290FD014290DD01E290BD0282909D0FD +:10FB9000322907D04B2905D0642903D0FF2901D091 +:10FBA000122003E0284603F091F900202071012083 +:10FBB00060713321E170207032E570B5BC4C0546B0 +:10FBC0002078002804D03E210E2000F0DEF827E542 +:10FBD00002F038FC002803D102F03AFC002801D0E2 +:10FBE0000C2003E0287808F087F90020207101201C +:10FBF00060713E21E170207012E510B5017801249A +:10FC00000B000BF07DFB3FBFBF21BFBF4C94BFBFBC +:10FC1000BF2427BFBF464F61BFBF59BFBFBF2B9790 +:10FC2000BF9B9FBF797DBFA38185888C6590BF5D99 +:10FC3000BF555275A7ABBF372F33BB6DAFBF7142F6 +:10FC40003F3B4969B3B7C000FEF788FD9BE0FEF774 +:10FC5000C8FD98E0801CFEF709FE94E0801CFFF7C9 +:10FC60001BF890E0801CFEF7B8FE8CE0801CFEF7CD +:10FC7000CAFF88E0801CFEF7ECFF84E0801CFEF7E2 +:10FC8000CBFD80E0FEF724FE7DE0801CFFF716F937 +:10FC900079E0FEF7A1FF76E0FEF7F6FE73E0FEF7EF +:10FCA00083FE70E0FEF72FFE6DE0FEF766FE6AE071 +:10FCB000801CFEF7BEFE66E0801CFFF798FE62E047 +:10FCC000801CFFF712F85EE0801CFFF7ADF85AE0E9 +:10FCD000801CFFF775F856E0801CFEF736FE52E0F8 +:10FCE000801CFEF75DFF4EE0801CFFF756FE4AE0E9 +:10FCF000801CFFF739FC46E0801CFFF715F942E055 +:10FD0000801CFFF785F93EE0801CFFF7B4F93AE06C +:10FD1000FFF7D4FA37E0801CFFF71DFB33E0801CAF +:10FD2000FFF787FB2FE0801CFFF7CDFB2BE0FFF7F1 +:10FD3000FFFB28E0801CFFF767FC24E0801CFFF736 +:10FD4000D7FC20E0801CFFF71DFD1CE0801CFFF7A6 +:10FD5000FAFC18E0801CFFF7B8FD14E0801CFFF7E8 +:10FD6000EDFD10E0801CFFF76DFE0CE0801CFFF73E +:10FD7000A5FE08E0801CFFF720FF04E0801CFFF7D1 +:10FD8000EBFE00E000242046CEE4494A2032537CBA +:10FD9000002B03D19074D17401205074704730B59A +:10FDA000134606E0CC18203CD51AE47F5B1E445570 +:10FDB000DBB2002BF6D130BD017800290CD14121F6 +:10FDC000095C002908D18030017C002904D0007C26 +:10FDD000042801D001207047002070470178406856 +:10FDE000002903D00178002905D100E0E4E7403084 +:10FDF0004078002801D000207047012070472C492E +:10FE000000208031886740310871704710B5017853 +:10FE1000012908D140688030417F002903D00021AA +:10FE2000417703F0B7F87FE410B50388214A191F22 +:10FE3000914223D241880C1F94421FD299421DD86F +:10FE4000C2891D49931F8B4218D2038A9C1F8C4282 +:10FE500014D29A4212D8418AFF22F43291420DD82C +:10FE6000818A154C0A460A3A241FA24206D2DA08B1 +:10FE7000914203D9C18A028B914201D9302053E4C7 +:10FE8000811D017903D0002904D0C9B205E0002901 +:10FE90000AD0FAE74179002901D0012904D1007B79 +:10FEA000002803D0012801D012203DE400203BE4CB +:10FEB0006C120020FD3F00007B0C000070B5FC4D73 +:10FEC00000246C702C70AC616C72AC720120E87212 +:10FED000F8484470C473AC62F7482C6302F05FF9D1 +:10FEE000002804D0FF20F5A14F300BF0E8F82C7764 +:10FEF00070BDF8B5F54902250D60F5490026CE63C1 +:10FF00000127CF63F349C96A09070DD4F24AD36ABE +:10FF1000F2494B62136B8B62536BCB62936B0B6337 +:10FF2000D26BCB051A434A63ED4C002823D001283D +:10FF300025D0FF20E1A1A2300BF0C1F8E948A06371 +:10FF4000FF2004306063276303202061E649962088 +:10FF50004860D7491C2008560B22D243811A904290 +:10FF600037D011DC1C313AD00A2938D0142934D0CA +:10FF7000182911D12FE0DD486061DD4802E0DD483D +:10FF80006061DD48A061D9E708301FD004281BD08C +:10FF9000082817D00C2812D0FF20D8A176300BF0FB +:10FFA0008EF8DB49D9488860DB48DA494160DB4993 +:10FFB0000160DB480560DB4910204860F8BD042083 +:10FFC000E060EEE7E660ECE7FC2000E0F820E060AF +:10FFD000E7E7F420FBE7F020F9E7EC20F7E7D8208B +:10FFE000F5E710B50C460146CF480BF064F9B04870 +:10FFF000047210BDAF4840787047AD4A5170107020 +:020000040001F9 +:100000007047F8B504460D4650791179000208434F +:10001000690009190884501C01460E7801273046F2 +:100020004E78360230438E78C9783604304309065C +:100030000843117800020843A900605028460830A0 +:100040003E468640002B0CD0012B04D0FF209BA104 +:10005000E9300BF034F8206B3043AF403843206375 +:10006000F8BD206BB043F8E770B50D46044608298B +:1000700004D9FF2091A1FA300BF021F80022002DC5 +:100080000CD9AA489100635809180B6053001B193A +:100090001B8C0B62521CD2B2AA42F3D3206BA44930 +:1000A000086070BD10B504460B22D2430C308C4959 +:1000B000944223D008DC1C3026D00A2824D01428EF +:1000C00020D0182809D11BE02046083014D004287D +:1000D00010D008280BD00C2807D0FF2087A176303D +:1000E0000AF0EDFF7248047710BD042000E0002004 +:1000F000C860F7E7FC20FBE7F820F9E7F420F7E712 +:10010000F020F5E7EC20F3E7D820F1E76948007B21 +:1001100070477349C2784A6202461378184653788A +:100120001B0218439378D2781B041843120610431D +:100130000002C8617047252808D0262808D0272843 +:1001400008D041000A2807D8091D06E0022105E071 +:100150001A2103E0502101E0891DC9B2604A916073 +:1001600061494861704752498861704770B50028FD +:1001700016D002224E4C6F4BA27203201860644DC1 +:100180006248686000200126207500290AD00129F4 +:100190000FD002291DD049A167480AF090FF70BD19 +:1001A0000122E7E76548012A01D0466070BD06607C +:1001B00070BD3F48012A006B05D001214905084365 +:1001C0002063696070BD01210905084320636960EF +:1001D00070BDA069002804D1492038A1C0000AF0F0 +:1001E0006EFFA169A06A4018554988604A48554980 +:1001F00081605549C1600120216BC0030143216327 +:1002000068602C48C67370BDF8B54A4801688F080D +:100210004449BF004A68D206D60F10228A600024E3 +:1002200004603B48394981600C2069460870474D9D +:100230002C614249012008610BE000BF00BF00BFF4 +:1002400000BF00BF00BF00BF00BF69460878401E66 +:10025000087068460078002802D028690028ECD091 +:1002600068460078002804D14D2024A1C0000AF07F +:1002700026FF2C610E48012144728472C1722D4800 +:100280000760002E02D0274910204860F8BD0146C3 +:100290000A7810464A78120210438A78C978120404 +:1002A00010430906084300020D49000AC86370475D +:1002B0007413002094130020A81300207372635C51 +:1002C00068616C5F7263732E6300000080E100E080 +:1002D000C01F004080000010C00000100017004048 +:1002E000001500405B0600004015004006010200BA +:1002F00025000302050103001F0003027372635C03 +:1003000068616C5F7263732E63000000004000043C +:1003100000F501404080004080F501401011004090 +:1003200080E200E000130040761300200016004039 +:10033000401600400012004055020000001000402E +:1003400040850040488100401010004000110040EE +:10035000FB4902200860FB4908607047FA49022007 +:1003600008607047F9490870704710B5F84801F007 +:100370001EFF002803D0F749F7480AF0A0FE10BD81 +:1003800010B5F34801F02BFF10BDF44948607047E9 +:1003900070B5F34C0546A06AA84203D3ED49F14875 +:1003A0000AF08DFE01202073EF490020256148608E +:1003B000EE4845600120216B800501432163EC4933 +:1003C000486070BDE64802210173C6210161E64A1A +:1003D00000215160816AE54AC63151600121026BFA +:1003E00089050A430263E248416070470121E04801 +:1003F00089058160DA48026B8A4300210263017338 +:100400007047DC4801214160C160D7490020486045 +:10041000D6494860D24988627047D749402008626F +:10042000D6490A6802430A607047D44801684022EE +:1004300091430160D049002008627047CF480168AD +:10044000102291430160CE49012088617047CD4957 +:100450000020C861C948016810221143016070473B +:10046000C849CA69012A01D000207047C24A92686F +:100470005206520E524202700020C861012070479D +:1004800070B50C00054604D1D920B24980000AF0AD +:1004900016FEE00705D0012C03D0AE49BA480AF099 +:1004A0000EFE002D0DD00221AD4801294172C4720B +:1004B000B24808D002290BD0A649B4480AF0FFFD83 +:1004C00070BD0121F0E7016804221143016070BD95 +:1004D000016808221143016070BDF8B5A04C0025E9 +:1004E000E27A910701D5410713D4D306A849002B1E +:1004F00005DA4B7B002B02D08B7B002B09D0130736 +:1005000002D50B78002B04D1520703D54978002976 +:1005100000D10125677A002201239849002F1BD0C2 +:1005200002263040284348D0084601688E08994981 +:10053000B6004D68ED06ED0F10278F6000210160B9 +:100540008B4A954890600C206A4610708D4F396137 +:100550008B490120086114E0854D8F48A860086828 +:10056000800880000860A272E372F8BD00BF00BF7F +:1005700000BF00BF00BF00BF00BF00BF1078401E1B +:1005800010701078002802D038690028EED010785A +:10059000002804D14D208149C0000AF090FD0020C0 +:1005A00038616072A0720120E07274480660002D0C +:1005B000DBD0784810214160F8BD012F06D0022F12 +:1005C0000CD0644976480AF07AFDF8BD0868042525 +:1005D000A84308606272E372A372F8BD0868082538 +:1005E000A84308606272E372A672F8BD5C490875A0 +:1005F0007047F8B5664D5A49EC7B086B002C58D013 +:1006000001245B4AE4039460A04308635B480768E5 +:10061000604C1021A16000210160001490600C204A +:100620006A461070574C21615548012606610AE060 +:1006300000BF00BF00BF00BF00BF00BF00BF00BFC2 +:100640001078401E10701078002802D02069002811 +:10065000EED01078002804D14D205049C0000AF097 +:100660002EFD0020E060206160606061A061434871 +:1006700007603F4900144860464910204860384CE4 +:10068000A07A01280FD0022810D0444945480AF02A +:1006900016FD0020E873207D022803D1424801683E +:1006A0008907FCD5F8BD36480660F2E73448466055 +:1006B000EFE72F4A906000200863087B2A4E00284D +:1006C00002D07068012809D000222E4C2069012830 +:1006D00006D00023887A012804D006E00122F4E73E +:1006E0004023F7E7E768012F04D000271F430128C4 +:1006F00002D004E02027F9E76368012B05D000232E +:100700003B432A4F022802D007E01023F8E739685C +:10071000012902D1E168012904D0002119430228EE +:1007200002D007E00821F9E73B68002B02D1E3681B +:10073000012B3DD000230B4302283BD03EE00000BC +:1007400080E100E080E200E000E100E092000020B3 +:10075000A8130020BC020100A20200000015004006 +:1007600074130020B3020000408100404085004027 +:1007700000F501400080004040150040001200409C +:100780000010004000110040690300007E030000DB +:10079000941300200013004000400004FC020100FC +:1007A000CF0300005E03000000E200E00014004000 +:1007B0000423C0E7002A01D0022100E000211943F0 +:1007C000022807D16068012804D17068012801D08F +:1007D000012700E0002790480F4301680906090E31 +:1007E00002D06169012900D0002129730068000648 +:1007F000000E02D0A069012800D00020687387484D +:10080000006A002803D000F0DCF9012800D00020A5 +:10081000A8730020E060206160606061A061804991 +:100820004860804E8049307548683C46706209686F +:10083000B1620B46B17A022909D17178002906D03C +:100840007A4A526812780A40317891430ED00021DA +:100850002970774FE10710D03978032908D0022991 +:1008600006D002F0D1FC0121B06A20E00121EFE7BF +:1008700007F016F90121B06A27E0A0060ED53878F6 +:10088000032806D0022804D00221184602F0CBFC2F +:100890000FE00221184607F004F90AE0A00708D586 +:1008A000387803280FD002280DD00021184602F016 +:1008B000BAFC5E4841680622B01C09310AF048FAC9 +:1008C000002805D00DE00021184607F0EAF8F0E70F +:1008D0005648317A40680078C009814201D1012030 +:1008E00000E0002068702046FFF7F7FD3878002808 +:1008F0000DD001281ED002282FD003284AD04D4900 +:100900004D480AF0DCFBB07A022856D075E0A0070B +:1009100001D507F0BAFC200702D5012007F0F1FC51 +:10092000600702D5002007F0ECFCA006EBD507F02D +:100930004DFCE8E7A00701D508F0BCFF200702D571 +:10094000012008F037FE600702D5002008F032FED3 +:10095000A006D8D508F08DFDD5E7A007BF25002853 +:1009600002DA2C4004F022FF200703D52C4001209E +:1009700004F05DFB600703D52C40002004F057FB1A +:10098000A00602D52C4004F061FE6006BBD504F041 +:100990004AFBB8E7A00701D505F0DDFE200702D528 +:1009A000012005F0A1FD600702D5002005F09CFDA7 +:1009B000A006A8D505F016FDA5E7307B00281CD0C1 +:1009C000174900224A60022820D0012803D0194983 +:1009D0001A480AF074FBB16A3069884203D8154995 +:1009E00017480AF06CFB1048316941600120316BF7 +:1009F00080050143316313494860307D012800D0F0 +:100A000050E6114801688907FCD5F8BD3169B06A24 +:100A1000411805484160E9E7401600404015004094 +:100A200040810040741300204085004000150040C4 +:100A300092000020BC020100FD040000120500002D +:100A40001305000000F5014000E200E02E480021FF +:100A500001704170704770B5064614460D4601207E +:100A6000F0F7A0FC28490120284B08709E60DC604C +:100A70001D6170BDF8B504460120F0F793FC2249D2 +:100A80000120087021494C60214900264E60032155 +:100A9000204D0906A960204F002C0AD0012C03D05C +:100AA0001EA141200AF00BFB3E6003200006686097 +:100AB000F8BD386001200006F9E710B5124801784A +:100AC00000290ED00321134A0906916010494A6893 +:100AD0000021002A03D0154A1268427000E04170DC +:100AE00001700020F0F75EFC10BD07480178002976 +:100AF00007D007484068002802D00C480068C0B200 +:100B000070474078704700009300002000F50040D7 +:100B100000F1004000F5014000F200407372635C98 +:100B200068616C5F63636D2E6300000000F4004039 +:100B30003B4800210170417010218170704770B5F1 +:100B4000064614460D460220F0F72CFC01203449DD +:100B5000344A0870E41E14619660556070BD10B58B +:100B60000220F0F71FFC2E49012008702E480021BA +:100B700001604160816001202C49C005486010BDC2 +:100B800010B527480178002917D00121274AC90547 +:100B9000916025490B680022002B05D04B68002B83 +:100BA00002D08968002902D04270102103E001219F +:100BB00041701F490968817002700020F0F7F2FB54 +:100BC00010BD17480178002912D017480168002984 +:100BD0000AD00168002905D04168002902D0806848 +:100BE000002803D000207047022070470120704782 +:100BF000407870470A48017800290FD00A480168F8 +:100C0000002905D04168002902D08068002801D061 +:100C10001020704706480068C0B27047807870475F +:100C20009500002000F5004000F1004000F5014073 +:100C300000F40040FFB593B0044600201D9E0490D0 +:100C400015981C9D1027082806D0E06901F014F8BB +:100C5000002809D03770CCE0288809213843288043 +:100C60001F980227017016E0E169012088710521B3 +:100C7000E269C9029180E1698872E169F9480881F5 +:100C8000E1690020887328882021084328801121E9 +:100C90001F98042701701F980225801C039030784C +:100CA00010900A203070204618301190F5F79FFC04 +:100CB00000206FE01598102809D1022D07D0684652 +:100CC000828A04990398401A8270110AC17068469A +:100CD000C08A1699884203D9E349097A149106E03B +:100CE000884204D11099002901D0317021E0039984 +:100CF0000870000A48701E980088401BC01B83B211 +:100D0000FF20C01B984200D203460398149AC019D2 +:100D10000CA90092019002912020015D6846C08AD2 +:100D20000022F5F7D9FC3070002806D0C0B2832825 +:100D300062D06846C08A208345E00F98002805D01D +:100D4000C948006800790A2830D33CE06846008E24 +:100D5000C119C9B20491022D0FD01F99049A497884 +:100D6000914203D16A46128C824209D0BE48049156 +:100D700000680178032909D027E008461F994870C8 +:100D8000B94800680178042906D008E000790A28EB +:100D90001BD201200F9009E06946C98A818003991E +:100DA0000498081803900498281885B205AA149985 +:100DB0001198F5F71FFC002805D11E980088401BEC +:100DC000B84200DB76E7022D0ED01598102807D127 +:100DD000049A03996846808A891A8870000AC87044 +:100DE0001E980580002030709F4800680078032816 +:100DF00002D0002017B0F0BD0220FBE7F8B5044692 +:100E0000406B0026134600282BD0491F8DB2618FFE +:100E10002A460832278F8A18BA4221D89A78401871 +:100E20005F78110239430170090A41701A79DF783D +:100E3000110239438170090AC1700571290A417193 +:100E40002A46591D801D09F0B0FF608FAD1D401965 +:100E500080B26087626B002110180170417000E061 +:100E600009263046F8BD30B50B88048F9C4212D954 +:100E7000446BE0184478057824022C430BD0447965 +:100E8000057924022C436404640CA41D1B190B80F7 +:100E90001060002030BD822030BDF7B588B000253D +:100EA0006846058205275DE00398417802780E02C6 +:100EB00016434179027908021043000452D40A987B +:100EC0000123068005A802905B020022009701958D +:100ED00030460999F5F700FC04004AD16846018ABA +:100EE000018303984179027909021143437802781A +:100EF0001C021443B4421ED10A041CD44B04012129 +:100F00005B0C890300950B4301970295C1788078AB +:100F10000A02024320460999F5F7FAF9040011D1B3 +:100F2000039948790A79000210430122D203104341 +:100F30000871000A487103AA06A90898FFF793FFF1 +:100F40000400CED00399009501970295487809785E +:100F50000002084369468B8A00220999F5F7D8F9FF +:100F6000822C06D103AA04A90898FFF77CFF04008D +:100F70009AD06846058209E003984179027909020E +:100F800011434904490C0171090A417103AA04A9DA +:100F90000898FFF768FF0028EED0822C02D0204688 +:100FA0000BB0F0BD0020FBE730B50446406B0025D8 +:100FB00097B000280DD00B2268460270228F028164 +:100FC000606B0391019000216846F2F728FB6846A8 +:100FD000057065636587258717B030BDF8B50F4686 +:100FE0000546696B0020069E144600290FD0012B90 +:100FF0000DD1324639462846FFF74FFF002806D16B +:10100000002C04D032463946284600F044FEF8BD94 +:1010100000220280C262831D0263C3614263428771 +:10102000028720300170704710B50022D243028041 +:101030000420FBF7D8FA10BD10B596B00446FFF7B0 +:10104000B3FF208E002808D0012069460870E06AAE +:10105000019000216846F2F7E2FA0020E062206386 +:1010600016B010BD01280000AC130020014609880D +:1010700000200A0700D501200A06120F01D0022223 +:101080001043CA0501D5042210438A0501D5102258 +:101090001043490501D5202108437047FFB5A9B089 +:1010A0000600329D359C2B981F46229016D0007862 +:1010B00041060FD48106890E1E2909D021884A05D0 +:1010C000520E0BD13A88172A08D3FE4A914205D016 +:1010D000C10906D08006800E122802D003202DB050 +:1010E000F0BD20462C302690F7492A98087200203F +:1010F00018AA039010726A46107404AA0A60339A00 +:101100004A6020AA90809081229800780190810600 +:10111000681C1C90701F1D902B98890EC21C249275 +:10112000224620321B92083A401C02920B000AF021 +:10113000E7F81FFDFD11FD1FFD8EFDFCFDFBFDFA17 +:10114000FDF9FDFCFDF8FDFDFDF7FDF6FDFDFDFDE6 +:10115000FDF5FD00032E76D102E018A9087219E30F +:10116000032028701C9917220A7000224A70CFE2CF +:10117000052EF0D14178027808021043208320A97F +:101180008880249A517812780902114361830028DB +:101190007ED088427CD800202072E080401E60848F +:1011A0000298F5F724FA05202870A81C0190022067 +:1011B00000901BAA2A990298F5F71CFA002868D11A +:1011C00018A8807C012803D002206870102002E05B +:1011D0000120687002202490002225A91CA8F1F7A4 +:1011E000A8FD00282BD120A8007D2499814226D17A +:1011F0003A880099801C511A814220DB10A8C18DC9 +:1012000001980170090A417001991CA8891C01917B +:101210000099019A891C009125A9F1F78AFD20A85F +:10122000007D01991BAA091801910099081880B244 +:1012300000902A990298F5F7DDF90028CCD00098A3 +:10124000022826D064E272E018A9087261E2072E33 +:101250006DD341780346027808021043208320A909 +:101260008880249A517812780902114361830028FA +:101270000ED088420CD801202072587919790002CA +:101280000843E08000202073E06900F0F5FC01E0F5 +:1012900098E0A9E000280ED1E169012088710521BC +:1012A000E269C9029180E1698872E1698748088131 +:1012B000E16900208873F01F60842298C01D60627D +:1012C0000298F5F794F907202870681C0090012017 +:1012D0000190002010A9C8852FE00198012814D0A2 +:1012E000E0698079012830D000981E38417F007F66 +:1012F0000902014300980170090A41700098801C9E +:1013000000900198801C80B2019010A8C18D0098B7 +:101310000170090A41700098801C09E00AE296E118 +:101320003BE1DFE004E29BE077E036E016E2AFE08D +:1013300000900198801C80B201901BAA2A99029803 +:10134000F5F758F9002803D007E010A8818DD1E700 +:1013500039880198081A0428BFDA0198012843D077 +:10136000E0698079012804D010A8818D5548814218 +:1013700006D110A8818D00980170090A417009E01A +:1013800000981E38417F027F0802009910430870C0 +:10139000000A48700198801CBAE1072E01D0152E72 +:1013A00076D14178027808021043208320A98880F2 +:1013B000249A51781278090211436183002801D0E0 +:1013C000884201D901203FE7012020720020E080FF +:1013D0002073052E0AD01D982299E269C0B2491DDA +:1013E000F1F781FC002801D00A202DE70020C0433E +:1013F00060841AA8019023A922980297039500916E +:10140000007800238206920E20462A99FFF712FCEC +:101410000390208B20A988807BE1032EC0D140223D +:1014200020A98A814178027808021043208320A9EC +:1014300088802A991EAB1C9A0293019200913988E8 +:101440000022491E8BB21B990978F5F745F918A9B6 +:101450000872002833D10B20287010A8008F3FE0BD +:10146000052E9DD1802220A98A8141780278080228 +:1014700010432083249984464A78097812020A434B +:10148000628420A988801248824202D30720DBE6CA +:10149000AFE03F208002024362842A981FAB1C9970 +:1014A0000293019100903888401E83B21B98017806 +:1014B0006046F5F711F918A9087200280CD08328A6 +:1014C000AAD107E0FFFF0000AC13002001280000B4 +:1014D000010200000220B8E00D20287010A8808FC3 +:1014E000401C15E101990C22C9095143C91CB142A4 +:1014F00004D9019840067CD5002009E142780378A0 +:101500001002184320AA9080844622980078400652 +:1015100009D505206A46107422980078C00905D0C4 +:10152000002010741DE106206A46107424981F9054 +:101530002A9A00900023701A029383B21E9001929F +:101540001B98002201786046F4F7E2FE18A90872A1 +:10155000002269460A74832801D102200390229850 +:10156000007840060DD52088C00506D520A9208B1F +:101570008988884201D100206062002018A9087281 +:10158000C6E0FF21013120A88181808820831E9838 +:1015900060841F9860621320B8E0052E29D341783B +:1015A00002780802104320A98880218F002902D0E8 +:1015B000FE4A914206D10A216A4611740121C943AB +:1015C000218702E007216A46117422992A9A491D4F +:1015D0000192009101221D990023D203029311432D +:1015E0008BB224994A78097812020A431B99097828 +:1015F00000E0C9E0F4F78CFE18A9087200226946E1 +:101600000A740122520220A98A81832808D0002866 +:1016100009D0218FE54881427ED10020208778E0E3 +:10162000888820834DE7606B002808D0314620462B +:10163000229AFFF7E3FB18A90872002869D12B460C +:101640003A463046229900F056FB039061E022981A +:10165000022E407801907DD1002801D0012879D157 +:101660000820694608740198087521A800901B9805 +:10167000002201782046019BFFF7B0FC694600225A +:1016800048758A75002802D10198012809D0208F59 +:10169000002806D0002008740120800220A988813B +:1016A0000EE004A83399F1F7BAFF039000206946D1 +:1016B00008740120800220A988810398022807D09D +:1016C000BB4800688079002805D018A908722BE073 +:1016D000019820831DE00398002803D0812018A9D9 +:1016E000087240E021A800901B9801220178204652 +:1016F000019BFFF773FC18A9087220463499FFF785 +:1017000053FC18A9087A002803D119202870012059 +:1017100038806846007C00E03CE0002804D004A843 +:101720003399F1F77CFF0390039800282ED01AE03C +:10173000062012E52078000713D5012E11D10921CA +:1017400068460174A188818204203499FAF74BFF1E +:10175000082100E005E020A88181CDE6019840063F +:1017600012D50320039020A920888989084320806E +:1017700020A988894005400E04D026992B9808603E +:10178000269886800398AAE40420E6E418A8007A44 +:1017900000280ED00120287022980078687020A8B8 +:1017A0008088A870000AE87018A8007A28710520BF +:1017B000388020A92088898988432080E2E7FFB506 +:1017C0000746A1B000201C903A7801209040794A49 +:1017D0007C68104010AA1087744B22885B1C9A42C8 +:1017E00003D0002804D0100702D5012025B0F0BD99 +:1017F000249E0020307023980025028810A80285BE +:1018000018A805756A4B68461972057404A8186013 +:1018100020462C301B902A985860249E9446387895 +:10182000721C0521039201282DD0022808D003281C +:101830007DD13078800980011D303070B889A0805A +:101840003878022804D13078800980011B3030704C +:10185000F01C1FAA01900292009110A8008D002296 +:10186000C01E83B22020015DB889F4F735FF00283F +:10187000DED10398B9890170090A417010A9888FD7 +:10188000C01C088528E1787B18AA10753A7B012ACC +:1018900002D0022ACCD1FCE022887F231B011A400F +:1018A00010AB1A87802A4AD006DC102A10D0202AD2 +:1018B0000ED0402A0AD124E0FF3A013A65D0FF3A1F +:1018C000013A79D0FF3AFF3A022A76D00525A2E004 +:1018D0002078C00601D5082000E010201C900420CC +:1018E0006A461074002090821AA81DAA1EAB0396A7 +:1018F0000192029000933B8A20461C9AFFF79AF9C6 +:1019000084E0228B3B8A9646934268D10A221C923D +:10191000002839D1039801906046401E1FAA83B267 +:10192000029220200091015D0022704600E0BAE0A2 +:10193000F4F7D2FE014618A801750B201AE0228B9D +:101940003B8A964693424AD10C221C92002862D1CF +:101950000398019060461FAA401E0292009183B234 +:101960002020015D628C7046F4F7B6FE014618A88F +:1019700001750D20307010A8818F491C018504214C +:1019800068460174218B818245E0238B3A8A9C460C +:101990009A4224D112221C9200283CD1606A00286D +:1019A00013D000226B4607C3638C07E0FEFF0000E4 +:1019B000AC13002009F800000DE04BE02020015D91 +:1019C0006046F4F7A5FC18A90875132030700120B3 +:1019D00010A908851FE0398A228B914201D0042585 +:1019E000B6E016211C91002815D11B988188026849 +:1019F0002046FFF703FA18A9087500280BD11B9899 +:101A00003346016880881AAA00F075F90546022855 +:101A10001BD0042D19D01B988088002811D068464F +:101A2000007C002804D004A82A99F1F7F8FD0546A7 +:101A30000120694608741B981B99006805900020D6 +:101A40008880002D48D0052D2ED06846007C0328C4 +:101A500078D07DE018211C91002806D0388A208398 +:101A60002046B968FFF7A0FAD5E720461830009065 +:101A70002020015D237E01222046FFF7AFFA18A93E +:101A800008750028ECD119203070012010A90885B4 +:101A9000E6E7208801214902084010A90887FF389D +:101AA000FF38022806D0052510A92088098F884311 +:101AB00020804DE0208F9849884290D116201C90BC +:101AC0003869002805D06063B88A208700206087C5 +:101AD00002E00020C043208710A8008F7F21090169 +:101AE00002468A430DD0782300220420B968FAF711 +:101AF000D5FC3878A07010A92088098F0843208071 +:101B000002E02188814321806846007C002805D0BE +:101B10008248416804A8F1F782FD054618A8007DB7 +:101B2000002815D01C98707001203070208BB07088 +:101B3000000AF07018A8007D3071052110A80185F9 +:101B400006E0FFE77548416804A8F1F768FD05461F +:101B50007248017A20884005400E22D11B98808867 +:101B600000281ED0239A0026138810AA1385249AD1 +:101B70002A9B6F464CC71B9A039412681AABFFF757 +:101B80008DFA054602280CD00120694608741B987E +:101B90002A990068059004A8F1F741FD05461B98B5 +:101BA000868010A8018D2398018028461EE600B586 +:101BB00097B0042807D102206A46107001910021D5 +:101BC0006846F1F72CFD17B000BD10B5534C0378F3 +:101BD00000222168012B02D0022B42D126E00B7893 +:101BE000002B01D0042B03D10A712268032111704C +:101BF000216883880A79D200921D8B5221680A7964 +:101C0000D20008328918C2880A80216803890A79BB +:101C1000D2000A328B52428920680179C9000C3106 +:101C2000425221680879401C08711EE00A748288BB +:101C30008A802168C288CA8022680189118122684D +:101C400041895181C1682068C1606168F1F7E7FC92 +:101C50000146022807D02068007C002802D1002914 +:101C600003D0812010BD832010BD002010BD406B2B +:101C7000002800D0012070478178012909D100880F +:101C80000521C902884202D0491C884201D10020A6 +:101C9000704705207047F7B586B0002468461546A2 +:101CA0000F46848105261AE00498417802780902DB +:101CB00011432980811D0196029400914179027996 +:101CC0000B021343C178827809020A4341780078F5 +:101CD000090208433946F4F71BFB002806D104AA81 +:101CE00003A90698FFF7BFF80028DDD0822800D1AD +:101CF000002009B0F0BD10B51488844201D205203F +:101D000010BD17241C701080421E581C491C09F07D +:101D10004CF8002010BD0000FEFF0000AC130020B6 +:101D200030B50346002002460DE09C5C2546303D60 +:101D30000A2D02D30020C04330BD0A256843303845 +:101D40002018521CD2B28A42EFD330BD70B50D4676 +:101D5000144608E00A2109F091F82A193031203A96 +:101D6000641ED177E4B2002CF4D170BD10B500230D +:101D700010E0040A00020443A0B2CC5C44402006F8 +:101D8000000F60400407240C44402006C00C604053 +:101D90005B1C9BB29342ECD310BD000010B572B631 +:101DA00000F0DCF800280BD0EFF77AFAFAF7D3FD51 +:101DB00008F04DFB6E490020C86288626D490860DA +:101DC00062B6002010BDF3B5002501200007C06AEF +:101DD00081B0C0430006000E04D167480068401C73 +:101DE00000D1012572B600F0B9F8002802D062B621 +:101DF0000820FEBDEFF7AAF9EFF756FA5F4B604EE9 +:101E000000211A68CA40D2071FD00246CA40D20732 +:101E100018D14AB2002A07DA1407240F083CA40894 +:101E2000A400A419E46904E09408564FA400E4193E +:101E300024689207D20ED4402206920F012A04D0C1 +:101E4000032A02D062B65048FEBD491C2029D8D3CF +:101E50000198030009F054FA142123232323232398 +:101E600023230B0D0F11131F1517191B1D2E0024F3 +:101E700016E0012414E0022412E0032410E00424FC +:101E80000EE008240CE009240AE00A2408E00B24F0 +:101E900006E00C2404E0052402E0072400E0062408 +:101EA000F06901210002000AC9070843F061002D12 +:101EB00004D009E062B601200003FEBD2C4D33487A +:101EC000E862EFF7F1F9A8622A4931480860314920 +:101ED00002980860EFF7E8F9214608F09FFAFAF750 +:101EE000FEFC08F0A5FC08F01BFB0198EFF7A6F933 +:101EF000040062B603D0FFF751FF2046FEBD00206C +:101F0000FEBD10B5044600F029F8002800D00120DD +:101F10002070002010BD204908600020704710B5D7 +:101F20000C46102808D011280BD012280CD01328EA +:101F30000ED00120086010BD03CC083CFFF743FF22 +:101F40000AE0FFF72BFF07E02068FFF7DAFF03E066 +:101F50001149206808600020206010BD05480C4928 +:101F60000068884201D101207047002070470000BE +:101F700000050040640000200010001000E100E0B7 +:101F800000ED00E000E400E001100000002200008D +:101F9000BEBAFECA980000200400002010B5203808 +:101FA0000C46030009F0ACF933A6AAAEB2B8BCC027 +:101FB000C5E0DBE41B1F23272C31373C41474D5044 +:101FC00054585C606D71656974787C8084888C90ED +:101FD00094989C9FA2CACFE9F0F3D3D7F800206869 +:101FE00000F0DDF8D6E0206800F0E1F8D2E02068EB +:101FF00000F0F5F8CEE0207840B208F07FF8C9E0B4 +:10200000207840B208F09DF8C4E02078616840B2C2 +:1020100008F0B0F8BEE0207840B208F0C0F8B9E0AF +:10202000207840B208F0CBF8B4E02078217940B2B3 +:1020300008F0D6F8AEE02078616840B208F000F908 +:10204000A8E008F00CF9A5E0206808F010F9A1E07C +:10205000207808F025F99DE02068FAF72EF899E03D +:102060002068FAF72EF895E021792068FAF730F821 +:1020700090E0206807F08EFF8CE0206807F08FFF6B +:1020800088E0207807F08FFF84E007F099FF81E077 +:10209000207807F09BFF7DE0207807F0ADFF79E026 +:1020A000206807F0C6FF75E0206807F0C8FF71E000 +:1020B000206807F0CAFF6DE0206807F0CBFF69E0F9 +:1020C000206807F0CDFF65E0206807F0CFFF61E0F2 +:1020D000206807F0D0FF5DE00846EFF74FF859E0C1 +:1020E000F0F785F956E0F0F7B2F953E02068F0F721 +:1020F000BAF94FE0206800F0E1F84BE0206800F00A +:10210000E9F847E0206800F0F0F843E02078A268A2 +:10211000616800F0F5F83DE0207800F006F939E05C +:10212000207800F017F935E02078616800F027F991 +:1021300030E02078616800F03AF92BE021792078CE +:1021400008F0BEF926E0206800F06BF822E0206875 +:10215000FAF7F0FA1EE02068FAF7D4FA1AE007CC92 +:102160000C3C08F0A7FA15E0206808F0FAFA11E034 +:1021700003CC083C08F025FB0CE0206808F016FDB5 +:1021800008E009E003E0FFE708F028FD02E020682E +:1021900008F060FD206010BD0120086010BD002126 +:1021A0000170084670470146002008707047EFF341 +:1021B0001081C907C90F72B60278012A01D0012225 +:1021C00000E0002201230370002900D162B6002A3A +:1021D00001D000207047012040037047E7E7EFF38C +:1021E0001081C907C90F72B600220270002900D100 +:1021F00062B600207047F2E710B52848FFF7CFFF1E +:10220000002803D026A11D2008F059FF2348401CB8 +:10221000FFF7C5FF002803D021A1212008F04FFFC0 +:1022200010BDF1B5224D6F6801261C48FFF7BFFFB6 +:102230001A4C002803D10026601CFFF7D0FF1D4A6E +:102240001D490120506000BF00BF00BF00BF00BF9C +:1022500000230B604B60009B6B60106000BF00BFF1 +:1022600000BF00BF00BF0868002802D148680028EE +:10227000F9D048680028E4D1002E04D06F60601CBB +:10228000FFF795FF07E0601CFFF791FF0028D3D10F +:102290000248FFF7A4FF0020F8BDC2E79C00002021 +:1022A0007372635C736F635F6563622E630000002B +:1022B00000E5004000E0004000E100405A495B4B6F +:1022C0000A685B499A42096801D18904890C016056 +:1022D000002070475449554B0A6855499A4201D12C +:1022E0008004800C4860002070474F494F4B0A68BB +:1022F0004F499A4201D18004800C886000207047C9 +:1023000030B5494B494D1C684A4BAC4202D01028AD +:1023100002D203E00E2801D3184630BDC300444862 +:10232000181801614261002030BD3F493F4B0A68E7 +:102330004049491C9A4202D0042802D203E00228F4 +:1023400001D3084670473C4A0121C0008018016053 +:10235000002070473449354B0A683649491C9A4277 +:1023600002D0042802D203E0022801D308467047B5 +:10237000314A0121C000801841600020704770B5CB +:10238000294A2C4B14682D4E284D82005B1C921953 +:10239000AC4203D0042803D2116006E0022801D326 +:1023A000184670BD8804800C1060002070BD70B5A8 +:1023B0001D4A204B1468214E1C4D82005B1C921953 +:1023C000AC4203D0042803D2106806E0022801D3EF +:1023D000184670BD10688004800C0860002070BD35 +:1023E00010B5134A164890600E200021C3009B18B8 +:1023F00019615961401C1028F8D300200F4A05E0EC +:10240000022803D383009B18196005E083009B1802 +:102410001C68A404A40C1C60401C0428F0D310BD4C +:10242000034907488860704764000020BEBAFECAAE +:1024300000F501400820000000F0014000F80140D4 +:1024400000C0FFFFFE48C07E7047FE4840687047EE +:10245000FD48C07E7047FFB5F94E85B0706A34689C +:10246000056860680190306A0390298D0798401ACA +:1024700080B202900898002804D0274638372046BA +:10248000483002E0371D2846A03000900320387104 +:10249000059800281FD001287ED0022863D0032889 +:1024A0007BD0EAA1ED4808F00AFE0898002806D083 +:1024B0003879032803D0E5A1E94808F000FEA16AB5 +:1024C0007069FAF7A2FDB860216A606A814265D935 +:1024D0000099086034E1306A002803D1DBA1E148AB +:1024E00008F0EDFD288BE04948434218069800218A +:1024F000002804D05043DD4908F0C0FC411CA16114 +:102500000191AA88D848002142430698002804D0A7 +:102510005043D64908F0B2FC411CE161306AD24A0E +:10252000801CA062298BD04B5143019A891AD04A52 +:1025300089180918A162AA7D01985A4340008018A1 +:10254000FF30193020626062306A081AC949FF38CA +:1025500015388842A9D2C84988427DD2BBA1C74854 +:1025600008F0ADFD8BE0288BBF4AE16850430A18A4 +:1025700006980021002804D05043BC4908F07EFC96 +:10258000411CA161AA88B84800214243069800284E +:1025900008D05043B54902E03EE073E0CEE008F0D9 +:1025A0006DFC411CE161306A002803D1A7A1B44849 +:1025B00008F085FDA620405BAB4A0028288BE16827 +:1025C00021D050430818A169401AA0622169A0686F +:1025D000A54A4843A1694018A97D400051434018CD +:1025E000FF3017302062A888E1695043411AA5489E +:1025F00008186062A06A316A401A9E49FF3855384F +:1026000088423CD351E750430818A169401A316809 +:10261000D63849684018D8E7284680300190C08CE9 +:10262000002802D0306A002803D188A1964808F01B +:1026300046FDA8888C49E3694843C01AA062019905 +:102640009C46CA8C2169A368521A4B43A169591848 +:1026500063465343C91800E011E0AA7D824B49004C +:102660005A438918FF311731216286494118616246 +:10267000316A401A7F49FF3855388842C2D201205A +:10268000387112E70898002803D03420005D002834 +:102690007ED1A88874494843E169401A02994843A9 +:1026A000A062284680300490C08C0028019825D074 +:1026B000002803D065A1754808F001FD04986A4A16 +:1026C000C18C02980818E16948434000FF30173078 +:1026D0002062A8885043411A6A48081860626C4812 +:1026E0004068002819D0A26A03990120511A614A52 +:1026F000FF395539914285D23871D6E6002802D08B +:102700000398002803D151A1624808F0D8FC019831 +:10271000A16AD6380818A062D0E7FAF7E4F972691E +:1027200001461046FBF7F8FBA16A081A5149FF3829 +:1027300050388842A5D2012009B0F0BD0098016050 +:102740000098554900684018F86028468030028A91 +:102750000799511A09B2002904DD0599022901D00F +:10276000032100E0002179710E99002915D0028F14 +:10277000002A1ED0418F4187A0352B7F491C4B4337 +:1027800093420AD27979491E002906DD012100E031 +:102790000CE07971418F491C41870898387008987E +:1027A000002808D03420005D002804D0022009B0A1 +:1027B000F0BD0021DFE70898012148402034607512 +:1027C000307FF27E3946B37E9A4202D0FAF702FE9B +:1027D00004E00020F076B07630607062002009B02E +:1027E000F0BDF0B52A4F83B038680568416A2E46BF +:1027F0000C682036717D00290AD0698E228D9142A5 +:1028000006D1407A002803D110A1244808F057FCD3 +:10281000FAF769F91E4F39684A6901461046FBF715 +:102820007BFB3F680028796A096807D089880E4ACF +:1028300051433A68D269891A08F020FB698E2FE06B +:10284000B8130020B8000020E01300207372635C0E +:102850006C6C5F6C6D2E73302E6300002B050000D6 +:1028600034050000B1040000E204000040420F0003 +:10287000330400005C0800001D030000CE040000CB +:10288000D604000094FBFFFFEF04000015050000D4 +:10289000A80000200E050000FF0B00001B06000032 +:1028A000228D1318994202DB491C698602E0401C04 +:1028B00010186886B07D002806D19421688E095BC7 +:1028C000884201D1401C6886388BFC4E401C3883FE +:1028D000204640300190C1888088081A218D401E12 +:1028E000401887B2C03418E03068F549406A0023C8 +:1028F00000794000085A009323795B00C95A0818F0 +:1029000081B2287D0023FFF7A6FD00280FD0012803 +:102910000FD0EC49EC4808F0D2FB6A8EB81A00B22E +:102920000028E1DA01980821817005F0B1FF03B0B9 +:10293000F0BD688E401C6886EFE770B5DF4D092951 +:102940002B686A687BD20C007C4424792419A74444 +:102950000463879784A6A675A30000201062D17E29 +:10296000042956D20B007B441B79DB189F4451513C +:102970000147516A0C681168087011684860106856 +:102980002030407D002808D1FAF7ADF86968096861 +:10299000096CFBF7C1FA002817DC6868228D016812 +:1029A000498E914205D123468033998A8A1ADA8268 +:1029B00004E0891A962211530168498E2185026824 +:1029C000C1681164C168416111E068680168098EDD +:1029D000228D8B1A22468032D3820168098E21858E +:1029E00001680B6CC3600B6C4361886C10622046FD +:1029F00006F0BEFB002821D0B4A1B8482AE0D06878 +:102A0000506105F07CFA002818D07720AFA1C000F3 +:102A100020E0AEA1B2481DE0D07E042817D201000C +:102A20007944097949188F441212010B06F0DAFC37 +:102A3000002803D0A5A1AB4808F041FB70BD2EE0F3 +:102A400005F093FB0028F9D0A0A1A74802E0F720E9 +:102A50009EA1800008F033FB70BDFDF7CAFD70BD7C +:102A6000D87E022806D0D87E032806D0FF2097A162 +:102A7000A9300EE0FFF7B5FE70BD00F012FC70BD8E +:102A8000D87E0228F6D0D87E0328F6D0FF208FA16A +:102A9000B43008F014FBF0E7FAF70AF870BDFF2035 +:102AA0008AA1C230D6E7F3B50126844C8F4D81B0A0 +:102AB0000F46092945D20800784400790018874458 +:102AC000042D38382D40403838000121874800F067 +:102AD000CFFB39460198FFF730FFE87E022826D168 +:102AE00060680468406A0768F9F7DBFFB988804AC4 +:102AF0005143E269891AD639E162B72803D28320AB +:102B00000001081A02E0081A7A494018E0627A487F +:102B1000E16A814200D80846E06205E00198FFF7CB +:102B20000CFFE87E022802D128682030067503B029 +:102B3000F0BD25600198FFF700FF0020206003B082 +:102B4000F0BDFF2061A1623008F0B9FA03B0F0BD1A +:102B500070B506460C4609291FD208007844007952 +:102B600000188744040D11110D1A1A1111000121CA +:102B7000624800F07DFB21463046FFF7DEFE70BD67 +:102B80003046FFF7DAFE70BD4C4D5C482860304699 +:102B9000FFF7D3FE0020286070BDFF204BA18830D6 +:102BA00008F08DFA70BDF0B5504985B0CA7E002698 +:102BB000424C032A03D02831CA7E032A64D100255F +:102BC0002160002824D001280ED040A14C4808F0F4 +:102BD00076FA2068002E05604562256054D0494889 +:102BE0004560002005B0F0BD0320887600E020BFDE +:102BF0002068C17E002903D0C17E827E9142F6D03A +:102C0000C17E002902D000268576E2E70126FBE797 +:102C10000026032708468F76C97E032903D0C07E8D +:102C200000282DD02DE0007F002803D127A13648B1 +:102C300008F045FA2068067F684607714771F9F782 +:102C400052FF0290FF20F530039001216846017089 +:102C500069463046FAF7BEFB2068007FFBF7E8F9CB +:102C600000280BD02068007FF9F722FF2068057745 +:102C7000C576857605600126456202E020BFEBE758 +:102C8000012620688576A4E70C2005B0F0BD10B5BC +:102C9000164800F04CFB194800F049FB1B49002086 +:102CA00008751849487011494861144A506188767E +:102CB000907602494860086010BD0000A80000201E +:102CC0009CB301004C280100550600007372635C40 +:102CD0006C6C5F6C6D2E73302E630000B2030000CD +:102CE000BF030000D1030000D5030000B81300208B +:102CF000E204000087F8FFFFEC060000E01300206C +:102D00001A030000B80000207A0200000814002016 +:102D1000F8B5FF4E05463068002401270004810FF6 +:102D2000FC480068800F814204D0FF20FA49CC3073 +:102D300008F0C5F93068F94E0004810F30680006CC +:102D4000800F814204D0FF20F349CD3008F0B7F95D +:102D5000F348C0693168800F0904890F884204D0A4 +:102D6000FF20ED49CE3008F0AAF9EE480570EE4D8F +:102D7000EC76AC76ED4EF476B476ED4807710460EF +:102D80006C6274622C60EB4F346028467C6000F00B +:102D9000CEFA304600F0CBFAE74804757C706C61DF +:102DA0007461AC76B476E54844600460F8BDE049EF +:102DB00008717047F8B5DC490546CA7EDB48DF4C30 +:102DC000002A02D1C27E002A03D0C97E022907D080 +:102DD00009E0DB482160F9F717FE216808770AE06F +:102DE000C17E002901D00C20F8BD2060D548F9F73C +:102DF0000BFE21680877CF48456021680860D248FB +:102E0000486228460121BC30F9F786F9A035287FB1 +:102E10008007800F401C28772068007F002803D19E +:102E2000BD49CA4808F04BF9F9F73BFEC84988424A +:102E300000D20846C749401886B221680320C876E8 +:102E400004F078FF2168086104F09CFF0127002549 +:102E5000002826D004F096FF21684A6A10600868AE +:102E6000012107706846F9F7E0F868460078BA492A +:102E7000000208F003F80F46F9F735FEF119FAF7EA +:102E8000C4F82168C860226803201072507215715E +:102E9000107FD37E111D967EB3420ED0FAF79AFAB8 +:102EA0000FE0F9F720FE3146FAF7AFF82168C86065 +:102EB0000868057008684770E5E7D576957615606F +:102EC00055622068058300202560F8BD7047F8B57D +:102ED000954EF17E002903D19449C97E002901D085 +:102EE0000C20F8BD0221F176914F934D7762356049 +:102EF000002438602C7500943979C0304A00974915 +:102F000000798A5A4000085A2346101881B2224696 +:102F10002046FFF7A0FA002803D07F49904808F028 +:102F2000CEF82C610120AC6028756C862C868D480B +:102F300084753968088D401E088534830020F8BDEB +:102F400010B57E4801244068817E03290CD00168B9 +:102F50004978002906D0006A8349884202D90024B2 +:102F600005F030F9204610BD0024FBE773484068A7 +:102F700002681178491C1170016A0068C26A9142A6 +:102F800004D8007D012801D001207047002070473F +:102F900000207047F8B5694D63482860416A0027F2 +:102FA0000C680068342126460F548036B17F002912 +:102FB00027D1007D032824D1F9F795FD29684A69B6 +:102FC00001461046FAF7A8FF00281ADD2D68674B66 +:102FD0006A6A2968126892880091C9695A43511A2D +:102FE00007F04CFF218D401C4218009953480A8677 +:102FF0002968B28A0B8ED21A12B2002A03DC07604B +:10300000F8BD2F60F8BD012220318A75214640317C +:10301000CA888988514F511A228D491E89188EB24B +:103020000546C03419E0496A09794900795A0022F5 +:103030000092028E2379007D5B00FB5A591889B2F9 +:103040000123FFF708FA00280ED001280FD002282C +:103050000AD03149464808F032F829680868028EDB +:10306000B21A12B2002ADEDA00202860F8BD286801 +:103070000068018E491C0186EFE770B52F490024D6 +:103080004D68062876D202007A4412799218974445 +:103090001820020E240D002000F08FF9EC76AC769B +:1030A0002C60002108466C6200F0E2F870BD1D48FB +:1030B0000D680078EFF728F9EC76AC762C606C623E +:1030C00070BD012000F079F90021084600F0D0F829 +:1030D00070BD29680320087570BD686A296800689A +:1030E000CA698A608188214A51432A68D1600146B1 +:1030F000C0310A8A02838A7B82754A8A82808A8AE0 +:10310000C280C98A018129680220087570BD31E03A +:1031100000E400E008E400E0CC2C010018E400E04A +:1031200000ED00E0A0000020B8130020E013002014 +:10313000B0000020B800002008140020A8000020E3 +:10314000A72A0100512B0100A4000020C5020000A5 +:10315000F6050000BB020000102700009CB3010030 +:103160004E03000028140020D9821300E20400005E +:10317000010600007520DD49000107F0A0FF70BDC9 +:1031800070B500280AD00024D94D01280DD002289E +:103190002ED0D649D74807F092FF70BD00F06BF9EA +:1031A0000021084600F064F870BD686801684C7042 +:1031B000C47684760460D04E446201220021706897 +:1031C00000F063FF71680846C0318C72CC72FFF763 +:1031D0007EFE002803D0C549C84807F070FFF9F704 +:1031E000CDFBC7486C600078EFF78EF86C6070BD5F +:1031F00000F041F96868C476847604600021446276 +:10320000084600F035F870BDB9494968CA7E022AFF +:1032100008D10A681378002B04D150600968CA6A83 +:103220001018C862704710B5B14A002952680BD017 +:10323000012906D0022906D0AC49B24807F03FFF69 +:1032400010BD801E00E0401F106210BD08B50020B8 +:10325000C04369460880AC48C07E002801D00020E9 +:1032600008BD084600F0F5F90028F9D0012008BD96 +:1032700070B59F4C05466268002908D0002A04D02A +:10328000FF209A490D3007F01AFF656070BD002AD3 +:1032900004D1FF209549133007F011FF0020606032 +:1032A00070BD38B5924C20680168497801291FD05B +:1032B00001216846F8F7B9FE684600789349000294 +:1032C00007F0DCFD2068426AC06812685118F9F7FF +:1032D0009CFE2168C8608C4822680321824202D08B +:1032E000108B0A2810D2108B401C108351720DE0F5 +:1032F0007D21C068C900F9F788FE2168C86004F024 +:1033000019FD21680861E6E702205072117200235E +:103310001371107FD47E111D957EAC4202D0FAF756 +:1033200059F838BDD37693761360536238BDF8B53B +:103330006F4C05461F27EE7E042E2DD230007844B8 +:10334000007900188744312801237148854203D051 +:103350006649704807F0B3FE02202560A87600E0B9 +:1033600020BF2168C87E002803D0CA7E887E8242A2 +:10337000F6D0CA7E002A04D000228A760C2722606A +:1033800010E000228A760A604A6222600DE0012085 +:10339000FFF709FC074603E054495F4807F08FFE3A +:1033A000002F02D0E87EB042C5D1E87E002803D0CD +:1033B0004E495A4807F083FEF8BDF8B54C4D012838 +:1033C0006A68516A0C6846D10879554940000B5A21 +:1033D0001068077D0126032F06D0027D022A13D034 +:1033E000007D012824D036E000270761106887603F +:1033F00094200096025BC420005D4000085AC0186B +:1034000081B23B4603201EE022468032D78C076102 +:103410000096C420005D928A4000085AC01881B20C +:1034200000230220FFF717F8696809680E750CE0A1 +:1034300094200096025BC420005D4000085AC0182A +:1034400081B200230120FFF706F8002803D02749A6 +:10345000344807F034FEF9F791FA29480078EEF77E +:1034600053FF6968002008830B68228D5A8609681B +:1034700020318875F8BDF8B51D4D002168680C46EF +:1034800000684278002A01D0447027E000780028C4 +:1034900009D001216846F8F7EDFD684600781B4920 +:1034A000000207F0EBFC6868426AC06812685118B5 +:1034B000F9F7ABFD6A68D060147103205072107F79 +:1034C000D37E111D967EB34202D0F9F783FF03E04D +:1034D000D47694761460546268680483F9F74EFADF +:1034E00007480078EEF710FFF8BD0000CC2C010073 +:1034F000A800002072070000B8000020FD060000B0 +:10350000A000002097070000E01300201027000013 +:10351000B8130020030200000F0200001502000093 +:103520009CB30100B6060000F8B50024E948FEF798 +:103530003EFE002825D1E84FC02026464643F51917 +:103540000146284607F090FC0120B8556C80E349FD +:1035500000200870E24A4A8080356962E149641CB3 +:103560000870A962E049E4B208704A80A963032C9C +:10357000E2D3D848FEF733FED648FEF718FE0028FF +:1035800001D00C20F8BDFF211931D84807F06CFCA0 +:10359000D648012101704480D54900200872087581 +:1035A000D4498872CB48FEF71AFE0020F8BD10B54A +:1035B000C848FEF7F4FD002803D0CFA1282007F06B +:1035C0007EFDC448FEF7EBFD002803D0CAA12D20E4 +:1035D00007F075FDFFF7A8FF002803D0C6A1332030 +:1035E00007F06DFD10BD10B50446BA48FEF7DFFDCB +:1035F000002801D00C2010BDBC490878002807D055 +:1036000000200870B3482160FEF7E9FD002010BDDE +:10361000B048FEF7E4FD1F2010BD70B505460C460E +:10362000AC48FEF7C4FD002801D00C2070BDAF4AA5 +:103630005088A84202D11078002804D0A548FEF78F +:10364000CEFD122070BDA3482260FEF7C8FD002009 +:1036500070BD10B504469F48FEF7A9FD002801D0B3 +:103660000C2010BDA1480178002907D00020C043DC +:1036700020809848FEF7B3FD122010BD40882080BE +:103680009448FEF7ACFD002010BD10B504469148EB +:10369000FEF78DFD002801D00C2010BD20780028F9 +:1036A00004D08C48FEF79BFD0C2010BD012020703B +:1036B0008848FEF794FD002010BD10B504468548EB +:1036C000FEF775FD002801D00C2010BD824A0021B4 +:1036D000C0204843105C00280AD0C0230020594372 +:1036E0005054881820607B48FEF779FD002010BDFB +:1036F000491CC9B20329EBD37648FEF770FD1F20A1 +:1037000010BD032805D2C0225043734A135C002B1E +:1037100001D012207047801808600020704710B553 +:1037200000220C46032809D2C02148436A490B5C99 +:10373000002B14D122704018606018E003280ED1CD +:103740006448FEF734FD002809D168484188032900 +:1037500002D10178002904D05E48FEF740FD122016 +:1037600010BD60605B48FEF73AFD0120207000202C +:1037700010BD10B504465748FEF719FD002801D0CA +:103780000C2010BD2088544A032804D2C02148438D +:10379000105C002801D00020208000202188491CD6 +:1037A00089B22180032900D300212180C0235943FD +:1037B000515C00290BD0401CC0B20328EED300207E +:1037C000C04320804348FEF70AFD122010BD414847 +:1037D000FEF705FD002010BD70B505460E463D48BC +:1037E000FEF7E5FC002801D00C2070BD2888341DB0 +:1037F000032804D303D0A04201D300202880002056 +:10380000361D1DD0394B34492A88521C92B22A8069 +:10381000A24200D300222A80042A02D3A24217D354 +:1038200001E0032A05D0C02672438A5C002A0FD02B +:1038300002E01A78002A0BD0401CC0B2A042E3D3A9 +:103840000020C04328802348FEF7C9FC122070BD29 +:103850002048FEF7C4FC002070BD10B504461D488A +:10386000FEF7A5FC002801D00C2010BD2078002810 +:1038700004D01848FEF7B3FC0C2010BD01202070C6 +:103880001448FEF7ACFC002010BD10B504461148EA +:10389000FEF78DFC002801D00C2010BD21780120FE +:1038A000002902D0012905D008E061680A78002AC1 +:1038B00009D003E061680A78002A04D00548FEF7C1 +:1038C0008EFC0C2010BD08700248FEF788FC00201A +:1038D00010BD0000C00000205814002098160020E1 +:1038E000FFFF0000C1000020C6160020D8160020EF +:1038F000B8170020D81700207372635C6C6C5F648B +:10390000622E630010B5282107F0ACFA10BD70B527 +:10391000054600780A0700090001120F10432870BD +:1039200007290ED20800784400790018874403055F +:10393000030503070300062408E00C2406E0222404 +:1039400004E00024F8A1572007F0B9FB687880094B +:1039500080012043687070BD00780007000F704739 +:1039600010B5C01C07F0A7FC10BD0A4610B5C11C5D +:10397000104607F0A0FC10BD10B5093007F09BFC05 +:1039800010BD0278BF23C9071A40490E0A430270CE +:10399000704700784006C00F704702785206520EFA +:1039A000C9010A430270704770B50C460546C11C38 +:1039B0002046093007F07FFC20784006400E20703A +:1039C00029784906C90FC9010843207070BD70B538 +:1039D00015460E4604461F2A03D9D3A1A82007F096 +:1039E0006EFB20462A463146093007F0DEF9607842 +:1039F000AD1D80098001A906890E0843607070BD65 +:103A000070B5054640780E468406A40E062C03D2F7 +:103A1000C5A1B82007F053FBA41FE4B21F2C00D9A6 +:103A20001F24294622460931304607F0BEF92046B8 +:103A300070BD70B515460E4604461F2A03D9BAA1BB +:103A4000CC2007F03CFB20462A463146093007F0DF +:103A5000ACF96078AD1D80098001A906890E084384 +:103A6000607070BD70B5044640780E468506AD0E98 +:103A7000062D03D2ACA1DD2007F021FBAD1FEDB276 +:103A80001F2D03D9A8A1E12007F019FB21462A46E2 +:103A90000931304607F089F9284670BD0A78C273AB +:103AA0004A7802748A784274C978817470470A78B7 +:103AB000C2744A7802758978417570474176090A5F +:103AC00081767047C176090A017770474177090A04 +:103AD00081777047C175090A017670478175704713 +:103AE00020300279C90652095201C90E0A430271F7 +:103AF000704720300279D206D20E49010A43027182 +:103B0000704710B51F3007F0CBFB10BD417800782F +:103B10008906890E0007000F06D0012808D0022868 +:103B200009D0062810D10AE0891F1F290AD90BE005 +:103B30000C2907D008E0891F1F2903D904E0891F39 +:103B40001F2901D801207047002070474178007874 +:103B500089060007890E000F042805D1062903D322 +:103B6000252901D8012070470020704770B40178E2 +:103B70000907090F03292ED0052931D1411C827E66 +:103B80000C46437E11021943037FC27D1D02037E52 +:103B9000C67E1B021343827D407835438006800E2B +:103BA00022281DD106291BD31920C001814217D814 +:103BB000FF26F436B54213D8002A11D0082A0FD8B0 +:103BC0008A420DD28B420BD8617F227F09021143BA +:103BD000814208D904E040788006800E0C2802D08B +:103BE00070BC0020704770BC0120704710B52221C6 +:103BF00007F038F910BD10B502788B0792089200D3 +:103C00009B0F1A43027042785209520142700129F7 +:103C100008D0022906D0032905D0FF2042A1E830B0 +:103C200007F04DFA10BD01210A43427010BD10B5D6 +:103C300002788B07920892009B0F1A430270427819 +:103C4000520952014270012907D0022905D00329E7 +:103C500004D035A1384807F032FA10BD01210A43DB +:103C6000427010BD00788007800F70470278EF2304 +:103C7000C9071A40C90E0A43027070474178C078DC +:103C8000C906C90E0E2835D202007A44127992185C +:103C9000974406090C0F1215181B1E2124272A2DE4 +:103CA0000C2929D02AE0082926D027E0022923D090 +:103CB00024E0172920D021E00D291DD01EE0012984 +:103CC0001AD01BE0012917D018E0022914D015E002 +:103CD000092911D012E009290ED00FE001290BD0DB +:103CE0000CE0012908D009E0062905D006E00229E8 +:103CF00002D003E01B2901D8012070470020704743 +:103D000070B50546C1700E2926D2080078440079A6 +:103D10000018874406131517191B1B151D1D1B1BA7 +:103D20001F150C241DE000007372635C756C5F70DE +:103D300064752E630000000001020000082410E0FA +:103D400002240EE017240CE00D240AE0012408E010 +:103D5000092406E0062404E000249A499A4807F062 +:103D6000AEF96878400940012043687070BDC078A2 +:103D70007047C171090A01727047017AC27908025D +:103D8000104370474172090A81727047817A427A02 +:103D9000080210437047C172090A01737047017B22 +:103DA000C27A0802104370474171090A8171704755 +:103DB0008179427908021043704701717047007998 +:103DC00070474173090A81737047817B427B080207 +:103DD0001043704770B4017AC37909021943431C38 +:103DE000857A1C46467A2B023343657926792C0264 +:103DF0003443C21C754E00798D1FB54215D8FF257E +:103E0000F435AB4211D800280FD008280DD88842CD +:103E10000BD28C4209D8507A117A00020843B11DA6 +:103E2000884202D870BC0120704770BC00207047E7 +:103E300010B5001D07F034FA10BD0A4610B5011D7B +:103E4000104607F02DFA10BD4172090A81727047C1 +:103E5000817A427A080210437047017170470079F5 +:103E6000704710B5001D07F033FA10BD0A4610B5B3 +:103E7000011D104607F02CFA10BD0A78027349782C +:103E800041737047027B0A70407B4870704710B5E1 +:103E90000E3007F01DFA10BD0A46014610B50E316E +:103EA000104607F015FA10BD0A7882754A78C27577 +:103EB0008A780276C97841767047827D0A70C27D21 +:103EC0004A70027E8A70407EC870704710B5001D2F +:103ED00007F0FEF910BD0A4610B5011D104607F0A7 +:103EE000F7F910BD0A7802734A7842738A788273B0 +:103EF000C978C1737047027B0A70427B4A70827B2B +:103F00008A70C07BC8707047017170474171090A9F +:103F100081717047C171090A017270470079704759 +:103F200081794279080210437047017AC279080208 +:103F300010437047017170470079704701717047F5 +:103F400010B5001D07F0C4F910BD0A4610B5011DDB +:103F5000104607F0BDF910BD10B5001D07F0B8F907 +:103F600010BD0A4610B5011D104607F0B1F910BD8D +:103F700070B515460E4604461B2A03D9114914484C +:103F800007F09DF82A463146E01C06F00EFF6078E7 +:103F9000E90640094001C90E0843607070BD70B564 +:103FA000054640780E46C406E40E1B2C03D905498D +:103FB000084807F084F82246E91C304606F0F5FE72 +:103FC000204670BD283D0100A10200007A0C0000CF +:103FD000F1030000FD03000070B504460020A0833B +:103FE000208C1E4648431546114606F055FF208496 +:103FF000F000294606F042FF401C80B2014619221B +:1040000069439202E083914201DD401EE0837D20FE +:104010002946000206F032FF401CA08470BD70B536 +:104020000A7BD206D20E0A73002282758B181B7A85 +:10403000DC075B08DD07E40FED0F2C195B08DD07DB +:10404000ED0F2C195B08DD07ED0F2C195B08DD0760 +:10405000ED0F2D195C08E307DB0F5B196508EC0712 +:10406000E40FE4186B081B1984186374847D521CD8 +:10407000E318D2B28375052AD8D3D8B2252803D93C +:10408000E1A18A2007F01BF870BD70B504460B460D +:1040900025462646214600202835C0368031032B90 +:1040A0000AD0002B3AD0012B41D0022B03D1A11C06 +:1040B0002846FFF7B4FF70BD2880A871E871E87248 +:1040C00028736873A873A870E8702871687168769F +:1040D000A8832B4668842033987128859872E875E8 +:1040E0002876E8732874D872187398731A75288420 +:1040F000FF226035AA709875088248828882C8823B +:10410000088348834877C884A422105508874887C5 +:104110002421085560843070B07170BDC8848877E0 +:10412000A18823890A462846FFF756FFBFE7C884BF +:10413000F38A728AA1882846FFF74EFF70BD70B5DA +:104140000446034628348033054603290AD0002953 +:1041500033D0012938D0022903D1A91C2046FFF70A +:104160005EFF70BD00202080A071E071E0722073BE +:104170006073A073A070E070207160716076A0839E +:10418000214660842031887120858872E075207610 +:10419000E0732074C872087388730A752084FF2244 +:1041A0006034A27088751883987618742421586139 +:1041B00048551877A035287370BDA9882B890A4601 +:1041C0002046FFF709FFC8E7586AA988C3894289D2 +:1041D0002046FFF701FF70BD70B5867D0D46044691 +:1041E000002E01D0252E01D9122070BD002A18D032 +:1041F000287EE17D50430818252106F03FFEE17539 +:104200000846CA084907490F834BAA18595C127A15 +:10421000914308D0314606F031FE491CCAB2002055 +:104220000AE0002070BD2076002070BD002803D079 +:104230002118097C511ACAB22118497C91423AD3FB +:104240002918097AC943CB07DB17D21A521E120666 +:10425000120E35D08B07DB17D21A521E1206120E21 +:1042600032D04B07DB17D21A521E1206120E30D074 +:104270000B07DB17D21A521E1206120E2ED0CB06D7 +:10428000DB17D21A521E1206120E2CD08B06DB1729 +:10429000D21A521E1206120E2AD04B06DB17D21A61 +:1042A000521E1206120E28D00906C917511A491EAD +:1042B0000A06120E26D0401C0528B7DB1F2070BD51 +:1042C000C0002076002070BDC000401C2076002079 +:1042D00070BDC000801C2076002070BDC000C01CD6 +:1042E0002076002070BDC000001D2076002070BD2B +:1042F000C000401D2076002070BDC000801D2076CB +:10430000002070BDC000C01D2076002070BD70B5BB +:104310000D460446072904D9FF203BA15D3006F075 +:10432000CEFEE078502108406907490F88300843E5 +:10433000E070A078A72108401830A07060785E2156 +:104340000840203060702078BC2108404030207048 +:1043500070BD0179490901D000207047002230B4B6 +:104360001146445C491CE3076408E507DB0FED0FC9 +:10437000EB186408E507ED0FEB186408E507ED0F8F +:10438000EB186408E507ED0FEB186408E507ED0F7F +:10439000EB186408E507ED0FA407EB18E40FE3182A +:1043A000D218D2B20529DCDB002A02D030BC0120B1 +:1043B000704730BC0020704738B505460C4668464B +:1043C000FCF74EF800281ED06946002008562072DF +:1043D000092161560022411A00D549422035EB7867 +:1043E0008B420FDCFF2B0DD0A17A491CC9B2A17200 +:1043F0002B79994202D8617A7F2903D1607200201B +:10440000A0720122104638BD7372635C6C6C5F75DC +:1044100074696C2E63000000ACB30100F8B5002491 +:10442000F74EFF20B470F0702546F64F06E0042DDD +:1044300004D3FF20F4A1AB3006F041FEFF21284653 +:10444000A0314843FF213331C0194A1C0C540146A6 +:10445000FF31145421310C754C75F178A94202D109 +:10446000B470FF21F170FF219D314A1C6D1C0C546A +:10447000EDB21454042DDAD30020FF21A0314143C2 +:10448000C919FF3181318C77401CC0B20428F4D3A4 +:10449000E048FFF7ABFB0021DE48FFF7E7FB012117 +:1044A000DC48FFF7A8FBDC49FF20087048708870E3 +:1044B000C87008714871F8BDB0E71B20704710B490 +:1044C000D04A0021FF23A0334B439B18FF33813395 +:1044D0009B7F002B04D0491CC9B20429F2D30DE004 +:1044E00004290BD2FF23A0334B439A180124FF3237 +:1044F000813294770170204610BC704710BC0020B8 +:10450000704730B40025042825D2FF220146A0328E +:104510005143BC4A89180B46FF3381339A7F002AE6 +:1045200019D0FF243334621C655455541A46603A3E +:1045300015755575B24AD478844202D19570FF2022 +:10454000D070FF209D304554FF319E310D709D7716 +:1045500030BC0120704730BC0020704704280ED2C8 +:10456000FF220146A0325143A64A8918FF3181310A +:10457000897F002903D0A849487101207047002095 +:10458000704710B4A449FF224979A03251439D4A93 +:1045900082B089180A46FF322132937C6C46237020 +:1045A000D27C2271237822795A40802A0AD022783C +:1045B00022235206520E5A435118016002B010BC19 +:1045C0000120704702B010BC002070479248FF21C4 +:1045D0004079A03148438B4981B041180846FF30EB +:1045E0003330FF312131CA7C69460A7003780922D1 +:1045F0000978594080290ED0037869460B700978F4 +:104600004906490E491C914208D26A461178491C54 +:10461000C9B2117009E0002001B0704769460978FD +:10462000090601D5002100E080210170012001B0C0 +:10463000704704280ED2FF220146A0325143714A2E +:104640008918FF318131897F002903D072490871AF +:10465000012070470020704710B46F49FF2209798C +:10466000A0325143674A82B089180A46FF3221328C +:10467000947C6B461C71D27C1A701C781A79944217 +:104680000AD01A7822235206520E5A43511801605A +:1046900002B010BC0120704702B010BC002070476F +:1046A00038B55D480179FF20A030414355480818CE +:1046B0000146FF3121318A7C6C4622700922FF308D +:1046C000343003782478A34223D004786B461C70DE +:1046D0001B785B065B0E5B1C934205D26B461A7817 +:1046E000521CD2B21A7006E06A461278120601D540 +:1046F000002200E080220270087D401C0875087DC1 +:10470000497D884203D140A1444806F0D8FC0120ED +:1047100038BD002038BD4048FF210079A031484312 +:1047200038494018FF302130C17C807C814201D162 +:1047300001207047002070473748FF210079A031E1 +:10474000484330494018FF302130817CC27C092029 +:1047500013464B40802B0AD049065206490E520E92 +:10476000914201D3881A01E0511A401AC0B2704731 +:10477000092070470022042813D2FF23A033584396 +:10478000204BC018FF239F331B5C002B09D0FF3048 +:104790000A702130027D437DD31A0B7042750120CF +:1047A000704700207047042811D2FF22A0325043E6 +:1047B000144A8018FF229F32125C002A07D0FF3073 +:1047C0002130027D407D101A0870012070470020C2 +:1047D000704710490160704704280ED2FF2201463D +:1047E000A0325143074A8918FF318131897F00295E +:1047F00003D009490870012070470020704700006D +:1048000010180020141800207372635C646D5F71CF +:104810002E630000901E0020C70000205A020000F6 +:10482000AC49CA78FF2A03D00021016008467047CE +:104830008A78A949012A02D001600120704700202E +:104840007047A6480178012907D001210170A448CA +:104850000178A048C17001207047002070470428EB +:104860000ED2FF220146A03251439E4A8918FF31E1 +:104870008131897F002903D0994948700120704710 +:10488000002070479349964BCA785B789A4206D1CC +:104890008A782039002A02D0016001207047002068 +:1048A00070478C488E4AC1785278914209D1FF21D5 +:1048B000C170801C0178002903D000210170012003 +:1048C0007047002070478348854AC17852789142EA +:1048D00004D18078002801D0002070470120704763 +:1048E00004280ED2FF220146A03251437D4A891886 +:1048F000FF318131897F002903D07949C8700120B7 +:1049000070470020704710B47549FF22C978A03263 +:104910005143744A82B089180A46FF328132147FAB +:104920006B461C70527F1A711C781A79FF316240F5 +:104930003731802A0AD01A7822235206520E5A435F +:104940005118016002B010BC0120704702B010BCC9 +:10495000002070476248FF21C078A0314843614978 +:1049600081B041180846FF309D30FF3181314A7FC8 +:1049700069460A70037803220978594080290ED0CD +:10498000037869460B7009784906490E491C914223 +:1049900008D26A461178491CC9B2117009E000209A +:1049A00001B0704769460978090601D5002100E089 +:1049B00080210170012001B070474948FF21C07873 +:1049C000A031484347494018FF308130417F007F84 +:1049D000814201D1012070470020704704280ED287 +:1049E000FF220146A03251433E4A8918FF318131EE +:1049F000897F002903D03A49887001207047002040 +:104A0000704710B43649FF228978A0325143354AA5 +:104A100082B089180A46FF328132147F6B461C71BE +:104A2000527F1A701A781B79FF3137319A420BD0B6 +:104A30006A46127822235206520E5A4351180160D8 +:104A400002B010BC0120704702B010BC00207047BB +:104A50002348FF218078A0314843224981B0401883 +:104A6000FF219D31095C6B4619700321FF309E3098 +:104A700002781B789A4219D003786A46137012782C +:104A80005206520E521C8A4205D26A461178491CBF +:104A9000C9B2117006E069460978090601D50021FE +:104AA00000E080210170012001B07047002001B0BA +:104AB00070470B48FF218078A031484309494018CE +:104AC000FF308130417F007F814201D1012070475A +:104AD0000020704710180020F01700201218002046 +:104AE000C700002014180020F8B5FD4F0A46044600 +:104AF00000207978FB4D0646002902D0012909D013 +:104B00000FE0F949497A00290BD0002A08D1012089 +:104B1000787005E0A97F002903D0002A00D17E70BB +:104B2000012079782B23594349198B7F034311D0F6 +:104B3000002A22D12A22A01C1F3106F036F9667005 +:104B4000042020700120A07078782B214843401960 +:104B5000867712E02878012801D00020F8BD002ACD +:104B60000BD16670132020701C22A91CA01C06F01B +:104B70001CF9A6712E70DD48C6770120F8BDD94812 +:104B80000178002901D080887047D9487047F8B56E +:104B9000D44E0746B07F00282DD13846FEF7DCFE04 +:104BA00000210125D34C072824D202007A4412792F +:104BB000921897440305081F1F1F0A00217006E082 +:104BC0002570217208E0032000E002202070CA490D +:104BD0003846FEF715FF20723846FEF7DAFE6070A1 +:104BE000C6493846FEF7C1FEBD4CC54F20787F2828 +:104BF00007D101E02172F8BDFF20C2A1543006F0B8 +:104C00005EFA207838707F202070B577032002F09C +:104C1000DBFEF8BD10B5002002F066FE002812D0C1 +:104C2000FBF79CFB00210120FBF7A0FABA48FBF739 +:104C3000ACFBAE4CA06AFBF7ABFB2079032805D098 +:104C4000022803D006E000F0F3FD10BD0121002092 +:104C5000FBF716FCFBF7FBFBB04C6078002803D099 +:104C6000FBF77DFFFBF7D9FB0320E07010BD70B5AB +:104C70009E490028CA8D08D0FF2A0DD25004000C8E +:104C8000C885FF2808D9FF2005E0012A04D950086B +:104C9000C88501D10120C88591484268012A01D008 +:104CA000002A01D10D224260D24317239B4C5A4364 +:104CB000637B3B25DB436B43D2184260C98D900C6C +:104CC00006F0DCF8617370BDF8B5944CE07802280A +:104CD00004D0E078012801D00C20F8BD0020814AE2 +:104CE00005462B21414389188D77401CC0B202280C +:104CF000F7D315706078002804D0FBF796FBFBF71C +:104D00003FFF6570794845778577C5778449257079 +:104D100001228A770571A570CA760A774A77714EA3 +:104D200001463246736F7432B46FF66FD7688B608A +:104D3000CC600E614F6112698A6105770020F8BD71 +:104D400010B5764A0023D3701371684B596318630A +:104D50000120D070FFF7B8FF002803D069A1714887 +:104D600006F0ADF910BDF1B582B00C2001906B4892 +:104D70000090C078012806D00098C078022802D0A0 +:104D80000C2003B0F0BDFBF7F0FA0020FBF7B1F800 +:104D9000564C207F002837D0524920460F46826863 +:104DA0007437C368056946694A678B67CD67FE60DB +:104DB0008069386100266677A677594DE87E00281D +:104DC00005D1287F002802D1687F00281AD00098DA +:104DD0000078002816D02079032802D0022805D0B8 +:104DE00008E00521504800F040FD03E003214E4853 +:104DF00000F03BFDA97E3846FBF7F3F80020019058 +:104E000026770CE0267703E00098C078022804D0CB +:104E10000098C078022828D00AE00020019000986D +:104E2000C078012804D10099087300980221C1704C +:104E3000606B0178002903D00178001DFBF714F99D +:104E4000206B0178002906D0384A401CFBF777FE1A +:104E50000099012048700298A0623548FBF717FAC4 +:104E6000FBF78EFA019803B0F0BD00990120C870DD +:104E70000C2003B0F0BD70B5FBF777FA274CE07853 +:104E8000022803D0FBF77CFA0C2070BD01201749E3 +:104E90006073C8850220FBF765FA2648FBF739F9ED +:104EA000254E0025A0780321401C05F0E7FFA170E6 +:104EB000885D012844D06D1CEDB2032DF2D3FFF7BD +:104EC000A9FE2079002809D0012807D002283DD06A +:104ED00003283BD00BA1194806F0F1F8002070BD63 +:104EE000D0000020B41E0020F41E0020341F00203B +:104EF000FFFF0000D41E0020DD1E0020D61E002073 +:104F0000FC1E00207372635C6C6C5F64645F73638F +:104F1000616E2E63000000006C1F0020541F0020F3 +:104F2000141F002051030000941F00206F1F002059 +:104F3000B4B30100BAB301002F1F0020EA03000040 +:104F4000C8B2FC49085CFBF7F6F8B8E7EEF760F882 +:104F5000C4E770B5F84C0125A577E37F002B01D09D +:104F60003A2070BD0026002802D1A07B884209D1DA +:104F7000A17366771146F14806F09DF96577F04810 +:104F800005702577A677002070BD0246002001231A +:104F9000E949002A03D0012A03D0122070478B74FC +:104FA00000E088740B774A767047E34A032800D103 +:104FB000516110760120107700207047E0490128E8 +:104FC00003D0032801D0002000E0012008717047C1 +:104FD000D948017F002903D0407E002803D17047C3 +:104FE00040790028FBD00120704710B5FBF709FA83 +:104FF000FBF7FCF9FBF708F9FBF7AAF9D04C60784E +:10500000002805D0FBF711FAFBF7BAFD002060700D +:10501000012020730220E070FBF7B2F9002010BDE0 +:10502000C7494871704710B500F002FC10BDF0B5DB +:10503000C44EC34D83B0002810D0C348FEF766FDB0 +:10504000002804D1C048FEF781FD002806D0BA4CE4 +:10505000207903280DD1A07F00280AD0E878052800 +:105060006BD201007944097949188F44666666F766 +:10507000F600E87805287AD20100794409794918C0 +:105080008F4475757502EE00AF48FEF765FCAD49BB +:105090008870AE480190807F002803D1FBF736F876 +:1050A000002800D0012000906878002813D0052641 +:1050B000761EF6B2FBF785FD0746022805D1002EC5 +:1050C000F6D1A349A34805F0FAFF0098002810D1B3 +:1050D000012F0ED000909B4F9F4EB878072871D2B9 +:1050E00001007944097949188F446DFE056C6C6C98 +:1050F00028000120EEE76878002803D0FBF795F937 +:10510000FBF73EFD8F48FBF7ABF9002801D17F206C +:105110003870FBF793F9009800280AD0207901280D +:1051200001D0022805D1FBF76FF88748FFF72FFD64 +:1051300037E2FBF769F8FFF76DFD34E26878002885 +:1051400003D0FBF772F9FBF71BFD7E48FBF788F9EC +:10515000002801D17F203870FBF770F900980028F3 +:1051600079D02079022803D001287AD047E221E2C1 +:105170007548FFF70CFD012002F0B6FB00286ED049 +:1051800076497148FEF710FC7448FBF7FEF8607F23 +:1051900000280ED06848019902898A824289CA8211 +:1051A0008089088331466D48FEF7DAFB002060777E +:1051B000A07701210846FBF763F9FBF703F9052007 +:1051C000E870F0E15BE16878002803D0FBF72DF987 +:1051D000FBF7D6FC5B48FBF743F9002801D17F20A1 +:1051E0003870FBF72BF90098002834D0207902287A +:1051F00008D0012835D0032837D05549584805F044 +:105200005EFFD0E15048FFF7C2FC012002F06CFBCA +:10521000002824D051494C48FEF7C6FB4F48FBF705 +:10522000B4F8607F00280ED04348019902898A8231 +:105230004289CA828089088331464848FEF790FB3C +:1052400000206077A07701210846FBF719F9FBF7EA +:10525000B9F8052001E10EE103E0BFE1ADE1B3E003 +:1052600022E13948FFF793FC9BE137482168C27877 +:105270000B7F9A421DD102794B7F9A4219D1427914 +:105280008B7F9A4215D18279CB7F9A4211D10A46FF +:105290002032C3791778BB420BD1037A52789342FC +:1052A00007D10078CA7E4006C00F904201D101208C +:1052B00000E000206279012A30D0002800D138E7D0 +:1052C000022002F011FB00287ED0012002F07CFBBE +:1052D00022491D48FEF768FB2068018B1F48FEF736 +:1052E000F9FB2068817D00E03CE01C48FEF7F6FBFE +:1052F0001A48FBF74AF8607F002866D00E480199EB +:1053000002898A824289CA82808908833146134889 +:10531000FEF726FB00206077A0779BE00028CFD126 +:1053200009481C31FEF721FB0748FEF732FB2168D4 +:10533000C876C5E7B7B30100341F00203C1F00202A +:10534000541F0020D00000206C1F0020141F0020DC +:10535000044F0100D4040000281F0020941F0020E7 +:10536000CC0500006878002803D0FBF75EF8FBF757 +:1053700007FCF948FBF774F8002801D17F2038704A +:10538000FBF75CF80098002875D0FAF733FE002888 +:1053900071D020790328F14804D0FFF7F8FBFAF721 +:1053A00033FFFEE02168C2780B7F9A4220D1027958 +:1053B0004B7F9A421CD142798B7F9A4218D18279D5 +:1053C000CB7F9A4214D101E056E043E00A462032F6 +:1053D000C3791778BB420BD1037A5278934207D135 +:1053E0000078CA7E4006C00F904201D1012000E043 +:1053F00000206279012A32D0002800D199E60220EB +:1054000002F072FA002837D0012002F0DDFAD44908 +:10541000D248FEF7C9FA2068018BD148FEF75AFB43 +:105420002068817DCE48FEF759FBCD48FAF7ADFFE5 +:10543000607F00280ED0CB4901980A8982824A8970 +:10544000C282898901833146C548FEF789FA002066 +:105450006077A0770120E0770620E870A3E00028BD +:10546000CDD1BE481C31FEF780FABC48FEF791FA58 +:105470002168C876C3E7C2E000F0DAF993E0687803 +:10548000002803D0FAF7D1FFFBF77AFBB248FAF70E +:10549000E7FF002801D17F203870FAF7CFFFFAF735 +:1054A000B3FEFFF7B7FB7EE0AC48FEF755FAB070ED +:1054B000AA48AB49C3784A7A93421CD103798A7AC5 +:1054C000934218D14379CA7A934214D183790A7BE3 +:1054D000934210D1C3794A7B93420CD1037A8A7BE1 +:1054E000934208D1007809784006C00FC909884264 +:1054F00001D1012400E00024FAF786FEB0780428E8 +:105500003ED1002C3CD09448FAF7AAFF002801D1E4 +:105510007F203070FAF792FF287B002802D000200D +:10552000FFF7A5FB0120904C28738C4F607A002870 +:1055300037D10420E0723846FEF72BFA002801D05C +:10554000012800D1207389493846FEF70EFA8849B0 +:105550003846FEF787FAE0741F2801D91F20E0744F +:105560003078844F7F2804D1FF208349543005F0E0 +:10557000A6FD307838707F2030700120607210E016 +:105580007548FAF76DFF002801D17F203070FAF7D7 +:1055900055FF287B002802D10120FFF768FB00207F +:1055A0002873FFF737FBE87802283DD0E878042815 +:1055B0002DD127E07049714821E66878002803D092 +:1055C000FAF733FFFBF7DCFA6348FAF749FF0028E4 +:1055D00001D17F203070FAF731FF10E05E48FAF712 +:1055E0003FFF002801D17F203070FAF727FF287B8A +:1055F000002802D10120FFF73AFB00202873FAF7B8 +:1056000003FECEE737205C49400105F058FD2879BC +:10561000002809D001280ED0022807D0032810D076 +:105620005549574805F04BFD03B0F0BDE878032815 +:1056300007D003B0F0BDE878062802D0E878052846 +:10564000F7D10120FAF7D2FF03B0F0BD70B54D4C91 +:10565000E07807285FD201007944097949188F441E +:105660005A5A5A5A5A030B003C48FAF78EFEFAF778 +:10567000EEFE0420E07053E0FAF7C3FEFAF7B6FE40 +:10568000FAF7C2FDFAF764FE012626730220E070E5 +:10569000FAF776FE3C4D2878002803D036493B487F +:1056A00005F00DFD0020A8702E4800684188A980F3 +:1056B000C17EE971818B2981C18B6981018CA981AE +:1056C0008188E982C1882983008968836079287785 +:1056D0002F483049807EA8732F4805F0ECFD607894 +:1056E000002803D0FBF76DFA012808D0687F400836 +:1056F000400068772E70022002F066F910E0687FA3 +:1057000030436877FBF776FA697F4000C907C90F15 +:1057100001436977EEE775201749000105F0CFFCDA +:10572000E078022816D0E078032806D0E078042834 +:1057300003D01149194805F0C2FC2079002809D08E +:10574000012807D002282DD003282BD00A4914485D +:1057500005F0B5FC70BD0000D00000206C1F0020DB +:10576000941F0020341F0020F41E0020011F002081 +:10577000081F0020271F0020044F01009E06000084 +:10578000F5060000541F0020B41E00202907000069 +:10579000141F0020281F0020C31E002056070000F1 +:1057A000620700000120FAF721FF70BD10B55C4CC4 +:1057B000E078052820D201007944097949188F44FE +:1057C0001B1B1B1902005748FAF74AFE002802D19A +:1057D00054497F200870FAF731FE207B002802D15F +:1057E0000120FFF744FA00202073FAF70DFDFFF7C0 +:1057F00011FA01E000F01CF8E078022813D0E078FC +:10580000032803D04849494805F059FC207900286D +:1058100009D0012807D0022806D0032804D0424925 +:10582000434805F04CFC10BD0120FAF7DFFE10BD27 +:1058300010B5FAF7E6FDFAF7D9FDFAF7E5FCFAF745 +:1058400087FD374C6078002805D0FAF7EEFDFBF7AE +:1058500097F900206070012020730220E070FAF7B1 +:105860008FFD002002F0B0F810BD70B5314C054638 +:10587000264660367434032943D0052940D1FEF70B +:1058800041F805212846FEF742F8B17E2846FEF78A +:1058900078F821462846FEF763F8274C2846216809 +:1058A0000F31FEF7FBF8216828461331FEF7FFF8A9 +:1058B0002068817D2846FEF711F92068018B284673 +:1058C000FEF708F9206881882846FEF7F7F8206877 +:1058D000C1882846FEF7F6F8206801892846FEF7B9 +:1058E000F5F8216828460A31FEF70BF92068817E19 +:1058F0002846FEF7F5F80A4841792846FEF7F9F8F8 +:1059000070BDFDF7FFFF03212846FEF700F8B17ECA +:105910002846FEF736F821462846FEF721F870BDE6 +:10592000541F0020D0000020044F01009907000000 +:10593000A5070000B41E0020341F0020F8B5FEF7B4 +:10594000FBFE0446FEF7BFFFFE4E0546F068203022 +:10595000407B002826D0012867D0022869D0032880 +:1059600071D0FF20F8A1773005F0A9FB3069F7224C +:10597000017811400170F2682032937BDB071B0F26 +:105980001943FB2319400170D37BDB075B0F1943DD +:105990000170577BEF23022F60D0012F63D0032FBC +:1059A00065D06AE0EC48FEF76DFF002827D030692B +:1059B0000090F168088DC9884018801D87B2009852 +:1059C000FEF7D5F9012805D00098FEF7D0F9002898 +:1059D00008D00FE0F06839468030C7850098FEF7A0 +:1059E00033FA07E0F06839468030406A87800098D3 +:1059F000FEF7E7F9F168032020314873B6E7D6488F +:105A0000FEF72AFE002804D0F0685321095C002923 +:105A100007D0D148FEF7DDFEF16801202031487340 +:105A2000A4E7022120304173A0E7CB48FEF7D1FE66 +:105A30009CE7C948FEF710FE002897D1FF20C2A1BD +:105A4000693008E0FFE7C448FEF71CFF00288DD14D +:105A5000FF20BDA1713005F032FB87E7012C08D88B +:105A6000002D06D009E06D1E2C4302D105E0002C6C +:105A700003D019401023194300E019400170D17D73 +:105A8000002915D0517B012912D0B448FAF77DFCCA +:105A9000B34801210176F268116E526E42610161D4 +:105AA000AE493269FAF7D7FF0020FAF7E3FF03E0C7 +:105AB000FAF76BFCFBF701F801210846FAF7E0FC66 +:105AC00003203070F8BD08282FD203007B441B79D7 +:105AD000DB189F4403060B0E11152528002926D03C +:105AE00023E0022923D0032921D01EE007291ED05C +:105AF0001BE008291BD018E00A390C2917D914E03B +:105B00000D2914D00C2912D0002A04D00D290CD351 +:105B100016290CD909E0112907D3162907D904E061 +:105B2000092904D001E0012901D00020704701209B +:105B3000704730B5054683B08748FEF771FE0028F0 +:105B400004D1672080A1000105F0B9FA7D4C2069DD +:105B5000FEF74CF803212069FEF769F82069EF226F +:105B60000178114001702946FEF7CAF80D2D76D252 +:105B7000280078440079001887441F160644808066 +:105B8000840E7280848460006E48C1680069803130 +:105B9000497FFEF762F975E06A48C16800698031A3 +:105BA000497AFEF7CBF96DE06648C168006980313B +:105BB000896A491CFEF73CF964E0624CE068803079 +:105BC000406A81792069FEF7F8F8E0688030406A21 +:105BD00001892069FEF7E8F8E0688030406A418971 +:105BE0002069FEF7C6F8E0688030406A8189206944 +:105BF000FEF7C8F8E0688030406AC1892069FEF786 +:105C0000CAF83FE04F4CE0688030416A2069091DC6 +:105C1000FEF727F9E0688030416A20690C31FEF711 +:105C20002CF9E0688030416A20691E31FEF72FF9B7 +:105C3000E16820698031FEF737F923E0414CA06923 +:105C400001782069FEF760F9A06981882069FEF774 +:105C50005DF9A06941882069FEF75CF912E00DE06A +:105C600000200090694601900878012108436946A8 +:105C7000087034480069FEF763F903E032A139483F +:105C800005F01DFAFEF7DDFD002803D12EA13648F0 +:105C900005F015FA0C2D0ED0072D0ED0012D0AD0CF +:105CA000002D08D0022D06D026480021C0684030C3 +:105CB00041810121817303B030BD22480021C068B9 +:105CC0004030018203B030BDF8B5FAF79AFBFAF71D +:105CD0008DFBFAF799FAFAF73BFBFAF7EEFEFAF7C3 +:105CE0004FFB184CE06820300079012801D1FAF709 +:105CF000A5FBE068012502462032917D002908D1EC +:105D0000E178CB0701D1890703D59575012101F011 +:105D100017FEA0790026002863D100F0A0FD0E48F0 +:105D2000FEF77EFD00285CD06079002859D1E0683C +:105D300054210A5C2030417D0120FFF7C4FE002879 +:105D40004FD113E0D80000207372635C6C6C5F6D00 +:105D500061737465722E6300E8000020E21F00206A +:105D600008200020B4060000BA060000E0680246E1 +:105D70008032117F002901D0022050E003462033F9 +:105D8000D97C052929D0F74F0C292DD00D2929D0F0 +:105D9000132943D01B7D012B4BD0052B42D0526AD7 +:105DA0001378002B61D0528843889A425DD14030ED +:105DB000027D0020FFF787FE00287FD0E068A42145 +:105DC00009580978891E062978D20A007A4412797E +:105DD000921897443A3C7373658EE3A1E64805F048 +:105DE0006EF9B8E00B201AE0F6F743F90C287DD3E2 +:105DF000E06808218030406A1E30F6F73BF9002841 +:105E000006D0E06804218030F6F734F9002803D189 +:105E1000D5A1384605F053F9032000E00620FFF72E +:105E200088FE98E00720FFF784FEE06820300675C2 +:105E300091E00C20FFF77DFEE06801464030827D56 +:105E40002A43827520310E7585E000200BE020305A +:105E5000C17D00290AD0007E002803D1C2A1C74815 +:105E600005F02DF90A20FFF764FE27E0F6F701F9A7 +:105E70000C2823D3E06808218030406A1E30F6F7F2 +:105E8000F9F8002806D0E06804218030F6F7F2F82F +:105E9000002803D1B4A1384605F011F90320E2E748 +:105EA0004030807D800709D10C20FFF742FEE0687A +:105EB000403046818573817D29438175B048FEF766 +:105EC000AFFC002847D0E06854210A5C2030C17C38 +:105ED0000020FFF7F8FD00283DD0E168AC20405CD1 +:105EE000002838D0E0690078002800E033E002D0D4 +:105EF00031E00820B7E7088D0A282CD905220A319D +:105F0000206A04F025FF002822D0E0688030816AF2 +:105F1000087800280CD00522491C206A04F018FFDC +:105F2000002818D1E0688030806A0078002806D107 +:105F3000E068216A8030806A401C05F0B1F9E068B1 +:105F40008030806A0178491C01700120FFF7F1FD63 +:105F5000E068A0300673E078C007E06802D0403007 +:105F6000868003E040308188491C8180E0689C2164 +:105F7000095C002908D154210A5C2030417D0120B0 +:105F8000FFF7A1FD002804D0E06840300189491CDA +:105F90000181A0793D21002804D0E0684030817063 +:105FA00045705BE0E07902280AD001280AD06079C8 +:105FB00000281BD0420701D4C2060AD51E21ECE7F7 +:105FC0001621EAE7E0689E21095C40308170457047 +:105FD00044E00207E1D4C10706D1800704D423209E +:105FE00061A1000105F06BF82A21D6E7E0680246BE +:105FF0004032917B002905D05389591C51819189E8 +:106000008B4213D2917C002905D0118A4B1C13823C +:10601000938999420AD21789D3889F4203D39C213E +:10602000095C002902D191898F4203D3222090700C +:10603000557013E03621095C0029918805D09942FA +:1060400009D308209070557008E0062903D33E203C +:106050009070557002E05178002908D0E068014640 +:106060002031CE740E758E752570022101E02570E9 +:10607000002101F065FCF8BDF7B582B00C46694619 +:1060800016460889FDF73DFB00287DD100980025C4 +:106090008030816B0A78072A23D0A11C0C2A30D0CB +:1060A0000B2A3BD0062A48D068460689354F00980F +:1060B0000146A030027C002A68D06570122222704E +:1060C000009AA032127C002A08D0A23105740A8AF4 +:1060D00062804A8AA280027C002AF7D1012005B0A2 +:1060E000F0BD002EFAD1657007212170816B0A2264 +:1060F000A01C091D04F059FE00988030806B0570CB +:10610000ECE7002EEAD165700C212170816B8A8842 +:106110006280C988A180806B0570DFE7002EDDD129 +:1061200065700B222270826B93880B80D3884B8022 +:1061300012898A80806B0570D0E7002ECED1657001 +:1061400006222270826B93880B80D3884B80138940 +:106150008B805389CB8093890B81D3894B81806B52 +:106160000570BBE7350700007372635C6C6C5F6D94 +:1061700061737465722E6300AC0500006705000052 +:10618000E8000020DA07000018E0FFE702A8FDF7AA +:10619000F0FA002803D0FE49384604F090FF694623 +:1061A0000889FDF7AEFA002803D0F949F94804F050 +:1061B00086FF68460089B04200D078E7002005B02D +:1061C000F0BDF5480078012801D00C207047002070 +:1061D000704770B5F04C05462078002804D0FF20A9 +:1061E000EB49C00004F06BFF0020A5612072012084 +:1061F00020702078012803D0E549E84804F05FFFCB +:1062000070BDF8B5E44C2178012901D00C20F8BD0F +:10621000E0608030807AFEF70CFA00283AD0E0681F +:106220008030807AFEF75CFB002833D0E068803055 +:10623000807AFEF7D1FA00282CD0E0688030807A8E +:10624000FEF70DFB002825D0FAF78FF80026A6717F +:106250000120F9F74EFEE068014640318A7B002AB2 +:1062600003D04A898B899A4211D28A7C002A03D0B2 +:106270000A8A8B899A420AD20B89CA88934206D22B +:1062800036231B5C8988002B06D0914206D301205F +:10629000A0703BE01220F8BD0629F8D2A67013309A +:1062A000F9F7F5FFE0680F30F9F733FF0320FAF74D +:1062B00059F8E06805462030017E002902D1C07DF2 +:1062C000002809D0294670318EC9B5488EC02946AC +:1062D000B448803104F0FCFF9820405BA91C401CAE +:1062E00082B228462830FDF777FF002803D0A8495E +:1062F000AD4804F0E4FEE06840300078F9F71BFF99 +:10630000FAF72CF801210020F9F730FFE67026712A +:106310006671E67102202070E06880300683FAF72B +:106320002FF80020F8BD10B5FAF71FF89A4C207826 +:10633000022803D0FAF724F80C2010BDA07800281A +:1063400002D0FFF7C1FC17E0FAF73CF8FFF7F6FAC6 +:10635000E06820300079012801D1FAF778F8207A36 +:10636000002809D0012809D0022805D0032805D02B +:1063700087498E4804F0A3FE002010BDECF748FECC +:10638000FAE770B505468030018B2C46491C018325 +:106390004034A188491CA180A17B002902D06189D9 +:1063A000491C6181A17C002902D0218A491C2182DB +:1063B000007F002807D13520415D227D0120FFF7B5 +:1063C00082FB002802D02089401C2081284600F052 +:1063D000DEF9002070BD7049087270476E4A116284 +:1063E000D0617047F8B56C4C2078032803D0684919 +:1063F0006F4804F064FEE16804272031887A0025A4 +:10640000002803D08D72207938432071206901263D +:106410000278D2439207002A18D1CA7A002A15D1ED +:10642000CE722179022211432171FDF7A0FC0628CA +:1064300002D00B280AD106E0E06800218166C1661F +:106440002030067602E0E0682030057620794007AB +:1064500004D5E0682030407D022802D06079002811 +:1064600002D0FFF731FC2AE05248FEF74CFA002830 +:1064700001D0657002E066704F486061E0682030CE +:10648000007E002811D04D48F9F77FFF444805767B +:10649000E268916ED26E42610161484A6169FAF721 +:1064A000DAFA0120FAF7E6FA04E06069F9F76DFF1D +:1064B000FAF703FB02210020F9F7E2FF27702078AA +:1064C00001280CD0207A002809D0012807D0022802 +:1064D00006D0032804D02E49394804F0F0FDF8BD59 +:1064E0000120FAF783F8F8BDF8B52B4C0546207863 +:1064F000042803D02649334804F0E1FD002D7DD067 +:10650000FAF7F3FA0125002812D1E0682030017E65 +:1065100000290DD061694A78D20609D00978C07B7C +:106520000907C90F814203D1A571FFF7CDFBAAE08E +:10653000E06820300079012811D1F9F77FFFE16888 +:10654000881C2831FDF738FF002808D0E068B22108 +:1065500042880A523121095CA030017505746069D6 +:10656000002600784007C10FE0682030827B91420E +:1065700056D0407B002853D002282ED1FEF790F849 +:10658000002803D10249104804F099FDE2681DE09B +:1065900068610100DE070000D80000200408000048 +:1065A000082000202120002043080000830800006C +:1065B000B8080000EC000020C01F0020E21F0020EF +:1065C000F5080000FD080000EB050000106E516E9C +:1065D0000023401C594151661066E0682030467324 +:1065E000C17A012916D1C672207908210843207189 +:1065F000FEF757F9002805D1FA4900E0A2E0FA4871 +:1066000004F05DFDE2680023106E516E401C59419C +:1066100051661066E0682030817B012944D0857383 +:10662000606901788C460907CF0FE1680A4620317E +:10663000CB7B9F420CD16746BF07BF0F012F4BD0CA +:10664000022F49D0032F31D06079042108436071B3 +:10665000E0782843E07020690078C00604D46069BF +:106660000078C00600D460E720790028FBD160786C +:106670000028F8D101F059F90028F4D060790028F9 +:10668000F1D1FFF75BF9207801280CD0207A00289F +:1066900009D001285BD0022805D0032857D0D14962 +:1066A000D24804F00CFDF8BD8673B9E7FDF7E6FAB1 +:1066B00000280CD0E06820308572217929432171AF +:1066C000C17B012901D1C673C2E7C573C0E76079F8 +:1066D000102108436071BBE74078C7062CD063786F +:1066E000002BB5D1C006C00E1B28F0D84032127D59 +:1066F000C97C0520FFF7E7F9002804D0607908215C +:1067000008436071A4E7E07804210843E070FEF7D5 +:1067100021F9002803D1B349B54804F0D0FCE06862 +:106720000023816EC26E491C5A41C26681662030C8 +:10673000C17B0129C9D1C6E7012B01D0CD7387E701 +:10674000CE7385E7E07802210843E070EDE6012092 +:10675000F9F74CFFF8BD10B5A6480078042803D01F +:10676000A049A54804F0ABFCFFF7AEFA10BD3621F6 +:106770000A5C40308188091D002A04D0C08881420B +:1067800003D3012070470629FBD200207047F8B5DB +:10679000054606462036F07C2C4600278034072824 +:1067A0001FD1288DE18D401C884257D1A16A28460F +:1067B0000A30491C04F074FD012202212846FDF72D +:1067C000BEFCF77401215E204155A06A00780028C4 +:1067D00003D18449894804F072FCA16A0878401EFC +:1067E0000870F07C082839D1616A288D8988401C9E +:1067F000884233D1A06B0178002904D079498048C0 +:1068000004F05DFC15E06988C180606AA16B408975 +:106810000881606AA16B80894881606AA16BC08928 +:106820008881A06B0771A16B07200870A16B688835 +:106830004880012211462846FDF781FC03212846A5 +:1068400001F07EF8606A69884088884203D0654913 +:106850006C4804F034FC606A0770F774F8BD70B5DA +:10686000644C6079002877D1207901264007002503 +:1068700000284ADAE0683321095C11293ED004DCA3 +:10688000022907D0052939D107E0132936D0152967 +:1068900034D107E053495C4801E052495B4804F0B9 +:1068A0000EFC2BE001464031CD748D73A4210958B4 +:1068B00040884988814203D04A49554804F0FFFB8B +:1068C000E06801468030426A1570826B1378002BB5 +:1068D00004D044494F4804F0F2FB0CE04B88D380CD +:1068E000836B027A1A71826B1572836B0B221A709A +:1068F000806B49884180E0682030C574E0682030B2 +:10690000417D022901D1E67145752079800741D585 +:10691000607900283ED12069C0780D2861D201003D +:106920007944097949188F44493606A4FEFEBE18F9 +:1069300023FE7D93CC00E06854210A5C2030417D29 +:106940000120FFF7C0F8002824D1E0680322352198 +:106950000A5440308573E4E0FCE0E06854210A5CAE +:106960002030017D0020FFF7AEF800286FD1DEE077 +:10697000E06854210A5C2030C17C0020FFF7A3F8B6 +:10698000002803D11749244804F099FBE068092145 +:106990002030C174CBE0E06854210A5C2030C17C17 +:1069A0000020FFF790F8002803D10E491B4804F09F +:1069B00086FBE06807212030C174B8E0E06854210C +:1069C0000A5C2030C17C0020FFF77DF8002803D14D +:1069D0000449134804F073FBE06808212030C174B7 +:1069E000A5E0A0E068610100FC050000510900007D +:1069F00044060000D800002059090000820200006F +:106A00008F020000A3020000390400003D040000D2 +:106A10004C040000510400009A0400009F04000090 +:106A2000A4040000E06854210A5C2030C17C0020EE +:106A3000FFF749F8002803D1FB49FC4804F03FFB6D +:106A4000E06853210E540A212030C1746FE066E0E3 +:106A5000E0682030C07C0D2804D04B20F2490001B2 +:106A600004F02DFBE06854210E540C212030C17439 +:106A70005DE0E06854210A5C2030C17C0020FFF713 +:106A800022F8002808D1E0684030007D002803D1BA +:106A9000E549E74804F013FBE06853210E540E214A +:106AA0002030C17443E0E0682030C07C132803D05C +:106AB000DD49E04804F003FBE06816212030C17492 +:106AC00035E0E068A421095843884A889A421CD1DD +:106AD0000978062919D154210A5C2030C17C002094 +:106AE000FEF7F1FF002803D1CF49D34804F0E7FABD +:106AF000E068014640318A7D920702D42030C67496 +:106B000003E08D738030406A0570E06854210A5CB0 +:106B10002030017D0020FEF7D6FF002807D0E06876 +:106B20004030857403E0C049C44804F0C8FA2079B5 +:106B300000070AD56079002807D1E0682030417D40 +:106B4000032902D10221E171457500F004F8E068E3 +:106B5000FFF71DFE70BDF0B5B94C8DB02079C007B0 +:106B60007ED0607900287BD16069C0780E2878D209 +:106B700001007944097949188F44737306732747D4 +:106B8000A78E73FE731EE992E06854210A5C2030E0 +:106B9000417D0120FEF797FF00287DD16069FDF758 +:106BA0005EF9E1689E2250540222352042540020B2 +:106BB000403188748873CFE1E0682030C17C0A29B5 +:106BC0006BD10021C1750D211DE0E0683321095C06 +:106BD0000E297FD1A421095840884988814203D0D9 +:106BE0009149984804F06BFAE0688030416A606926 +:106BF0002631FDF770F9E16860698431FDF77BF9B2 +:106C0000E06811212030C174A6E1E1683320405CC6 +:106C100011285FD180318C464B6A8B4810260022A8 +:106C2000082168440E33B51AED18203DEF7F4770F8 +:106C3000AD7F8570801C491E921C0029F3D16146EE +:106C40004B6A03A810260022082103301E33B51A10 +:106C5000ED18203DEF7F4770AD7F8570801C01E00F +:106C600082E15AE1491E921C0029F0D16846FBF7E7 +:106C700014FB08AD8DCDE16800260E664E660D460C +:106C800070318DC101262035EE75704E8DC670486D +:106C900004F01EFB132001E0C4E01BE0E8745BE19C +:106CA000E0683321095C112901D00E2912D140304E +:106CB000007D00280ED16069FDF73EF9E168882269 +:106CC000505415202031C87446E1E0683321095C36 +:106CD000162902D0022060713EE1014600254031B4 +:106CE000CD748D73A421095840884988814203D00E +:106CF0004D49584804F0E3F9E06801468030426AA3 +:106D00001570826B1378002B02D047495248E6E099 +:106D10000B4640331E7D002E0BD01D754B88D38053 +:106D2000826B1571836B0C221A70806B49884180CD +:106D3000EFE04B88D380826B1571836B01221A724E +:106D4000836B0B221A70806B49884180E1E0E06818 +:106D500054210A5C2030017D0020FEF7B4FE00289B +:106D60000FD1E06854210A5C2030C17C0720FEF777 +:106D7000AAFE002805D100E072E0607901210843F5 +:106D80006071607900284DD1E0684030807D8007D7 +:106D900015D46069FDF7C2F8E1684031C8756069D3 +:106DA000FDF7BEF8E168403108836069FDF7BDF882 +:106DB000E168022240314883887D10438875E0688D +:106DC000014640318A7DD20716D10A7D2030017DEF +:106DD0000020FEF778FE002803D113491F4804F075 +:106DE0006EF9E0680121342211540623A0221354C5 +:106DF0004030817400210182E068014620310A465A +:106E0000C97C012903D10021D1744E221154A4213F +:106E1000095840884A88824204D10878062801D15E +:106E20000020087098E0000068610100A9040000DB +:106E3000B6040000BE040000CA040000E404000020 +:106E4000D800002002030000FFFFFFFF0820002001 +:106E5000212000205203000057030000920300008D +:106E6000E06854210A5C2030C17C0620FEF72BFE2E +:106E7000002803D1607901210843607160790028FE +:106E80006AD169466069FDF76CF868460078C10709 +:106E9000C90F6846017004D0E068012140300177D5 +:106EA00003E0E068002140300177E06800254E21D2 +:106EB0000D54A421095840884988814204D00F20EC +:106EC0002A49800104F0FBF8E06802468030416AFC +:106ED0000D70816B0B78002B04D02449244804F0FA +:106EE000EEF816E05388CB80816B6B460D71816B99 +:106EF0001B880B816B465B884B816B469B888B8123 +:106F00006B46DB88CB81836B06211970806B5188BF +:106F10004180E0682030C5741EE0E06854210A5CBE +:106F20002030017D0020FEF7CEFD002803D16079DE +:106F3000012108436071607900280DD16069FCF778 +:106F400016FFE16889225054052234204254002063 +:106F50004031088201208874E1680023886ECA6E7F +:106F6000401C5A41CA6688660DB0F0BD68610100D8 +:106F7000C5030000F7B582B006460398174681881E +:106F8000FE48FE4A41430398039D008B0024504372 +:106F9000009080352A7C002A0CD0F948012A4068EC +:106FA0003CD0022A1FD0032A38D0F6A1F94804F0B9 +:106FB00086F84BE0002F04D17D20F2A1C00004F040 +:106FC0007EF8EF4C6068002803D1EEA1F24804F08F +:106FD00076F86068A168001D0918F04A00988018CA +:106FE0000C18012018E0791E084303D1E5A1EC48F4 +:106FF00004F065F8EB48016800980C18002F0AD0DF +:10700000DF484168E8480818A04204D98120DDA182 +:10701000C00004F054F80320287415E00C46002F3B +:1070200012D0D74F002806D17878002803D0D5A1F8 +:10703000DE4804F044F8DC4879680818A04203D917 +:10704000D0A1DB4804F03BF8002C03D1CDA1D948F6 +:1070500004F035F821466869F5F7D7FF686100202C +:107060003070012434716869B0600398FFF77FFBCA +:10707000002801D0747104E0287C012805D0032089 +:107080007071CD48F06005B0F0BD0220F8E7F0B5B2 +:10709000054687B00F46012000F01BFDC4B20B204F +:1070A00000F017FDC0B2844204D0FF20B5A14D30DE +:1070B00004F005F8012000F00CFDC4B2182000F027 +:1070C00008FDC0B2844204D0FF20AEA14E3003F0D0 +:1070D000F6FF3846B94F6C1E6900CD190026403DB9 +:1070E00009287DD201007944097949188F44044167 +:1070F00050504CE9E9E9A0000B2C04DBFF20B0A1C3 +:10710000213003F0DCFFE88F6946FCF7FAFA00282B +:1071100004D0FF209BA1563003F0D1FF0B2C04DBE1 +:10712000FF20A7A1213003F0CAFF0099E88F49880A +:10713000884204D0FF2093A1583003F0C0FF00988C +:107140008030007C002804D1FF208EA1593003F04C +:10715000B6FF8B484660467086600098FFF751F88E +:10716000002804D0FF2087A1603003F0A8FF07B0FB +:10717000F0BDFFF7D8F80028F9D0FF2081A16630D4 +:1071800003F09DFF07B0F0BDF9F733FA07B0F0BD8B +:107190000420C04300F09DFCC6B2192000F099FC09 +:1071A000C0B2864204D0FF2076A1723003F087FF80 +:1071B0000B2C04DBFF2082A1213003F080FFE88F3D +:1071C0006946FCF79EFA002804D0FF206DA17630B6 +:1071D00003F075FF0B2C06DBFF2079A1213000E0C6 +:1071E0006FE003F06CFF0099E88F4988884204D073 +:1071F000FF2064A1783003F062FF0098FFF7C1F828 +:10720000002804D0FF205FA17B3003F058FF009CD2 +:107210000022214602A8FFF7ADFE8034A07E02A91D +:10722000F6F7D8F80099088D401C088507B0F0BD26 +:107230000B2C04DBFF2062A1213003F040FFE88F1C +:107240006946FCF75EFA002804D0FF204DA1863085 +:1072500003F035FF0B2C04DBFF2059A1213003F094 +:107260002EFF0099E88F4988884204D0FF2045A16D +:10727000883003F024FF00988030007C042804D07C +:10728000FF2040A1893003F01AFF009C803426744F +:10729000A57E4F4F681E0B2804DBFF2048A1273036 +:1072A00003F00DFF4548690008184038C787A07EE5 +:1072B000F5F7FEFB4748A6760078EBF725F807B010 +:1072C000F0BDFF202FA193304FE770B5424C06462A +:1072D000E08B0025401C80B2E08323780A46002B17 +:1072E00009D021464968042B0BD0052B17D03D202F +:1072F00024A1000102E0ED2022A1800003F0DFFEC6 +:1073000014E00A2801D3022000E003207071002A53 +:107310000BD00320226900F0F5FB054606E00220B1 +:107320007071002A01D02D4D00E00D4629462069DC +:10733000F5F76BFE00212061317001213171B060E1 +:10734000A068FF303130F06070BDF0B5074685B001 +:107350000E46012000F0BDFBC4B20B2000F0B9FBCB +:10736000C0B2844204D0FF2006A19E3003F0A7FEE5 +:10737000012000F0AEFBC4B2182031E0E2040000AE +:10738000302000207372635C6C6C5F6C6D2E6D300E +:107390002E6300001C040000E903000055040000F7 +:1073A00003040000000100205F0400001604000038 +:1073B000170400001F040000F60400005C200020F9 +:1073C0007372635C6C6C5F6C6D2E6D302E630000AD +:1073D000FFFF0000FC0000203C200020B80B000054 +:1073E00000F077FBC0B2844204D0FF20FD499F30FB +:1073F00003F065FE00250120FB4C092E70D2310000 +:107400007944097949188F44041A3737336B6B185C +:10741000520060732073607800280ED1F3484560F5 +:1074200085602573A068C338FDF79DFC002804D053 +:10743000FF20EC49B33003F042FE05B0F0BD6178A7 +:10744000002909D0207B002801D1FDF7CEFD65730E +:10745000F5F794FA05B0F0BDA073FDF70CFD002818 +:10746000F8D0FF20DF49C73003F029FE05B0F0BD9A +:10747000F9F7BFF805B0F0BD0420C04300F029FBC8 +:10748000C4B2192000F025FBC0B2844204D0FF2012 +:10749000D449D53003F013FE012200216846FFF7DE +:1074A00014FF69463846F5F795FF05B0F0BD207822 +:1074B000052804D0FF20CB49E13003F000FE207FF7 +:1074C000002804D1FF20C749E23003F0F8FD2577FA +:1074D0002570207DF5F7ECFA257505B0F0BDFFE7C6 +:1074E000FF20C049ED30A6E7F0B5BF4C87B020784B +:1074F0000026042805D02078052802D00C2007B0EB +:10750000F0BD01276770607B0025002827D072B688 +:10751000607B002808D0A07B002805D0FDF765FD22 +:107520006573A573F5F72AFA62B6207DF6F780FD3C +:10753000002827D0207F002808D02577207805282C +:1075400003D0A849AA4803F0BAFD0C26657025703F +:10755000207DF5F7ADFA2575304607B0F0BD207DEA +:1075600000900320694608734873F5F7BCFA04904D +:107570000020C043694605900F7202A90098F5F7F4 +:1075800029FFD2E720BFD0E7F0B5974883B0007855 +:10759000002801D0FFF7A8FF944F01203870FF2684 +:1075A000944D2D36002405E00B2C03D39249304630 +:1075B00003F085FD204601A9FCF7A3F8002838D187 +:1075C00001988030007C002833D00B2C03D38A49EB +:1075D000304603F074FD2046AC422ED06946FCF7DD +:1075E00090F8002803D08449844803F068FD00988F +:1075F0008030807EF6F71CFD002822D00098002104 +:1076000080300174847E0C2C04D3FF207A4927300B +:1076100003F055FD7A48610008184038C587009886 +:107620008030807EF5F744FA00990020803188761A +:10763000B8E7641CE4B2032CB6D30020387003B062 +:10764000F0BD20BFD3E710B500786E4C00280FD0F6 +:1076500001280CD068496C4803F031FDA0686B49E3 +:10766000884203D364496A4803F029FD10BD694884 +:10767000A060F3E710B55D4900220A70614C2070EC +:1076800059480270427002770273427382738261BA +:1076900002752030574B0380052143808380001DF5 +:1076A000491EFAD1100004D0002A04D05948A06025 +:1076B00005E0A26003E05049534803F000FDA068D4 +:1076C0005249884203D34C49514803F0F8FCFFF774 +:1076D0005BFF10BD70B5444C0E46217884B0154652 +:1076E000002902D00C2004B070BDA0618030007C65 +:1076F000002803D03B49484803F0E1FC4748464393 +:1077000045434748ED1C30186660A560854200D8A7 +:107710002846A060354900208860052121706070EE +:107720002077E0833F48F5F76FF92075002803D1F3 +:107730002C493D4803F0C3FCF5F7D5F92061002240 +:1077400001216846FFF7C1FD207D6946F5F742FE3D +:10775000002004B070BD08B50020C0436946088011 +:1077600021480078002801D0002008BD0846FCF719 +:1077700000F80028F9D0012008BD10B51A4C84B0DB +:107780002278002A02D00C2004B010BD234A5143B5 +:107790005043C91C224AA16060608018814200D811 +:1077A0000846A0600020607004212170E0831D481D +:1077B000F5F72AF92075002803D10A491B4803F080 +:1077C0007EFCF5F790F91A49F5F71FFC20610022BD +:1077D00001216846FFF779FD207D6946F5F7FAFD3E +:1077E000002027E0847301003C200020302000208E +:1077F00076020000FFFF0000C073010019030000C3 +:107800005C200020FC000020510500006A180000E8 +:107810005A050000C40900008B020000710200003C +:10782000B3FBFFFF4B73010097020000C60200008C +:10783000B80B000004B010BD10B5E14CA1690160A7 +:10784000FFF752FE0021A16110BD70B5DC4C84B081 +:107850002078052802D00C2004B070BDA069002853 +:1078600003D1D849D84803F02AFCA0698030007CB5 +:10787000002803D0D349D54803F021FCA06980300B +:10788000807E002803D0CF49D14803F018FCD148AE +:10789000F5F7BAF8A1699A22505405464E88401E61 +:1078A0000B2804DBFF20C749273003F008FCCA4936 +:1078B000680040184038C687A0698030807E002864 +:1078C00003D1C049C54803F0FAFB01226846A1690B +:1078D000FFF750FBA06969468030807EF5F77AFD9E +:1078E0000020A06104B070BD10B5BD494C6898344B +:1078F00000280ED001280FD0022811D03520B94918 +:10790000000103F0DCFBAE488068A0420BD90120E7 +:1079100010BDFF347934F6E7B12080002418F2E777 +:10792000FF346134EFE7002010BDAD4841780029F5 +:1079300002D10078002801D0002070470120704754 +:1079400070B504460422A84E803484B000290DD0BE +:10795000012923D0022907D0032921D0A149A34816 +:1079600003F0ADFB04B070BD227410E005469C48E6 +:1079700000780028F8D1294601226846FFF7FAFA74 +:10798000A07E6946F5F726FD288D401C2885F4F772 +:10799000F5FF3078EAF7B8FC04B070BD032010E0C2 +:1079A0008188934A5143934A1160616A0A8902832C +:1079B0008A7982754A8982808A89C280C9890181CF +:1079C0000220207404B070BDF0B5874E01463078B7 +:1079D00000257B4C85B0002908D0012916D002294A +:1079E00042D0032958D07F49834839E0E583EAF73C +:1079F0008BFC6078002849D1002211466846FFF7C9 +:107A000064FC207D6946F5F7E5FC3FE0744F206992 +:107A10007968774B401879494218A0698188408875 +:107A2000594300F06FF8B1680546884205D2A16954 +:107A30006F4A88884243551903E06D4903F01EFAE6 +:107A4000A1690883A06905218175008B68494843B5 +:107A5000281A6B49B860884204D32520594940014F +:107A600003F02DFB05B0F0BDE583EAF74DFC0120E6 +:107A70002077A0692169803041610574FFF7E5FE38 +:107A8000002803D04F495F4803F019FBF4F776FF55 +:107A90006573A57305B0F0BDEAF736FC05B0F0BD1F +:107AA000704710B54E4A00290ED0012906D0022990 +:107AB00006D04C49544803F002FB10BD401E03E0C1 +:107AC0005178491C5170001F506010BD3C4800782F +:107AD00070478107C90E00280BDA0007000F08382D +:107AE00080084A4A80008018C069C8400006800F9C +:107AF00070478008464A800080180068C840000629 +:107B0000800F7047F7B582B00D460646414F0024FE +:107B100006E00B2C04D3FF202A492D3003F0CFFAC6 +:107B2000204601A9FBF7EDFD00280ED10198803019 +:107B3000007C002809D00B2C04D3FF2021492D30D4 +:107B400003F0BDFABC4204D006E0641CE4B2032C8E +:107B5000DFD3002005B0F0BD69462046FBF7D1FD1C +:107B6000002803D017492C4803F0A9FAA64204D1F3 +:107B7000DD201449800003F0A2FA2848341B444356 +:107B80000098803041690498F6F7C6F9041908D5C1 +:107B9000281B66422946401E03F07EF96843841B79 +:107BA00005E02946204603F077F96843241AAC42E1 +:107BB00003D904491A4803F082FA204605B0F0BD03 +:107BC0003C200020C0730100E7020000E902000031 +:107BD000EB0200008F7001005C200020EE0200002C +:107BE0003020002084730100FC000020ED04000020 +:107BF000E204000000010020190500004E0600000C +:107C00006A180000B30400003605000000ED00E033 +:107C100000E400E0FFFF00007103000077080000AF +:107C20008903000070B5F84E0446B079002501289C +:107C300005D0F64E307A01280CD0002070BD002906 +:107C400015D1657014202070F149A01C03F040FB91 +:107C5000B5710CE000290AD16570132020701C2238 +:107C6000EC49A01C03F0A1F80120A071357201209D +:107C700070BDE648007A002802D0E748808D704742 +:107C8000E6487047F8B5E6480178002902D00C268E +:107C90003046F8BD0026E04D34462E756E75EE7503 +:107CA0002E76AE75DF496E734E73D84F7F217E718D +:107CB0008170687E002804D0F8F7B7FBF8F760FF02 +:107CC0006C763C72D848FBF71DFED848FBF71AFECD +:107CD000DEE770B5D24A00251570CC4ED44B357115 +:107CE0001966D8651078002805D0FF20D1A17A3018 +:107CF00003F0E5F970BDC84C25756575E575257609 +:107D0000A575C8486573457375717F209070607E56 +:107D1000002804D0F8F789FBF8F732FF6576357252 +:107D2000C148FBF7EFFDC148FBF7ECFD70BDBA4859 +:107D3000007D704710B5B849C87B897B420783072F +:107D4000D20FDB0FC007D218C00F10184000052952 +:107D500011D20A007A44127992189744090509024F +:107D60000700B849085A10BDB74810BDB74900E030 +:107D7000B749085A10BDFF20AEA19A3003F09FF911 +:107D8000002010BDA448B349008A484370479F486B +:107D90008079002800D001207047F8B506469E4C37 +:107DA000407BE07330790027A073012825D030880C +:107DB00020829648B37B83719D4DA7482970114658 +:107DC00003F079FAB0796873F11DA44803F073FAEF +:107DD000607B0126002800D066759248407B002811 +:107DE00000D0A675A07B05284DD201007944097901 +:107DF00049188F440409262B09002782D9E700215E +:107E00008948FBF784FD25E001218748FBF77FFDCA +:107E1000E91D8548FBF7B0FD687B002807D00128E5 +:107E20000AD0FF2083A1E83003F049F912E00021D5 +:107E30007D48FBF7B2FD0DE001217B48FBF7ADFD6E +:107E400008E006217848FBF762FD03E0022176484E +:107E5000FBF75DFDE7752776691C7348FBF780FD2E +:107E600029787148FBF78DFD04217048FBF74FFD21 +:107E7000691C6E48FBF774FD29786C48FBF781FD9F +:107E800026750020F8BDFF206AA1F230CCE770B55E +:107E9000614C012525765D4A127A002A01D03A20EC +:107EA00070BD634A13780022834205D1E2756A48A7 +:107EB00003F001FAE57500E02276002070BD70B590 +:107EC0000446554D0020A8752246654802F06DFF16 +:107ED000544844730120A87570BD4C49087170471F +:107EE00010B54D4C00226275607302465D4802F089 +:107EF0005CFF0120607510BD444948717047F8B5BA +:107F0000474D287800282CD1434C207D002828D0CC +:107F1000F8F72BFA0026A674E6746E703046F8F770 +:107F200021FA0020F7F7E5FF4F48F8F7F2F84F483D +:107F3000F8F7ADF9F8F746FAE07B0127C107002909 +:107F400002D0A17CC9070ED0810712D5A17C890778 +:107F50000FD42620F8F7EFF8A07C02210843A07484 +:107F600013E00C20F8BD2520F8F7E5F8A07C384395 +:107F70000AE0400709D5A07C400706D42720F8F77F +:107F8000DAF8A07C04210843A074F8F7E7F901218E +:107F90000020F8F7EBF80F210520F8F72EF8244D14 +:107FA0002978681CF8F71DF8A07B01280AD004285E +:107FB00008D0607D002805D0627B2A491A48FBF76B +:107FC00006FD6675A07D002806D016482449427B30 +:107FD0009830FBF72EFDA675286E0178002903D096 +:107FE0000178001DF8F740F8E86D0178002904D009 +:107FF0001F4A401CF8F7A3FD6776F8F7C1F9002087 +:10800000F8BD074948607047F4200020D4200020C4 +:10801000FB200020DE200020B4200020FFFF000015 +:108020000801002094200020042100202C210020A1 +:10803000742000207372635C6C6C5F6164762E63E5 +:1080400000000000CEB301009A891300D6B30100EE +:10805000C6B3010071020000752000207B200020C3 +:1080600082200020A2200020C1B30100BEB3010085 +:1080700057210020F8B50126FE4C0546002824D0E3 +:10808000E07B2146C207897C002A01D0CA070BD0B9 +:1080900082070FD58A070DD42620F8F74CF8A07C6C +:1080A00002210843A07410E02520F8F744F8A07CD2 +:1080B0003043F7E7400708D5480706D42720F8F7EC +:1080C0003AF8A07C04210843A074E07C00280AD080 +:1080D000A07B012804D14B20E749000102F0EFFF0B +:1080E00000F0BDFAF8BD002D0CD002210020F8F7F9 +:1080F0003DF8E2480079032801D0012802D102208E +:10810000F8F774FAE07D002700280AD0DC4DDD483E +:10811000691CFBF725FC691CDB48FBF721FCE775B4 +:108120002776D848F8F731F9A07B05280CD2010052 +:108130007944097949188F440202020B0200012197 +:108140000846F8F79DF903E0CB49D04802F0B7FFA5 +:10815000E07BA17C884303D1A07B012803D0E67497 +:10816000CB480670F8BDA774FAE710B5F8F7FDF82C +:10817000C7480078002816D1BE48007D002812D0DC +:108180000020FFF777FFBD480079002809D00128BB +:1081900015D0022805D0032811D0B749BD4802F0F8 +:1081A0008EFF002010BDF8F72CF9F8F71FF9F8F74B +:1081B0002BF8F8F7CDF8F8F7E3F80C2010BDEAF744 +:1081C00027FFEEE7B249012048707047F8B5002458 +:1081D000FAF7B6FE002822D0FF202D30F7F7C3FFB4 +:1081E000AB4D2878A54F01281CD0022801D00328C8 +:1081F00031D0CF20A049800002F061FF287800280C +:108200000CD03879002809D0012807D0022835D0B1 +:10821000032833D09849A04802F051FFF8BD00F080 +:108220001EFAF8BD934EB07B032814D0707E002850 +:1082300003D0F8F794FCF8F7F0F89848F8F7A5F8A9 +:10824000B07B012812D0042810D0B879012806D0BC +:10825000032804D004E00120FFF70CFFCEE7102430 +:1082600021460E2001430020F8F70AF97879012809 +:1082700001D1F8F7ECF802202870BFE7287802282F +:10828000CFD10120F8F7B2F9F8BD70B57B48804C2A +:108290004079012808D18248F8F7E2F8002801D196 +:1082A0007F20A070F8F7CAF8724D687E002803D0CE +:1082B000F8F7BBF8F8F764FCFAF742FE00280BD099 +:1082C0002078022804D0DD206B49800002F0F7FE00 +:1082D000A87B012803D006E000F0C1F970BD992009 +:1082E0008000F7F740FF0120FFF7C4FE2078002848 +:1082F000F4D020780128F1D05F496A4802F0DFFE0F +:1083000070BDF0B5044689B0002006900190F7F7E3 +:10831000FDFE03905E480078022803D0564962486B +:1083200002F0CDFE554D6879012809D15C48F8F777 +:1083300097F8002802D156497F208870F8F77EF818 +:108340005648FBF709FB4B4E0746002C6FD05348AD +:10835000FBF70CFC00286AD0F7F74CFE002866D02B +:10836000707E00280AD00524641EE4B2F8F729FCC8 +:10837000022811D0012800D000200190474A4B4C20 +:10838000D01C0290062F52D2380078440079001891 +:108390008744B4B4B409B44E002CE5D144A1484894 +:1083A00002F08DFEE8E7B07B012840D004283ED0E3 +:1083B00001990398084304D1A879002801D0022824 +:1083C00035D1687901281AD1A079002817D1012068 +:1083D000A07110784006C00FE0713A48029902F08F +:1083E0006AFF2B4C384FA0787F2804D1532030A14E +:1083F000000102F064FEA07838707F20A07022484F +:10840000F7F7C3FF2248032101702879002877D0AD +:10841000012808D0022873D0032804D024A12B48B7 +:1084200002F04DFE6CE00120F8F7E0F868E065E04E +:108430001348D178C07981424AD111481179037A21 +:10844000994245D15179437A994241D19179837AC0 +:1084500099423DD1D179C37A994239D1117A037BBE +:10846000994235D11178407B4906C90F81422FD1FD +:1084700001212EE0B420002034800100D42000200F +:1084800074200020042100202C210020DE040000A4 +:1084900008010020D10200005103000054210020F7 +:1084A0000A01002083030000C1030000F420002023 +:1084B0007372635C6C6C5F6164762E630000000015 +:1084C000AB030000FC200020022100200904000072 +:1084D0000021B07B012801D0042801D100290AD154 +:1084E00000280BD101990398084304D1A8790028EA +:1084F00001D0012802D1307E00281FD00120069033 +:10850000707E002803D0F7F790FFF8F739FB069844 +:10851000002802D00120FFF7ADFD73480178002943 +:108520000AD00178012907D00078032804D0492017 +:108530006E49000102F0C3FD09B0F0BD6A486C4FFE +:108540004068397BC173797B0174B97B4174F97BD5 +:108550008174684909784906C90FC1761C300299AF +:1085600002F0A9FE6048397C4068C174797C0175CD +:10857000B97C4175F91E897D817502994A7D0B7D13 +:10858000110219430183F91E8A7E4B7E12021A439F +:108590008280029A537E177E1A023A43C2808A7FF3 +:1085A0004B7F11021943018153490A3002F078FED2 +:1085B00052480179CA064C49D20E49688A76007938 +:1085C0004009C0310871287A002803D047494C4837 +:1085D00002F075FD0020A87243484B49476878882F +:1085E000B085F87EE873B88B2882F88B6882388C67 +:1085F000A88244480078A875444802F05CFEB88818 +:10860000F087F888208038896080C03738792071F9 +:108610000198002860790BD0012108436071F8F7B8 +:10862000E9FA61794000C907C90F0143617102E0AD +:10863000400840006071012028722B4C00202070FF +:10864000F7F7DFFEF7F7D2FEF7F7DEFDF7F780FE6C +:10865000F7F796FE01206168FAF792FD50E7F8B54A +:10866000F7F7CFFEF7F7C2FEF7F7CEFDF7F770FE8C +:10867000274E0027707E002804D0F7F7D6FEF8F7C3 +:108680007FFA7776184D2F70F7F77AFEB07B0128C6 +:1086900004D000210846FAF773FDF8BD002102203E +:1086A000FAF76EFD1B4C207A002803D00F491A48B8 +:1086B00002F005FD68780028EFD01248417BE17395 +:1086C0000078A0751549164802F0F5FD0E490F48CF +:1086D00002F0F1FD3C20A07268684088B08501205E +:1086E00020726F70F8BD000008010020B084010006 +:1086F00057210020542100207321002074210020E4 +:108700003D0400007420002075200020EB20002094 +:10871000B4200020D42000204F0200007B20002045 +:10872000E4200020F8B5FCF707F80446FCF7CBF886 +:10873000FD4E054670692030407B002826D0012878 +:1087400044D0022846D003284DD0FF20F7A19A300C +:1087500002F0B5FCB069F72201781140017072692E +:108760002032937BDB071B0F1943FB231940017059 +:10877000D37BDB075B0F19430170577BEF23022F7D +:108780003CD0012F3FD0032F41D046E0EB48FCF70F +:1087900079F8002804D07169032020314873D9E7A3 +:1087A000E648FBF759FF002804D070695321095CA3 +:1087B000002907D0E148FCF70CF87169012020314D +:1087C0004873C7E7022120304173C3E7DB48FCF759 +:1087D00000F8BFE7D948FBF73FFF0028BAD1FF20D8 +:1087E000D2A18C3007E0D548FCF74CF80028B1D175 +:1087F000FF20CEA1943002F062FCABE7012C08D838 +:10880000002D06D009E06D1E2C4302D105E0002C9E +:1088100003D019401023194300E019400170D17DA5 +:10882000002915D0517B012912D0C548F7F7ADFDBD +:10883000C448002101767269116E526E4261016175 +:10884000BF49B269F8F707F90020F8F713F903E018 +:10885000F7F79BFDF8F731F9B0690078C00606D448 +:10886000F0690078C00602D4F079002806D0B0790B +:10887000002803D101210846F7F702FE03203070DB +:108880003079002803D1F7F79DFD01203071F8BD44 +:1088900010B5A5490023486902462030C37483758A +:1088A0000120412398548032927F002A03D008701F +:1088B0000021022001E000210320FAF7DEFB10BDB9 +:1088C00006281AD202007A441279921897440205B7 +:1088D000090D101000290ED00FE0891E02290AD9B7 +:1088E0000BE0891F012906D907E0082903D004E01D +:1088F0000B390C2901D8012070470020704730B592 +:10890000044683B08D48FBF78BFF002803D187A175 +:108910008D4802F0D4FB844DA869FBF767F9032169 +:10892000A869FBF784F9A869EF220178114001706A +:108930002146FBF7E5F90E2C5BD220007844007944 +:1089400000188744565606561F5A5A175642565A0A +:10895000312B75485D224169525C002A04D0062102 +:108960008069FBF77AFA48E0C031C9798069FBF782 +:1089700074FA42E06C48416980698031497AFBF7BA +:10898000DDFA3AE0684D6969A869B031FBF79EFAF3 +:108990006969A8698431FBF7A5FA2EE062480621CF +:1089A0008069FBF7C7FA28E05F4D28690178A8695C +:1089B000FBF7AAFA28698188A869FBF7A7FA286952 +:1089C0004188A869FBF7A6FA17E000200090019003 +:1089D000554841694031097F002905D06A46117820 +:1089E000012211436A46117069468069FBF7B4FAA7 +:1089F00003E04EA1554802F062FBFBF722FF00287E +:108A000003D14AA1524802F05AFB0C2C0AD0072C81 +:108A100006D04548002140694030418101218173E1 +:108A200003B030BD4048002140694030018203B0AE +:108A300030BDF0B53C4D064668698DB020300079F8 +:108A4000012801D1F7F7FAFC0024012E1ED1686934 +:108A50002030017E002902D1C07D002801D0F8F726 +:108A60002CF8F7F7CEFCF7F7C1FCF7F7CDFBF7F7DB +:108A70006FFCF7F785FC6879C006686902D580301D +:108A8000048703E08030018F491C01876879022642 +:108A9000C107002901D1800713D568692030817D85 +:108AA000002902D0032907D00BE0012181750021A4 +:108AB0000120FAF7E2FA04E0867500210120FAF7B6 +:108AC000DCFA68692030817D012903D169790907C1 +:108AD00000D586751448407A002865D100F0F7FE6D +:108AE0001648FBF79DFE00285ED00F4D287A00281F +:108AF0005AD16869C621095C00290ED02030C17C9A +:108B00000120FFF7DDFE002807D168692030C17C15 +:108B10000420FFF7D5FE00281CD06869CB21095C32 +:108B200006291DD023E00000100100207372635C51 +:108B30006C6C5F736C6176652E6300002801002009 +:108B400080210020A821002089070000CB07000019 +:108B5000D1070000686940300481447702204DE06D +:108B60002030C17C0420FFF7ABFE002815D06869D7 +:108B70002030C07C801E16287ED2010079440979FD +:108B800049188F449B9B9B1C9B9B9B979B1E9B9B6D +:108B90009B243E9B9B9B9B9B9B9068695621095CF9 +:108BA000C90702D0C030C472AEE00C20FFF7A7FEA8 +:108BB000686901224030817D11438175A4E007205E +:108BC0001CE0FBF7FAFE00286CD00B2016E0F3F750 +:108BD00050FA0C2866D368690821B030F3F74AFAD6 +:108BE000002806D0686904218430F3F743FA00288E +:108BF00003D1F4A1F74802F062FA0420FFF77FFEE8 +:108C000082E068698446C030807A042802D0052852 +:108C100039D079E06046E030007D002874D1EE491B +:108C20006046102600230822D8306944F51A2D1812 +:108C3000203DEF7F4F70AD7F8D70891C521E9B1CB5 +:108C4000002AF3D103A86346102608210330A83375 +:108C5000B51AED18203DEF7F4770AD7F8570801C01 +:108C6000491E921C0029F3D16846F9F716FB08AF9C +:108C70004ECFDA4D686900E020E070304EC005202C +:108C8000FFF73DFE0BE060464030017D002903D038 +:108C900001214177022000E00D20FFF730FE6869D6 +:108CA000C030847230E00620FFF729FE686940304A +:108CB000847329E00920FFF722FE25E06869CA21B4 +:108CC000095C002920D0062906D02030C17C002074 +:108CD000FFF7F6FD002817D068690146C0318A7A8F +:108CE000072A11D213007B441B79DB189F440C0C1C +:108CF0000C0C0C0C03004030807DC20700D154E7FF +:108D0000C043800700D18C72B44D2879002868696F +:108D100002D08030048303E08030018B491C018342 +:108D20006879C007686904D0A4210C54403084805D +:108D300003E040308188491C8180E879002806D012 +:108D40006969A0310879022806D8401C0871686951 +:108D5000A0300079022806D9686901468030048372 +:108D60004483A0310C7168692030C17C0020FFF77A +:108D7000A7FD002804D168692030C07C07284CD1A9 +:108D800068690146C0318A7A062A46D0C97A06291E +:108D900043D03621095C02293FD1A0300079002858 +:108DA0003BD1FBF7B8FC002837D0FBF78CFD00283F +:108DB00033D06869014680314A8A012A2DD90122BF +:108DC0004A77024640329688D288931E9E4201DB43 +:108DD000012302E0921B521E93B20A8BAE89B2426B +:108DE00001D3012202E0B21A521C92B2934200D97E +:108DF0001346012B00D14C77C0300278002A10D0E6 +:108E0000498B4088814201D3012102E0401A401C75 +:108E100081B28B4205D90B4603E06869012380309B +:108E200044776A69118D1646C81883B2104680309F +:108E300083822036B77D002F25D0012F23D0022F2B +:108E40000CD0032F0AD05FA1654802F038F9687989 +:108E5000C006686919D58030C4841BE0F67C032EF7 +:108E600009D0082E0FD04032D1889288891A891EE5 +:108E700059180182EBE740329688032E03D3D2883B +:108E80008918491CF5E70382E1E78030C18CC28A6A +:108E90008918C18468690246C0329179002906D0D8 +:108EA0000146403196230E891B5AF3180B81697ACB +:108EB0000426002913D002463D214032917001461C +:108EC0002031CC748C75012151708030807F002856 +:108ED00070D0297000210220FAF7CFF85EE0014639 +:108EE0002031CB7C042B48D02B7A002B1ED05A0784 +:108EF00001D4DA0604D51E2240308270CE743CE0E4 +:108F00001A0704D53D2240308270CE7435E0D80770 +:108F100005D1980703D42BA1324802F0D0F8686934 +:108F20002A21422211542030C67426E04030837B2F +:108F3000002B05D047897B1C438183899F420FD238 +:108F4000D37A062B02D0927A062A05D1038A5A1CBC +:108F500002828289934203D20389C288934203D357 +:108F600022228270CE7408E08B7D002B23D0838870 +:108F700093423CD308228270CE7468694122014634 +:108F80002031CC748C75012111548030807F0028F1 +:108F90002AD0297000210220FAF76FF8F9F7F8FFBC +:108FA00000282DD068690146FF300130827A002AFE +:108FB00022D025E018E08288062A18D33E2282704B +:108FC000CE74DAE77372635C6C6C5F736C617665A8 +:108FD0002E63000029060000FFFFFFFF10010020A4 +:108FE0005A0800004302000000210320D4E70120BA +:108FF000287000210846CFE74988818101218172CC +:109000006869803084770DB0F0BDF8B50C4617461E +:109010006946FAF702FB002801D00020F8BD00984D +:109020000146E030027AFE4E0025002A17D0002FBC +:109030007DD1657007212170007A00280DD07169FB +:10904000E8204D8445540A22A01CEA3101F0ADFE0F +:109050000098E030007A0028F1D1A57067E0027D29 +:10906000002A2AD0002F62D1017D0D2920D20A00CA +:109070007A441279921897441B1B1B1B1B1B1B1B4A +:109080001B1B1B0F060065700C212170817DA170D8 +:1090900071694988A18009E065700B212170817D8B +:1090A000A17071694988A180817EA17105753EE03A +:1090B000DC49DD4802F003F839E0027F002A15D0D0 +:1090C000002F34D16570082222707269FF315288F6 +:1090D000628001310A88A2804A88E2808A882281DF +:1090E000CA8862810989A181057720E0FF310131B9 +:1090F000887A002808D0002F19D1657011202070BF +:10910000888960808D7212E0887B002886D0002FCD +:109110000DD1657012202070887B002807D08D73D8 +:10912000088A6080488AA080887B0028F7D10120C7 +:10913000F8BDBB480078012801D00C207047002002 +:10914000704770B5B64C05462078002803D0B54965 +:10915000B64801F0B4FF00202561A0720120207004 +:109160002078012803D0AF49B14801F0A8FF70BDB5 +:10917000F8B5AB4D2978012901D00C20F8BD0126A6 +:10918000686180308677807AFBF753FA00282ED00A +:1091900068698030807AFBF7A3FB002827D06869D4 +:1091A0008030807AFBF718FB002820D06869803077 +:1091B000807AFBF754FB002819D0F7F7D6F86869D6 +:1091C00000248030408A002825D09A48FBF728FBED +:1091D000002820D06869C621095C00291BD02030F6 +:1091E000C17C0120FFF76CFB002802D013E01220A5 +:1091F000F8BD68692030C17C0420FFF761FB0028BE +:1092000009D168694030048144770220FFF777FB79 +:109210006869803044776869E821095C002905D1D4 +:10922000418CC288914201D9A98101E0C188A981FC +:1092300001468031CA8A521E93B20A8BD21892B26A +:109240000A830F7F002F02D04C830C7702E04F8BF4 +:10925000FF184F8305464035AF88FF18AF804D8A11 +:10926000012D01D86D1C4D82002B01D0A4231C546C +:109270002030C07C6A4D042817D0487F002816D0C3 +:10928000A889824213D2FBF746FA00280FD06869FA +:109290000146C0300278002A09D08031498B4088CD +:1092A000814204D3AC70EE7003E0AE7001E0AC70AC +:1092B000EC7068699D210C543321095C062901D0AA +:1092C000072917D1CC21028D095A511A09B2002958 +:1092D00010DB0146CE310A3002F00BF801220221E8 +:1092E0006869FAF7D2FE6869CB210C5433210C541B +:1092F000403086774A4D962168690A5A811C283089 +:10930000FAF76AFFA87800284DD16869C021095C86 +:10931000002901D0803044830120F6F7EAFD404D5A +:1093200068691330F6F7B3FF68690F30F6F7F1FE9E +:109330000120F7F717F8686901462030027E002AFD +:1093400002D1C07D002806D07031ACC93A48ACC00B +:109350003A4801F0BDFFF7F701F801210846F6F79A +:1093600005FF2F4D68698030006AF7F711F834481F +:10937000FBF7C9FA002801D06C7002E06E7031482A +:10938000E86168692030007E002802D068780028F3 +:1093900016D0E869F6F7F9FFF7F78FFB68694030F8 +:1093A0000078F6F7C8FE1E4802214471C47184712A +:1093B0000472447204710170F6F7E2FF0020F8BDF8 +:1093C0002048F6F7E2FF1C4806766A69916ED26E75 +:1093D000426101611B4AE969F7F73DFB0120F7F79C +:1093E00049FBDBE710B50E4C2078022801D00C2099 +:1093F00010BDA078002803D00020FFF71AFB30E052 +:10940000F6F7B3FF01210020F7F73AF804202070A7 +:10941000606920300079012801D1F7F718F813E0CE +:1094200010010020C48F0100BE0800000E090000DA +:109430001909000028010020A8210020C1210020D6 +:109440002C01002080210020A07A002809D00128CA +:1094500007D0022807D0032805D0FD49FD4801F0B8 +:109460002EFE002010BDE9F7D3FDFAE7FA49887215 +:109470007047F8B5F84C2078032803D0F449F74832 +:1094800001F01DFE616901252031887A002806D08F +:10949000002088720D73A07904221043A071A06986 +:1094A0000278D243920724D1C97A002921D1FAF750 +:1094B0005EFC042816D0052802D00B2812D10DE03E +:1094C000616900208866C866382045547031CCC96F +:1094D000E348CCC0E34801F0FBFE03E061690020F3 +:1094E00020310876606902212030C572A0790843D6 +:1094F000A071A0690078C00606D4E0690078C006B3 +:1095000002D4E07900280CD06078002809D1A07935 +:10951000002806D1F9F72AFD002802D0207A002879 +:1095200003D00120FFF785FA1DE0CF48FBF7EBF9E8 +:10953000002802D00020607002E06570CB48E06136 +:1095400060692030007E002802D0607800281BD09F +:10955000E069F6F71AFFF7F7B0FA01210020F6F7F5 +:109560008FFF04202070207801280CD0A07A0028DA +:1095700009D0012807D0022818D0032816D0B449F2 +:10958000BB4801F09CFDF8BDB848F6F7FEFEB448B4 +:1095900005766269916ED26E42610161B34AE169FA +:1095A000F7F759FA0120F7F765FAD6E70120F7F740 +:1095B0001DF8F8BDF8B5A84D04462878042803D056 +:1095C000A349AC4801F07BFDA34A102751793943E8 +:1095D0005171002C7ED0F7F788FA0125002814D1AC +:1095E0009D48416920310A7E002A0ED0C269537815 +:1095F000DB060AD01278C97B1207D20F8A4204D147 +:1096000045720120FFF715FA3EE1934CE0780028FF +:109610001ED0E0694178C9061AD10078C00617D477 +:1096200060692030007901287ED1F6F707FF616973 +:10963000881C2831FAF7C0FE002875D06169C81D62 +:109640004A88F93002822031097C81748573FBE0FD +:10965000606920300079012811D1F6F7EFFE6169C9 +:10966000881C2831FAF7A8FE002808D06069C11DBF +:109670004288F9310A822030007C88748D73E06959 +:10968000002600784007C10F60692030827B91423C +:1096900042D0407B00283BD002280FD1FBF700F8D6 +:1096A000002803D16A49744801F009FD626900236A +:1096B000106E516E401C5941516610666069203031 +:1096C0004673017B012903D10673A1793943A17146 +:1096D000C17A00E0A1E0012914D1C672A079082165 +:1096E0000843A071FBF7DDF8002803D1584963480F +:1096F00001F0E5FC62690023106E516E401C594177 +:109700005166106660692030817B01292ED08573F7 +:1097100060790821084360714F49C8694969037835 +:109720001A07D40F203100E08EE0CA7B94420CD19E +:109730009B07494C9B0F012B40D0022B3ED0032BA3 +:1097400016D0207A042108432072434841792943E6 +:109750004171C6718179090704D541692031C97CFD +:10976000032971D0007A00286ED18BE08673CFE791 +:109770006378002BE9D18D72A3792B43A371012A61 +:109780000CD0CD73FAF7F3FA062809D00B28DCD1F8 +:10979000606937210E5440300575D6E7CE73F1E786 +:1097A00061690020086648663720455470319CC9BD +:1097B0002B489CC0093001F08BFDC6E74078C306FA +:1097C00025D061780029C0D1C006C00E1B281BD847 +:1097D0006079042108436071FBF7BCF8002803D1CD +:1097E0001B49274801F06BFC60690023826EC16E43 +:1097F000521C59418266C1662030C17B012901D0CB +:10980000C573A2E7C673A0E7207A38439CE7012A14 +:1098100001D0CD7399E7CE7397E70F480222114329 +:109820004171C179491CC9B2C17101290CD8406983 +:109830002030007E002825D00C484078C106C90E93 +:1098400005291FD2C0061DD00120FFF7F2F81BE04A +:10985000C48F0100EE09000010010020170A00006B +:10986000A8210020C12100202C01002080210020FF +:109870006A0A0000820A0000FB06000013070000CD +:109880005E070000FEF74EFFFB48017801290CD06F +:10989000807A002809D0012808D0022805D00328A2 +:1098A00004D0F649F64801F00AFCF8BD0120F6F7AD +:1098B0009DFEF8BD10B5F0480078042803D0EF49AC +:1098C000F04801F0FCFB0120FFF7B3F810BDF8B53C +:1098D000E94C0025A0790007002831DA207A002819 +:1098E0002ED160692030C07C801E132828D2010050 +:1098F0007944097949188F442309232323232323F7 +:10990000232323232323232323231C0060690146CD +:1099100040318D734A7F002A05D006228A700421C7 +:109920002030C1740CE016228A7004212030C174EA +:1099300006E0616908464031CD748D732030C574EE +:10994000607940070BD560692030C17C0520FEF7A7 +:10995000B7FF002803D0207A08210843207200F0C6 +:1099600035F9A27901265007002822DA207A00284A +:109970001FD16069014620310F46C97C891E072925 +:1099800017D20B007B441B79DB189F440312121281 +:109990000C120F00034640339D73C030017A99705A +:1099A0000420F87405E0C030C67202E00221C03025 +:1099B000C17290070327002849DA207A002846D18F +:1099C00060692030C17C0120FEF77AFF00283ED17B +:1099D000A069C0780E287CD2010079440979491821 +:1099E0008F44A5A506A53646620AA517A526955457 +:1099F00060692030C7749EE060692030C07C052813 +:109A000003D09E49A04801F05AFB60692030C5741C +:109A100091E060692030C07C092803D097499B48B9 +:109A200001F04DFB60694E210D542030C57482E079 +:109A300060692030C07C0B2803D09049944801F025 +:109A40003EFB606953210E540C212030C17472E03A +:109A500060692030C07C0F2803D088498D4801F010 +:109A60002EFB606953210E5410212030C17462E036 +:109A700060692030C07C102803D08049864801F0FE +:109A80001EFB606912212030C17454E060692030EF +:109A9000C07C102803D07949804801F010FB606930 +:109AA00014212030C17446E060692030C07C172842 +:109AB00003D072497A4801F002FB606901464030E8 +:109AC000C5748573E031087D002805D06B49754861 +:109AD00000E02CE001F0F3FA6069014640310A7DB4 +:109AE000002A08D00D754288F8210A520146E0315B +:109AF0008D750C2207E04188F82211520146E031B1 +:109B00008D758E760B220A752030C57413E060695E +:109B10000146C030827A062A04D14031897D890706 +:109B200000D58572C17A062905D1C57203E0534973 +:109B30005D4801F0C4FAA079C00613D5207A002848 +:109B400010D160692030C17C07290BD20A007A4409 +:109B500012799218974406060606060603000721A6 +:109B6000C174F8BD60693321095C0829F9D1014647 +:109B7000028DC0318B89521C9A42F2D1227A002A7E +:109B8000EFD14A8A83889A4207D18B8AC488A3423C +:109B900003D1CB8A0489A34208D043888B85CA8528 +:109BA0008A8A0A86CA8A4A86E8210E540122114608 +:109BB000314CFAF76AFA00210420F9F75EFA60697D +:109BC000CB210D542030C5748775F8BD30B52A4CB3 +:109BD00083B0A079C0076BD0207A002868D1606973 +:109BE0002030C17C0120FEF76BFE00287ED1E069A9 +:109BF000C0780D287BD201007944097949188F4437 +:109C0000581506DF7676FD75FC76B6D0FB00E06968 +:109C1000FAF725F96169C8225054022233204254D0 +:109C200000204031488101208873A3E16069203021 +:109C3000C17C0020FEF744FE0028207A02D00028D4 +:109C400054D103E001210843207293E1E069FAF75F +:109C5000FFF86169CC2250520A8D801A134A00B273 +:109C600090427DDC00287BDDCE31E069FAF7E5F833 +:109C7000606906212030A1E010010020C48F01009E +:109C8000E40A0000EC0A0000150500001B050000B6 +:109C9000220500002A0500003105000037050000FC +:109CA000490500004E050000AB050000FE7F0000E6 +:109CB00068E160692030C17C0020FEF701FE0028C9 +:109CC00003D1207A012108432072207A00280DD187 +:109CD000E069FAF77FF8002831D0E069FAF775F803 +:109CE0006169CC2250520A8D801A01E0AEE029E170 +:109CF000A54A00B2904233DC002831DDE069FAF772 +:109D00005EF86169C0318873E069FAF751F86169FA +:109D1000C0310882E069FAF730F86169C0314882E1 +:109D2000E069FAF733F86169C0318882E069FAF7CF +:109D300036F86169D62250520820203197E06069D8 +:109D40002030C17C0020FEF7BBFD002803D1207A23 +:109D5000012108432072207A002877D101E1FFE732 +:109D600028204222505404202031C87402E1606946 +:109D70002030C17C0020FEF7A3FD002803D1207A0B +:109D8000012108432072207A00285FD160690022F7 +:109D9000014640304281012282730B202031C87479 +:109DA000E8E060692030C17C0C2903D0217A0222CE +:109DB00011432172217A002948D10D21C174D9E0C3 +:109DC00060692030C17C0020FEF77AFD002808D1B0 +:109DD00060694030007D002803D1207A01210843CA +:109DE0002072207A002831D160690022014640307B +:109DF00042810125857302E03BE075E027E0A83150 +:109E0000E069FAF749F86169E0698031FAF755F8D5 +:109E10006069E030007F002803D05C495C4801F0B5 +:109E20004EF96169FE204A884252FF310131E069F2 +:109E3000FAF71CF86169E069FF310931FAF722F895 +:109E40006069FC210D540F212030C17492E06069DB +:109E500001462031CA7C122A03D0227A02231A43F7 +:109E60002272227A002A6CD1403082731720C87483 +:109E700080E060690146C031CA7A002A06D0897A3A +:109E8000062903D0217A012211432172217A002967 +:109E900070D14030807D800715D4E069FAF73EF834 +:109EA00061694031C875E069FAF73AF86169403193 +:109EB0000883E069FAF739F8616902224031488382 +:109EC000887D1043887560690146C0318A7A062A08 +:109ED00001D100228A724030827DD2074AD1062207 +:109EE000CA720021018245E060692030C17C0020F7 +:109EF000FEF7E6FC002803D1207A012108432072F6 +:109F0000207A002836D16946E069FAF71EF86846DB +:109F10000078C107C90F6846017004D0606901214B +:109F20004030017703E060690021403001776069CB +:109F300000220146403042810122827309202031F3 +:109F4000C87417E060692030C17C0020FEF7B8FCBF +:109F5000002803D1207A012108432072207A0028AA +:109F600008D1E069F9F703FF61698922505405209F +:109F70002031C87461690023886ECA6E401C5A4142 +:109F8000CA66886603B030BDFE7F0000C48F010042 +:109F90000E040000474909680160002070474549E8 +:109FA0000860002070470121434A002803D001289F +:109FB00003D042487047916300E0D16300207047AE +:109FC0003F49012008603D48801C704704223D4BFA +:109FD0003B49002805D05A600869012210430861F6 +:109FE00008E008694008400008619A603249002092 +:109FF000C03188600020704731490622002808D00F +:10A00000012809D002280DD003280FD02B48401C6E +:10A0100070470869904302E008699043801C08611A +:10A020000020704708699043001DF8E70869104355 +:10A03000F5E723494A6A02434A62002070472049F3 +:10A040004A6A82434A62002070471D49496A01609A +:10A05000002070471A49CA690243CA61002070474C +:10A060001749CA698243CA61002070471449C96907 +:10A070000160002070471249024600204031002A4A +:10A0800003D0012A01D0072070478A6370470D4929 +:10A090000420886008490020C03188600A480168AF +:10A0A0008022090A09021143016008490120086061 +:10A0B0007047000000040040400000400420000001 +:10A0C000000500400003004000E400E000E100E083 +:10A0D0008107C90E002808DA0007000F0838800839 +:10A0E000814A80008018C06904E080087F4A8000AF +:10A0F00080180068C8400006800F704710B50446FD +:10A1000000F0DBF8002813D02046FFF7E1FFC0B2D3 +:10A1100000F0E1F800280DD07549E2060B78D20E68 +:10A1200001209040002B08D04A681043486006E0A8 +:10A13000704810BD6F48401C10BD6F49086000207A +:10A1400010BD10B5044600F0B8F800280BD06849DF +:10A15000E2060B78D20E01209040002B05D04A6811 +:10A1600082434A6004E0634810BD6349803108605F +:10A17000002010BD70B50D46044600F09EF8002882 +:10A180000BD05E480068E206D20E012191400840E3 +:10A1900000D001202860002070BD564870BD10B569 +:10A1A000044600F08AF8002807D0E106C90E012015 +:10A1B000884052490860002010BD4E4810BD10B5BF +:10A1C000044600F07AF8002808D0E106C90E012004 +:10A1D00088404A4980310860002010BD454810BDC4 +:10A1E00070B50D46044600F068F8002819D02846DE +:10A1F00000F071F8002816D0A007C10EFF228A4097 +:10A20000A807000E8840002C10DA2107090F083932 +:10A210008B0835499B005B18D96991430143D9618B +:10A220000CE0344870BD3348401C70BDA3082F4972 +:10A230009B005B181968914301431960002070BDB1 +:10A2400070B50C46054600F038F8002805D02846C1 +:10A25000FFF73EFF2070002070BD264870BDBFF3A1 +:10A260004F8F21492648C860BFF34F8FFEE770B576 +:10A270001F4C05462178012000290ED1207072B6AE +:10A2800000F0F4F81C4E803631688143616000F0C4 +:10A29000EDF8C043306062B600202870002070BD29 +:10A2A00013490A78002A06D0002804D1124A4868C7 +:10A2B0001060002008700020704710B50446202868 +:10A2C00007DA00F0D3F80121A140084201D10120B2 +:10A2D00010BD002010BD012803D0032801D00020AC +:10A2E000704701207047000000ED00E000E400E04E +:10A2F000300100200120000000E100E000E200E069 +:10A300000400FA05F8B50446800700250126002858 +:10A3100004DA5848C563C66302208443E00404D5C8 +:10A320005548C563C66380148443600003D5534811 +:10A33000456080058443E00504D55148C563C66384 +:10A3400080158443A00404D54E48C563C6634014F9 +:10A35000844360042704C00FF90F884203D04AA148 +:10A36000612000F0ACFEB80F0AD04C49CD634C48D8 +:10A37000C563C563CE63C663C6630320800384439D +:10A3800020050AD5474FFD632F20E6F70DFFFE633A +:10A390002F20E6F709FFF8148443F8F721F8424824 +:10A3A000044203D038A18D2000F089FEF8BDF0B53D +:10A3B00000210A46FF230446CC40E4072AD04CB2D1 +:10A3C000E606F60E0125B540384E3560384E35604C +:10A3D000002C11DA25072D0F083DAE08354DB600CB +:10A3E0007719FD69A407E60E1C46B440A543144640 +:10A3F000B4402543FD610DE0A6082F4DB600761947 +:10A400003568A407E70E1C46BC40A5431446BC4073 +:10A4100025433560491C2029CDD3F0BD70B5274CAC +:10A420000D462060FFF76EFF2068FFF7C0FF28464B +:10A43000E8F7AEF8F7F7E0FEF1F7D2FDF7F7D0FF57 +:10A44000FFF725FEE7F72AFF00F06AF870BD10B5A8 +:10A450001A4C2068FFF756FF2068FFF7A8FFF7F7B0 +:10A46000BFFFE8F70FF90020206010BD1348006817 +:10A4700070470000C01F0040C0CF004000E5014011 +:10A48000C08F0040C0DF00407372635C736F635F16 +:10A49000636F6E6669672E6300000000C0EF0040C6 +:10A4A000C0FF0040C0BF0040FEFF0FFC80E100E0A5 +:10A4B00080E200E000ED00E000E400E03801002070 +:10A4C00070B5002402460D4620462146002A1ED0C3 +:10A4D000012A04D0022A04D0032A1ED103E001205D +:10A4E00002E0022013E003202B0000F009FF071612 +:10A4F0000507090B0D0F1600012108E0022106E0F7 +:10A50000032104E0042102E0052100E00621F2F726 +:10A5100094FA002801D0204670BD0724FBE7000014 +:10A52000B348002101708170704770B5B14D0123AF +:10A530006B60B14B1C68002CFCD0002407E00E6857 +:10A5400006601E68002EFCD0001D091D641C94428C +:10A55000F5D30020686018680028FCD070BD70B585 +:10A56000A34C0E466178884203D0A4A16F2000F06E +:10A57000A6FD0325330000F0C3FE09520624245231 +:10A580005252524952002078022803D09BA17320D6 +:10A5900000F095FD2570A078022802D0012804D093 +:10A5A00008E0A068E8F70EFD04E02046083007C880 +:10A5B000FFF7BBFF0020A070F2F7E0F90420207045 +:10A5C00070BDF2F790FA01466068F3F7A5FC064605 +:10A5D0002078022803D089A1872000F070FD8B4AE3 +:10A5E0008B498C48964205D86269032A02D2521CD4 +:10A5F000626102E0864207D84D71801BC8608449C1 +:10A600006078F2F7E7FE70BD032003E0A078002831 +:10A61000FAD10220F2F7BAF800F0E1F870BD77A1A4 +:10A62000B12000F04CFD70BD70B50546F2F75BFA45 +:10A630006F4C60602078012803D070A1B82000F032 +:10A640003EFD73490220087000220A718D600422C9 +:10A650004A71704ACA6020706078F2F7BBFE70BD24 +:10A6600010B5634CA078002802D12078002801D0D2 +:10A67000112010BD6848F2F7C7F9607060780028B3 +:10A6800004D0012020700020606110BD032010BDA7 +:10A6900010B50124020B64040121604BA04202D2D8 +:10A6A0009140186802E0203A58689140084000D074 +:10A6B000012010BDF8B50E46910005464F1914460D +:10A6C0003F1F0091E8F78FFC009980028919091F4C +:10A6D000B14201D2012200E00022002C03D0FF2170 +:10A6E00001318C4201D90920F8BD4D498D4219D361 +:10A6F000AF4217D3854205D2874203D22846304362 +:10A70000800701D01020F8BD8E420BD3002A09D15A +:10A710002846FFF7BDFF002804D13846FFF7B8FFF1 +:10A72000002801D00F20F8BD3E483F49006888420C +:10A7300005D0224631462846FFF7F7FE0FE0FFF727 +:10A740008FFF0028EFD12A480121C660856004618F +:10A7500081702046302148431830FFF765FF002004 +:10A76000F8BD10B504462E48800A84420BD3E8F7A2 +:10A770003AFCA04201D8102010BDA0020446FFF709 +:10A7800087FF002801D00F2010BD26482649006809 +:10A79000884203D02046E8F715FC0AE0FFF760FF87 +:10A7A0000028F1D112480221846081701F48FFF710 +:10A7B0003BFF002010BD1A48010B01208840401EBD +:10A7C000704700B50B460246FFF7F5FF104201D077 +:10A7D0000F2000BD114802604360002000BD10B58D +:10A7E000034C6078F2F764F900202070A07010BD6F +:10A7F0003C01002000E5014000E401407372635C0D +:10A80000736F635F666C6173682E63003075000060 +:10A81000D0210020D0FB01005FA501000006004010 +:10A8200000D0010064000020BEBAFECA3A56000003 +:10A83000F74805218170002101704170C17081606D +:10A84000704710B5F3490A78022A07D0CA68101871 +:10A85000C860C8689638F3F718FB10BD8A681018EE +:10A8600088608868F6E70378EB49EC4A002B02D051 +:10A87000012B10D014E00379002B01D0012B0FD154 +:10A880004379002B01D0012B0AD18368643B8B42B2 +:10A8900006D2C06810E00379002B03D0012B01D051 +:10A8A000002070474379002B01D0012BF8D1C368F9 +:10A8B000643B8B42F4D280689042F1D8012070470B +:10A8C000F8B504460226F2F76DFF0068002803D0B1 +:10A8D000D3A1BD2000F0F3FB0127CD4D002C08D003 +:10A8E0002078002817D0012805D0022811D003288D +:10A8F00013D02F710DE06068C82808D3F3F73AFB36 +:10A90000002804D06068FFF79CFF012603E00026C2 +:10A9100001E000F0F9F93046F8BD28780028F8D1B8 +:10A920006068FFF7A0FF0028E3D060680078002887 +:10A9300026D0A878042803D0B9A1F72000F0BFFBE7 +:10A94000B44F0020387060680079012800D00020E2 +:10A95000387160684079002837D0042078716068C9 +:10A960008168E868F2F751FBB8606068C0689630AB +:10A97000F8600320A870A749E878F2F72BFDC8E734 +:10A98000A4480221017061680979012919D00021C8 +:10A99000017161684979002915D00421417161680C +:10A9A0008968963181606168C968C160C068984CE7 +:10A9B00014346060F2F797F820606F700220A8707E +:10A9C000A7E70321E4E70321E8E70320C6E7F8B59A +:10A9D0008F4C0D46E178884204D0FF2090A11930B9 +:10A9E00000F06DFB28468A4F00250126143703002E +:10A9F00000F086FC090612375A7C8D97C4A0C4006B +:10AA0000A078032807D0A078022804D0FF2084A1D2 +:10AA10001D3000F054FBF8BDA078032807D0A078C3 +:10AA2000022804D0FF207EA1213000F048FB042042 +:10AA3000A07025712078002810D1FFF702FFE07880 +:10AA4000F2F70AFBE0607D49886A7D4A0240226194 +:10AA50007B4AD24310408862002050E000F054F955 +:10AA6000F8BDA078032807D0A078022804D0FF20E2 +:10AA70006BA1423000F023FB2078002802D000F0C8 +:10AA80004FF9F8BDA07803281FD104202AE0091A45 +:10AA90006048C1600146E078F2F79CFCF8BD0420F4 +:10AAA000F1F774FEA570F8BDA078032807D0A07850 +:10AAB000022804D0FF205AA1633000F000FB207868 +:10AAC0000028DCD1A07803280BD0F2F70CF801465F +:10AAD0003868F3F721FA0028E1DB79688142DEDB90 +:10AAE000D5E70520F1F752FEA670F8BDA07804283E +:10AAF00004D0FF204AA1843000F0E1FA0220A168CE +:10AB00008847FFF7DDFEFF260546BD3642E0A07808 +:10AB1000042804D0FF2042A1893000F0D0FA01209F +:10AB2000EDE7A078042899D0FF203DA18E3000F0F9 +:10AB3000C6FA93E7A07804280AD06078002802D0EB +:10AB4000A078022804D0FF2035A1933000F0B7FA96 +:10AB50002078002893D12079002804D00620F1F72E +:10AB600015FE2571C0E76078002805D02949E078F6 +:10AB7000F2F730FC6570F8BD0720B3E7FF2028A18D +:10AB8000AE3046E7002D0AD0012D06D024A1304674 +:10AB900000F095FA022DF5D1F8BD042000E0032065 +:10ABA000A1688847FFF78CFE0546F3E770B50500FE +:10ABB00005D0174CA078052803D0112070BD1020B7 +:10ABC00070BD2048F1F720FFE070E078002803D046 +:10ABD000A5600020A07070BD032070BD10B50C48AA +:10ABE0000178002901D0112010BD817805292BD0D2 +:10ABF000817801292AD08178002927D0012101708C +:10AC00008178012922D0807800281FD020E0000020 +:10AC100054010020E02100203D860100FF1FA10714 +:10AC20007372635C736F635F726164696F5F746991 +:10AC30006D65736C6F742E630000000000050040AA +:10AC400002810000CFA901000F2010BD00F068F8BC +:10AC5000002010BDF8B5394E0446B078002801D068 +:10AC600001280DD1002C0DD02046FFF7FCFD002857 +:10AC70000AD02078324D002808D0B078012823D09F +:10AC80000F20F8BD1020F8BD0720F8BD02272F7057 +:10AC90002079012814D0002028716079002811D073 +:10ACA00004206871A0689630A860E068E860E868F1 +:10ACB000224C14346060F1F716FF2060B77019E081 +:10ACC0000320E9E70320ECE7002028702079012821 +:10ACD00016D0002028716079002813D004206871F4 +:10ACE000A168F068F2F791F9A860E0689630E86032 +:10ACF0000320B0701249F078F2F76CFB0020F8BD29 +:10AD00000320E7E70320EAE710B50E48816A0E4A00 +:10AD100011400A4A126911438162F1F72FFE10BDFA +:10AD200010B5064CE078F1F7C3FE0820F1F72EFDD0 +:10AD30000520A07000202070607010BD540100201C +:10AD4000E021002000050040FD7EFFFF70477047B6 +:10AD5000034610B50B439B070FD1042A0DD308C837 +:10AD600010C9121FA342F8D018BA21BA884201D9DB +:10AD7000012010BD0020C04310BD002A03D0D3071E +:10AD800003D0521C07E0002010BD03780C78401C53 +:10AD9000491C1B1B07D103780C78401C491C1B1B4A +:10ADA00001D1921EF1D1184610BDF8B5042A2CD35A +:10ADB000830712D00B78491C0370401C521E830776 +:10ADC0000BD00B78491C0370401C521E830704D023 +:10ADD0000B78491C0370401C521E8B079B0F05D03B +:10ADE000C91ADF002023DE1B08C90AE0E6F7ECF9E8 +:10ADF000F8BD1D4608C9FD401C46B4402C4310C098 +:10AE0000121F042AF5D2F308C91A521EF0D40B7887 +:10AE1000491C0370401C521EEAD40B78491C037075 +:10AE2000401C012AE4D409780170F8BD01E004C097 +:10AE3000091F0429FBD28B0701D50280801CC9079A +:10AE400000D00270704700290BD0C30702D00270F7 +:10AE5000401C491E022904D3830702D50280801CAE +:10AE6000891EE3E70022EEE70022DFE7020A08700E +:10AE70004A70020C8A70020ECA70704700220309E1 +:10AE80008B4273D3030A8B4258D3030B8B423CD3C0 +:10AE9000030C8B4221D312E003460B437FD40022E4 +:10AEA00043088B4274D303098B425FD3030A8B425E +:10AEB00044D3030B8B4228D3030C8B420DD3FF22C8 +:10AEC000090212BA030C8B4202D31212090265D096 +:10AED000030B8B4219D300E0090AC30B8B4201D349 +:10AEE000CB03C01A5241830B8B4201D38B03C01A90 +:10AEF0005241430B8B4201D34B03C01A5241030B07 +:10AF00008B4201D30B03C01A5241C30A8B4201D3B7 +:10AF1000CB02C01A5241830A8B4201D38B02C01A62 +:10AF20005241430A8B4201D34B02C01A5241030AD9 +:10AF30008B4201D30B02C01A5241CDD2C3098B42BE +:10AF400001D3CB01C01A524183098B4201D38B013B +:10AF5000C01A524143098B4201D34B01C01A5241DE +:10AF600003098B4201D30B01C01A5241C3088B4223 +:10AF700001D3CB00C01A524183088B4201D38B000E +:10AF8000C01A524143088B4201D34B00C01A5241B0 +:10AF9000411A00D201465241104670475DE0CA0F87 +:10AFA00000D04942031000D34042534000229C4647 +:10AFB00003098B422DD3030A8B4212D3FC22890151 +:10AFC00012BA030A8B420CD3890192118B4208D327 +:10AFD000890192118B4204D389013AD0921100E089 +:10AFE0008909C3098B4201D3CB01C01A524183099D +:10AFF0008B4201D38B01C01A524143098B4201D3CA +:10B000004B01C01A524103098B4201D30B01C01AF4 +:10B010005241C3088B4201D3CB00C01A524183086E +:10B020008B4201D38B00C01A5241D9D243088B42C4 +:10B0300001D34B00C01A5241411A00D20146634667 +:10B0400052415B10104601D34042002B00D54942CB +:10B05000704763465B1000D3404201B50020C046F4 +:10B06000C04602BD70477047704710B500F058F8F1 +:10B0700010BD30B58C180278401C13071B0F01D18E +:10B080000378401C120906D10278401C03E00578C1 +:10B09000401C0D70491C5B1EF9D101E00B70491C6E +:10B0A000521EFBD1A142E6D3002030BD012308CBC4 +:10B0B000134B1860134B1960134B1A607047134AF7 +:10B0C000134B13607246053AF0E7114A0F4B1B68A9 +:10B0D0009A420ED10D4B0020186001980D4B04B51B +:10B0E00098470CBC9E460246029800990A4B1B6882 +:10B0F000184706980599094B1B68DB68184700003C +:10B10000780100207C0100208001002070010020D7 +:10B11000EFBEADDE4D2F000098000020040000209F +:10B120001D481E497047FFF7FBFFE6F707F800BD13 +:10B1300001200007C06AC0B2FF2804D1184819498D +:10B140000968884202D0184818490160184819490E +:10B150000968884203D1184A13605B68184700BD2C +:10B1600020BFFDE712481349096888420ED1134BEE +:10B1700018680B498842F3D080F308881049884248 +:10B1800004DD1048026802210A4302600E4880472D +:10B190000E4880470E480047F0210020F021002093 +:10B1A000FFFFFFFF001000102C050040080000000A +:10B1B00000100000000000200400002000D001006A +:10B1C0000020002024050040632F000031B1010061 +:10B1D000ADB001001348704502D1EFF3098101E0E1 +:10B1E000EFF30881886902380078102814DB2028E2 +:10B1F00010DB2B280BDB0C4A12680C4B9A4203D154 +:10B20000602804DB0A4A1047022008607047094A98 +:10B2100010470000084A1047084A12682C3212688A +:10B2200010470000FDFFFFFF64000020BEBAFECA09 +:10B23000AD1200009D1F01001F1F0100040000202F +:10B240000D4B0E4908470E4B0C4908470D4B0B4957 +:10B2500008470D4B094908470C4B084908470C4B58 +:10B26000064908470B4B054908470B4B034908475C +:10B270000A4B024908470000B12500005122000096 +:10B28000D52B0000772A0000252A0000D7270000D0 +:10B29000B912000017140000392B000047230000EA +:10B2A0000A7802704B7843708A788270CA78C270CC +:10B2B0000B79037170470A7802704B7843708A7873 +:10B2C0008270CA78C2700B7903714A7942717047F3 +:10B2D0000A7802704B7843708A788270CA78C2709C +:10B2E0000B7903714A7942718A798271CB79C37182 +:10B2F00070470A8802804A8842800A790271704742 +:10B3000030B47446641E2578641CAB4200D21D46DE +:10B31000635D5B00E31830BC18470000FFFFFFFFD0 +:10B320000000FFFF0100030000000100000000001A +:10B330000000000000000000000000008700000086 +:10B3400000000000000000000000000000000001FC +:10B35000020304000D0E0F10000000000F69000032 +:10B360002D6B0000F56B00004F6C0000A36C00001B +:10B370000B6D000069690000216A0000AD6D0000DE +:10B38000BB790000100110013A0200001A0200000F +:10B39000040104013C00170044000E00F401FA000F +:10B3A000960064004B0032001E00140001020408E5 +:10B3B00010204080555555252627D6BE898E5555D7 +:10B3C00055D6BE898E0000007006120DB413000021 +:10B3D00014035A06A00900006004F208840D00005E +:10B3E00010B401000800002010000000041100004B +:10B3F00020B40100180000206C01000072B00100B0 +:10B4000040B40100840100206C20000020110000E5 +:10B41000024801688907FCD57047000000E200E09F +:10B4200001353601000100543720FB349B5F80B4A6 +:10B43000800010026801337F0102A029E4B1B0014D +:00000001FF From 8130301af623338e71c7b053c8163679e8962d11 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Wed, 29 Apr 2015 10:22:50 +0100 Subject: [PATCH 15/24] switch from s130-alpha to s130v1.0 --- .../TARGET_MCU_NORDIC_16K/nRF51822.sct | 4 +- .../TARGET_MCU_NORDIC_32K/nRF51822.sct | 4 +- .../TARGET_MCU_NORDIC_16K/NRF51822.ld | 2 +- .../TARGET_MCU_NORDIC_32K/NRF51822.ld | 2 +- .../s130_nrf51_1.0.0-3.alpha_softdevice.hex | 6851 ---------------- .../s130_nrf51_1.0.0_softdevice.hex | 6861 +++++++++++++++++ 6 files changed, 6867 insertions(+), 6857 deletions(-) delete mode 100644 libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex create mode 100644 libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0_softdevice.hex diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct index 799bc9f68d0..212c545f250 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K/nRF51822.sct @@ -12,8 +12,8 @@ ; ;WITH SOFTDEVICE: -LR_IROM1 0x1D000 0x0023000 { - ER_IROM1 0x1D000 0x0023000 { +LR_IROM1 0x1C000 0x0024000 { + ER_IROM1 0x1C000 0x0024000 { *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct index adf992cc7dd..cbbea83ae78 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct @@ -12,8 +12,8 @@ ; ;WITH SOFTDEVICE: -LR_IROM1 0x1D000 0x0023000 { - ER_IROM1 0x1D000 0x0023000 { +LR_IROM1 0x1C000 0x0024000 { + ER_IROM1 0x1C000 0x0024000 { *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld index af6c21698e1..c334dbb3cd8 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_16K/NRF51822.ld @@ -2,7 +2,7 @@ MEMORY { - FLASH (rx) : ORIGIN = 0x0001D000, LENGTH = 0x23000 + FLASH (rx) : ORIGIN = 0x0001C000, LENGTH = 0x24000 RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x1800 } diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld index eea7ec83891..0b9c664fc41 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld @@ -2,7 +2,7 @@ MEMORY { - FLASH (rx) : ORIGIN = 0x0001D000, LENGTH = 0x23000 + FLASH (rx) : ORIGIN = 0x0001C000, LENGTH = 0x24000 RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x5800 } diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex deleted file mode 100644 index 859c9e344b0..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0-3.alpha_softdevice.hex +++ /dev/null @@ -1,6851 +0,0 @@ -:020000040000FA -:10000000C0070000D1060000D1000000B1060000CA -:1000100000000000000000000000000000000000E0 -:100020000000000000000000000000005107000078 -:100030000000000000000000DB000000E500000000 -:10004000EF000000F9000000030100000D010000B6 -:1000500017010000210100002B0100003501000004 -:100060003F01000049010000530100005D01000054 -:1000700067010000710100007B01000085010000A4 -:100080008F01000099010000A3010000AD010000F4 -:10009000B7010000C1010000CB010000D501000044 -:1000A000DF010000E9010000F3010000FD01000094 -:1000B00007020000110200001B02000025020000E0 -:1000C0001FB5C046C04600F0EFFA04B00FB41FBD24 -:1000D00008205A49096809580847382057490968CB -:1000E000095808473C2055490968095808474020E5 -:1000F0005249096809580847442050490968095875 -:10010000084748204D490968095808474C204B4981 -:10011000096809580847502048490968095808479C -:100120005420464909680958084758204349096836 -:10013000095808475C204149096809580847602068 -:100140003E4909680958084764203C49096809582C -:100150000847682039490968095808476C20374919 -:100160000968095808477020344909680958084740 -:100170007420324909680958084778202F490968CE -:10018000095808477C202D490968095808478020EC -:100190002A490968095808478420284909680958E4 -:1001A0000847882025490968095808478C202349B1 -:1001B00009680958084790202049096809580847E4 -:1001C00094201E4909680958084798201B49096866 -:1001D000095808479C201949096809580847A02070 -:1001E0001649096809580847A4201449096809589C -:1001F0000847A8201149096809580847AC200F4949 -:10020000096809580847B0200C4909680958084787 -:10021000B4200A49096809580847B82007490968FD -:1002200009580847BC2005490968095808470000D3 -:1002300003480449024A034B7047000000000020B5 -:10024000C0070000C00700000122D84B5A6000BF61 -:10025000D74A1268002AFBD0016000BFD44A126856 -:10026000002AFBD00022D14B5A6000BFD04A12684E -:10027000002AFBD07047F0B505460E46174600240D -:1002800006E0A200B158A2005019FFF7DDFF641C80 -:10029000BC42F6D30020F0BD0120C043C549086030 -:1002A000401048607047014601229204086890425D -:1002B00001D9102070470020FCE7F0B505460C4638 -:1002C0001646002706E028462168FFF7BDFF2D1DD2 -:1002D000241D7F1CB742F6D3F0BD70B505460C4611 -:1002E0002E460BE0304600F075F9FF2C01D80024B3 -:1002F00001E0FF3C013C012080023618002CF1D1C6 -:1003000070BD0146012212044868904201D90920BB -:100310007047A9484069401C01D10F20F8E7002030 -:10032000F6E7FEB504462068030000F037FA05043E -:100330002B4249598B00201DFFF7E3FF0546002D96 -:1003400001D02846FEBDFFF7A7FF0120C00200F044 -:1003500041F9042221469948FFF78DFF002801D07A -:100360000320EFE708222146944800F06DF90028A9 -:1003700006D1002192480068FFF766FF00F00CF9F3 -:100380000320DFE7A768E6686068019031463846D9 -:10039000FFF7A3FF324638460199FFF78EFFB20000 -:1003A0003846019900F050F9002800D1CAE703202F -:1003B000C8E700F0E3F9834800688349086041E03A -:1003C00060680190E668A0680090B200009901980A -:1003D00000F03AF90746002F00D1B3E70E20B1E74D -:1003E000201DFFF760FF0546002D01D02846A9E734 -:1003F0006068002807D1FFF74FFF0320800200F05C -:10040000E9F800F0C9F8FFF747FF0120C00200F04B -:10041000E1F8042221466948FFF72DFF002801D0AA -:1004200003208FE708222146644800F00DF90028D8 -:1004300006D1002162480068FFF706FF00F0ACF823 -:1004400003207FE700BF00207CE770B505460C461F -:10045000182D04D12068FFF764FF206002E001201E -:10046000206000BF00BF70BDF0B589B05248406940 -:1004700003905248806881000398081802900398FE -:10048000000B01900121090302984018401E000B47 -:1004900000900124002520462946019A00F0C4F866 -:1004A0000022401E91410791069001260027304608 -:1004B0003946009A00F0B8F80022401E914105919B -:1004C0000490049BDB43059AD2430698184307998E -:1004D00011430791069037490698086007984860CD -:1004E00009B0F0BD70B53448446934488568466841 -:1004F000AA003146204600F0A7F8002801D00020CD -:1005000070BD0120FCE72D484068002801D0012083 -:1005100000E000200546FFF7E5FF002807D0FFF7C1 -:10052000BBFE0320800200F055F800F035F8FFF71D -:100530009BFF002D0ED020484669204884684768FC -:1005400021463046FFF7C9FE224639463046FFF7BE -:10055000B4FE00BF00F020F810B5184844681A48EF -:100560000460204600F0DCF810BD15480068006803 -:10057000401C01D100BFFEE710480068002802D0EF -:10058000042806D101E0FFF7BEFFFFF7E5FF00BF3B -:10059000FEE700BF00BFFEE7BFF34F8F0B480C49DB -:1005A000C860BFF34F8F00BFFEE7000000E50140C9 -:1005B00000E40140000600400010001000080000A8 -:1005C000B8070000BC070000000000200400FA0586 -:1005D00000ED00E010B50146104B1A6808460223F2 -:1005E0000F4C636000BF0F4B1B68002BFBD0531CEC -:1005F00004D0904202D20A4B186101E0084B986087 -:1006000000BF084B1B68002BFBD00023044C636029 -:1006100000BF044B1B68002BFBD010BD0010001066 -:1006200000E5014000E4014010B5202A04DB01464A -:10063000203A9140002010BD914020239C1A03468F -:10064000E3401943904010BD034610B50B439B0790 -:100650000FD1042A0DD308C810C9121FA342F8D025 -:1006600018BA21BA884201D9012010BD0020C04328 -:1006700010BD002A03D0D30703D0521C07E000208E -:1006800010BD03780C78401C491C1B1B07D1037854 -:100690000C78401C491C1B1B01D1921EF1D118463D -:1006A00010BD70477047704710B500F007F810BDD7 -:1006B000014B1B68DB6818470000002019481A49E5 -:1006C0007047FFF7FBFFFFF7FBFC00BD20BFFDE716 -:1006D0001649174C24688C420BD1164B1B68994263 -:1006E0000CD1154B154A1360186810498842EDD09B -:1006F0000AE0134880F30888124B18470F4A13602A -:1007000018680A498842E1D080F308880E49884277 -:1007100004DD0E48026802210A4302605B68184744 -:100720000346DFE7C0070000C0070000FFFFFFFF30 -:10073000000C000014100010001000000000002049 -:10074000000400206B05000000200020240500406C -:100750000D48704502D1EFF3098101E0EFF3088104 -:10076000886902380078182802D1C046074A104725 -:10077000074A12682C3212681047000000B5054B7A -:10078000054A9B58984700BDFDFFFFFF4B04000042 -:1007900000000020001000000400000030B4744687 -:1007A000641E2578641CAB4204D3635D5B00E318D0 -:1007B00030BC18471D46F8E7000C00000010000090 -:10100000F021002065B101005D220000CBB001009D -:1010100000000000000000000000000000000000D0 -:10102000000000000000000000000000D5B1010039 -:1010300000000000000000005D2200005D220000B2 -:1010400041B2010047B201005D2200005D220000B4 -:101050005D2200005D2200005D2200005D22000094 -:101060004DB201005D2200005D22000053B201007C -:101070005D22000059B201005FB2010065B20100BB -:101080005D2200005D2200005D2200005D22000064 -:101090005D2200005D2200005D2200005D22000054 -:1010A0006BB2010071B201005D2200005D22000000 -:1010B0005D2200005D2200005D2200005D22000034 -:1010C00000F002F81AF02FF80CA030C808382418E5 -:1010D0002D18A246671EAB4654465D46AC4201D170 -:1010E0001AF021F87E460F3E0FCCB6460126334259 -:1010F00000D0FB1AA246AB4633431847E4A20100D6 -:1011000014A30100103A02D378C878C1FAD8520764 -:1011100001D330C830C101D504680C6070470000AD -:101120000023002400250026103A01D378C1FBD803 -:10113000520700D330C100D50B6070471FB5C046C1 -:10114000C04619F092FF04B00FB41FBDF0B4404682 -:10115000494652465B460FB402A0013001B506482D -:10116000004700BF01BC86460FBC804689469246B8 -:101170009B46F0BC70470000C11000008269024924 -:101180008161024810447047911100000100000085 -:1011900001B41EB400B501F000FF01B40198864609 -:1011A00001BC01B01EBD0000401E00BF00BF00BF5B -:1011B00000BF00BF00BF00BF00BF00BF00BF00BF37 -:1011C00000BFF1D17047000070B505460C461646C9 -:1011D00002E00FCC0FC5103E102EFAD2082E02D31B -:1011E00003CC03C5083E042E07D301CC01C5361F2E -:1011F00003E021782970641C6D1C761EF9D270BD45 -:101200008307FF22DB0E9A408907090E99400028C8 -:101210000BDA0007000F0838830828489B001818CD -:10122000C36993430B43C3617047830824489B0001 -:101230001B181868904308431860704710B504469F -:1012400000210120FFF7DCFF00211820FFF7D8FF65 -:1012500000210B20FFF7D4FF02211920FFF7D0FF58 -:1012600002210D20FFF7CCFF02210E20FFF7C8FF5F -:1012700002210F20FFF7C4FF0221C81FFFF7C0FFA4 -:1012800003211620FFF7BCFF03211520FFF7B8FF4D -:10129000204600F019F8002010BD6621018070473B -:1012A00010B500F020F810BD0648704710B500F0EA -:1012B00022F810BD704770477047000000ED00E055 -:1012C00000E400E003F9004370B505462D4C08200A -:1012D0002070A01CFFF7E1FF5920A080294620467E -:1012E00000F0B3FB70BD10B500F0B8FB254900203D -:1012F000891E087010BDF8B5224E0446B61E30781F -:1013000001270D46002807D0204660380B2808D852 -:10131000204600F059FF2BE0602CF9D01A480860F5 -:10132000F8BD20466C38032803D8204600F08DFF16 -:101330001EE0204670381F2803D8204600F047F9E9 -:1013400016E0204690380F2803D8204600F0EAF82F -:101350000EE02046A0380F2803D8204600F076F88B -:1013600006E02046B0380F2804D8204600F0E2F905 -:10137000286000E02F60602CD2D128680028CFD1EF -:101380003770F8BD1A000020013000000120254907 -:10139000C003086024490020087007202349C005C5 -:1013A0008860704770B5204D04462878A04207D069 -:1013B000002C05D0002803D01DA14D2019F07FFE80 -:1013C0002878A0420ED000211E4A18482C70002C0C -:1013D0001BD01D4B012C06D0022C0DD014A168206F -:1013E00019F06DFE70BD116002211160536103217F -:1013F00009068160416070BD116003211160536175 -:101400000121C9058160416070BD11601160072133 -:10141000C905816070BD10B505A1712019F04FFE9E -:1014200010BD000080E100E02000002000F5014038 -:101430007372635C68616C5F63636D5F6161722E80 -:101440006300000000F500408401002010B5A038C2 -:10145000030019F055FF0B070E172028313A414BB6 -:10146000525C65004B6808788A68194603F0D9F920 -:1014700010BD88888A6883B20888194680B203F054 -:10148000DFF910BD08884C68CB688A6880B22146B5 -:1014900003F0DAF910BD08884B688A6880B21946F3 -:1014A00003F0EEF910BD88888A6883B2088819466F -:1014B00080B203F0FAF910BD88888A6883B2088880 -:1014C000194680B203F034FA10BD08884A6880B229 -:1014D000114603F073FA10BD088982B2888883B27E -:1014E0000888194680B203F074FA10BD08884A686B -:1014F00080B2114603F091FA10BD08894C6882B29F -:101500000888CB6880B2214603F00AFB10BD08882A -:101510004C68CB688A6880B2214603F01BFC10BD82 -:10152000012010BD10B59038030019F0E9FE09063E -:101530000F161D242C363F464E0088888A6883B2D9 -:101540000888194680B204F01DF910BD08884A6861 -:1015500080B2114604F051F910BD08884A6880B283 -:10156000114604F056F910BD08884A6880B2114649 -:1015700004F05CF910BD08884B688A6880B219468F -:1015800004F067F910BD088982B2888883B20888A0 -:10159000194680B204F066F910BD08894B6882B222 -:1015A0000888194680B204F07CF910BD08884A68A2 -:1015B00080B2114604F087F910BD888882B208888D -:1015C000114680B204F0DBF910BD012010BD10B54A -:1015D0007038030019F094FE1B0F15192125282FD0 -:1015E000363B4044484C53585F68707881889095EA -:1015F000999CA2A5AC004A680878114607F017FC30 -:1016000010BD086807F064FC10BD0C790B7B8A687C -:101610000868214607F06DFC10BD086807F0FEFC65 -:1016200010BD07F08AF910BD08884A6880B21146DB -:1016300007F032FE10BD0A790888114680B207F023 -:10164000C2FE10BD087840B207F0CBFE10BD08887E -:1016500080B207F0DFFE10BD086807F0EDFE10BD98 -:10166000086801F0ECFB10BD086801F016FC10BD25 -:10167000088982B209C9194607F0F6FE10BD05C9EE -:10168000114607F040FF10BD08884A6880B2114635 -:1016900009F002FA10BD0C790888CB688A6880B21C -:1016A000214609F0C4FA10BD0B7908888A6880B217 -:1016B000194609F074FC10BD08884B688A6880B22E -:1016C000194609F0E5FC10BD08884C68CB688A68AB -:1016D00080B2214609F04AFD10BD08884A6880B2F0 -:1016E000114609F083FD10BD0B7908880A7A80B293 -:1016F000194607F02BFF10BD088880B207F02BFFBA -:1017000010BD086807F02EFF10BD07F0FAF810BDF5 -:101710008A6809C9194607F08AFF10BD07F0DAF890 -:1017200010BD08884A6880B2114608F059F810BD0B -:10173000012010BD10B5B02805D0B12808D0B228BE -:101740000BD0012010BD088880B20AF04EF910BD00 -:10175000088880B20AF068F910BD08884B688A686A -:1017600080B219460AF071F910BD000010B50300EF -:1017700019F0C6FD0A0609060C0C0F0F0606061224 -:1017800007F003F910BD09F01FFF10BD01F042FA88 -:1017900010BD06F075FA10BDFAA1FE4819F08FFCD5 -:1017A00010BD7FB5FC49054603C901900291132085 -:1017B000800169468881F94A0F2310460A2128389A -:1017C0000AF03BFE0024F6480AF055FE641CE4B221 -:1017D0000A2CF8D304200090F04801231A4603A9EC -:1017E000F0300AF055FA002804D0FF20E5A153306C -:1017F00019F065FC686800F024FC00211E220846F0 -:1018000004F040F907F0C4FA02222421E54801F06F -:101810007FFBE44801222C214C3001F079FBE149A7 -:101820000B20B03901F000FA002804D0FF20D5A128 -:10183000673019F044FC09F097FE02F075F901AB2E -:1018400000220821D8A007F083F9002804D0FF2047 -:10185000CCA16D3019F033FC284602F0C2FC002800 -:1018600004D0FF20C7A16F3019F029FCDB218900CB -:10187000D04819F0F9FACF48012141710221817154 -:101880000621C1717FBD10B5CA4CA078092804D3C8 -:10189000FF20BCA1A73019F012FC2078602148433A -:1018A000001900210173417BF722C908C900C91C36 -:1018B0001140EF22114041730121E1700C3010BD45 -:1018C00070B50E4600211C4619801546030019F01C -:1018D00017FD0723050B1711231D23002246294658 -:1018E000304609F08EFE70BD22462946304606F08D -:1018F00096FE70BD22462946304601F0C2FF70BDFB -:1019000022462946304603F0C0FD70BD22462946D6 -:10191000304600F010FC70BD9E489AA1D53819F0F1 -:10192000CEFB032070BD70B5A24CE078002818D023 -:101930002078602148430019407B00254007400F74 -:1019400001190879401E08712078401CC0B220702F -:10195000092800D12570A078401CA0700AF011FF62 -:10196000E57070BD9348C079002800D08BE77047C0 -:1019700070B5904DA86800280CD0FFF7F3FF002841 -:1019800062D06022A968FFF71FFCFFF7CCFF0020A0 -:10199000A860EFE76879002856D0FFF774FF044687 -:1019A00080484C3001F0C4FA6060002804D1C9209E -:1019B00074A1800019F083FB60680AF0E2F8002847 -:1019C0000DD0204606F00FFD6078010703D5C00852 -:1019D000C000401C2BE0734861684C302DE071481A -:1019E00061684C3001F0ADFA00F05AFB00282BD1B1 -:1019F000FFF749FF04466B4801F09AFA606000283F -:101A000004D164485FA16D3019F059FB60680AF099 -:101A1000BCF8002814D0606800886080204609F077 -:101A200023FE6078010706D5C008C000801C6070E6 -:101A3000FFF779FF9EE75B48616801F082FA99E75A -:101A40005848616801F07DFA70BD10B55A4CE160EC -:101A5000A0605A4800F034FC607010BD5649002068 -:101A60000870704770B5564E0546706A94B00C46C3 -:101A7000401C04D1B06AC0430004000C0BD0306A93 -:101A8000C007C00F2870706A19F0F0F9B06A2071B1 -:101A9000000A607114E02B206946087009A96846A5 -:101AA0000AF043F8002804D0972036A1800019F0EE -:101AB00006FB0120287006220AA9204619F075F9B4 -:101AC0002878002803D06079C0210843607114B0E1 -:101AD00070BDF0B53A4C0646206895B00D463746C5 -:101AE0000837401C08D16068401C05D1A068401C24 -:101AF00002D1E068401C11D02068314619F0B6F9D7 -:101B00006068311D19F0B2F9A068394619F0AEF9D4 -:101B1000E06831460C3119F0A9F925E02B2069461F -:101B2000087009A968460AF000F8002804D019488E -:101B300014A1553819F0C3FA08220AA9304619F041 -:101B400034F92B206946087009A9684609F0EDFFB1 -:101B5000002804D0A3200BA1800019F0B0FA0822BD -:101B60000AA9384619F021F920692E460836401C8A -:101B700029D16069401C26D1A069401C23D1E069AD -:101B8000401C1FE07372635C686F73745F636F72F5 -:101B9000652E6300DA0200001CB30100D8010020AA -:101BA0006D170000A40B00206E52463531383232DA -:101BB00000000000880700202400002071190000A8 -:101BC0008000001012D02069294619F04FF9606991 -:101BD000291D19F04BF9A069314619F047F9E06960 -:101BE00029460C3119F042F915B0F0BD2B24684696 -:101BF000047009A909F099FF002803D0F649F748B5 -:101C000019F05DFA082209AF28460AA919F0CDF8A3 -:101C10006846047009A909F088FF002804D0EF483D -:101C2000ED49C01D19F04BFA0822391D304619F054 -:101C3000BCF8D9E770B5EA4C0546A068002804D086 -:101C40000320E549000219F03AFAA56070BD10B50D -:101C50000146E44801F075F9E1498879401CC0B2B9 -:101C60008871012803D1E048407800F04DFB10BD99 -:101C700070B50446DD4816460D46814204D1D7486A -:101C8000D549CB3019F01BFA012E05D0E120D249FD -:101C9000800019F014FA70BD6620207000202072B8 -:101CA000A5810120A07370BD70B515460C4606468F -:101CB000FFF758FE00280CD06621017046800121F4 -:101CC000017221680161A18881820573FFF72BFEF3 -:101CD00070BD1321304607F076FB70BDC2494968DC -:101CE000884201D210207047032101700020704704 -:101CF00070B5BD4C05462078002694B0002801D070 -:101D00000820E4E6BA4A6260954201D21020DEE67D -:101D10006868002809D00921D82804D3C31C9B086F -:101D20009B00834205D00846D1E60320400268604C -:101D30000EE0012109074B6B896B4B43AD49511AEA -:101D40000122591AD202891A814201D20421EAE7FA -:101D500000F052FF6178A0680CF042FBE068401E82 -:101D600007280BD8302269460A70887068460DF043 -:101D700044FF002802D009A80CF0EFFC2846FFF72A -:101D800010FD012020703046A1E6F8B504469648C3 -:101D90000F464068814208D3002C01D0844204D30E -:101DA000E01C80088000A04201D01020F8BD8C48C3 -:101DB0008178002911D039880091417860225143FF -:101DC0000D18287B0C350007000F3B4600222946E2 -:101DD000FFF776FD060004D015E0002038800520CE -:101DE000F8BD002C13D039880098814201D90C2607 -:101DF0000DE028783B460007000F22462946FFF7F2 -:101E00005FFD060005D00C2E01D000203880304642 -:101E1000F8BD734C6078401CC0B26070092801D1D5 -:101E200000206070A078401EA07068784107490FBC -:101E300001290ED0022906D003291AD066496E481E -:101E400019F03DF9E3E7C006E1D46868FFF7FFFE4B -:101E5000DDE7644869684C3001F073F86079401C34 -:101E6000C0B260710128D2D15F48407800F04CFACE -:101E7000CDE7E079401CE071C9E7604A10B59042B7 -:101E800009D3594A0124A4045268A04201D39042C4 -:101E900001D3914201D2102010BD00F0FEFE10BD12 -:101EA000564B10B5994209D34F4B0124A4045B68EB -:101EB000A14201D3994201D39A4201D2102010BD10 -:101EC000022803D0102801D0092010BD00F00BFF1C -:101ED0000028FAD0052010BD484B10B598420DD30C -:101EE000414B0124A4045B68A04201D3984205D36E -:101EF000994203D3002A03D09A4201D2102010BD88 -:101F000000F017FF0028FAD0072010BD10B50446D6 -:101F1000354894B04068844202D2102014B010BDFD -:101F20000F2008A9087369460BA809F0FEFD0028D8 -:101F3000F4D16846007A207068464089608068461F -:101F40008089A0800020E9E710B500290BD0264A3F -:101F50005268914202D30B68934201D2102010BD07 -:101F60008A88002A02D001F037FE10BD092010BD7A -:101F700010B5224A94B091420ED31B4A01239B0410 -:101F80005268994201D3914206D3441E1E2C41D877 -:101F9000994203D3914201D21020BFE7012837D1E3 -:101FA00008780024C007C00F002803D0032069462A -:101FB000887001E06846847038206946087009A975 -:101FC000684609F0B2FD002804D004480CA18B3803 -:101FD00019F075F82046A1E7841B0000AA02000052 -:101FE00088070020A40B002024000020FFFF000031 -:101FF00000220020000000202104000000D0010089 -:102000007372635C686F73745F636F72652E6300D5 -:10201000072083E70246203A1F2AF9D806F0FFFD81 -:102020007CE710B5604A5268914201D2102010BD81 -:102030000246203A1F2A02D806F066FE10BD07208D -:1020400010BD70B50546594C002020702046461939 -:1020500055484660E01C80088000A04204D0FF2064 -:102060005349293019F02BF801200007C06AC043FA -:102070000006000E03D14F480068401C03D04E48B4 -:102080004E49301AC862A8B20422214604F00DF964 -:10209000002804D0FF204649393019F010F870BDEF -:1020A000F0B595B03B2008A9087369460BA809F064 -:1020B0003CFD002804D0FF203D49813018F0FFFF8F -:1020C0003F4E00246D4630E02F19B87DC10706D081 -:1020D000400704D460004019C08809F0E1FB39488A -:1020E000807900281FD0B87D80071CD5600040197A -:1020F000C0880022062109F0EFFB002813D03C2104 -:1021000008A8017360004019C1886846C185694606 -:102110000BA809F00AFD06000BD0FF2024499630D9 -:1021200018F0CDFF05E0641CE4B268460079A042D7 -:10213000CAD8304658E5F7B50546007800270009AB -:102140000C463E46062804D0FF201949BF3018F03F -:10215000B6FF287A00280ED0012814D0FF20144999 -:10216000E03018F0ACFF0298002C068001D02780E8 -:1021700066800020FEBD02270926002C10D0A88909 -:10218000A080A87B0AE003271426002C08D06888CA -:10219000A0802869E060A88A2082287B2072E2E77C -:1021A00002980680E5E700002400002000220020BD -:1021B000002000000010001000000020000500407A -:1021C000043000008807002010B56038030019F0C3 -:1021D00097F80A060A0F13181F252930353A0868A0 -:1021E000FFF786FD10BD05C91146FFF7CEFD10BDF6 -:1021F0000868FFF773FD10BD05C91146FFF73DFEE6 -:1022000010BD4B6808788A681946FFF749FE10BD73 -:102210008A6809C91946FFF75FFE10BD0868FFF715 -:1022200075FE10BD08884A6880B21146FFF78CFE23 -:1022300010BD05C91146FFF79BFE10BD05C911462B -:10224000FFF7EFFE10BD012010BD01207047000018 -:102250000E4A12680C498A420AD118470B4A126882 -:10226000094B9A4204D101B500F08EFE03BC8E46A4 -:10227000074909680958084706480749054A064BAF -:102280007047000000000000BEBAFECA64000020D3 -:1022900004000020F0210020F021002001203F490F -:1022A000400608603E4908603E490A68FF231B0259 -:1022B0009A4383121A430A6038498039086070478C -:1022C00010B502460420384904E0C3005B181B79AE -:1022D000002B0AD00346401EC0B2002BF5D133A11B -:1022E000432018F0ECFEFF2010BDC300CA500022AE -:1022F00059184A718A7101220A7110BD2A4A0021B7 -:10230000C00080180171704710B50446042803D33B -:1023100026A1522018F0D3FE2348E1000C182079A2 -:10232000012803D021A1532018F0C9FE6079A179BA -:10233000401CC0B2814200D06071012017494006A4 -:102340008031086010BD70B5164804250068164E2F -:102350000004800F1B4C02281AD014A1692018F029 -:10236000AEFE15E02078C10088190279012A07D154 -:10237000427983799A4203D04279827170588047BA -:102380002078401CC0B22070042801D300202070A7 -:1023900028466D1EEDB20028E4D170BD80E100E05A -:1023A00080E200E018E400E0200C00207372635C1F -:1023B000736F635F7369676E616C6C696E672E63C0 -:1023C000000000003400002010B5EFF31080C407B7 -:1023D000E40F72B6D2484178491C41704078012818 -:1023E00001D10AF0F3F9002C00D162B610BD70B52E -:1023F000CB4CE07800280AD10125E570FFF7E4FF17 -:102400000AF0ECF9002804D000200AF0BFF90020FF -:1024100070BDC44865714560F9E770B5EFF3108091 -:10242000C507ED0F72B6BE4C6078002803D1BEA17F -:102430008F2018F044FE6078401E6070607800289D -:1024400001D10AF0C7F9002D00D162B670BD10B5F8 -:10245000B348C178002904D000214171C170FFF751 -:10246000DCFF002010BD10B504460AF0B7F9AC49F6 -:10247000C978084000D001202060002010BDF8B5C8 -:102480000246A74C0026A67108200421012510272A -:10249000130018F035FF0D080A0C0E101214161E4A -:1024A000262123252800257122E0022001E0217148 -:1024B0001EE020711CE027711AE02020F9E70126B8 -:1024C00016E0FFF781FF0AF089F90028FBD0022609 -:1024D0000EE02171A5710BE02771FBE7202000E0E1 -:1024E00040202071F6E7FF208FA1763018F0E7FD3D -:1024F0000AF080F9002809D00AF082F9B04205D12B -:1025000030460AF080F90028FAD02CE0012080073C -:10251000C560894900224A60884A9661814B02223F -:102520005A60856086480269D243D206D51702698F -:1025300010231A4302610F466D1C00E020BF78682B -:102540000028FBD030460AF05EF90028FAD0002DB2 -:1025500004D17B48026910218A430261714902203B -:10256000886000207860A07900280CD00AF036F945 -:1025700005460AF093F8734A002D02D0A260E0608D -:1025800001E0E260A060002E01D100F0A5F8F8BDE6 -:1025900010B504460AF028F9002805D0604901204A -:1025A000C8704A78521C4A702046FFF768FF10BD79 -:1025B000F8B5614DA8680026012802D1AE600AF086 -:1025C000E5F86868012800D16E6028680127544C3E -:1025D000012812D12E606079002803D000200AF073 -:1025E000D5F866712078002807D00AF0F7F800289F -:1025F00003D0012080070761A770286901282AD12C -:102600002E6100F05FF8012080074761A079002863 -:1026100015D00AF0E3F800900AF040F8009900297C -:1026200001D0E16800E0A168411A022901DA8A1CA0 -:1026300011DC0099002901D0E06000E0A060FFF704 -:10264000C3FE0AF0CBF8002804D001208007076100 -:10265000A77000E02770E868012812D100F032F876 -:1026600000F030F800F02EF8A078002804D1FF2008 -:102670002DA1033018F023FDEE60A6702670FFF741 -:10268000CCFEF8BD10B5264CE078002801D10AF048 -:10269000A1F801208107886100F014F8A0780028D3 -:1026A0000BD0254CE068002803D10AF0ACF80028D4 -:1026B000F8D10020E06000F005F800201949C0437F -:1026C000886010BD08B55020694608806A461088A9 -:1026D000411E1180FAD208BDF8B51248192787604B -:1026E000154900200860C8600AF078F8BE07012488 -:1026F0000B4D002802D03461AC7000E02C70FFF765 -:1027000063FE084847600D4928798863FFF7DAFFC0 -:10271000B461FFF7D7FF0849002008617461F8BD74 -:1027200038000020000300407372635C736F635FC6 -:10273000636C6F636B2E6300000100400005004076 -:1027400000ED00E0FFFFFF7F8107C90E002808DAD7 -:102750000007000F083880082E4A80008018C069E2 -:1027600004E080082C4A800080180068C8400006F9 -:10277000800F704710B50D20FFF7E6FFC4B20420AC -:10278000C043FFF7E1FFC0B2844203D023A11A2067 -:1027900018F095FC26490120486010BD0121254A0A -:1027A00048031060244B00221A60244A5160244AD6 -:1027B0001060244A11601F49803908607047012168 -:1027C0001C4A480310601F4A51601B4A00211160D7 -:1027D0001B490860704710B517490868012804D0E4 -:1027E0000EA1572018F06BFC10BD11488068002224 -:1027F000C0B20A6009F0B6FC10BD10B50E48016801 -:102800000029FCD0FFF7E7FF01200D4940030860D5 -:1028100010BD000000ED00E000E400E07372635CB6 -:10282000736F635F68616C5F726E672E6300000098 -:1028300000D5004080E100E000D1004000D300401E -:1028400080E200E000D0004030B40121BC48C90261 -:102850000160CD1005604A030260BA4803681B029C -:102860001B0A036004680023240A24020460B6489B -:102870000468240A24020460B4480124446084608B -:10288000B34C23606360A360B24B19601D601A6093 -:10289000B14B19601A600121016030BC704710B45F -:1028A0000121A748CA0202600B0203600C06046003 -:1028B000A64841608160A94841680029FCD1A4492B -:1028C0000020086048608860A248026003600460DD -:1028D00010BC704701219F48C9020160C910016006 -:1028E0007047002805D0012805D0022805D19C4852 -:1028F00070479C4870479C48704710B59BA18B203F -:1029000018F0DDFB002010BD70B500219E4C9F4DDE -:102910009F4A8F4B002808D001281DD0022822D0C2 -:1029200092A1B32018F0CBFB70BD01200004A06081 -:10293000A86011601960974BC2039A60964A906034 -:102940007F4A0012106095480160864801609448F3 -:1029500001609448017070BD01204004A060A8602F -:102960005160596070BD01208004A060A860916032 -:10297000996070BDF8B59446834A8B4F834D00240F -:102980000126002808D0012832D0022840D077A1A3 -:10299000E82018F094FBF8BD891E0902090A0120FD -:1029A000000490603C6468606C4A1164012B1DD087 -:1029B00000217C4A7D4B51706146DC63DE637C4BB9 -:1029C0005C6002249C6004241C61744B3D311960DE -:1029D00073490E605F4B891519606F4B58605E48F4 -:1029E00001606C49C00548601670F8BD0121E0E740 -:1029F0000120704E4004704F012B04D134645060AC -:102A000068603964F8BD9060346468603964F8BD0A -:102A100001206A4E80046A4F012BF4D1EEE74F4843 -:102A20004068704770B54A4D28680026564C01280A -:102A300006D1A068C00303D501200004A0602E6069 -:102A40006868012809D1A068800306D501204004E8 -:102A5000A0606E6001200AF0AAFEA868012809D1D2 -:102A6000A068400306D501208004A060AE6002206B -:102A70000AF09DFE70BD10B54A490878002818D0AC -:102A80000120444AC0079060434AC00B90602C4A22 -:102A900000121060414A00201060324A1060404A23 -:102AA000106008704A78002A02D048700AF07FFE51 -:102AB00010BD0320FAE70120424900060860704774 -:102AC0000120244900060860704701203D49400567 -:102AD0000860704701201F4940050860704733496E -:102AE0000020C86388151B4908607047410A364AB0 -:102AF000C005C00D5043801C5143400A0818704760 -:102B000010B4324C430B63431B0C5C020C602E4C24 -:102B10006343C31A2E485C0258432B4B400D43437A -:102B2000E31A0124DB0324041B191B1613700A6823 -:102B30001018086010BC704710B50AF00BFF10BDEC -:102B400080E100E008E400E018E400E000B00040AC -:102B500040B1004080E200E000E100E000B500404C -:102B600048B100404081004044B100407372635C52 -:102B700072656D5F68616C5F6576656E745F7469C0 -:102B80006D65722E6300000000B3004040B300404A -:102B900040B5004000F50140008300404085004002 -:102BA000008200404800002000B10040C08F00407B -:102BB0000085004004B1004004B5004008B1004069 -:102BC00008B5004000E200E0093D00003786000043 -:102BD0006F0C010010B50AF0A9FE10BD00200449D9 -:102BE000C863012001218140024A116000BF704783 -:102BF000C01F004080E200E010B50DF05FF909F061 -:102C0000EFF9FEF7C3FB0FF0F7FA0DF091FF0DF0AF -:102C10001DFF10BD70B50C46054603F0A7FA21460E -:102C200028460EF0C4FF70BD70B50D46040012D0EA -:102C3000002D10D02101284618F014F91022544913 -:102C4000284618F0B2F85248012108380180448023 -:102C50004560002070BD012070BD70B54C4E002451 -:102C60000546083E11E0716820014018817BAA7B6F -:102C7000914209D1C17BEA7B914205D10C222946C0 -:102C800018F066F8002806D0641C30888442EADB1D -:102C90000020C04370BD204670BD70B50D460600D3 -:102CA0000AD0002D08D03A4C083C20886188401C8E -:102CB000884203D9042070BD102070BD3046FFF754 -:102CC000CCFF002801DB401C0AE02088616800017D -:102CD00040181022314618F068F82088401C2080E7 -:102CE0002870002070BD70B514460D001FD0002C58 -:102CF0001DD00021A170022802D0102817D108E0B1 -:102D0000687829780002084311D00121A170108051 -:102D10000BE02846FFF7A1FF002808DB401CA0704D -:102D2000687B297B000208432080002070BD0120C1 -:102D300070BD70B5054614460E000AD000203070F4 -:102D4000A878012807D004D9114908390A88904287 -:102D50000BD9012070BD002C04D028782070288861 -:102D6000000A50700220087010E0002C0CD0496856 -:102D70000001411810222046103918F016F8287862 -:102D800020732888000A607310203070002070BD06 -:102D9000540000205A4910B5884207D30121890404 -:102DA000884205D357490968884201D2102010BDD6 -:102DB0000146012005F0C9F810BD30B5044693B0B6 -:102DC00000200D46079014210BA818F04DF81C2187 -:102DD000684618F049F86A461120107700205077AD -:102DE000107802210843107007A80C90012008AA4F -:102DF000907245486A4610850AA80B902088108476 -:102E000060885084A0889084E088D084907FF921E5 -:102E10000840801C4008400090770820908610876A -:102E200008A80F9010AA0BA9684600F05CFF0028C4 -:102E300003D110A800882880002013B030BD3EB513 -:102E400004460820694608802D48844207D30120A3 -:102E50008004844205D32B480068844201D21020AC -:102E60003EBD2146012005F070F80028F8D12088E9 -:102E7000694688806088C880A0880881E088488189 -:102E800005F063FE01AB6A46002101F0BBFB694619 -:102E900009880829E4D003203EBD1FB50446002060 -:102EA000029008206946088115480391844207D39F -:102EB00001208004844206D312480068844202D272 -:102EC000102004B010BD05F040FE014602AA0F48D4 -:102ED00001F02EFD0028F4D169460989082901D0A6 -:102EE0000320EEE7694609882180694649886180A8 -:102EF00069468988A1806946C988E180E1E70000C8 -:102F000000D0010028000020042A0000FFFF00007C -:102F100010B5031D03600020521E04E05C181C6005 -:102F2000401C2346C0B29042F8DB0020186010BD60 -:102F300001460A680020002A02D0104612680A6082 -:102F4000704702680A6001607047000010B50146D2 -:102F50002022094817F029FF07490020C8770846B2 -:102F600010BD0649012048610548064A01689142A2 -:102F700001D1002101607047B00E00200005004023 -:102F800064000020BEBAFECA0C4908784A78401C8A -:102F9000C0B2904200D008707047094A074820BF6D -:102FA00040BF20BF4178037843701368002B02D1E3 -:102FB00003788B42F3D00020704700006B000020A4 -:102FC00000E200E00A4A022151600A490B68002B26 -:102FD000FCD0906008680028FCD000205060086891 -:102FE0000028FCD0704701200007406970470000AE -:102FF00000E5014000E401407047704770477047AA -:1030000010FFFFFFDBE5B15100D001006600FFFFBC -:1030100003B40148019001BD09000020002803D03D -:103020008178012939D101E0102070470188FE4ADA -:10303000881A914233D01BDCFC4A881A91422ED068 -:103040000BDC00292BD00320C002081A27D001284E -:1030500025D001210903401A07E001281FD00228CA -:103060001DD0FF281BD0FF380138002815D116E0ED -:10307000FF220132811A904211D008DC01280ED0C3 -:1030800002280CD0FE280AD0FF2806D107E001292B -:1030900005D0022903D0032901D0002070470F205A -:1030A000704700B50B2826D009DC030018F028F97A -:1030B0000B1D2125251B25292325271F1B00112832 -:1030C0001BD008DC0C2816D00D281CD00F2814D0DB -:1030D000102808D10FE0822809D084280FD0852835 -:1030E0000FD0872811D0032000BD002000BD05208F -:1030F00000BDCF4800BD072000BD0F2000BD04204B -:1031000000BD062000BD0C2000BD0D20800200BDCA -:1031100070B500290BD0CB1FFA3B81241E46CDB2DF -:10312000112B1BD2012805D0022806D009E000206F -:1031300010701DE0FF20043001E0FF2003308142C9 -:1031400018D0330018F0DCF81116131316131616E6 -:103150001316161613131313161316000846FF380A -:1031600081381F2803D9FF39FE39022902D815708A -:10317000002070BD1470072070BD00B5030018F06A -:10318000BFF8060406040C080A0C002000BD11203C -:1031900000BD072000BD082000BD032000BD007851 -:1031A0000207120F04D0012A05D0022A0AD10EE02C -:1031B000000907D108E00009012805D0022803D042 -:1031C000032801D0072070470870002070470620B0 -:1031D0007047002807D0012807D0022807D003280D -:1031E00007D007207047002004E0112002E02120D2 -:1031F00000E0312008700020704738B50C4605000B -:103200004FD06946FFF7CBFF002822D12088032149 -:1032100089028843694609788907090D0843208097 -:103220006946681CFFF7BBFF002812D121880320E4 -:1032300000038143684600788007800C01432180A9 -:10324000A8784007820F2020012A03D0022A03D049 -:10325000072038BD814300E00143218088B2010589 -:10326000890F08D0012189038843A9780907C90F6C -:1032700089030843208080B28104890F0AD0A9788D -:103280004004C906C90F400CC903084320808004CC -:10329000800F02D12088400403D5208840210843B4 -:1032A0002080002038BD70B50446002008801546F7 -:1032B0006068FFF7A2FF002815D12189A08981420B -:1032C00010D861688978C90708D00121490288426D -:1032D00008D8491C17F0D2FD298009E0FF21FF31F1 -:1032E000884201D90C2070BDFF30FF3003302880A8 -:1032F000002070BD10B5137804785B08E4075B000C -:10330000E40F23431370FD2423400478A407E40F43 -:10331000640023431370FB24234004786407E40F04 -:10332000A40023431370F724234004782407E40FF8 -:10333000E40023431370EF2423400478E406E40FF1 -:10334000240123431370DF2423400478A406E40FF0 -:103350006401234313700078BF244006C00F23404C -:10336000800103431370002906D00878C10701D1FA -:10337000800701D5012000E00020C0015906490E58 -:103380000843107010BD30B50A8803239B020488DF -:103390009A4323059D0F02D1A3049C0F01D09B0FDC -:1033A00000E001239B021A4303230A801B039A4374 -:1033B00003889804840F02D11805830F01D0800F71 -:1033C00000E00120000302430A8030BDF3B593B052 -:1033D0000D000FD0139800280FD01221284617F0A7 -:1033E00041FD03AAFF21012003F0D5F80024264661 -:1033F00037467AE0102015B0F0BD0720FBE768469D -:10340000807D01280BD16846818A0520C002081AF8 -:1034100010D0012810D0022812D0032812D0042C7A -:1034200014D0052C15D113E002290000012800005A -:1034300003300000012400E002246846468A08E0C8 -:10344000032406E068460424478A02E0052400E0DD -:1034500006246846418A1398814246D12C74002E76 -:1034600041D00DAA0EA905200292019100901023CF -:103470000022FF21304603F02FF9002823D16846AF -:10348000808E2A46C0B20EA9FFF72DFC00281AD163 -:10349000AE81002F27D00DA9052008AE0291009023 -:1034A000132300220196FF21384603F015F9002866 -:1034B00009D16846808EF11CC01EC0B22A1DFFF7DC -:1034C00012FC002801D0032095E708A881784278F3 -:1034D00008021043E881062C05D16846807DA87259 -:1034E0006846808A2881002085E703A803F05CF8FD -:1034F000002884D0FFF7D5FD7DE7002805D0FE4ADF -:10350000012903D0022903D003207047518800E02D -:103510009188814201D1002070470720704770B523 -:103520000C4605461C21204617F09CFC00202080FC -:10353000002D08D0012D04D0F0A1F54817F0BFFDF3 -:1035400070BD062000E00520A07070BD70B592B07F -:103550001546064601206A461071107453740846D9 -:1035600008300395029048889082FEF7FBF904002A -:1035700019D06580172069468883203600940AABED -:103580007178023307AA01A80EF019F9064660788F -:10359000000701D5FEF7C7F9002E0AD03046FFF725 -:1035A000ECFD12B070BD1321284605F00CFF03207E -:1035B000F7E708A800906846838B0422012128467B -:1035C00007F0ABFEEDE770B506468AB000200D4669 -:1035D00007900590069003A90490052402460291E5 -:1035E0000190102300942946304603F075F8002816 -:1035F0000DD108A804A9009102900194684683891E -:1036000000222946304602F083FE002801D0FFF751 -:1036100048FD0AB070BD10B50EF0D7FA10BDF0B578 -:1036200089B000260546059600780C460827030059 -:1036300017F066FE0CFD070C390B75759BBEFCD3AD -:10364000E3FD68680A38FEF702FB07E1A88800225C -:1036500080B20421009008F05FFB0290002C04D09F -:10366000AB48A6A16E3017F02AFD0298002804D1BD -:10367000A748A2A16F3017F022FD029800990830E8 -:103680000DF0D2FCFEF76EF9040007D060783843E5 -:10369000607000986080FEF746F9E1E01321009821 -:1036A00005F091FEEAE0002C04D1BD2093A180003A -:1036B00017F005FD60880022042108F02DFB009022 -:1036C000002804D192488DA1883017F0F8FC0099A9 -:1036D000002008802A7994461EE0C3005B199B688D -:1036E00007936B469B8B1A0708D5DA0606D560460A -:1036F000C20050194038C08F088006E05B0409D52D -:103700000871C2005019C0884880607838436070E2 -:103710000226A3E0401CC0B28445DED89EE0E888C3 -:10372000694608800090002C04D1794873A1983034 -:1037300017F0C5FC2878062813D10098C00B10D0CC -:1037400060880022042108F0E7FA060004D17048DE -:103750006AA1A23017F0B3FC00203071A8887080F5 -:1037600039E060783843607078E0002C04D1684814 -:1037700062A1B43017F0A3FC60880022042108F095 -:10378000CBFA0090002804D161485CA1B73017F053 -:1037900096FC009808300EF06AFA0121484002D1E8 -:1037A000E888C00B5AD0009861880226C180D8E70B -:1037B000002C04D1564851A1D03017F080FC60880D -:1037C0000022042108F0A8FA002804D150484BA197 -:1037D000D33017F074FC0226C3E7002C04D14C4808 -:1037E00046A1DC3017F06BFC0226618801222046DE -:1037F000FEF73EFA01200590B3E7A889002280B2C7 -:103800000421009008F088FA0746002C04D04048B4 -:103810003AA1EE3017F053FC002F04D13C4837A1F9 -:10382000EF3017F04CFC6868029001E009E010E00E -:10383000288969468881012202A90098FEF734FA96 -:103840000CE0002C8DD16D202CA1C00017F037FCAE -:1038500087E72F4829A1FE3017F031FC002C0DD04E -:10386000607800070AD50598002807D184202070C9 -:103870002046582229460830FDF7A6FC304609B0FC -:10388000F0BDF7B50C460546007A224688B00A32EC -:103890000492921C01920027811E16323E4602922B -:1038A0000B0017F02DFD08F405F348488ED0F2F315 -:1038B00068880022042108F02FFA0190002803D123 -:1038C0000EA1144817F0FBFB01980088002802D0D5 -:1038D0005227072600E151271E26002C70D0688849 -:1038E000A0800120A071019804990079C0004019BE -:1038F000C089FFF76BFD0FE0400C00207372635C22 -:1039000067617474735F636F72652E6300000000FB -:103910006F0200008603000000287DD10198007925 -:10392000C0004019C089208101980079C000401969 -:10393000408AA083F0E0698A0091062820D1E889B6 -:10394000C00B1DD008462230512786B2002CC5D0AE -:10395000A8890199FFF73AFD002872D16888A080F4 -:103960000220A071A88920810120A072288AE0830A -:10397000009820846969009A029817F016FACBE043 -:1039800008462030502786B2002CA7D0A889049979 -:10399000FFF71CFD002854D16888A080A889E0802A -:1039A000287A06280AD002202072288AA08300984C -:1039B000E083204669692030009ADEE70120F3E7C2 -:1039C0008FE068880022042108F0A6F90690688A32 -:1039D00000900698002803D1FD49FE4817F06FFBC0 -:1039E000069808300EF043F90121484002D1E889D9 -:1039F000C00B25D000985127223086B2002C7AD0F7 -:103A00006888A080A8890199FFF7E0FC002818D1F8 -:103A10000220A071A88900E013E020810420A07298 -:103A2000288AE083009820846969009A029817F038 -:103A3000BCF90699002008710698A98941806BE0BD -:103A400003200BB0F0BD688804F0DBF900906888B3 -:103A50000022042108F060F901900098002804D1A8 -:103A6000DC48DB492C3017F02AFB0198002804D1F0 -:103A7000D848D7492D3017F022FB0198D649C08885 -:103A8000884205D05127222604E01EE03FE035E0C1 -:103A900050272026002C2ED06888A080502F07D0D9 -:103AA0000220A0712146287B0831FFF738FD33E062 -:103AB000287BA11DFFF733FD6A8800230199009838 -:103AC000FFF744FD0028BCD126E0C449A889C98875 -:103AD000814207D154270626002C0CD06888A0808C -:103AE0001AE008E053270826002C04D06888A0803C -:103AF000A889E08010E00A98068013E05527072681 -:103B0000002CF8D0A889A0800020A07104E08D20AE -:103B1000AF49C00017F0D3FA0A98002C068001D0F4 -:103B20002780668000208CE7AC4900200870704731 -:103B300030B585B00C4601F0DBF90546FF2804D10D -:103B4000A448A349953017F0BAFA002020802071CC -:103B50006080401EE0802046294608300DF058FA6B -:103B60006A462946012002F016FD102412E068463C -:103B7000808800070ED56846C0882946FFF723FDD8 -:103B800068468188FF2321438180C0882946019AA5 -:103B900002F02CFE684602F007FD0028E7D005B0D1 -:103BA00030BD0A46014610B5104608300DF044FA03 -:103BB00010BD70B505460022042108F0ADF80400E0 -:103BC00004D184488249B73017F079FA2046294653 -:103BD00008300DF029FA70BDF0B591B00C460746DB -:103BE00004F00FF9050005D02878222804D2082017 -:103BF00011B0F0BD7A48FBE700220421384608F0F6 -:103C00008BF80646002C02D0A08800280CD001209A -:103C1000694608710220087400204874002C05D001 -:103C2000A0880883206802E00920E1E70883059066 -:103C30003046083003970290FDF794FE040018D038 -:103C40006780172069468883203500940AAB69781D -:103C5000023307AA01A80DF0B2FD054660780007FF -:103C600001D5FDF760FE002D09D02846FFF785FA43 -:103C7000BEE71321384605F0A6FB0320B8E708A8E5 -:103C800000906846838B04220121384607F045FBEB -:103C90000021C943F180ABE7FFB585B00E9E778860 -:103CA000384604F0AEF8054600220421384608F0F4 -:103CB00033F80446002D03D145494A4817F0FFF96F -:103CC000002C04D147484249401C17F0F8F9083449 -:103CD000089869460394C1C105A80DC820356978C4 -:103CE0000DF0DCF9CBE5F0B50446002099B00D46A7 -:103CF00001460D9010A88181164601818180374AC6 -:103D000068469180018510A80180684601878185F9 -:103D100081841078012808D0022806D0032804D016 -:103D2000042802D0082019B0F0BD2F4A944273D362 -:103D30002E4F0121890438688C4201D3844278D304 -:103D4000294A954275D3012189048D4201D38542C8 -:103D50006FD36168002913D0234A914269D30122AD -:103D60009204914201D3814263D3608921898842C0 -:103D700003D801225202914201D90C20D3E70D90C1 -:103D800016AA0EA92846FFF78EFA0028CBD168683C -:103D900080784007800F02280AD16846008F80048F -:103DA000800F05D02869002802D03968884240D3A6 -:103DB0000AA92069FFF721FA0028B4D12069002858 -:103DC0001CD0607880076846008D14D580040FE011 -:103DD000FC380000EE030000FFFF0000400C002054 -:103DE000023000000C05000000D001002800002077 -:103DF000800F68D002E08004800F64D16846008D97 -:103E0000810618D58004800F606806D0002812D083 -:103E1000396888420DD302E00BE000280BD0FE4940 -:103E2000884206D301218904884204D33968884234 -:103E300001D2102077E709A96069FFF7DEF90028B1 -:103E40009CD16069002808D06846808C0105890FE4 -:103E5000012938D18004800F35D00BA9A069FFF764 -:103E6000CCF900288AD16846808C80062BD468461D -:103E7000808D810627D4A169002906D00105890F0C -:103E8000012920D18004800F1DD0E068002804D0D3 -:103E90000078002817D01C2815D204AA611C2046DF -:103EA000FFF728FA0121890210A80180012768463E -:103EB0008773DA49818104AA033217A92868FEF7BB -:103EC00038FF002801D007202DE710A8007F15A992 -:103ED000C01CC2B200200C920190FF320090034639 -:103EE0000291FF3203A80332109902F0ACFA0028C5 -:103EF00026D110A9888A0F902A892969C84801917A -:103F00000092029010A90A8B6B8928680E9902F022 -:103F10009AFA01007ED1C2480025001F81886846B8 -:103F20004174090A8174052104A86A4623C210A8B5 -:103F30002A46FF21808A0C9B02F0EAF9002802D071 -:103F4000FFF7AFF8EFE66846007C0322C1090020C6 -:103F5000920290430122920280181490002928D0E6 -:103F6000014610A8018068462921877309028181D2 -:103F7000058608A8007C0023410860784900C00736 -:103F8000C00F014308A80174FD2001406078A54AD4 -:103F90008007C00F4000014308A801740CA902204B -:103FA00001910090029503A8109902F04CFA0100CB -:103FB00030D16068002828D0206900280DD10AA9D6 -:103FC0000EA8FFF7E0F96078800706D46946088DEF -:103FD0000321090388436946088590496846877329 -:103FE000FE3181818F492089891E16F047FF626862 -:103FF0000D9811AB0192009002930A46002303A88A -:104000000A9902F020FA010004D12078C10603D4F5 -:10401000800600E085E02AD56846058660690028AC -:104020000DD109A90EA8FFF7AEF96846818C0320CF -:104030008002814301208002091868468184694614 -:10404000888CC82108436946888474488F73FF3080 -:10405000888112AA0CA902200292019100900023EB -:10406000704A03A8099902F0EEF9010059D12078AD -:10407000C00729D068460586A06900280DD10BA984 -:104080000EA8FFF780F96846818D032080028143E6 -:10409000012080020918684681856846818D40208C -:1040A00001436846818587735F49818113AA0CA902 -:1040B000022002920191009000235A4A03A80B9912 -:1040C00002F0C1F901002CD1E06800282DD010A821 -:1040D00014990180544968468773491C8181E168BD -:1040E00008A80A78027449784174E068412241883E -:1040F00068464186E0680023017908A80175E068F8 -:10410000D200C18808A84175090A81750CA8072149 -:1041100001900091029503A8109902F094F9010012 -:1041200003D00F9800F0E8FEFDE53D480321001F95 -:104130000170002E0AD08088308010A8808870809E -:1041400010A80089B08010A88089F0800020EAE5DE -:1041500030B501248BB015460B46012802D0022849 -:104160001CD104E0684605218473C90203E02B4991 -:1041700068468473891E8181002B12D003210020A0 -:10418000890288430121890240186946888405AA6A -:1041900004A91846FEF7CDFD002804D007200BB077 -:1041A00030BD1020FBE76A46127C1D480092801E3D -:1041B00005A9FF3201910290FF32002303A80332C8 -:1041C000099902F040F9002802D0FEF76AFFE6E7FD -:1041D0001348001F002D01D0418829800470002061 -:1041E000DDE770B592B00446012608A886700F4935 -:1041F0006846018410AA08A93046FFF7A9FF0028E5 -:104200004ED12078064DC00700242D1F002849D02C -:104210001C2168460CE0000000D0010003280000CB -:10422000440C0020030200000329000001180000D4 -:1042300016F01AFE68460178202001436846017096 -:1042400008A88670F9496846018411940794817F13 -:10425000F92001406846891C8177002001466846A4 -:104260000177002001466846417704218185C48595 -:10427000018607A80A9011A80D9008A809900EAA17 -:1042800009A96846FFF72FFD002809D16846008F6D -:10429000E8806846808F2881401C68812C7000204F -:1042A00012B070BDEC802C8110A80088F4E7F7B53F -:1042B000DF4900260A789EB0012A04D0022A02D0E3 -:1042C000082021B0F0BD4A88824201D00620F8E7DC -:1042D0001F98824201D10720F3E7012210A98A75B5 -:1042E000D4488882002003239B020146994393020D -:1042F000CB1810A90B8669468A81CF4ACA8118A9B2 -:10430000887110A9888419A904916946CA82069007 -:10431000FF20087503A802F06AF900242546274605 -:1043200008AA052103A802F065F9002810D0822808 -:104330006FD1002C6FD0002D6DD010A88480C58067 -:104340000021017418A8807B11AC012865D06DE0B4 -:1043500008A88079002F21D0012857D16846818C88 -:10436000B44881421CD113AA0DA905206B4607C38E -:104370006846408C10230022FF2102F0ADF900288E -:1043800068D110A88089042801D006284CD168463D -:10439000818E1F98814239D10F2092E7012835D1B3 -:1043A0006846808C0521C902884202D0491C884297 -:1043B0002CD19F4841886846408C814201D1012719 -:1043C00000E00027002C01D0002D10D01F9988425A -:1043D0001CD113AB0DAA05216E460EC60446102350 -:1043E0000022FF2102F078F9002833D101E03546A0 -:1043F0000CE010A88089022801D0102814D1C0B286 -:104400001BAA0DA9FEF76FFC00280DD16846468C4B -:1044100086E71FE0FFE7052053E714A91BA8221D2C -:10442000FEF787FC002801D003204AE710A8007C93 -:104430000023001DC2B210A80274209802900194BB -:10444000009215A81C9901F0FEFF002802D17849BE -:1044500002220A70FEF725FE33E710B50B46401E18 -:1044600086B084B203AA00211846FEF743FF04AACF -:10447000052103A802920191009001230022FF214F -:10448000204601F045FF04466846008A012804D012 -:104490006D206A49000116F012FE2046FEF701FE6B -:1044A00006B010BDF0B5624F0446387887B00E46AE -:1044B000032804D0042802D0082007B0F0BD04AAC5 -:1044C00003A92046FEF7EFFE0500F6D1606880786C -:1044D0004007800F02280DD1684680898004800F34 -:1044E00008D02069002805D055490968884201D2C2 -:1044F0001020E2E7208905AA6B46216907C36946B7 -:104500000A8A63892068039901F09DFF002802D080 -:10451000FEF7C7FDD1E7002E02D06846808A3080C2 -:10452000042038702846C8E738B50C00054609D085 -:1045300000236A46FF2102F031F9002804D0FEF77B -:10454000B0FD38BD102038BD69462046FEF755FE47 -:104550000028F8D1A078FF21C307DB0F2846009A76 -:1045600002F044F9EBE73EB50C0009D002AB6A4615 -:10457000FF2102F013F9002804D0FEF792FD3EBDA2 -:1045800010203EBD0321204616F06CFC68460088D2 -:1045900001A90005800FFEF71CFE00280BD168461C -:1045A000007920706846008801A98004800FFEF71A -:1045B00010FE002801D003203EBD684600796070DF -:1045C000A278EF20024068460088C10B09010A4327 -:1045D000F7210A404104C90FC9000A43A270F9211A -:1045E0000A40800601D5022000E001204000694613 -:1045F0000243097A50084000C907C90F0843A07058 -:1046000000203EBD7FB514460522019203AD029500 -:1046100000930A462388FF2101F07AFE69468989C2 -:104620002180FEF73EFD04B070BD0000052A0000A9 -:10463000400C002002280000FFFF0000FC380000B2 -:1046400028000020F3B5002799B068460C4607877C -:104650003D4600291DD0E068002806D0A06800284B -:1046600017D001886A4611870780199803F0C9FBA3 -:10467000002811D0007822287ED3199800F038FC49 -:10468000009000220421199807F046FB060009D18A -:1046900004E010201BB0F0BDFC48FBE7FC49FD48DE -:1046A00016F00DFDA078012803D0022801D00720C4 -:1046B000F0E72088002808D0401E80B203AA0099A5 -:1046C00001F069FF002859D11DE0F048401CE1E7E6 -:1046D0006946498A228891420BD26846807D00252E -:1046E000012810D16846808AEB4988420BD1012508 -:1046F00009E0914203D1002D2AD06D1C01E0022D6A -:104700000BD0032D04D203A801F04EFF0028DFD008 -:1047100082281BD0002831D11DE06946897D0129FE -:10472000F1D16946DC4B8A8A5B1ED11A9A420FD0BE -:1047300005DCDA48101A0BD00128E4D108E0012981 -:1047400006D0FF390129DED10325E1E7022D15D17D -:104750000D2080029EE7E068002816D00EA90522F1 -:1047600002910192009069460B8FA2882088FF2158 -:1047700001F0CEFD002800E01DE002D0FEF791FC24 -:1047800088E76846A168008F08806846008AC006EE -:1047900001D5C3487EE70798002803D06846008B00 -:1047A000022801D0032075E70798A1780078012935 -:1047B00003D0800710D408206CE7C007FBD000228C -:1047C0000721199807F088F8002802D00725022051 -:1047D00004E0AE48801C5DE70225032008A90870AC -:1047E000218868468185199808360A90099617210C -:1047F0006846818712AB02330FAA052108A80097EB -:104800000CF0DDFF002802D0FEF7B7FC42E710A84D -:1048100000906846838F04222946199806F07DFD92 -:1048200038E770B5064615460C460846FEF7F6FB17 -:10483000002804D12A4621463046FFF789FCF3E6DA -:1048400010B5FFF734FD10BD70B51E4614460D00BF -:1048500014D0002C12D0616800290FD00121FEF77E -:104860004CFE002809D12068FEF7D8FB002804D1AF -:10487000324621462846FFF736FAD5E61020D3E621 -:1048800070B515460C000ED00221FEF736FE00284A -:1048900008D12068FEF7C2FB002803D12946204634 -:1048A000FFF700FEC0E61020BEE6F8B506467D48DC -:1048B0000D46016814468A4231D36068002808D04A -:1048C000794A90422BD301229204904201D388422C -:1048D00025D37648864204D0304603F092FA002869 -:1048E0000CD0304600F004FB0646284600F0BDFA26 -:1048F000002804D16068002802D012E06348F8BDA7 -:1049000000236A463146284601F048FF002802D0BD -:10491000FEF7C7FBF8BD68460088800601D410206A -:10492000F8BD6188224628466368FFF76BFEF8BD34 -:10493000F7B55C4E0746306886B01446824202D214 -:10494000102009B0F0BD384600F0D2FA05465748AD -:10495000874201D0FF2D08D0002304AA29460798DA -:1049600001F01CFF002826D101E04848E9E768462D -:10497000008AC00601D54A48E3E703A90020029156 -:104980000527019000976288484B2946079801F057 -:10499000A3FE00280FD161683268914208D30191CB -:1049A00002900097238862882946079801F094FEB8 -:1049B000694689892180FEF774FBC2E7002907D088 -:1049C0003B4B0A881B899A4202D83048401C7047EA -:1049D00038E610B586B004236C46A382344BDC88DD -:1049E000002C07D01B898B4201D2914204D9274861 -:1049F000401C55E5062053E56B4619825A8200217A -:104A0000009101911C800221997005A9029104A9CD -:104A100003916946FFF716FE42E5F3B50C4685B0F3 -:104A2000812069460873002C1AD0059803F0E9F933 -:104A3000070017D03878222868D3059800F058FA74 -:104A4000049000220121059806F046FF00280BD0B3 -:104A500000220421059807F05FF905000AD105E05E -:104A600010202AE5094828E5112026E508491148C3 -:104A700016F025FB284608300CF0F8FA0646207898 -:104A8000012819D0022838D0072016E5023000008E -:104A9000FC380000E10800000328000000280000A6 -:104AA000013400002800002000D00100FFFF0000BA -:104AB000400C0020840A0000A18803AAFEF728FB0E -:104AC0000028CED1B00721D56846007B00281FD131 -:104AD000A079C0071CD0E068002205216B4607C3FF -:104AE000638922896888049901F012FC6946087379 -:104AF00000280DD0FEF7D5FADFE4A18803AAFEF75F -:104B000007FB0028ADD13420064201D10820D4E4AF -:104B10006846037B29463846059AFEF717FDCCE424 -:104B2000FFB597B0002001901F4615460C460E4673 -:104B3000179803F066F9002804D00078222803D2E1 -:104B40000820A7E5F348A5E5B80801D00720A1E5AE -:104B5000032F00D10027179800F0CAF90890002C05 -:104B60001BD0022D77D3EC48006884427CD36119B6 -:104B70000091012902D0491E814275D3AD1EAAB20F -:104B80002146E6480DF0F2F800991E394A7F0B7F66 -:104B900011021943884267D1ADB2E148B90702D585 -:104BA0000189491C00E0012189B20091F90701D077 -:104BB000078900E0D94F03AA0899009801F0EBFC9F -:104BC0000DE0F078B1780002084310284CD8019924 -:104BD000091D401880B20190A84245D82618002E21 -:104BE00060D0707831780002084300998842E8D399 -:104BF00058E06946098A0A0754D5002C3FD0019A2B -:104C0000A618121D92B20992F278B37812021A43D2 -:104C10009446102A28D8099A6244AA4224D8727865 -:104C2000337812021A4390421ED1C8061ED5099845 -:104C30000AAA052120186B4607C370783178000254 -:104C4000084363460022089901F062FB002803D064 -:104C5000FEF727FA1EE507E0F078B1780002084376 -:104C60006946098D884201D00B2013E5F078B178B0 -:104C7000000208430999401880B2019006E0C90675 -:104C800004D50899FEF79FFC0028E3D16946088AFD -:104C90001021884369460882488AFF23049A0899AC -:104CA00001F0A4FD03A801F07FFC002803D16846B1 -:104CB000408AB8429DD900220421179807F02CF8A9 -:104CC000040003D19749984816F0F9F92088002884 -:104CD000C0D0012108A80170017300264673218805 -:104CE0006846018620460830099017980A90FCF71C -:104CF00039FE05001BD01798688017206946888008 -:104D000010AB023301AA052108A800950CF057FD4D -:104D100007466878000704D583488249223016F098 -:104D2000CEF9002F09D03846FEF727FAB2E4132156 -:104D3000179804F048FB0320ACE40EA800906846E6 -:104D4000838804220121179806F0E7FA00288CD105 -:104D500026809FE4F0B500248DB01F4615460E4610 -:104D6000002A04D0B90804D007200DB0F0BD1020EF -:104D7000FBE7032F00D1002700F0BAF80390FF28CB -:104D800004D06749B80703D5488902E06148ECE7D9 -:104D90000120FA0702D04989491E00E05F4906AAAE -:104DA0008FB2039901F0F7FB38E06946898B090758 -:104DB00034D504AB05210022029300910192574B98 -:104DC000039901F089FC002821D1002E21D06A46E8 -:104DD000128A2988A2183019121D914234D36946CB -:104DE000CA8B0270120A42700A8A8270120AC2705A -:104DF00004A90522001D0092029101906946C88B0A -:104E00000B8A0022039901F067FC002801D00320DF -:104E1000ABE76846008A2018001D84B206A801F09E -:104E2000C3FB002804D0822806D0FEF73AF99CE79D -:104E30006846C08BB842B8D9002C07D0002E10D0DD -:104E40002988A01C814203D20C208EE705208CE724 -:104E50002246314631480CF089FF31190870000AAA -:104E60004870A41C2C8000207FE700B585B06946FF -:104E7000FEF7ACFA00280AD16846007C030016F061 -:104E80003FFA08052F2F2F2F08080531032005B002 -:104E900000BD68468078012807D168460088032154 -:104EA000C902401A1CD001281AD06846807901280E -:104EB00006D16846808815214902401A05280FD975 -:104EC0006846807A012811D16846018929200002AC -:104ED000081A05D0022803D0032801D0042805D1E0 -:104EE0000F20D4E711A1164816F0E9F80020CEE70C -:104EF00010B506F007FF10BD10B50C4601F01EFB03 -:104F0000002803D009A10F4816F0D9F82046FEF773 -:104F1000C8F810BD0230000028000020FFFF00008C -:104F2000400C0020FC3800003F0B00007372635CF3 -:104F300067617474735F636F72652E6300000000B5 -:104F400022020000BB060000F8B500780C461646A9 -:104F500010340E36069F022809D0032836D00528C3 -:104F60007ED0FF20F6A1E53016F0A9F8F8BDCD8976 -:104F70000A2068430E30188031203880002AF5D08E -:104F8000087B9581801FC7B21AE020886168308055 -:104F900048780A7800021043F080C8788A780002C6 -:104FA00010433081B21C3846091DFDF79CFE002FCE -:104FB00001D0002802D000203071708008340A36F9 -:104FC00028466D1EADB20028DFD1F8BDCD890A207C -:104FD00068430E30188032203880002AF5D0087BD4 -:104FE0009581401FC7B243E0616822880878F2804B -:104FF0003279C30752085200DB0F1A43FD231A40CF -:105000008307DB0F5B001A43FB231A404307DB0FC8 -:105010009B001A43F7231A400307DB0FDB001A43F8 -:10502000EF231A40C306DB0F1B011A43DF231A408C -:105030008306DB0F5B011A43BF231A404306DB0FD5 -:105040009B011A433271C00970718A784B78100243 -:105050001843308132463846C91CFDF744FE00E053 -:105060000CE0002802D00020B070308008340A36EE -:1050700028466D1EADB20028B6D1F8BD087BCD899B -:10508000801E86B2304608306843103018803420C5 -:105090003880002AF1D0174695811037E800D68174 -:1050A000C01900900DE02088388000987860324662 -:1050B0006168009815F079FE009808348019083767 -:1050C000009028466D1EADB20028ECD1F8BDFFB5AA -:1050D00081B00A9D1E460C46002A05D0607AFF303A -:1050E0000130D080E089108101980E2700780300FC -:1050F00016F006F90B7E0719293541536C7878783C -:105100007E000092087B082805D0032803D091A1D7 -:10511000954815F0D4FF378030200FE0009900202B -:10512000888105B0F0BD0092087B042804D08E4829 -:1051300088A1143015F0C3FF3780312028800098F3 -:105140000028EBD1EDE70092087B042804D09320DF -:1051500080A1800015F0B3FF37803220EEE7009287 -:10516000087B022804D080487AA13A3015F0A7FFC6 -:1051700037803320E2E7087B1746042804D07A48BA -:1051800074A14C3015F09BFF102030803420288013 -:10519000002FC6D00020B88116E0207B17460528D6 -:1051A00006D0062804D070486AA1603015F087FF49 -:1051B0001220308035202880002FB2D0E089B881BD -:1051C0000020388201984088F881AAE70092087B85 -:1051D000072804D064485FA1713015F070FF378054 -:1051E0003620ABE733460095019800F00AFC98E7BB -:1051F0002F2053A1000115F062FF92E770B50C4615 -:10520000054602F0FEFD002804D00078222803D2D3 -:10521000082070BD554870BD00220521284606F0C3 -:105220007BFD2060002801D0002070BD032070BDF0 -:10523000FFB58BB00D4607461720694608850E98C6 -:1052400003261446002805D10EA93846FFF7D6FFDD -:10525000002834D1002D0BD000220321384606F05F -:105260003BFB002834D00E980078002830D108E0AD -:105270002078092819D00F2823D031A13C4815F0F7 -:105280001EFF0E98A760801D03AA606002320AA963 -:10529000204600F00CFC002827D0030016F030F860 -:1052A000071A182323211C1E23000726002231463B -:1052B000384606F011FB0028E3D12C48801C0FB0C3 -:1052C000F0BD00220321384606F006FB0028D8D1A5 -:1052D0001120F4E70020F2E70820F0E72348401C03 -:1052E000EDE70720EBE70320E9E701A80090684617 -:1052F000038D04223146384606F00FF80028DED12F -:10530000002DDCD00E990D70D9E730B587B01D4661 -:105310000C46002A11D0042369460B7013888B8138 -:105320005288CA81A2788A7422880A8200236A4637 -:105330002946FFF77DFF07B030BD1020FBE70000D6 -:105340007372635C67617474635F636F72652E630D -:10535000000000007372635C67617474635F636F65 -:1053600072652E630000000025020000023000007C -:105370004F030000F3B581B001980C460078082671 -:10538000030015F0BDFF125E46461B134A0A0A0AC7 -:105390000A0A0A0A0A0A0A0A0A5E002C02D1F64917 -:1053A000F64808E06078304360703BE0002CF9D1AB -:1053B000F248F149083015F082FEF3E70198002227 -:1053C0008088052187B2384606F0A6FC0546002CE9 -:1053D00004D07520E849C00015F071FE002D04D1FD -:1053E000E648E549143015F06AFE3946A81D00F07C -:1053F00055FBFCF7B7FA040006D0607830436070C4 -:105400006780FCF790FA0FE01321384603F0DBFFCA -:1054100015E0DA48D849283002E0D848D6492D307E -:1054200015F04DFE002C0AD06078000707D59320B8 -:1054300020702046582208300199FBF7C5FE002055 -:10544000FEBDCE48CC493130EAE710B500210170ED -:10545000801D00F020FB10BD0A4610B50146901DCE -:1054600000F024FB10BD70B505460022052106F0B2 -:1054700053FC040004D1F920BF49800015F01FFE41 -:105480002946A01D00F00AFB70BDF7B5054684B0A3 -:105490000C4600206946088188806F8802460521F5 -:1054A000384606F039FC060004D1FD20B2498000E0 -:1054B00015F005FE002C03D0A7800020E08020819D -:1054C000297A20461230C91E142700900B0015F0CF -:1054D00017FF0FFDFCFB3809A95E657A2FB2C9E9F9 -:1054E0009191FB003078012804D0A3497020143139 -:1054F00015F0E5FDA9896A46C8000E30908030207D -:105500001081002C13D0A18100200DE0C100327960 -:1055100009190A747288CA8182005319DA894A8289 -:105520001A8A401C8A8280B2A1898142EED8F1E0B9 -:1055300002A8009001AB22462946304600F02AFA24 -:10554000E8E03078042804D08B49BD20143115F0F0 -:10555000B6FDA8890622014650436A460E30908067 -:1055600033201081002CE2D0A18100200BE0062125 -:1055700041434F190919FA89CA81BA7C8A743A8A57 -:10558000401C0A8280B2A1898142F0D8C2E0307802 -:1055900006280BD078491431D72005E0307806284A -:1055A00004D07549EB20143115F089FDE88969466E -:1055B0001230888035200881002CB8D0A989A181BB -:1055C0007188E18126E03078072804D06A49FF20FD -:1055D000143115F074FDA8896A4601460E3090809A -:1055E00036201081002CA2D0A1812046AA890E303D -:1055F000296954E0E8896946123080B238228880EF -:105600000A81002C7ED0A989A181287A102807D090 -:105610000221A173E9892182EA89296900983EE083 -:105620000121F6E702A8009001AB22462946304648 -:10563000FFF78AFC6EE03078082805D04E49FF203D -:105640001431EE3015F03BFD68463721878001812B -:10565000002C5FD0A989A1810020608220820120D6 -:10566000A07357E03078092805D04349FF20143152 -:10567000FF3015F024FD288A6946143088803720D1 -:105680000881002C46D00421A173A989A181E98950 -:105690002182298A618220462A8A1430696915F09C -:1056A00084FB37E030780A2804D033493448143179 -:1056B00015F005FD6846372187800181002C29D02F -:1056C0000521A173002002E01FE004E00DE0A081AD -:1056D000208260821EE002A8009001AB224629468B -:1056E0003046FFF7F4FC15E00CE00D206946392246 -:1056F00088800A81002C05D00120E08000202081D4 -:10570000207307E00699088019E01C481A49A43064 -:1057100015F0D5FC6846069980880880002C0ED0CC -:10572000684600892080684680886080287A03283F -:1057300005D0102803D0112801D00020307000209F -:1057400007B0F0BDF7B5568815460F4682B0002267 -:105750000521304606F0E0FA040004D10748064966 -:10576000C43015F0ACFCA41D33462A4639460094DB -:10577000029800F022FBD4E440530000950300009F -:1057800013020000F7B58CB00D46144607A90C981B -:10579000FFF734FD002812D1B64E0127002C0FD0A0 -:1057A0000321684601701021818208A802460690F4 -:1057B000204605A9FDF7BDFA00280BD007207EE59D -:1057C0000821684601708581C68105218774C90258 -:1057D00001820BE00798A178017121884180684619 -:1057E00005218774C90201828581C6810246012193 -:1057F000079B0C98FFF71CFD61E508B501236A467D -:1058000093709D4B13800A4602236946FFF77DFD86 -:1058100008BD08B501236A469370974B5B1C138043 -:105820000A4603236946FFF770FD08BD00B587B03F -:1058300000290CD002236A4613700B889381498893 -:10584000D18100230421FFF7F3FC07B000BD102035 -:10585000FBE710B5002903D00523FFF756FD10BD67 -:10586000072010BD70B588B00D461446064607A93E -:10587000FFF7C4FC00280DD1002C0DD0062168468E -:1058800001708581C481079B02465C8006213046F9 -:10589000FFF7CEFC08B070BD052168460170858118 -:1058A000F1E710B588B000290BD007246B461C70B7 -:1058B0009A81049100236A462146FFF7B9FC08B09B -:1058C00010BD1020FBE770B50024172288B0002916 -:1058D00014D00D782B0015F013FD062305051904CF -:1058E0001B231522D21E93B2CA88002A02D08E68CA -:1058F000002E03D09A4203D90C20CBE71020C9E731 -:10590000042D05D08A88002A0AD101E00620C1E7CB -:10591000012D11D0022D05D0042D18D0052D23D036 -:105920000720B7E709236A4613704B889381CB8819 -:10593000D381896804911DE00C236A4613704B885B -:105940009381CB88D38189680824049112E00D23C8 -:105950006A4613704B8893818B88D381CB881382DE -:1059600089680924059105E00E236A461370497879 -:1059700011730A2400232146FFF75AFC8AE700B579 -:1059800087B00F236A461370918100231946FFF7F1 -:105990004FFC5AE7FEB50078089D1C4616460F4698 -:1059A000012803D03549912015F089FBF889C00002 -:1059B0000E30208030202880387B001FC0B201903C -:1059C000002E1DD0F889B081002516E0E80084196A -:1059D000C0190090224641690E320198FDF783F903 -:1059E000002802D000202074E08100986D1C008AFD -:1059F00060820098ADB2408AA082B089A842E5D802 -:105A0000FEBD70B514461425049A1D8037231380FB -:105A1000002C0ED0CA89A281002262820078082858 -:105A200008D0092810D00A2819D01449144815F0B4 -:105A300046FB70BD087B0C2804D011480F490C3878 -:105A400015F03DFB012008E0087B0D2804D00C4830 -:105A50000A49083815F033FB0420A07370BD087B99 -:105A60000E2804D006480549001F15F028FB052024 -:105A7000F3E70000FFFF000002280000545300007D -:105A8000BB02000010B5FE4B586019721A80C900A5 -:105A900015F0EAF910BD00210180704710B5002211 -:105AA000D2430280032006F09EFD10BD7047F0B582 -:105AB0000E460446017801208840F24999B008401A -:105AC0000090616815460888EF4A904206D0009A17 -:105AD000002A06D0EB4A521E104202D0012019B013 -:105AE000F0BD009A10430880002D12D000202870CD -:105AF0002178EA1C0027681C01920B0015F000FCBD -:105B000010F30E16233A59616F3CB4B08AB8F2F123 -:105B1000F0F320780B28EBD00420E0E70221297075 -:105B2000A1890170090A4170032097E004212970BE -:105B3000A1890170090A41700198E1890170090A7F -:105B4000417005208AE006212970A1890170090AA7 -:105B500041700199E2890A70120A4A70218A017122 -:105B6000090A4171A28AE81DA16915F01EF9A08AEF -:105B7000C01D73E0082129702178082901D1102166 -:105B80002970A1890170090A41700198E1890170A9 -:105B9000090A41700520308020466A1D02A9103094 -:105BA000FDF7C7F800287DD169463088097A40188A -:105BB00054E00A212970A1890170090A417003206B -:105BC0000BE00C212970A1890170090A417001982C -:105BD000E1890170090A4170052030809CE0A089AC -:105BE00084464000401C81B2308888425AD305293F -:105BF00058D30E202870002008E0236942009B5AE9 -:105C0000521953701B0A401C937080B26045F4D344 -:105C10003180B9E09A48417A002973D0491E417217 -:105C2000217B4068C9004518A988286808224018C7 -:105C30000838216915F0B9F8022168460171002180 -:105C4000417128680390A98868460181002101A854 -:105C5000FFF790FB0020A880002E00D0308093E05A -:105C60002978802211432970297840221143297014 -:105C700029788909890112312970A1890170090ADD -:105C80004170E289E81C216915F08FF8E089C01C99 -:105C90003080287841063FD5C00975D0012168467B -:105CA000017200E02CE0002141723188091D8181E0 -:105CB0000495E189019808180590001D0690704828 -:105CC000017A68460177002102A8FFF753FB0746D7 -:105CD00030880C303080022F06D0002F54D065E081 -:105CE0003DE033E01CE05EE065486946097F4268BC -:105CF000CB00D218037A994202D29188002902D0AF -:105D0000042753E02FE0417A491C41721560308826 -:105D100090800020308049E06168A089888033E06D -:105D200029788909890116312970A1890170090A28 -:105D300041700198E1890170090A4170228A681D49 -:105D4000616915F032F8208A401D46E728788009FD -:105D5000800118302870207B687002207EE7606820 -:105D60000188090401D4052720E0C088A189884260 -:105D700001D006271AE01E202870012030806068BC -:105D800001884904490C0180009800280ED03C4845 -:105D900000220088A1688300032006F07FFB616871 -:105DA0002078887007E00020308003276068009921 -:105DB00002888A430280384691E6FFB59FB0289D4D -:105DC0000E46002805D0172803D82A882E4B9A4261 -:105DD00002D1072023B0F0BD3278530601D4D20996 -:105DE00001D00820F6E700226B461A715A7114465A -:105DF0003278431E1D939BB2189303AB1A939706F8 -:105E0000CB1CBF0E1B93821E711C3B0015F078FA51 -:105E1000209011EE66EE74EEB0EED4EEEDEEECEE08 -:105E2000EBEEEAEEE9EEEEEEE8EEE7EEE6EEE5EEBC -:105E300090EE05287CD1042168460171A978017291 -:105E4000F078B2780102114368464181317941719D -:105E500070788006800E0C282ED009DC801E03008E -:105E600015F04EFA0919661C66216624662766003D -:105E700012282AD00ADC0E2821D01028DAD121E0FD -:105E80004C0C0020FF710000FFFF000016281FD0FF -:105E90001828CFD11FE02878800701E02878400734 -:105EA000002845DA45E128780007F9E72878C00698 -:105EB000F6E728788006F3E728784006F0E72878A8 -:105EC0000006EDE72888C005EAE72888C004E7E770 -:105ED00028888004E4E728884004E1E72A789207CC -:105EE00026D50328A6D105206A461071487809787E -:105EF0000002084310811CE129784907F0D50628E3 -:105F000016D3717890B2012902D0022992D101E012 -:105F1000022100E01021189106216A46117100212A -:105F2000118102AF189AB11C0237921C1B921AE021 -:105F3000B3E04A780B7812021A433A80801E891C1B -:105F40001790BA1C1A911898FCF7CDFE1A99189858 -:105F5000189A091817986B46801A1A8980B2521C31 -:105F60001A811B9ABF1D8242E3D9002886D1E0E046 -:105F700028780007B4D51D98694682B207200871B9 -:105F800000200881701C0A3111E0437807781B0259 -:105F90003B430B80C37887781B023B434B806F46A3 -:105FA0003B89121F5B1C001D92B23B81091D042A14 -:105FB000EBD2002A71D1BCE02978C9066DD5022840 -:105FC0006BD30820694608710020488170780872F8 -:105FD000844692B2B01C1A9919E089E090E07EE004 -:105FE00067E05BE030E025E019E013E0BCE04378D7 -:105FF00007781B023B430B80831C4B606346D21A1D -:106000006F467B8960445B1C92B27B81083194456A -:10601000EDD9CEE7287880063FD5092203E028781D -:1060200040063AD50A2268460271AA880281189A67 -:10603000428107E0287800062FD50B206A461071B0 -:1060400018981081039174E02988C90525D5022884 -:1060500023D30C20694608710020488170780872AB -:10606000844692B2B01C1A9914E0437807781B0258 -:106070003B430B80C37887781B023B434B80031D57 -:106080004B606346D21A6F467B8960445B1C92B2B8 -:106090007B8108319445E8D98BE763E02988C904FE -:1060A00060D501285ED10D2168460171A988018162 -:1060B0003FE02988890455D5052853D30E22694627 -:1060C0000A71AA880A811B99401F4A78097812022E -:1060D0000A4369464A818881701D049029E0298815 -:1060E00049043FD501283DD10F206946087120E0C1 -:1060F0002A88120436D44A780B7812021A43EA80AE -:1061000003282FD332789206920E1B2A26D0112212 -:106110006B461A712A880123DB031A432A804A78C6 -:10612000097812020A4369460A81C01E48811B98F9 -:10613000039030788006800E1B2809D01D2807D0D8 -:106140000320229906F04FFA2888C00BC00328804C -:1061500001A82199FFF70EF920463BE610226B4675 -:106160001A71DCE70724F7E70824F5E700B597B0D4 -:10617000032806D16A461070019100216846FFF796 -:10618000F9F817B000BD000010B58B78002B11D0C6 -:1061900082789A4207D10B88002B0BD003E08B79D1 -:1061A000091D002B08D08B789A42F8D103880C88FF -:1061B000A342F4D1002010BD812010BD052826D0B7 -:1061C000002A02D0012A0DD102E00988090501E068 -:1061D00009888904890F07D0012918D0022909D01C -:1061E00003290ED081207047002A01D00320704778 -:1061F0000220704703280AD0042808D0002804D0C1 -:1062000007E0042803D0022803D0052070470020AF -:1062100070470F20704770B51388054614460B80F1 -:1062200018061DD5FE481022807AA84203D81343D1 -:106230000B80002070BDA06893430078E840C00741 -:10624000C00E03430B802078A1788007800D08439F -:10625000F44914F013FEA06869430818401C70BD8F -:10626000906870BD37B569468B88138019061BD5B9 -:10627000EB4C0125A47A9168844209D8FE280FD1FD -:10628000D80602D5A5406D1E00E000250D7007E080 -:1062900085400C78DB06DB0FAC4383401C430C705D -:1062A00010881021884310803EBDF8B50746C81CF1 -:1062B00080080E468000B04201D08620F8BD082A32 -:1062C00001D90E20F8BDD64D00202E60AF80288168 -:1062D000AA723446E88016E0E988491CE980810604 -:1062E00010D48007A178800D0843CE4914F0C6FD74 -:1062F000206800F0BAFA2989401880B22881381A3B -:106300008019A0600C3420884107E5D40020F8BD36 -:10631000FFB589B09F041646139DBF0C01930998E1 -:1063200000F095FA04000AD02078000609D5BC4890 -:10633000817A0A98814204D887200DB0F0BD0120EF -:10634000FBE7224669460A98FFF765FF06900020A2 -:1063500069460872052D14D0012221462846FFF710 -:106360002DFF0028E9D1207840060AD50221684691 -:106370000172099981810188C18106824782129840 -:1063800005900198000404D500273E460125079793 -:1063900009E02078A1788007800D0843A149079083 -:1063A00014F06CFD0D46019840040AD50798A842E8 -:1063B00007D12088E1788005800F00020843B042B1 -:1063C00001D3AE4201D90720B7E7B81980B20190D6 -:1063D000A84201D90D20B0E76846007A002804D011 -:1063E00002A8FDF718F90028A7D10798A8420BD1F9 -:1063F000208803210902884301998905890F090230 -:10640000084320800198E0701498002800D007808D -:106410001298002815D006983A468019129914F05F -:10642000C4FC224669460A98FFF7F5FE69460888CB -:106430001021884369460880224600990A98FFF790 -:1064400011FF002079E7FFB5754D0C22E888296817 -:10645000504383B00C180D9F7249059814F00EFD3F -:106460000091049800F001FA29682A898E46611A81 -:106470000C310918944651188AB2A988914202D861 -:10648000842007B0F0BD6A46168A320603D5B206EC -:1064900001D58520F5E7EA88521C92B2EA800E9B6E -:1064A000002B00D01A80B20601D5A76006E0604438 -:1064B00080B22881091A70460818A0602246FE2082 -:1064C0000499FFF7CFFE0598A0700098E07020882F -:1064D0000599800889058000890F08430321090276 -:1064E000884300998905890F09020843042108435C -:1064F000208003988078A07103980088A0800020F5 -:106500002073310601D5AC7A00E00124B10600D534 -:10651000002700260EE0052100200191029000973F -:10652000E88831460C9B069AFFF7F2FE0028A8D1B6 -:10653000761CF6B2A642EED30020A2E7F1B5009891 -:1065400000F085F9060002D00025009C14E001202F -:10655000F8BD204600F07BF90746007831498007F6 -:10656000820DB878104314F089FC386800F07DF98A -:106570004019641C85B2A4B22948C188601E8142BA -:10658000E7DC00992648491EC1800189491B018129 -:1065900000203070F8BD002804D0401E108091709B -:1065A000002070470120704710B5044601881C4840 -:1065B000C288914201D3822010BD00680C22514351 -:1065C00042189079A072908820811088D178800537 -:1065D000800F00020843A081A078211DFFF71BFE59 -:1065E00020612088401C2080E080002010BD012117 -:1065F00001827047F7B50546002084B0C043108083 -:1066000068681746817868468170686801886846BE -:10661000018000218171288A2C88A04205D303E0E3 -:10662000580C00200102000004462C8235E0288A24 -:10663000401C2882301D6968FFF7A6FD00282AD17A -:1066400039889248814201D1601E38806888A04212 -:1066500028D33088F1788005800F0002084302902B -:106660006946301DFFF790FD002814D169898748DD -:1066700081421BD0002231460598FFF79FFD00287C -:1066800009D16A890298824205D1E968B06814F09C -:106690005FFB00280AD0641CA4B2204600F0D7F8A3 -:1066A0000600C4D1641E2C828220EAE67C80B07988 -:1066B000B871B088B8803078B1788007800D084311 -:1066C00078810298B8813946287A32460831FFF736 -:1066D000A2FD38610020D4E6FFB585B01C460F4608 -:1066E000059800F0B4F8050009D02878000608D510 -:1066F0006748807AB84204D8872009B0F0BD0120ED -:10670000FBE707982A468605B60D69463846FFF727 -:1067100082FD07460E98052816D000222946FFF76D -:106720004DFD0028E9D1287840060DD501216846A5 -:10673000017105990181018841818681C48101A887 -:10674000FCF769FF0028D8D12888AA788107890D2D -:1067500011438005800FEA7800021043079A9642A1 -:1067600007D04C4A914204D3611E814201DD0B20C7 -:10677000C3E7864201D90720BFE7801B82B2A2424D -:1067800000D922461098002800D002800F980028D7 -:1067900002D0B91914F009FB0020AEE7F8B51D4688 -:1067A00017460E4600F053F8040008D02078000683 -:1067B00007D53748807AB04203D88720F8BD01203A -:1067C000F8BD224639463046FFF725FD002D0BD097 -:1067D0002078A1788007800D08432E49884201D295 -:1067E000012000E0002028700020F8BDF8B51E460A -:1067F00017460D4600F02BF8040008D0207800065C -:1068000007D52348807AA84203D88720F8BD012005 -:10681000F8BD224639462846FFF724FDFF2E14D046 -:106820002588A178A807800D08431A4914F026FB93 -:10683000002E03D1FF31FF31033189B2A170A808C6 -:1068400080008905890F084320800020F8BD104989 -:10685000CA88824207D3002805D00C220968504319 -:106860000C38081870470020704703B50846694681 -:1068700009888A0607D4090604D50549897A41435F -:10688000491C88B20CBD00200CBD0000FFFF0000B9 -:10689000580C002001020000F8B507780D460446A8 -:1068A000012F19D0072F02D00C2F19D114E0A068A6 -:1068B000216906780B2E0BD0052005F094FE052EDD -:1068C0000ED0782300220520216905F0E7FD07E0BE -:1068D000782300220620F8E70520216905F083FED1 -:1068E000002D0ED0002028702946204603F0DFF945 -:1068F000FE482978C05D884201D10320F8BD0220FE -:10690000F8BD0021204603F0D2F90020F8BD70B593 -:106910000E460C462036317901208AB015460029F2 -:1069200009D0012905D12978042902D10520107048 -:1069300000200AB070BD6068019005A802900D218A -:10694000C01C14F08FFA032205A8A16814F02DFAD8 -:1069500001203071062069460870206A049029469B -:106960006846FFF799FFE4E770B50C4615462031FD -:106970000A790120062686B0002A2CD0012A28D1C7 -:106980002978042925D169681022A06801F0B4F99A -:106990006868C07B000606D5D44AA0681023103A68 -:1069A000014601F09EF91022A168E06801F0A4F907 -:1069B000A068C07B000606D5CC4AE0681023103AD8 -:1069C000014601F08EF92E70A0686860E068A8604A -:1069D000002006B070BD60680190C4482038029065 -:1069E0000120087168460670206A049029466846AE -:1069F000FFF752FFEDE7027B032A06D00022242393 -:106A00005A540B78092B02D003E0042070470A7611 -:106A1000CA61027B9300521C0273C150032070476D -:106A2000F0B50E4615460C46203602463179012057 -:106A3000072393B000290CD0012924D002292ED09D -:106A4000032904D12978042901D12B70002013B027 -:106A5000F0BD01203071606800280DD0A1690B7075 -:106A600060684860206988606069C860206A086260 -:106A70001046FFF7C0FFEAE706202870206968602B -:106A80006069A86009E029780629E0D10220307108 -:106A9000042028709548203868600320D7E72978BB -:106AA0000429D4D1A08910280AD9103880B2A08135 -:106AB000A1681023091805A86A6801F012F923E0FB -:106AC00010282FD0C2B21020801AA1680DAF1190EB -:106AD000C01914F06AF911980006000E06D0401E85 -:106AE000C1B280207854384614F0BCF96269102392 -:106AF0000DA909A801F0F5F8102309A905A86A68ED -:106B000001F0EFF8032030716068019005A8029051 -:106B1000062069460870206A049029466846FFF7F7 -:106B2000BBFE94E710232269A168E2E7F0B50E46A8 -:106B30000C4620363179012006278FB015460029F2 -:106B40000BD0012932D0022905D12978042902D19C -:106B50000820107000200FB0F0BD217D08A8CA07E2 -:106B6000D20F02718807C10F08A801716846027030 -:106B700041700722801CE16814F017F902A807226F -:106B80000130216914F011F9606805900AA8069097 -:106B900010236A46A16801F0A4F80120307168460C -:106BA0000774206A0890294604A820E0297804295F -:106BB000D1D1062205A8E16914F0F7F806A806224B -:106BC0000230A16914F0F1F800200890606801908B -:106BD00009A80290102305AA696801F082F8022032 -:106BE000307168460770206A049029466846FFF7AE -:106BF00053FEB0E770B50D460C46203529790120CB -:106C00008CB01646002909D0012905D13178042914 -:106C100002D10920107000200CB070BD6068019096 -:106C200006A802900822E16814F0BFF8082208A81C -:106C3000A16814F0BAF8012028710620694608708E -:106C4000206A049031466846FFF726FEE4E770B5F7 -:106C50000D460C462035297901208CB016460029B6 -:106C600008D00129D8D131780429D5D10A20107053 -:106C70000020D1E76068019006A802900822A16870 -:106C800014F093F800200890099001202871062044 -:106C900069460870206A049031466846FFF7FCFD9B -:106CA000BAE730B50B4620331C7901208BB0002C9D -:106CB00009D0012C05D11178042902D10B201070C4 -:106CC00000200BB030BD4868019005A802908C6888 -:106CD00068462578057564784475CC68257885758F -:106CE0006478C47500200690079001E04CB3010061 -:106CF000089001201871062368460370086A049002 -:106D000011466846FFF7C8FDDBE770B50C46203436 -:106D1000034625790120002D0AD0012D14D0022D23 -:106D200005D111780A2902D10C201070002070BD05 -:106D300001202071C868052202704A684260F84A42 -:106D40008260921CC2600BE015780B2DEFD10220FF -:106D50002071C86804240470526842608A688260A6 -:106D6000096A016201461846FFF745FE70BD30B55D -:106D7000011D02463132947803258379ED432C437B -:106D800023408371DB070DD04B79547923404B713D -:106D90000B79127913400B718278C9788A4200D935 -:106DA000817030BD00224A710A71F5E7F7B50C46D3 -:106DB00086B00020694626460870203631790127C2 -:106DC0001E2015461F2977D24B007B449B885B0011 -:106DD0009F441E0017023E025602690288029A0270 -:106DE000D102F5022E03590371037F03AE03C303DF -:106DF000CC03F7031A0464049A04AB04DF04FE0412 -:106E000010052A0565059B05C605830587058B05C5 -:106E10006069002802D0007813287DD0A068059012 -:106E2000002849D0012168460170206A049003219E -:106E3000684601710A214171E069029020790028B9 -:106E4000EFD0059909780029E7D00C2964D20B000E -:106E500014F056FA0CFD1A4B90B5E8FCFBFAF9F861 -:106E600007FD022828D16069002802D00078082890 -:106E700052D1022168460170206A04900598417839 -:106E8000684601710021B9E20620216A05F0ABFBDA -:106E900020790728E6D1606900F050FF02280CD065 -:106EA000606900F04BFF042807D060690028B8D063 -:106EB00000780128D6D103E01BE261690120087047 -:106EC00005980079C11F0A2901D30A2050E06169A1 -:106ED0000722887060690599303013F066FF012041 -:106EE000307161690320087034E00728BAD1606905 -:106EF000002896D001780929B4D10599C978890765 -:106F000007D1059949790029DFD1059989790029A7 -:106F1000DBD105994A7900E04EE2014620314B7DF4 -:106F20009A43D2D1059A8B7D92799A43CDD1059A15 -:106F30001279D31F0A2BC8D20979914236D8072279 -:106F4000C01C059913F031FF0120307161690A20DE -:106F50000870032069460870206A04906069313027 -:106F600001906069001D029060691C300390A1E2ED -:106F70002076F2E311288DD1606900F0DFFE04284D -:106F800004D0606900F0DAFE0B2893D1606905999E -:106F900010223730491C13F008FF6069017804297A -:106FA0007CD12421095C8278914201D90620DFE757 -:106FB000052101700320307168460170E2E3112859 -:106FC00094D1606900F0BAFE062804D0606900F030 -:106FD000B5FE0C288AD1E068002813D0206900286B -:106FE00010D060690178062910D00D210170606908 -:106FF000059910225730491C13F0D7FE60695730AD -:1070000009218CE100206946087072E107210170B6 -:107010006069059910224730491C13F0C6FE60696B -:107020004730EDE70228F0D1606900F087FE0028C4 -:10703000EBD0606900F082FE0128E6D0606900F0C4 -:107040007DFE05E0B1E08DE06CE02AE00AE0D6E0EC -:107050000828DAD00521684601710598417868460C -:10706000417146E11128D0D160690028CDD0017866 -:107070000E29CAD1C16A4078022810D000201422FB -:1070800050431430085805991022491C13F08DFE06 -:107090000520216A00F040FE0F205EE0F1E10120B2 -:1070A000EDE70B28B1D160690028AED001780F2937 -:1070B000ABD1C16A4078022826D000201422504368 -:1070C0000C300958059842780A70807848706069D9 -:1070D000C16A4078022819D0002014225043103091 -:1070E000085805990822C91C13F05FFE0520216A83 -:1070F00000F012FE60694178022909D000220832AE -:10710000825C5208520073E00120D7E70120E4E7D7 -:107110000122F4E7012100E0002108314254BCE3E0 -:1071200026B3010011289CD16069002899D001780C -:10713000102996D1C16A4078022811D0002014226B -:1071400050431830085805991022491C13F02DFEA1 -:107150000520216A00F0E0FD112061690870B4E3A8 -:107160000120ECE7082884D1606900289DD00178CF -:10717000112997D10599C06A49780170606905990C -:10718000C06A0622401C891C13F00FFE0520216AEC -:1071900000F0C2FD60694178022904D00022083263 -:1071A000825CFD2323E00122F9E71128BBD160694D -:1071B0000028BBD001781229B5D1C16A40780228D5 -:1071C00019D00020142250431C3008580599102271 -:1071D000491C13F0EAFD0520216A00F09DFD60695D -:1071E0004178022909D000220832825CFB231A4030 -:1071F000022991D18EE70120E4E70122F4E707207C -:10720000B6E6287801288ED16069696814221C309E -:10721000F9F7DAFF6069017F002901D02176ACE33C -:107220000178032901D0032037E00227C770817954 -:107230004907490F8171017A4907490F0172417A63 -:107240004907490F41726069FFF791FD377196E276 -:1072500028780F28E3D1072069460870216A049135 -:10726000916802916946087161690722C91C0298F8 -:1072700013F09BFD61690420087000203071BBE0B1 -:1072800028780328CBD1606901780529696807D07F -:107290000822473013F089FD0420307105206FE289 -:1072A00008225730F6E728780328B8D160690178BA -:1072B0000529696811D008224F3013F076FD0520AA -:1072C00030716069006A00280AD00220287000200E -:1072D00028716069006AA860F9E008225F30ECE775 -:1072E00004204DE22878022899D12879002801D07D -:1072F000207642E36069A96801626069002901D1D2 -:10730000F949016206200BE228780F2887D1A86886 -:10731000E0616069017805292BD047300721317180 -:10732000E16802220A706269126A4A6088606069D4 -:107330003030C8606069C01C08616269087D926A6B -:10734000400812784000D207D20F104308756269D6 -:10735000926A521C8A61FD2210406269D26A1278D8 -:10736000D207920F104308756069C06A401CC8615B -:1073700053E25730D2E728780828BAD160690178FB -:1073800005291AD00B210170072069460870206A70 -:107390000490E069029011200871029803210170A5 -:1073A00051681022401C13F000FD00216846FFF7D1 -:1073B00073FA00203071E06187E20621E3E7287864 -:1073C0000F2896D1072069460870206A0490A868A3 -:1073D00002901120087102980421017061690A78F5 -:1073E000072A0ED0002232710C220A706169102225 -:1073F000401C473113F0D9FC00216846FFF74CFAD6 -:1074000063E21022401C573113F0CFFC0021684684 -:10741000FFF742FA0A203071E168032008706069C2 -:10742000006A486060695730886060694730F3E1FE -:1074300028780828A1D1606969681022373013F0D4 -:1074400087FC002801D0042092E5606900780728B5 -:1074500017D00A203071E168032008706069006A63 -:10746000486060695730886060694730C860206A4A -:1074700008620698FFF7BFFA07466069FFF777FCD6 -:107480006BE208207AE1287809289AD10B20307124 -:1074900061696868897810224018511A13F0E2FC7B -:1074A000082069460870206A049068680190606945 -:1074B0008078087268E129780D29BBD161698979E2 -:1074C000C90703D00C20307109203EE0307103273A -:1074D00070E228780E28ADD160691422291D1C3075 -:1074E000F9F772FE6069018DC06A4172090A817202 -:1074F00060698178C06AC1716169CA6A081D117AC0 -:10750000C909C90111724379626919438378D26A42 -:107510009B079B0F012B00D0002300799B01C0002B -:1075200003431943117260694078012876D0B4E1B1 -:1075300060694178022901D0012100E00021083171 -:10754000405CC00707D00E20EAE069460870206A58 -:107550001146049019E11320B8E728780F2894D138 -:10756000A868E0610F2030710520EEE72878032835 -:107570008BD16069C16A4078022801D0012000E007 -:10758000002014225043103008580822696813F074 -:107590000CFC10203071E1680620226908706069D7 -:1075A000406A48606069C36A4078022801D00120BF -:1075B00000E000201427784310301858CA60886013 -:1075C0002BE128780C2886D16069C26A40780228AD -:1075D00001D0012000E00020142148430C30105855 -:1075E00002230932696800F07CFB11203071E168E8 -:1075F000052008706069006A48606069C06A0930E7 -:1076000088603948001F07E128780B28A7D16169F5 -:107610004878CA6A022802D0012001E059E100201E -:1076200014235843143010588A78696813F0BDFB4E -:1076300060694178C26A022901D0012100E000217D -:107640001423594314315258817850181022511A7A -:1076500013F008FC072069460870206A0490E0696E -:107660000290112008710298062101706169CA6AAE -:107670004978022901D0012100E000211423594357 -:10768000143151581022401C13F08FFB0021684622 -:10769000FFF702F90020E06112206FE028780F2840 -:1076A00091D1072168460170206A04909068029089 -:1076B0000B2268460271029801706169CA6A4978B2 -:1076C000022901D0012100E00021142359430C318B -:1076D00051580A784270497881706169CA6A49785C -:1076E000022903D0012102E02CB301000021142360 -:1076F0005943103151580822C01C13F056FB002189 -:107700006846FFF7C9F826E760694178022901D089 -:10771000012100E000210831405C800703D51420DE -:1077200030710A2011E71620D0E628780F287AD188 -:10773000A868E061072069460870206A0490E06943 -:107740000290112008710298082101706169CA6ACB -:107750004978022902D0012101E011E1002114231E -:107760005943183151581022401C13F01EFB0021C0 -:107770006846FFF791F80020E061152030710A207B -:1077800069460870206A049029466846FFF784F825 -:107790002BE028780F2846D1072069460870206A18 -:1077A00004909068029008200871029809210170E5 -:1077B00061690622C969097841706169801CC969DB -:1077C000491C13F0F2FA00216846FFF765F8AAE7B2 -:1077D00060694178022901D0012200E000220832CC -:1077E000805C400703D51720C8E70746B5E00129AC -:1077F00053D070E028780F2815D1A868E0611820D0 -:107800003071E168052008706069006A486060694D -:10781000C06A09308860F848C860206A0862069823 -:10782000FFF7E9F8E1E76FE028780B286CD1606991 -:10783000C16A4078022801D0012000E00020142213 -:1078400050431C3008581022696813F0AEFA072024 -:1078500069460870206A0490E0690290112008715E -:1078600002980A2101706169CA6A4978022901D027 -:10787000012100E00021142359431C3151581022EA -:10788000401C13F092FA00216846FFF705F800202B -:10789000E0616069407801281DD1192016E6606911 -:1078A0004278022A09D000210831411809780029BC -:1078B0000DD0CA0703D00E2106E00121F4E78907A5 -:1078C00001D5102100E012210170002772E0012A89 -:1078D00001D00D20FAE51C20F8E51D2030710B20A9 -:1078E00033E62978102948D1F0E56069017801294B -:1078F00043D0082941D00021317100F019FA0C2041 -:1079000069460870206A049037E028780F2805D06F -:107910001020107003271B2030714BE007216846B0 -:107920000170206A0490A8680290022168460171E3 -:10793000029805210170217E417000216846FEF702 -:10794000ABFF0B2168460170206A04902946684607 -:10795000FEF7A2FF07461B203071012F0DD029E052 -:10796000012168460170206A049004216846017173 -:10797000217E41710020207612E0207E00280FD069 -:107980006169132008701A2030710A206946087056 -:10799000206A049029466846FEF77EFF074609E004 -:1079A0006069002801D01421017068460078002821 -:1079B00000D021E5384609B0F0BDF7B50F462037B5 -:1079C0003879012686B00C46002804D0012828D03A -:1079D00002281CD197E02079012804D0022811D078 -:1079E000032814D10AE0A068407801280ED10620AF -:1079F000216A04F0D2FD00287FD10CE0A168132099 -:107A0000087008E0A0684178022901D0052674E0DA -:107A10000078082871D1012038710A206946087061 -:107A200033E0089800780F2867D107216846017075 -:107A3000206A049008988568029522790220012A1C -:107A400004D0022A29D0032A57D10FE006466846FF -:107A500006710B202870207B00214007400F6870C2 -:107A60006846FEF719FFA068067045E006466846BE -:107A7000067105202870207B687000216846FEF79B -:107A80000BFF3E710B2168460170206A0490684626 -:107A90000899FEF701FF06462FE0684601710120B4 -:107AA0002870207C6870607CC007C00FA870A07C24 -:107AB0004007400FE870E17C2971C0071FD0207D8E -:107AC0004007400F6871607D4007400FA87100219A -:107AD0006846FEF7E1FEA06807222946303013F021 -:107AE00064F9E068017AA06820300171A168287902 -:107AF0008870A16809200870002630465BE70020E6 -:107B0000A8716871E3E7A168142008700121684634 -:107B10000170206A0490042168460171217B417143 -:107B20000021FEF7B9FEE7E7F0B585B00F46054640 -:107B30000124287B800040198038C66F3078411EB0 -:107B40000A290AD22C498000323140188038C36F8C -:107B50003A463146284698470446002C01D0012C6D -:107B600011D1287B401E0006000E287301D003248B -:107B7000DFE70D2069460870306A04900021019605 -:107B80006846FEF789FE032CD3D0204605B0F0BD31 -:107B900070B515460A46044629461046FFF7C4FF4D -:107BA0000646002C0FD0207814280CD1207E002807 -:107BB00006D000202870204629460C30FFF7B4FF7D -:107BC000204600F0B5F8304670BD704710B5012969 -:107BD00003D0022901D0052010BD417000F0A8F8A3 -:107BE000002010BD002809D0027E002A06D00A46D7 -:107BF00001460C31CCE700002AB301000120704798 -:107C000030B5044687B00D46062004F0ECFC29464A -:107C1000052004F0E8FC2078142805D000206946EF -:107C200008702046FFF7DEFF07B030BD7FB50E4677 -:107C300000216A4611730178092903D00A2903D06B -:107C4000002407E0446900E08468002C02D0217E13 -:107C5000002912D0154601462846FEF7CCFE03281F -:107C600009D1324629462046FFF792FF6946097B33 -:107C7000002900D0042004B070BD25460C35EAE789 -:107C800000B50023012285B005280CD0062808D1B4 -:107C90006846027004910221017143710021FEF7D0 -:107CA000FBFD05B000BD6846027004910271F4E767 -:107CB00010B590B00C4605216A461170019022481B -:107CC0000290001D03900AA96846FFF7AFFF002845 -:107CD00005D1102220460B9913F067F8002010B050 -:107CE00010BD30B505E05B1EDBB2CC5CD55C6C40F2 -:107CF000C454002BF7D130BD10B5002409E00B7837 -:107D0000521E5B00234303700B78401CDC09D2B287 -:107D1000491C002AF3D110BD70B50C46054604F08D -:107D200062FC782300222146284604F0B7FB70BD90 -:107D30004178012900D0082101707047002801D046 -:107D4000007870470820704724B3010070B5F84DE3 -:107D5000040008D0012C10D0022C07D0032C05D031 -:107D6000F4A1752007E0F3A16C2004E02878012835 -:107D700003D0F0A1722013F0A2F92C7070BD70B581 -:107D8000EB4D044610280AD0112C16D028468178D5 -:107D9000122C07D0132C0AD0E6A1A4200BE0E5A1F9 -:107DA000992008E0112908D0E2A19E2003E01129C2 -:107DB00003D0E0A1A12013F082F9AC7070BD10B522 -:107DC000DB4894B0007B002819D017206946087062 -:107DD000D74900A806220D31023012F0E6FF09A9AA -:107DE000684603F0A2FE0446112805D0002C03D0FB -:107DF000D0A1C02013F063F9204614B010BD32208A -:107E0000E4E710B50022022103F086FF10BDFFB5A4 -:107E100095B01D460E460746FFF7F3FF04000AD053 -:107E20002078222804D3A07F8006C00FA84204D166 -:107E3000082019B0F0BDC348FBE737216846017040 -:107E40004780002D05D0012101714671179981717C -:107E500002E000206946087109A9684603F065FE42 -:107E6000A07FDF21084069010843A0770020E0E7F8 -:107E700070B50446084620380D46030013F040FA5A -:107E80000A060A11232C334249505761FF20A9A149 -:107E90000D3052E02078202851D1FF20A5A11030CC -:107EA0004BE0A3480178032949D08078132846D0B5 -:107EB0002078242843D0252841D023283FD0FF20F4 -:107EC0009CA1133039E02078222838D0232836D8D6 -:107ED000FF2098A11A3030E0207822282FD0FF20F0 -:107EE00094A11E3029E02078222828D0242826D0EA -:107EF000262824D0272822D0292820D0FF208DA171 -:107F000021301AE02078252819D0FF2089A12830B7 -:107F100013E02078252812D0FF2086A12B300CE01A -:107F2000207825280BD0FF2082A12E3005E0207874 -:107F3000282804D0FF207FA1313013F0C0F825702D -:107F400070BDFF207BA13430F7E730B57E4C0B8845 -:107F50007E4A022801D0934204D09D1FA54225D21B -:107F6000022802D04D88954203D04D88AD1FA5420E -:107F70001CD24C88A34219D88B88FF25F435AB421C -:107F800014D8022802D0C888904205D0C8886E4D07 -:107F90000A382D1FA84209D2C888904208D09442BE -:107FA00006D05B1C63438000834201DB072030BDA9 -:107FB000002030BDF0B56649884245D3654A0125A9 -:107FC000AD041368A84201D398423DD30279002A38 -:107FD00006D0082A02D8067B082E05D90720F0BD56 -:107FE000047B002CFAD0F6E7002A06D004688C4205 -:107FF0002AD3AC4201D39C4226D3002E06D08468FB -:108000008C4221D3AC4201D39C421DD300240CE00E -:108010000568A700ED598D4216D30127BF04BD4264 -:1080200001D39D4210D3641CE4B2A242F0D80022D6 -:108030000125AD040CE084689700E4598C4203D319 -:10804000AC4203D39C4201D21020F0BD521CD2B2EC -:108050009642F0D80020F0BD10B502893E4B111FAA -:10806000994213D24189042910D3DB1C99420DD8BF -:1080700091420BD80178890706D54068002803D0C3 -:10808000FFF798FF002800D1002010BD072010BD89 -:10809000FFB50022099B002802D0994205DC6EE062 -:1080A000002902D1002004B0F0BD0920FBE7845C68 -:1080B000002C12D087187D78112D59D010DC2B00A0 -:1080C00013F01EF90A561726262C2C2E2E4C4C5631 -:1080D000835C002B46D1521CD2B28A42F8DBE1E726 -:1080E0001C2D45DA123D2B0013F00AF9044242120E -:1080F0001A42022CD9D1BB78039C072B237001D2E2 -:108100005B0701D40A20CEE7029B01241B782CE0F8 -:10811000E343DB0708E0012C08D029E00620C2E792 -:108120000F2523072D075B19002BF4D03046BAE743 -:10813000640C00207372635C6761705F636F7265CB -:108140002E630000023000007B0C0000FFFF0000E7 -:1081500000D0010028000020FD3F0000029B1B789A -:108160009C0701D50B209EE702242343029C237029 -:10817000835C521C9A18D2B28A4202DD95E7192616 -:1081800076028A4293DB8DE710B504780B46002C0B -:1081900008D00121F94A012C07D0022C0BD0032C66 -:1081A00013D10EE00021197011E01970817989094D -:1081B00003290AD10BE0197081798909012904D1B9 -:1081C00005E019708179890901D0104610BD411C64 -:1081D0000622581C12F0E9FD002010BD08B5134618 -:1081E000002806D0E6A00068009048796A46800919 -:1081F000105C18700622581C12F0D7FD08BD30B56F -:108200000C46097895B0222902D2082015B030BD5D -:10821000282369460B704880132A03D03B2A01D0DB -:108220000720F3E708460A7109A903F07EFC050060 -:1082300003D121212046FFF71BFE2846E6E700B5C3 -:1082400095B0232369460B70488010888880508839 -:10825000C880D08848819088088100208881C881A2 -:1082600009A9684603F061FC15B000BD70B50C00AB -:10827000064610D0FFF7C5FD050003D1C149C2482D -:1082800012F01DFFA6802889E08028892081688956 -:108290006081A889A08170BD70B50E46050003D02D -:1082A0000021092004F09FF90120B84C022E207310 -:1082B00024D0032E04D0D320B249800012F0FFFE58 -:1082C000B24806210D3003F027FFA07C8006800E07 -:1082D000A074FFF774FDA08B00280ED0002D0CD0E9 -:1082E000830001220021092004F0D8F8092804D0D5 -:1082F000A548A449283012F0E2FE70BDA34803212E -:10830000103003F009FFA07C40218006800E084356 -:10831000A0749E480C3002F052FBDAE77FB501A949 -:10832000022003F068FD002851D097489549673036 -:1083300012F0C5FE4BE0029C2078212847D0A07F98 -:1083400001072BD520462230009068462346628ED6 -:1083500080882146343301F083FC050005D01128C4 -:108360002ED089488749843028E0A07FF721084033 -:10837000A077E17F480889074000C90F0843202102 -:10838000095D4007400FC9000843E077207828289E -:1083900024D129212046FFF76BFD1FE0400716D5A9 -:1083A00068462246808821460E32FFF748FF0500C6 -:1083B00008D0112804D074487249933012F07FFE1F -:1083C00000250BE0A07FFB210840A07706E001A874 -:1083D00003F01FFD0500AED0052D02D0284604B0E5 -:1083E00070BD0020FBE7F8B5040004D1664865497C -:1083F000A13012F064FE72202070606808260178B7 -:10840000091F0B0012F07CFF11FD0A4668FC460EA6 -:10841000FCFC4746464646FD92FD46007B205949F6 -:10842000C00035E087883846FFF7EBFC050004D133 -:108430001F205449400112F042FE6078042130436D -:108440006070524CA07F0843A07721212846FFF797 -:108450000FFDA87F8007800F012801D1801EA0801A -:10846000384603F0ABF83846FCF7FDFF3846FBF71B -:10847000A0FB3946022004F0B6F8A87FEF2108409F -:10848000A877FFF74BFF002804D03F483D49C9308B -:1084900012F015FEF8BD85882846FFF7B2FC0028CB -:1084A00004D139483749D33012F009FE606880782A -:1084B000012804D034483349D53012F000FE6068FA -:1084C0008179284603F096F90028E3D0617831439A -:1084D00061706168C880F8BD87883846FFF791FCF5 -:1084E000050004D128482749E63012F0E8FD6078FD -:1084F0003946304360706068C088288160680089B0 -:10850000688160684089A881022004F06CF800202E -:10851000A875A87F8007800F0228DCD1FFF7FEFE38 -:108520000028D8D0212017494001B1E780783C28A5 -:1085300003D00025022814D000E0012500270028E0 -:1085400008D03C2806D0022804D00F480D49FF303F -:1085500012F0B5FD002F06D00226304601F06CF96E -:10856000F8BD0127EBE76078304360700748817FF2 -:1085700031438177002D0BD00126EEE70232000057 -:108580000302FF01348100002E030000640C002070 -:1085900060688788384601F07BF905466068807915 -:1085A000012832D00226A87F0622800880003043AE -:1085B000A8776068C08A28816068008B68816068DD -:1085C000408BA8816068C079E875616828461830DA -:1085D000083112F0EAFB60680622807B68706168EF -:1085E000A81C0F3112F0E1FBA87F8107890F3846E4 -:1085F00002F0CEFFA87F8007800F0128ADD101E0F7 -:1086000005E008E0FE488780A7E70126CBE7204683 -:1086100001F02DFEF8BD607830436070F8BDF7B50D -:1086200005460078002700090C463E4601287DD00B -:108630000022F44902287AD0072804D00A2877D0EB -:10864000F149F24839E1686803780D2B35D006DC32 -:10865000042B6ED0072B3AD00A2B69D106E0122BDF -:108660003CD0132B44D0142BF7D1BEE011270726A2 -:10867000002C7CD08088A0806968FB238979A17157 -:10868000DF4905468A7F1A408A77042103F06BFB95 -:108690000521284603F067FB0021284603F063FB11 -:1086A0000121284603F05FFB0321284603F05BFB12 -:1086B0000221284603F057FB01E101270926002C7F -:1086C000D7D08088A080686880792072F7E0122770 -:1086D0000E2680882146FFF7C9FDF0E01A270726FD -:1086E000002CC6D04088A08068680079A071E6E0C0 -:1086F00081783C293ED010271E26002CB9D08088D6 -:10870000A0806868C08A20836868C08AE082686840 -:10871000008B60836868408BA0836968607D497FB7 -:1087200040084000C907C90F084303E06CE097E028 -:10873000BAE029E060756968C007497FC00F490841 -:108740004900084360756968A21DC8790831FFF7C0 -:1087500045FD69682246887B0D320F31FFF73EFDEB -:1087600068688079002803D00120207507E076E052 -:108770000220FAE719270726002C70D0A271A04822 -:10878000F722817F11407DE01B272E26002C66D02A -:10879000A1806968A21D0879491DFFF71FFD68685F -:1087A0002030C07A60736868C0780428A07B19D034 -:1087B00040084000A073F921084069681F22C97869 -:1087C0008907490F0843A07369684007C97A400FB9 -:1087D000C9000843A073696820460F300C3112F0BD -:1087E000E4FA6CE001210843E4E71E270E26002C82 -:1087F0006DD0A1806868E21D407AA07169688878B0 -:10880000C91CFFF7EBFC5AE0287A012805D00228A2 -:1088100015D07E487C4932384FE01D270E26002CAB -:1088200055D06888A080A889E080E8892081288ABE -:108830006081688AA0817248DF22817FA2E71227C7 -:108840000E266888FFF712FD002C40D0687840079C -:10885000400F032833D16A48FD22817F92E736E03A -:10886000287A030012F04CFD060410102020202668 -:1088700019270726002C2AD0A1806148A271817F88 -:108880004908490081771AE019270726002C1ED0D5 -:10889000A180287A012805D00320A0715848EF2232 -:1088A000817F6FE70220F8E721462846029A01F00F -:1088B0006BFEFEBD55485449801F12F000FC029823 -:1088C000002C068001D0278066800020FEBD029823 -:1088D0000680FAE710B54A4894B08078132802D091 -:1088E000082014B010BD22206946087009A9684606 -:1088F00003F01BF904460021072003F074FE204614 -:10890000EFE700B53E4895B08078122801D00820E6 -:10891000AAE41E216846017000218170C17009A976 -:1089200003F003F90028F3D10021072003F05BFED8 -:108930001120FFF724FA002096E400B5304895B0E6 -:108940000078022801D0032818D11B2108A8017340 -:108950000021817369460BA803F0E7F8002804D1D1 -:10896000684640781B2801D003207DE4002108469A -:1089700003F039FE68468078002801D0082073E4AF -:108980000120FFF7E3F900206EE4F8B51C4C03006A -:1089900012F0B6FC0A067917797979794435677946 -:1089A000FFF7CBFF00282AD1F8F7DCFF002826D0FC -:1089B0002221017000210172F8F7B5FFA07F01218B -:1089C0004BE08EB23046FFF71CFA050004D10F4889 -:1089D0000D492E3012F073FB287821280FD0F8F7BC -:1089E000C1FF002814D012210170022707724680AF -:1089F0000020A875F8F797FFA07F3843A077F8BD4F -:108A0000640C0020FFFF0000348100005F050000BF -:108A1000132229463046FFF7F2FBF0E7A578122D26 -:108A200006D0132D07D0F849F84812F048FBE6E7C6 -:108A3000FFF767FF01E0FFF74DFF0028DFD1F8F7F0 -:108A400091FF0028DBD022210170122D07D00221D6 -:108A50000172F8F768FFA07F10210843CEE70121DB -:108A6000F6E7A07C810901290BD0800904D0E748F2 -:108A7000E549223012F023FB03210020FFF70CFC14 -:108A8000BDE70221F9E7E148DF492930CDE7F7B535 -:108A900014460D0004D1DD48DB49313012F00FFBE4 -:108AA00028780827012807D002281FD0D748D649A0 -:108AB000623012F004FBFEBD0098FFF7A2F9060039 -:108AC00004D1D248D049383012F0F9FA0220B075FA -:108AD0001030207060783843607007CD083407C4C8 -:108AE000CB482022817F11438177FEBD0098FFF79C -:108AF00088F9060004D1C548C349463012F0DFFAB0 -:108B0000A988C448814208D1EA88824205D113224B -:108B100031460098FFF773FBFEBD814202D1E88821 -:108B2000002809D01220207060783843607007CD8B -:108B3000083407C4002006E07823002202200099B0 -:108B400003F0ACFC0120B075FEBDB1484089704710 -:108B5000FFB591B01498FAF71DF900285DD10124F2 -:108B6000684603218471C9028180002201A9204640 -:108B7000FBF7EEFA002850D16846152184714902AE -:108B8000818000261C2102A8009612F06DF90120B8 -:108B90000146684610310170002001466846417068 -:108BA0008178F9273940891C21438170017A022597 -:108BB0002943017212998186C6861F2101870C9074 -:108BC00011980F9001A80B9009AA0BA902A8FBF716 -:108BD0008AF8002821D168468D4E808CF080684646 -:108BE00084718D498180807809AA3840801C4108B1 -:108BF0004900684681708586058713A80F900BA9E8 -:108C000002A8FBF770F8002807D16846808C3081F5 -:108C100031460A311498FAF7D0F815B0F0BD30B5E6 -:108C20000C467E4995B08C423CD37D49012292048A -:108C30000968944201D38C4234D3203800220125A4 -:108C4000030012F05DFB06042A44484E575F0021E2 -:108C5000082003F0A2FC002802D0112015B030BD7E -:108C600024206946087000A80522A11C023012F0D9 -:108C70009CF809A9684602F058FF05002FD1082387 -:108C800000221146184603F009FC082827D05F4847 -:108C90005D49D63012F013FA21E06068002803D055 -:108CA000884201D21020D9E73D2168460170218811 -:108CB00041806188818009A902F037FF05000ED14B -:108CC000606800280BD06946098D018007E02068A4 -:108CD00001F0BCFE02E0204600F024FE05462846D6 -:108CE000BCE73E2007E0857000E0827009A902F031 -:108CF0001CFFF3E73420694608702078C0076846F7 -:108D0000F3D0F0E70720A9E730B50C46444995B009 -:108D100009688C4201D21020A0E72038030012F02D -:108D2000EFFA05042121232132002088FFF769F89A -:108D3000002804D00078222803D208208EE7394882 -:108D40008CE72521684601702188418009A902F03D -:108D5000ECFE050015D10AA905220231A01C12F073 -:108D600024F80EE006250CE02068002805D0884293 -:108D700001D2102505E001F057FE25480025808B23 -:108D8000A08028466AE7072068E72148133070472B -:108D900010B520211E4812F065F80120FEF7D6FF1D -:108DA0001120FEF7ECFF00211948C9438180002102 -:108DB0008176E1218900818301460C300D31044622 -:108DC000F8F750FE124807222146133011F0EDFF4C -:108DD000FEF7F5FF002803D00B49134812F06FF996 -:108DE00001F0F6F910BD10B504463C2112F03AF836 -:108DF000A07F80088000A077202020700020A07530 -:108E00002034607010BD000034810000B505000002 -:108E1000640C0020FFFF0000012A000000D00100C8 -:108E200028000020023000001C0700007047FEB53B -:108E30000546FF480C46814207D301208004844246 -:108E400005D3FC480068844201D21020FEBD002DED -:108E500002D0012D32D126E0F74908220F4668469C -:108E600011F0A3FF39462046FFF78EF90028EDD117 -:108E7000FEF7A5FF060006D007226946384611F026 -:108E800094FF3046FEBD2078002801D0012805D18E -:108E9000E94807223946C01D11F087FF002109204B -:108EA00003F0A1FB0FE00978002907D0012905D0C4 -:108EB000022905D0032903D0E048FEBD0720FEBDEE -:108EC0000120FFF7E9F9DC480C3885760020FEBD6B -:108ED00010B5D8490968884201D2102092E7D649D6 -:108EE00002460C390B7B0D311846FFF777F900204D -:108EF00088E7FFB599B00546002008A908746946BF -:108F0000087108A908730875CA4814460121C84A9F -:108F1000890400681E46002D05D095420BD38D4272 -:108F200001D3854207D3002C08D0944203D38C424E -:108F300004D3844202D210201DB0F0BD2846204345 -:108F400018D01F270BAB0CAA009728461A99FFF7D9 -:108F50009FF80028F0D10DAB01AA314620460097BA -:108F6000FFF796F80028E7D168460079C00703D0DC -:108F70000A20E1E70720DFE702AF002D0FD01A201B -:108F8000694608721A9888722946F81C1A9A11F0D4 -:108F90000CFF0EA902A802F0C8FD0028CCD1002CBD -:108FA0000ED0202168460172867232462146F81C96 -:108FB00011F0FBFE0EA902A802F0B7FD0028BBD1FC -:108FC0009D4908A8007B0C3948700020B4E770B5B3 -:108FD00006460A200C46087015461146204602F047 -:108FE000A4FD002807D1392121702046294602F02E -:108FF0009CFD002804D0082801D19048401C70BD79 -:109000002A462146304600F0B9FC0446082803D120 -:109010008B498C4812F053F8204670BDF0B50446D9 -:1090200089A003C897B0824D002715911490AC42D7 -:1090300011D380480121890403688C4201D39C42EA -:1090400009D32078012809D16268AA4203D38A4251 -:1090500004D39A4202D2102017B0F0BD76490C39E1 -:109060000A78012A0CD18A88794B9A4203D00028C9 -:1090700006D0012804D08A7F13079B0F06D101E098 -:109080000820E9E7D30701D1910701D51120E3E7D3 -:10909000218A704B0A46203A9A4207D3012877D199 -:1090A000002975D1628A002A72D111E0022801D00C -:1090B000032801D1A0296BD3012809D05E4A0C3ABC -:1090C0005278D20704D0628A002A61D0B42A5FD8CD -:1090D000002806D0012808D0022804D0032857D140 -:1090E00017E0002518E0022516E0002902D1608A69 -:1090F00000280CD004256068007800280CD00128D6 -:1091000009D0022807D0032805D04C48A4E7012540 -:10911000F1E7032500E00127207A002806D0012886 -:1091200006D0022806D0032867D105E0002604E017 -:10913000012602E0022600E00326002D01D0022DC8 -:1091400016D1002E14D0E068002803D0FEF732FFBD -:10915000002881D138480C384078800702D0374841 -:10916000401E79E7022D03D1022E46D0032E44D0B3 -:10917000182168460170218A4180218A8180857189 -:109180002D480C38007B002803D001286FD104E063 -:1091900033E000216846C17102E001206946C871D0 -:1091A0006846077221780930012920D0062111F084 -:1091B00059FE69460E74207D8207C107D20F400711 -:1091C000C90F5200C00F11438000014314A8405C36 -:1091D0006946C873002810D009A9684602F0A5FCAA -:1091E000002893D1002D0AD0022D08D012E061682A -:1091F0000622491C11F0D9FDDBE707202CE7002EE1 -:1092000008D0E068002805D009AA6946FFF7DFFE0C -:109210000028A6D11B20694608700120887009A982 -:10922000684602F082FC00289BD108A8407913E030 -:1092300000D0010028000020700C00200232000045 -:10924000348100002708000007060504030201001E -:10925000FFFF0000E13F00001B2819D12B0012F096 -:109260004FF80504040707040A00032001E00FE09B -:109270000220FEF76BFD012D0CD0608A002809D07A -:10928000002283001146104603F008F9002801D09F -:109290000320E1E60020DFE6F3B5032687B00D46A4 -:1092A00000290AD0FE4885426FD301208004854200 -:1092B00003D3FC480068854267D30798FEF7A1FDF9 -:1092C000040005D02078222804D2082009B0F0BD7F -:1092D000F548FBE7A07F8707BF0F002D05D0294683 -:1092E0003846FEF732FE0600F0D139460027EF4837 -:1092F000012907D0022931D0ED49EE4811F0DFFEF7 -:109300003046E3E7A27D2946012A02D0827F9207F8 -:1093100001D51120DAE700291BD108216A460497FC -:1093200011820592418904AAE348FBF701FB00285A -:10933000CCD16846008A082801D00320C6E76846D9 -:10934000018801814188418181888181C188C181F1 -:1093500002A9079802F0E1F90646D1E7A17D0229AA -:1093600016D1807F800613D4002D04D0A07F400743 -:109370000CD4002100E00121079802F00EFA06004B -:10938000BED1A775002DBBD004E01AE01126B7E7C7 -:10939000002D16D02A4621460798FEF750FF0646B4 -:1093A0001128ADD1A07F4007AAD420460822294623 -:1093B0000E3011F0FAFCA07F04210843A0770026AC -:1093C0009EE7102082E770B50C460546FEF719FDB2 -:1093D000010004D022462846FEF711FF70BDB248B6 -:1093E00070BD00B50146143195B0192901D281072D -:1093F00007D001461E3104D00A3102D0072015B033 -:1094000000BD312269460A70887009A9684602F0D9 -:109410008CFBF4E701B582B0022069460880A348BE -:1094200002AB00896A460021FBF7ECF8694609881F -:10943000022900D003200EBD1CB50021009102219D -:109440006A461180974901900968884201D210202C -:109450001CBD964801899848FBF76AFA6946098855 -:109460000229F5D003201CBDF0B50E468C4985B00D -:10947000174605468E4207D38A48012292040068A7 -:10948000964204D3864202D2102005B0F0BD1F2FB1 -:1094900001D90C20F9E7854C8D4226D3954201D3A2 -:1094A000854222D3E08803A9FBF75DF80028ECD1C0 -:1094B000287869464873E08803A9FBF735F8002847 -:1094C000E3D1694600900878022108436946087094 -:1094D000497B090703D00821084369460870E088E2 -:1094E0006946FAF7BAFF0028CFD169468F80E08835 -:1094F000334601AA0021FBF785F869468988B942FD -:10950000C3D00320C1E71CB50C4600210091019196 -:10951000228869460A80634901900968002801D0C1 -:10952000884201D38C4201D210201CBD002801D0FA -:10953000002A09D05D486A46C1885F48FBF7F8F900 -:109540006946098821801CBD0C201CBD10B5012373 -:10955000FEF75DFC56E4002310B51A461946FEF7E7 -:1095600056FC4FE470B504464D4894B0844207D38E -:1095700001208004844206D34A480068844202D213 -:10958000102014B070BD2046FEF766FD0028F8D10B -:1095900046488178112901D00820F2E7817FC90669 -:1095A00001D51120EDE71D2269460A7021780025BA -:1095B000CA07D20F69468A7022898A806289CA8066 -:1095C000217801268907CA0F69464A72007B002864 -:1095D00003D0012804D00320D3E708460D7201E030 -:1095E00008460E7209A902F0A0FA0028C9D1207815 -:1095F000800708D56068002805D009AA6946FFF7EA -:10960000E6FC0028BDD11E21684601708670C57039 -:1096100009A902F08AFA0028B3D1A08900F073F9F1 -:109620000400AED11220FEF7AAFB2046A9E7F0B550 -:1096300016461C4A0C46050019482049126899B084 -:1096400005D085420FD38D4201D395420BD384427E -:1096500009D38C4201D3944205D3864203D38E4270 -:1096600004D3964202D2102019B0F0BD0F4FB87F3C -:10967000C106890F01D1400701D51120F4E720462A -:10968000FEF7EAFC0028EFD120788107C90F2943B3 -:1096900003D0800714D5002D12D00720E4E7000086 -:1096A00000D001002800002002300000640C0020DF -:1096B00034810000F3090000FFFF000000000400F7 -:1096C00031460220FEF741FC0028CDD1C948807800 -:1096D000112803D0122801D00820C5E70220002756 -:1096E00014A9189002F087FB00280DD0C2A1C6482B -:1096F00011F0E5FC08E01598807F81071898890F24 -:10970000814201D17F1CFFB214A802F082FB002825 -:10971000F1D0032F01D30420A6E7B64880781228A1 -:1097200003D1FFF7EEF800289ED12078800708D5F6 -:109730006068002805D009AA6946FFF748FC0028A0 -:1097400092D12121684601702189418061898180FF -:10975000207800278007C10F684681712078800734 -:10976000002815DB2878002807D0012808D0022817 -:1097700006D0032804D0A54876E76846C77102E002 -:1097800001206946C8710622691C02A811F00DFB70 -:109790009848007B002803D0012804D0032063E709 -:1097A0006846877302E001206946887331886846FD -:1097B000018271884182B1888182F188C1820783E8 -:1097C000478309A902F0B1F9002886D1A08900F0E9 -:1097D0009AF80400A0D11320FEF7D1FA204643E7FF -:1097E00030B505468A4895B000680C46814202D2E1 -:1097F000102015B030BD2846FEF703FB002807D027 -:109800000178222902D3807F800603D40820F0E764 -:109810008048EEE7132168460170458009A902F0EF -:1098200084F90028E5D108AA0A2151567F2901D0E0 -:109830002170DEE70520DCE710B56E49012807D06E -:10984000022815D0FF206CA14D3011F038FC81E6C4 -:109850000878032804D0FF2067A1433011F02FFCC3 -:109860000021084602F0BFFE0120FEF76FFA71E604 -:109870008878132804D0FF205FA1483011F01FFC26 -:109880000021072002F0AFFE1120FEF778FA61E612 -:10989000F8B504460122022102F03EFA07460122F1 -:1098A0000321204602F038FA06460122052120460F -:1098B00002F032FA054601220421204602F02CFA79 -:1098C0000446002F04D1AF204BA1800011F0F7FB1C -:1098D000002E04D14C4848A11A3811F0F0FB002D9D -:1098E00004D1494844A1193811F0E9FB002C04D1F6 -:1098F000454841A1183811F0E2FB22213846FEF715 -:10990000B7FA3846F8BD10B5002809D08300002208 -:109910001146072002F0C2FD072801D0032019E6F6 -:10992000002017E610B50446006800280CD03A491C -:10993000884207D301218904884205D33449096844 -:10994000884201D2102005E601F062F8A088294C77 -:10995000A083A07E01280DD10021092002F01DFE68 -:10996000002800D00120A17C8909012904D003210D -:10997000FEF792FC0020EDE50221F9E7F7B500269D -:109980000C4605460B271AE02968B00009580978EB -:10999000002903D0012901D00720FEBDA17029684C -:1099A00006220958E01C491C11F0FFF927702046D7 -:1099B000029902F0BAF80028EFD1761CF6B22879A5 -:1099C000B042E1D800263A270FE0A868B10041581C -:1099D0001022A01C11F0E9F927702046029902F02C -:1099E000A4F80028D9D1761CF6B2287BB042ECD876 -:1099F0000020FEBD640C00207372635C6761705FC1 -:109A0000636F72652E630000D7020000023200000F -:109A1000280000200230000000D0010030B5F94BD2 -:109A20009A4207D301239B049A4205D3F64B1B6845 -:109A30009A4201D2102030BD1578EB065B0F042B43 -:109A400007D85478072C04D39378102B01D8A3425D -:109A500001D2072030BDD3785B0702D413795B07AE -:109A600001D5062030BDC37FAC075B085B00E40F67 -:109A70002343C3770878EF23184013789B06DB0F46 -:109A80001B0118430870F12318401378DB065B0FA5 -:109A90005B001843087050780873002030BD30B563 -:109AA00000240C70C378DB07DB0F0B70C578AD07A3 -:109AB000ED0F6D002B430B70C5786D07ED0FAD00FA -:109AC0002B430B7014700179C907C90F117003790A -:109AD0009B07DB0F5B001943117000794007C00F33 -:109AE00080000143117030BD70B514460D46064626 -:109AF000F7F738FF002809D0A2210170142221466F -:109B00000830F7F761FBF7F70EFF70BD1322294607 -:109B10003046FEF774FB70BD70B514460E46054620 -:109B2000F7F720FF002809D0222101704580217815 -:109B3000017261784172F7F7F6FE70BD132231466B -:109B40002846FEF75CFB70BD10B5B04C207C0028A9 -:109B50000CD1204621461038FEF7AAF8002803D081 -:109B6000ABA1F12011F0ABFA0120207410BDFFB5BC -:109B700081B00A9D06461C4617461421284611F05E -:109B800073F90B9800210160F8070ED09E492068F8 -:109B90000968884239D31230286020681430686020 -:109BA0002068A8600B9821680160B80726D5606816 -:109BB000002803D094490968884226D302990029D5 -:109BC0000AD0FC3600280ED031461030FEF7DCFA01 -:109BD00000281BD1606810E0002816D0E8608036AD -:109BE0006068B0670AE0FFF7D0F801460722304608 -:109BF00011F0DBF8FFF7A8FF8448E860780708D584 -:109C00008149A0680968884202D2102005B0F0BDE1 -:109C100028610020FAE770B5054611200C4608704F -:109C2000002161702121495D002908D003290ED04F -:109C3000042910D0FF2076A1523011F040FA20788C -:109C40000009012802D9E87FC008607070BD0007D4 -:109C5000000F203002E00007000F30302070EEE7E8 -:109C600070B594B015460C462C226946189E0A70B1 -:109C70004880002B17D00822194601A811F095F84A -:109C800068468581102231460E3011F08EF809A900 -:109C9000684601F04AFF002803D1A17F102211433A -:109CA000A17714B070BD002001900290E8E7F0B5F4 -:109CB0000646008A97B080B20D460190FEF7A1F8E3 -:109CC0000446524831784838554F09900B0011F03E -:109CD00017FB0EF2F148085F87ABCAF3EFEEEDEC2D -:109CE000EBF2A07F8007800F012807D0002100221F -:109CF000019802F011F8050007D101E00121F6E713 -:109D0000FF2043A1943011F0DAF9387CC00904D067 -:109D100043484038406DA86112E02B206946087224 -:109D20000BA902A801F001FF002804D0FF2038A1F0 -:109D30009F3011F0C4F93B490C9811F09FF8A961CC -:109D40007068A862B068E862A07F8007800F012871 -:109D500020780DD0252804D0FF202DA1B03011F09F -:109D6000AEF9324621460198FFF7BEFE17B0F0BDAE -:109D70002528F6D0222806D0242804D0FF2024A1AC -:109D8000A93011F09CF925212046FEF771F8E8E78B -:109D9000A07F8007800F012807D0002100220198B2 -:109DA00001F0BAFF060007D101E00121F6E7FF202C -:109DB00017A1BB3011F083F92078252804D0307822 -:109DC000012108433070D1E702202870B068A860F4 -:109DD000B068002802D000202871C7E70120FBE707 -:109DE0002B2069460870094968464C3901F09DFEF0 -:109DF000002804D0FF2006A1DA3011F060F903201A -:109E00002DE0000000D0010028000020300D0020CF -:109E10007372635C6761705F7365632E630000003B -:109E2000500E002040420F002A206946087000A80A -:109E300010220230716810F0B8FF04A8102202301E -:109E4000B16810F0B2FFFE49684601F06EFE0028CE -:109E500004D0FF20FB49EB3011F031F904202870C9 -:109E60000998686082E7B068002804D1FF20F549AE -:109E7000F73011F024F9E07F400704D5FF20F149C5 -:109E8000F83011F01CF9B06806220A3800903379D6 -:109E90000421019801F041FA002894D0FF20E949FB -:109EA000FD3011F00CF961E774E1D5E0CBE0A8E0FA -:109EB0004BE001E083E087E1002C04D18120E149FF -:109EC000800011F0FCF8204622301022054671680F -:109ED00010F06BFF28212046FDF7CAFFA07F800706 -:109EE000800F02280CD100231A46214600950198C4 -:109EF000FFF7B6FE11280BD029212046FDF7B8FF49 -:109F0000E07F317A4007400FC9000843E0772DE732 -:109F1000A07F000703D5CB49CB4811F0D0F8A07F34 -:109F200008210843A077002060862046343010F0D6 -:109F300099FFE07FFD220146C9071040890F0843C1 -:109F4000E077307A2034207010E7A07F8007800F00 -:109F5000012807D000210022019801F0DDFE040055 -:109F600007D101E00121F6E7B748B6491D3011F0ED -:109F7000A6F82B2069460872B14902A801F0D5FD68 -:109F8000002804D0B048AF49223011F098F8AC480E -:109F90008188204621300176090A41760E212970F8 -:109FA0002146FC316960017E2974407E6874A448B2 -:109FB0002C30A860103030346C61E860D6E6002C9C -:109FC00004D1A1489F49363011F079F82078212832 -:109FD0009DD93079012802D0022808D103E0E07F22 -:109FE00004210843E077387C012108433874324665 -:109FF00021460198FFF778FD23212046FDF738FF21 -:10A00000B4E601220421019801F066FC00289BD0EF -:10A01000A07F8007800F012807D00021002201982F -:10A0200001F07AFE040007D101E00121F6E786483D -:10A030008449543011F043F80F20287017202871FC -:10A040006E34AC6092E60421019801F094FC002883 -:10A05000B4D11020287089E6A07F8007800F0128E6 -:10A0600007D000210022019801F056FE050007D11B -:10A0700001E00121F6E7744872496D3011F01FF8D4 -:10A080002E462036307E41064DD5A17F8F07BF0F6B -:10A09000C00713D02A468032516F00290ED0087CA9 -:10A0A000F37DC007C00F5B0018430874516FE27F57 -:10A0B00040084000D207D20F10430874307E0007DA -:10A0C00013D528468030026F002A0ED0117CF37D14 -:10A0D000C907C90F5B0019431174E27F49084900A1 -:10A0E000D207006FD20F11430174307E80070BD569 -:10A0F000F8204259002A07D0012F05D02946307C8C -:10A1000031311032FEF76AF8307EC0060BD5F820E8 -:10A110004259002A07D0012F05D12946307C313120 -:10A120001032FEF75BF8052368460370357E4570F4 -:10A13000434822216038019A01704178C908C9005A -:10A14000C91C4170428003724572F7F773FD207895 -:10A15000252809D021280BD00B203A49800110F086 -:10A16000AEFF2078222803D922212046FDF780FE69 -:10A17000A07F8007800F01280AD00021019801F0FC -:10A18000F2FD002800D1F1E559202E49C00088E6F3 -:10A190000121F3E774682A4D20786035092802D040 -:10A1A0000A28F0D10BE0E168002902D02846F8F730 -:10A1B000C8FE2169002902D02846F8F7C2FE2146D0 -:10A1C0002846F8F7BEFED1E51F481E49DC3068E698 -:10A1D0001B4810B5072228216030F8F799FE1B486C -:10A1E0000024017C4906490E017440384465FDF79E -:10A1F000ECFC13493C3108461038F7F76AFC10486C -:10A200004C30047410BD70B50D46FDF7FAFD040026 -:10A2100004D1C3200B49800010F051FFFF2105310C -:10A22000284610F021FEA07F8007800F012814D05F -:10A23000022128468830FDF7C9FC00280CD007E031 -:10A24000E40C0020109E000011020000500E0020BF -:10A25000FA49FB4810F033FF70BD0121E9E70A46D7 -:10A26000014610B510468830FDF7CAFC10BDF0B5A8 -:10A2700005464068082601789BB008290DD00B29B7 -:10A2800003D00C2940D10121817168688788384644 -:10A29000FDF7B7FD040042D13CE047883846FDF7A2 -:10A2A000B0FD040004D1E648E449153010F007FF82 -:10A2B0002078212828D0282828D1686802210C304D -:10A2C00000F0A7FF002821D068680821001D00F0D9 -:10A2D000A0FF00281AD02D21684601704780214632 -:10A2E0001022223101A810F060FD0FA9684601F08C -:10A2F0001CFC002804D06720D049C00010F0DFFE0D -:10A3000029212046FDF7B4FD1BB0F0BD687830432D -:10A310006870F9E7CA48C949423010F0D0FEA07F02 -:10A320008107890F022902D1EF210840A077207808 -:10A33000212810D068688179002902D0807800280F -:10A3400018D0A07F8007800F022864D0E320BB498B -:10A35000800010F0B4FEA07F8007800F0228D3D1C8 -:10A36000FDF7DCFF0028CFD0B548B449883010F0A5 -:10A37000A6FEC9E7687830436870E07FC00701D067 -:10A38000042100E00321212001552078292818D03C -:10A390002428E0D13946062002F025F92221204662 -:10A3A000FDF766FDA07F8007800F012831D00021D6 -:10A3B000384601F0D8FC0028CDD0A1489F496D3027 -:10A3C000C7E7A07F8007800F012807D00021002267 -:10A3D000384601F0A1FC050007D101E00121F6E7B4 -:10A3E000DB209649800010F06AFE25212046FDF70B -:10A3F0003FFD0D2008A90871284609A98830FDF7FE -:10A40000F1FB0228A7D00028A5D08D488B496230E7 -:10A410009FE70121CCE76878304368709BE7F7B588 -:10A420008AB015460646FDF7ECFC002844D00178BA -:10A43000222941D323293FD0C17F49073CD4807FC3 -:10A440008007800F01280ED0002201280DD00021A6 -:10A45000304601F061FC07467A480290F8F768FD43 -:10A46000040009D103E00122EFE70121F0E7ED202C -:10A470007249800010F023FE002F1FD088376761DB -:10A480000298F8F755FD07460298F8F751FD0921A3 -:10A490002170266225710B99E760A160206103A9F4 -:10A4A0002046FDF7C3FB022806D0002804D03D203B -:10A4B0006249000110F003FE0DB0F0BD0020074618 -:10A4C0006061E4E730B587B00446FDF79AFC0546C5 -:10A4D000807F8007800F01280BD0002100222046BA -:10A4E00001F01AFC0446287822281ED9002C07D136 -:10A4F00001E00121F2E7F7205049800010F0DFFD74 -:10A500000F21684601701721017120466E300290BC -:10A5100069461A30FDF766FB022806D0002804D0F1 -:10A5200047484649D03010F0CAFD07B030BD30B5BD -:10A5300087B00446FDF765FC0546807F8007800FE5 -:10A5400001280BD000210022204601F0E5FB044643 -:10A5500028782228E9D9002C07D101E00121F2E76F -:10A5600037483649DD3010F0AAFD102069460870E2 -:10A5700020468830FDF736FB0028D6D030482F49DA -:10A58000E03010F09CFDD0E7F7B5054600780027D5 -:10A59000000982B00C463E4602287DD0072802D032 -:10A5A0000A2849D152E068680178082906D00B29A9 -:10A5B0002FD00C292DD02149234866E114271A26D3 -:10A5C000002C6AD04088A080FDF71BFC009000287A -:10A5D00004D11D481949243810F071FD00980099E4 -:10A5E000C07DA21D1831FDF7F9FD68680822808939 -:10A5F000E081696820461030091D10F0D6FB207EEE -:10A6000001210843F9210840207600984021807FED -:10A6100050E018270826002CD3D08088A080FDF7B2 -:10A62000F0FB050004D108480449401F10F047FD25 -:10A63000A11D2846FFF7EFFA29E10000109E000057 -:10A6400011030000440D00202E040000002C01D056 -:10A65000288BA080287A01287ED0022804D00328E5 -:10A660002FD0F649F64810E11C270726002CA8D069 -:10A67000A088FDF7C6FB0090002804D1F048EF4900 -:10A68000723810F01CFD287B8007800F0128A0790C -:10A6900014D04008400001E0E9E0E3E0A071FD21B2 -:10A6A0000840297B4907C90F49000843A071009859 -:10A6B0008021807F084300998877E8E001210843E2 -:10A6C000E9E713270B26002CA6D0A088FDF799FBFD -:10A6D0000090807F8007800F012807D00021A0888C -:10A6E000002201F019FB050007D101E00121F6E786 -:10A6F000D348D2495F3810F0E2FC0098807F800791 -:10A70000800F012850D0E86A81788907890F0129D4 -:10A71000A1794BD049084900A1718278FD255207E3 -:10A72000D20F294052001143A171E3221140027857 -:10A730005207D20E1143A171DF2211404278D20795 -:10A74000920E1143A1710021E171C1782172427909 -:10A750000179607A400800E02BE0D3074000DB0F6E -:10A7600018439307DB0F28405B0018435207FB2375 -:10A77000D20F1840920010436072A07ACA074008B6 -:10A780004000D20F10438A07D20F284052004907D9 -:10A790001043C90F184089000843A0720098007840 -:10A7A000232874D92621C4E0A86AADE70122114309 -:10A7B000B2E7297BA348022911D017270C26002CC9 -:10A7C00050D0012912D003291FD0042920D00529F7 -:10A7D0001ED09B489949143810F071FC23E01927CA -:10A7E0000726002C53D00121A17105E00121A171A0 -:10A7F000E17989088900E171017CCA094906D20121 -:10A80000890E49000A4302740DE00220A07106E09F -:10A81000687B0007000F8030A07105291DD0E0790A -:10A8200080088000E071A088FDF7EBFA054600780B -:10A8300021282CD0232804D081488049083810F0E2 -:10A840003EFCA87F8007800F01280ED00021A08841 -:10A8500001F089FA222128466CE0E0798008800026 -:10A86000401CDFE70498068017E00121EFE7002C89 -:10A8700001D06888A080287A032832D004280FD01D -:10A8800005285AD06E486D49513010F018FC0498D4 -:10A89000002C068001D027806680002005B0F0BD26 -:10A8A00015270C26002CDDD0A088FDF7AAFA807FA2 -:10A8B0008007800F012807D00021A088002201F026 -:10A8C0002BFA050007D101E00121F6E75C485B495E -:10A8D000173010F0F4FB0622A11DA86907F036FA24 -:10A8E000D5E716270726002CBCD0A088FDF789FAEB -:10A8F0000090807F8007800F012807D00021A0886A -:10A90000002201F009FA050007D101E00121F6E774 -:10A910009B204A49C00010F0D2FB2878C00601D520 -:10A92000022000E00120A071009800782328AED911 -:10A9300027210098FDF79CFAA9E717270C26002C81 -:10A9400090D0A088FDF75DFA00906D7A002804D1C0 -:10A950003B483A49383010F0B2FB0621A01D10F0F8 -:10A9600081FA0020A071207A032108432072FB2184 -:10A9700008400099C97FC907490F0843207268063B -:10A9800085D5E07904210843E071A07AE907400801 -:10A990004000C90F0843E17A2A0749084900D20F4D -:10A9A0001143FD22AB07DB0F10405B001843A07280 -:10A9B000E806C00F114040000143E17267E710B59F -:10A9C0000446807990B08009012804D01C481B49B6 -:10A9D0006A3010F074FBFFF7B7F801206946087081 -:10A9E00019480190201D0290601C0B900AA968462E -:10A9F000FDF71CF9002804D011481049743010F0FC -:10AA00005EFB0322601C0B9910F0CFF910B010BD53 -:10AA100010B50D4C002805D001461022204610F03C -:10AA2000C4F90120207410BD10B50446FFF78CF85E -:10AA300010220549204610F0B8F910BD109E000004 -:10AA4000B3040000500E0020300D002070B500252A -:10AA5000FE4C00281CD0FE49884207D301218904FE -:10AA6000884205D3FB490968884201D210250DE0D0 -:10AA7000062107F055F9411C07D0F44940394865D3 -:10AA8000207C80210843207400E00725284670BD03 -:10AA9000207C4006400EF6E7F3B5002089B00D4655 -:10AAA000029000290AD0EA4885421CD30120800484 -:10AAB000854203D3E7480068854214D30998FDF71F -:10AAC000A0F9060003D03078222815D102E0E24830 -:10AAD0000BB0F0BD002D08D1B07FC10903D08007B5 -:10AAE000800F022801D01020F2E7B07FC10601D408 -:10AAF000010703D5002D01D00820E9E7D349097CDF -:10AB0000C90717D1F17F490701D50D20E0E780077C -:10AB1000800F01280CD000210122099801F0FCF8D7 -:10AB2000070007D0B07F8007800F022804D00DE017 -:10AB30000121F1E71120CBE7002D07D02A46394645 -:10AB40003046FEF76BFF02900028C1D1C348F8F7EA -:10AB5000EFF9040003D1C249C24810F0B0FA0A204C -:10AB600020700998206238468830A060B07FFB21B1 -:10AB70008007800F012829D0002D3DD002202071B0 -:10AB8000381DE06038780007400F20743878C00620 -:10AB9000C00F6074A07C2A788008D2078000D20F92 -:10ABA0001043A0740840F17F01AAC907490F084368 -:10ABB000A074A878E07469462846FEF770FF6846DE -:10ABC0000079207568460078607519E001202071D1 -:10ABD000207B2A788008D2078000D20F1043207390 -:10ABE000084029788907C90F890008432073242168 -:10ABF0003046FDF73DF90BE003202071052020735E -:10AC000025213046FDF734F9B07F4006400EB0777D -:10AC100003A92046FDF70AF8022806D0002804D030 -:10AC200090488F492B3010F04AFA029850E7FFB550 -:10AC30008D4A0E4607CA97B002AB07C3002701979B -:10AC40000C971798FDF7DDF8050005D02878262821 -:10AC500004D008201BB0F0BD7F48FBE7A87F800729 -:10AC6000800F012807D000210022179801F054F826 -:10AC7000040007D101E00121F6E77A487849623003 -:10AC800010F01DFAA87F8007800F1690012814D0BD -:10AC9000022824D0734872497B3010F010FA012149 -:10ACA0000022852E31D01EDC002E26D0812E26D00B -:10ACB000822E26D0832E1ED125E0002EEFD12146F4 -:10ACC0002846199AFEF7AAFE0028C3D11998807861 -:10ACD000019019980078C007C00F0C90DFE7199811 -:10ACE000002808D1DBE7862E11D0882E11D0892EBE -:10ACF00011D08A2E11D00720ACE710460EE008468E -:10AD00000CE002200AE0032008E0052006E006200F -:10AD100004E0082002E0092000E00A20002222715D -:10AD200001216A461176211D0791002801D020716A -:10AD30000BE1169801280CD0A66AE06A02220121D4 -:10AD400011900020A0602846173002291AD0012156 -:10AD500019E0E66AA06A1190032030702078FB2386 -:10AD6000C006C00F7070B07801221840019BF370CC -:10AD700080080C9B800018430221B0700020707185 -:10AD80003071DEE70021890009190861681C022A78 -:10AD900001D0012100E00021890009190861B07883 -:10ADA0008007800F01286FD1119880788007800F6D -:10ADB000012869D11198007901901198407900908B -:10ADC000169801281DD0317908A801747179017590 -:10ADD00008A8027C01980099024008A8007D08405C -:10ADE0001490104350D01A491A98884207D3012171 -:10ADF0008904884215D317490968884211D2102066 -:10AE000028E70CAA0DA91998FEF749FE08A8007CAE -:10AE100001990840307108A8007D009908407071C0 -:10AE2000D6E720463C3021460090F031169801913B -:10AE3000022845D000211A9B20460C33FEF797FECE -:10AE40000028DDD12146F43120460FE0500E0020CD -:10AE500000D001002800002002300000440D002036 -:10AE6000109E0000AF05000084B301005030009038 -:10AE700016980191012825D0002120461A9B149A8A -:10AE8000FEF775FE0028BBD111988078400702D4E8 -:10AE9000E87FC0072BD0169902A8012914D0119978 -:10AEA00009784900405A21780907490F4900C840EC -:10AEB0008707BF0F2AD0012F14D0022F0FD113E024 -:10AEC0000121B8E70121D8E721780907490F490096 -:10AED000405A119909784900C8408707BF0F032FCE -:10AEE00004D004E0022711E001270FE002271698A2 -:10AEF00001280BD1B078FB210840E97FC907490F31 -:10AF00000843B07020780007400F3070207810227E -:10AF10004008400020701199D2434978C907C90EF2 -:10AF2000114308402070C00622D4022F20D0012FE8 -:10AF300020D00020A061E0612062606220461830CD -:10AF4000A060E87F40084000E877204606A98830E6 -:10AF5000FCF748FE002805D0022803D0B449B548C4 -:10AF600010F0ADF825212846FCF782FF002071E69D -:10AF7000032008E020460D211B300FF073FF204610 -:10AF80001830A060042069460875E87F0121084355 -:10AF9000E87705AA29461798FEF7BEFDD5E7F0B574 -:10AFA00087B015460F0004460DD0A348854207D34D -:10AFB00001208004854206D3A0480068854202D261 -:10AFC000102007B0F0BD2046FCF71BFF060004D0A0 -:10AFD0003078272803D00820F3E79948F1E7B07FBD -:10AFE0008007800F012807D000210022204600F0B2 -:10AFF00093FE040007D101E00121F6E78D488C495A -:10B000001F3010F05CF80020002F05D0022F08D070 -:10B01000012F11D00720D4E701216A461171A060E9 -:10B0200018E0234618336946A360087110222946A8 -:10B0300018460FF0BAFE0DE021461831A1606946AE -:10B040000871A061E061206260620621284606F076 -:10B0500067FEA0612078C10714D04008400020702E -:10B060000220694608702046183002907030FCF7C4 -:10B07000B9FD022806D0002804D06E486C49423041 -:10B0800010F01DF825213046FCF7F2FE002098E76D -:10B09000F8B515460E460746FCF7B3FE040004D08B -:10B0A0002078222803D00820F8BD6548F8BDA07F8D -:10B0B0008007800F022802D06148C01CF8BD5E489E -:10B0C00086420ED3012189045C4A8E4202D3136862 -:10B0D0009E4206D3854204D38D4204D31068854234 -:10B0E00001D21020F8BD00953288B31C21463846A5 -:10B0F000FEF7B6FD112816D00028F3D1E17F2A7C97 -:10B100004908D2074900D20F1143E1772A7C490749 -:10B110009206490FD20ED2001143E177A17F490672 -:10B12000490EA177F8BDA17F0907FBD4204608226C -:10B13000B11C34300FF039FE308860862046102272 -:10B14000294622300FF031FEE07FFD210840297CA6 -:10B15000C907890F0843E077287C41082020015562 -:10B16000A07F08210843A0770020D7E770B594B0EE -:10B170000D460646002B02D0072014B070BDFCF728 -:10B1800040FE040007D02078222802D3A07F40068A -:10B1900003D40820F1E72A48EFE7002D19D02D212C -:10B1A0006846017046801022294601A80FF0FDFD77 -:10B1B000E07F297C4008C9074000C90F0843E077B9 -:10B1C000297C40078906400FC90EC9000843E07773 -:10B1D00003E02E2168460170468009A9684600F008 -:10B1E000A4FCA17FBF221140A177C6E710B50C4691 -:10B1F000FCF707FE002805D0104909688C4203D2ED -:10B20000102010BD0E4810BD2146FEF704FD0020A1 -:10B2100010BD05E00278401C002A01D000207047D4 -:10B220000A46491E89B2002AF4D101207047000065 -:10B23000109E0000F306000000D00100280000204E -:10B240000230000030B50346072903D00620DA7823 -:10B250001C7916E00320FAE707290BD05500ED18FA -:10B260006D79072D01D0401EC0B2521CD2B2092AFE -:10B2700007D105E05500ED186D79072DF3D0F4E7FF -:10B2800000222546641EE4B2002DE5D130BDFFB595 -:10B2900081B00C461646114620460A9F0B9DFFF7CB -:10B2A000D1FF00280AD02079092803D3FEA1A020CD -:10B2B0000FF005FFA078C00907D019E0072E02D0D3 -:10B2C000112005B0F0BDFD48FBE701982880381D2E -:10B2D0006880002068712871EF80049828812846D2 -:10B2E00000F04BFC002803D1EFA1AD200FF0E7FEEA -:10B2F000E07821794018491CC0B22171092801D396 -:10B300000938C0B24000001946718179F12249081C -:10B310004900114081710020D3E7FFB583B0164684 -:10B320000F461C46002203210C9D039800F0F4FCFC -:10B33000010008D033463A46019500940398FFF780 -:10B34000A6FF07B0F0BDDD48801EFAE7F0B5054660 -:10B3500016460F4650888DB00022032100F0DCFC19 -:10B36000040003D1D0A1DF200FF0A9FE0020694620 -:10B370000871A078400603D1CBA1E3200FF09FFE17 -:10B38000042F5ED32A78D007C017401C06D16178FD -:10B390006B78994255D12178090752D00121142A9E -:10B3A00046DA012A42D0122A02D0132A40D128E0DC -:10B3B0000C2F3DD1A2785206520E012A38D02078A7 -:10B3C00000090001401C20706878607068460171B7 -:10B3D00068792A790102114368460181E879AA79DE -:10B3E0000102114368464181687A2A7A01021143B9 -:10B3F00068468181E87AAA7A010211436846C181D0 -:10B400001AE0062F14D120780009000120707188FD -:10B41000012001F0E8F8022168460171C91E01818E -:10B4200068792A790102114368461FE0062F0AD085 -:10B430006A461279002A1BD07088324601A9FDF7AE -:10B4400026FB0DB0F0BD2078000900012070718846 -:10B45000012001F0C8F802216846017168792A7953 -:10B4600001021143684601810021C9434181E3E79C -:10B470000028E6D07488684681766978C176022112 -:10B4800081830021C18304A8052200900623114670 -:10B490002046FFF742FF0028D3D089A1D6200FF025 -:10B4A0000EFECEE7F7B58CB015460C990D98FAF75D -:10B4B00049F9C0B2082850D10020694688856888BB -:10B4C0000022032100F028FC040004D1FF2076A113 -:10B4D00063300FF0F4FD01230021E07822790BE0C6 -:10B4E0004600361976799E4201D1491CC9B2401CEA -:10B4F000C0B2092800D100201646521ED2B2002E3A -:10B50000EED1002902D117206946888504AB0233A9 -:10B510000BAA00950C990D98F8F7BEFB0006000EDB -:10B5200007D002281BD0032817D0FF205EA1893046 -:10B5300011E06846808D00280FD002A9019100908B -:10B540006888042301222146FFF7A1FE002804D0C9 -:10B55000FF2055A176300FF0B2FD0FB0F0BD687836 -:10B56000102108436870F8E700205A49024643005A -:10B57000401CCA520828FAD3704700218170017814 -:10B5800009090901017000214170C1700171704702 -:10B5900070B50D460022032100F0BEFB040004D16B -:10B5A000FF2041A1CF300FF08AFDA0786906C009C5 -:10B5B000C001490E0843A07070BD704710B5014628 -:10B5C000012001F010F810BD3EB58DB2002203211C -:10B5D000284600F0A1FB040004D1FF2032A1E43092 -:10B5E0000FF06DFD207869460009000120700220EF -:10B5F000087039488880C88000222846FDF747FA3D -:10B600003EBDF7B505460078002700090C463E46CA -:10B61000012804D0FF2024A1F3300FF050FD287A38 -:10B6200003280CD0412020A1C0000FF048FD029853 -:10B63000002C068001D0278066800020FEBDEA89AC -:10B64000702710460A3086B2002C0AD06888A08085 -:10B65000A8892081E28020460A3029690FF0A5FBE5 -:10B66000E5E702980680E8E7F8B543680246D9792D -:10B670009C79090221435C7A1E7A25025C88981D18 -:10B680003543241FA14238D11B79022B35D1042D1B -:10B6900034D0052D3DD0062D34D0402D2DD3061DA0 -:10B6A0000F461446284619E07372635C6C3263617E -:10B6B000705F636F72652E6300000000043000004D -:10B6C0007372635C6C326361705F636F72652E636B -:10B6D00000000000680E0020FFFF000000F0E3F90A -:10B6E00008280AD01120207003202072A581E7814C -:10B6F00026616078082108436070F8BD001DFFF7DF -:10B70000D1FEF8BD031D50880A461946FEF787FE94 -:10B71000F8BD001DFFF71AFEF8BD70B50D468CB0E0 -:10B7200006460022032100F0F7FA040031D0207809 -:10B730000007000F01282ED0122069468874607817 -:10B740000523801CC874082088822888C8826888DD -:10B750000883A8884883E888888302A90C2001917F -:10B7600000901A4621463046FFF791FD00280ED181 -:10B77000F02300223146012000F090FE20780009DD -:10B780000001401C20706078801C607000200CB0AC -:10B7900070BDCB48FBE71120F9E770B50D468CB0C2 -:10B7A00006460022032100F0B7FA040006D02078F4 -:10B7B0000007000F012803D00820E8E7C048E6E7AB -:10B7C0001321684681746178C17402218182C58227 -:10B7D00002A906200523019100901A462146304611 -:10B7E000FFF755FD0028D2D1207800090001207014 -:10B7F0000020CCE7F3B581B00D460022032101986B -:10B8000000F08AFA00260446002803D1AD49AE486C -:10B810000FF055FC2079A8423BD2AB48A949401C07 -:10B820000FF04DFC35E0E07841000F19401C7979AC -:10B83000C0B20091E070092801D10020E0702079A9 -:10B84000401E2071B879C00708D0009801990428DB -:10B8500015D09C49822018310FF031FCB8790007CF -:10B86000410F08D0400F019904280CD095498F2032 -:10B8700018310FF024FC009807280AD107E0084689 -:10B88000FEF755FEEAE70846FEF71CFEF3E7761CD6 -:10B89000F6B228466D1EEDB20028C4D13046FEBD7A -:10B8A00010B50022032100F037FA040004D1B520BE -:10B8B000844980000FF003FCE07821794018C0B281 -:10B8C000E070092801D30938E07000202071A078C9 -:10B8D00080210843A07010BDF8B517460D46002220 -:10B8E000032100F019FA040005D0002D0CD0002F20 -:10B8F00007D0062006E0072D01D00620F8BD032062 -:10B90000F8BD0820A84204D86F486E4942300FF0B5 -:10B91000D6FB29462046FFF795FC0646002F28D087 -:10B92000002E26D1E07821791CE0420012195379CB -:10B93000072B03D093791B075B0F04D0401CC0B2C8 -:10B9400009280CD00CE0400000198079F123184040 -:10B950006B071B0F1843907100290AD104E00020E7 -:10B96000491EC9B20029E0D1574856495A300FF054 -:10B97000A6FB3046F8BDF8B50D460022032100F0C5 -:10B98000CBF9040004D150484E4968300FF097FBC2 -:10B99000681E052804D34C484A4969300FF08FFBD4 -:10B9A0000921E2782079002310E0560036197779D2 -:10B9B000AF4206D1B17949084900B1715B1CDBB2D5 -:10B9C0001146521CD2B2092A00D100220646401E5E -:10B9D000C0B2002EE9D1092905D2480000198179A9 -:10B9E0000122114381711846F8BD10B50446402864 -:10B9F00001D2072010BD00F056F8082802D03120EF -:10BA0000000210BD0021314802E0491C082903D280 -:10BA10004A00825A002AF8D1082903D0490044522A -:10BA2000002010BD042010BD10B5402801D2072011 -:10BA300010BD00F038F8082805D00021234A400046 -:10BA40001152084610BD052010BDF0B58BB016464A -:10BA50000C00074607D0002E05D06188402904D28B -:10BA600007200BB0F0BD1020FBE72088002801D094 -:10BA7000172801D90C20F4E7084600F014F808282C -:10BA80000FD0258803A82A46314602300FF08DF9E1 -:10BA900001A8009062882B4607213846FFF73DFC3D -:10BAA000DFE70520DDE701460020084A02E0401CF0 -:10BAB000082803D24300D35A8B42F8D170470000C4 -:10BAC00002300000A8B60000AD020000680E0020A1 -:10BAD00000B51E2827D00FDC0C2820D008DC03007E -:10BAE0000FF00EFC0913211521211B1B1719210032 -:10BAF000122818D1072000BD302814DD3A38030081 -:10BB00000FF0FEFB030F11091100002000BD2148BA -:10BB100000BD042000BD0D2000BD0F2000BD082089 -:10BB200000BD112000BD032000BD10B50C4604F07F -:10BB300064F800281ED0204602F00FFE002816D020 -:10BB400022780E2A0DD00F2A0BD0022A09D0032A00 -:10BB500007D0102A09D010A17E200FF0B0FA0020E3 -:10BB600010BDA078FFF7B4FF10BD112010BD0AA1D1 -:10BB70008420F2E708A18A20EFE710B502F09EFCCE -:10BB800010BD10B502F0E9FD10BD10B502F016FDB4 -:10BB900010BD0000023000007372635C686F737444 -:10BBA0005F6863692E630000F8B5054606ACC1CC3A -:10BBB000E44C21706270A370E070681C4208277129 -:10BBC0005200E14B66710021880000198446026230 -:10BBD000605C40008218002D0AD0002005E0664617 -:10BBE0004700366A401CF353C0B2665C8642F6D802 -:10BBF000491CC9B20629E7D30026D21C9708B00019 -:10BC0000BF0000198760304600F02AF9A15D761C5C -:10BC10004843C219F6B2062EEFD3501B80B2F8BDCE -:10BC2000F0B504468C46C7490020A500FF23024614 -:10BC30006D18C54E0C5D0BE02F6A5100795AB14268 -:10BC400004D1401CC0B2FF2B00D11346521CD2B20B -:10BC50009442F1D8002801D061460B70F0BD70B558 -:10BC6000B84C0023655CA678B54200D10346890034 -:10BC700009199D420AD90C6A5E00A45B844202D174 -:10BC80001370012070BD5B1C9BB2F2E7002070BDF9 -:10BC9000FFB583B00C9C1F460D46060009D0002D51 -:10BCA00007D0F01C80088000B04204D0102007B0FC -:10BCB000F0BD0E20FBE70598A04201D8A74201D9AC -:10BCC0000720F4E701460094019423463A460020F9 -:10BCD0000294FFF769FF2988814207D0814201D28F -:10BCE000042100E0092128800846E0E7009401943F -:10BCF00023463A46029430460599FFF755FF2880BF -:10BD00000020D4E710B5044600F0B4F8002801D0B4 -:10BD1000E0B210BDFF2010BDF8B505468A481646B2 -:10BD20000C46854201D0062C01D30020F8BD002727 -:10BD300069460F7028466A462146FFF790FF0028A3 -:10BD40000DD068460178204600F09CF8002EEDD01A -:10BD50000028EBD12146284600F0A0F8F8BD38466F -:10BD6000002EF7D1F8BDF8B505460C460020764EFA -:10BD70006946764F0870B5423BD0062C01D30720A8 -:10BD8000F8BD0A4621462846FFF769FF002830D053 -:10BD900068460178204600F075F823000FF0B0FAED -:10BDA000060404090C11161B01462846FEF757FA33 -:10BDB00015E0FDF73BF812E001462846FFF7FDFBD2 -:10BDC0000DE001462846F7F7ECFE08E0014628465C -:10BDD000F9F742FB03E05EA17C200FF070F9594AAD -:10BDE0006846A10000788918096A40000E520020B8 -:10BDF000F8BD3846F8BD5A4A1268914201D2102067 -:10BE00007047062801D30720704708720020487247 -:10BE10007047F8B5044652480068844201D21020A9 -:10BE2000F8BD207A474A83009B18617A464D125C20 -:10BE300011E01E6A4F00F65BAE420AD04A1C6272E5 -:10BE40001A6A4B00D25A228000F01CF86060002071 -:10BE5000F8BD491CC9B28A42EBD861720520F8BD11 -:10BE60000EB5404B40000ECB009102930192694603 -:10BE7000085A0EBD33498978814201D901207047A3 -:10BE80000020704770B50C460546FFF7E9FF2D4AC4 -:10BE9000A900891889686043401870BDF8B5044648 -:10BEA0000E4600206946087005462046FFF7E2FF6F -:10BEB000002803D126A1F3200FF001F92148214BDE -:10BEC000815D8278B000C718914209D1E0B269461D -:10BED0000870396A4000085A1B49884206D02EE093 -:10BEE00069463046FFF79CFE002828D06846007857 -:10BEF000396A40000C52684601783046FFF7C2FFAD -:10BF0000054633000FF0FCF9060404090C0F141762 -:10BF100029462046FEF777F911E0FCF764FF0EE0B2 -:10BF2000FFF72BFB0BE029462046F7F701FE06E062 -:10BF3000F9F78BFA03E006A162200FF0C0F828465B -:10BF4000F8BD0000780E0020FFFF00000230000066 -:10BF50007372635C686F73745F636D2E63000000BF -:10BF60002800002090B301008107C90E002808DADC -:10BF70000007000F08388008C24A80008018C06996 -:10BF800004E08008C04A800080180068C8400006AD -:10BF9000800F7047BD4948788978884201D3401A9C -:10BFA00002E02122511A0818C0B27047B749233164 -:10BFB00048788978884201D3401A02E02122511A38 -:10BFC0000818C0B27047B14946314878897888422C -:10BFD00001D3401A02E02122511A0818C0B270475A -:10BFE000A94910B50C310868FF22120290430122C2 -:10BFF000D20310430860A54900202331487088709F -:10C00000233948708870463148708870A04806F01F -:10C01000C6F89F48401C06F0C2F8F6F7ABFB00F0EC -:10C0200028F910BD20207047B4E770B50C460546CE -:10C030000026FFF7AFFF9549A04214D30A46203AE5 -:10C0400000232046641EE4B200280BD08878105CE0 -:10C05000287088786D1C401CC0B288702128F0D1EF -:10C060008B70EEE7012600F004F9304670BD202009 -:10C0700070479BE770B50C4605460026FFF796FF14 -:10C0800082492331A04214D30A46203A0023204695 -:10C09000641EE4B200280BD08878105C2870887881 -:10C0A0006D1C401CC0B288702128F0D18B70EEE767 -:10C0B000012600F0DEF8304670BD2021017000201E -:10C0C000704710B50446FFF77EFF2070002010BDBA -:10C0D00070B50C460546FFF776FF6C494631A04225 -:10C0E00015D30A46203A00232046641EE4B20028F5 -:10C0F0000BD08878105C287088786D1C401CC0B20A -:10C1000088702128F0D18B70EEE7002400E0614CAC -:10C1100000F0AFF8204670BD70B50C4605462129E9 -:10C1200004D9FF205CA147300EF0C9FF5548406894 -:10C13000103840B2FFF718FFC6B20D20FFF714FF0A -:10C14000C0B2864207D2FF2053A14D300EF0B7FF98 -:10C1500001E0F6F752FB21462846FFF766FF00286C -:10C16000F7D070BDF8B507464948484C401E474EC9 -:10C170000078254646362335002806D1A978687808 -:10C18000212200F06BF800280ED0A17860782122DF -:10C1900000F064F8002814D0B1787078212200F003 -:10C1A0005DF8002828D033E038496878C91C0F545E -:10C1B0006878401CC0B26870212829D100206870BE -:10C1C00026E03249607820390F546078401CC0B2B4 -:10C1D0006070212801D1002060702D4F7F1E3878BB -:10C1E000002815D0A1786078212200F037F80028C7 -:10C1F0000ED0002038700BE02449707826310F549F -:10C200007078401CC0B27070212801D1002070707D -:10C21000A9786878212200F021F800281DD0A178A3 -:10C220006078212200F01AF8002816D0B1787078D2 -:10C23000212200F013F800280FD0F6F7C0FA1448B6 -:10C2400005F0B5FF01214903884203D016A1C120A2 -:10C250000EF035FF0E4805F0C2FFF8BD401C8842C5 -:10C2600005D0904201D1002901D000207047012063 -:10C27000704710B5064805F09AFF002801D1F6F77F -:10C280008DFA10BD00ED00E000E400E0F00E0020AB -:10C2900069000020072000007372635C736F635FA6 -:10C2A00072616E642E6300007372635C736F635F10 -:10C2B00072616E642E630000FEB5F34C0746606841 -:10C2C000FF213E0181552178FF2913D00901083152 -:10C2D00041583246491E083209020192090A805823 -:10C2E00000F0C8F9002802D02478254615E06168DE -:10C2F000207888552770FEBDE348426801981158A0 -:10C30000280100900830105800F0B4F9002806D138 -:10C31000DD482C46416800980D5CFF2DECD1DA48D1 -:10C320002101406885554754FEBD70B5D64A044684 -:10C330000020157A53680AE00201561C9E5DA64251 -:10C3400003D10C329A588A4204D0401CC0B28542B4 -:10C35000F2D8FF2070BDF8B5CB4F3E7801F006FE55 -:10C360000146FF2E68D034012546786808354059CB -:10C3700000F080F9022802D9786840595AE0C24991 -:10C380004868025D0A70A11C425C002A0CD0521E53 -:10C39000425441590122D20589180902090A415122 -:10C3A0003046FFF789FF30E0631CC25C0092221D1B -:10C3B00094468258002A10D001239B029A420FD93A -:10C3C0009205920D43595703DB191B021B0A435177 -:10C3D0006346C3589A1A920A09E0FF21C1540AE041 -:10C3E000435952039A181202120A4251002242542F -:10C3F0003046FFF761FFA4480C344168C2680098DA -:10C40000095980001258009890479F4C2078FF28C7 -:10C4100012D001F0ABFD01462078626800010830BF -:10C42000105800F027F9012896D92078616800019A -:10C430000830085801F08DFDF8BDF8B51C461546CA -:10C440000E460746FF2B03D390A1D3200EF037FEF4 -:10C450008D48FF21C7604560047206740170002298 -:10C460004270104604E00201521C401CA954C0B2A4 -:10C47000A042F8D3F8BD70B5834C06466578207CA1 -:10C48000854203D381A1E6200EF019FEE068A900E1 -:10C4900046506078401C6070284670BDFFB581B082 -:10C4A0001D46FF2401F062FD774F0646797801981A -:10C4B000814203D875A1F4200EF001FE72480021DC -:10C4C000037A406810E00A019446521C825CFF2AFD -:10C4D00024D0019FBA4205D162460C328758029A95 -:10C4E00097421DD0491CC9B28B42ECD8FF2C17D003 -:10C4F00021014B1C019AC2540B33029AC250039B78 -:10C50000614F0022012B0ED00B1DC25001239B0254 -:10C510009D4216D9AA05920D08D008E00C46E1E725 -:10C52000FF2005B0F0BD0B1DC550EFE71A465303C1 -:10C530009B190E461B0208361B0AAA1A8351920A3F -:10C5400009E0002D00D101256B039B191D022D0A66 -:10C550000B460833C550891C42543D463E78204660 -:10C56000FFF7AAFE2878B04215D001F0FFFC014683 -:10C5700028786A6800010830105800F07BF801281C -:10C5800007D92878696800010830085801F0E1FCF3 -:10C5900001E0FFF7E0FE0198C3E770B50C460546E1 -:10C5A00001F0E4FC064621462846FFF7BEFEFF28C0 -:10C5B00017D0354D040120466968083008583146C7 -:10C5C00000F058F80121090340186968A41C095DAE -:10C5D000400B002901D089020818002800D1012051 -:10C5E00070BD002070BDF3B581B00F460198FFF714 -:10C5F0009CFEFF282AD0244D2E78696832463446A6 -:10C6000004E0844205D026462301CC5CFF2CF8D1FF -:10C610001CE0FF2C1AD0A6421FD11001085C287024 -:10C62000FF2818D001F0A2FC2A78014612016868A0 -:10C630000832805800F01EF8012809D92878696866 -:10C6400000010830085801F084FC06E00020FEBD1F -:10C65000FFF781FE01E001F084FC39460198FFF705 -:10C660009CFF22016968FF23541C0B558A5C33012F -:10C67000CA54FEBD401A00020121000AC9058842C1 -:10C6800000D90020704700003C0F00207372635CEB -:10C69000736F635F74696D65722E6300F0B500247B -:10C6A0001C4A01211C4B0803546018601B4B1C6082 -:10C6B0001B4C20601B480469E443E406E617046948 -:10C6C00010252C430461184C6160184D2960761CBC -:10C6D00000E020BF1F68002FFBD0002E03D10769A8 -:10C6E0001026B743076190688005906801D5104A0D -:10C6F00010436960A160002119600121084A090303 -:10C700001160F0BD10B50446FFF7C8FF206000209F -:10C7100010BD000000C5004080E100E000C1004005 -:10C7200080E200E000ED00E000C3004000C00040F7 -:10C7300000FCFFFF70B51F490A68002A17D00023CC -:10C740001D4601244A68521C4A60092A00D34D60E4 -:10C750000E792246B2400E6816420AD072B60B68B5 -:10C7600093430B6062B649680160002070BD0520EC -:10C7700070BD5B1C092BE5D30FA136200EF09FFC8A -:10C78000F5E701201049800508607047EFF310813C -:10C79000CA07D20F72B601218140064803681943C7 -:10C7A0000160002A00D162B6EBE702480021016077 -:10C7B00041607047700000207372635C736F635F49 -:10C7C0006576742E6300000000E200E0012081071E -:10C7D0000860704701208107486070471048C068B2 -:10C7E000C00700D0012070470D488068C00700D006 -:10C7F000012070470A484069C00700D001207047F7 -:10C800000748C069704706498A69D20306D5896915 -:10C810008907890F814201D10120704700207047AC -:10C8200000040040F8B5F74C207EE17D88421CD022 -:10C830000126F54D0027E07D215C14200A46424385 -:10C840005019037C052B11D0037C062B1CD0037CD4 -:10C85000072B28D0437C012B33D0ECA1EE480EF0FF -:10C860002EFC207EE17D8842E5D1F8BD0674E07D96 -:10C87000162807D0E07D401CE075491CC8B2AA58B4 -:10C8800002210CE00020F7E70674E07D162808D0AE -:10C89000E07D401CE075491CC8B2AA5803219047AE -:10C8A000DFE70020F6E70674E07D162807D0E07D7C -:10C8B000401CE075491CC8B2AA580821EFE70020C7 -:10C8C000F7E74774E07D162807D0E07D401CE0754F -:10C8D000491CC8B2AA580721E1E70020F7E770B564 -:10C8E0000024CE4E0C207072CD482546447304734C -:10C8F00028300476C475CB4805F051FCCA4805754C -:10C90000F572CA49601E88607571B570F570357131 -:10C910007570C748E83905704570142060434018A9 -:10C920000574641CE4B20B2CF7D30120F5F7ECFF7F -:10C930000020F5F7E9FF0120B071F5F7AFFCBD4825 -:10C94000F5F7BEFCBC4C2070BC48F5F7B9FC607034 -:10C95000F5F77AFF70BD10B5F5F7A1FFB64C20785A -:10C96000F5F7CCFC6078F5F7C9FCAC4C207A0028D0 -:10C9700003D0F5F752FD0020207210BD70B5A74C12 -:10C98000A079002804D0A1A1AD480EF098FB70BD9D -:10C99000E07A002803D19DA1AA480EF090FB012661 -:10C9A000A6710025E572607A042114225043964A4C -:10C9B000801801749D488168491C04D0691E8160FB -:10C9C0000120F5F7A1FF0020F5F79EFFF5F782FFA4 -:10C9D00005F026FDF6F783F89B4805600560012009 -:10C9E0009A49C0030860F6F7F9F8914800780228E0 -:10C9F00004D0032804D1E078002801D0A67000E01C -:10CA0000A570F6F758F870BD03467F490B20142235 -:10CA100042435218203A127F002A04D0401E0006DA -:10CA2000000EF4D170471422424351180A46803A4E -:10CA3000D366012220390A777047012805D00328E0 -:10CA400005D1002903D1002070470029FBD010B484 -:10CA5000724C00236370764A002890700CD0022834 -:10CA60000AD007291AD208007844007900188744B0 -:10CA70001505070D0F111300D37003E01B2000E014 -:10CA80003A20D0700120607010BC70475820F8E741 -:10CA90007720F6E79620F4E7B520F2E710BC0020F7 -:10CAA000704710B562484078F6F720F880B210BDA4 -:10CAB000411E1422504310B5534A8418203C0A29C1 -:10CAC00002D8207F002803D150A161480EF0F7FA68 -:10CAD000207F012804D0B3204CA180000EF0EFFA93 -:10CAE0000020207710BD70B54D4C607B217B8842C3 -:10CAF00001D1012500E00025F5F791FFF5F7F6FFDC -:10CB0000617B227B914201D1012100E00021A942F9 -:10CB1000EBD170BDF7B50646481E84468EB0C0B254 -:10CB2000142205905043384A85180495287C2D1D01 -:10CB300007282AD1334C0027E07D227E824221D073 -:10CB4000235C059A934201D1012701E0002F04D014 -:10CB5000162811D0421CA25C225416280ED0401C6C -:10CB6000227EC0B28242EBD1002F0BD0207E002863 -:10CB700006D0207E401E04E00022ECE70020EFE714 -:10CB8000162020760498012202746046234C0A285D -:10CB900013D8142041431C4808182038007F00286F -:10CBA0000BD00498007C01280BD00498007C01284D -:10CBB00003D01098807A012807D014A125480EF0E0 -:10CBC0007EFA1098807A01286DD104980E4B007C73 -:10CBD000022843D00B4C207E162870D0207EE17DA9 -:10CBE000401C884203D109A11B480EF068FA049941 -:10CBF00001204874217E05986054207E162862D05A -:10CC000063E0000038110020541100207372635C4F -:10CC100072656D2E63000000CF0500005C120020DD -:10CC20001011002068120020201100203C1200206A -:10CC30007A00002057C300007800002025C80000BB -:10CC40007D0200005E02000000F5004080E200E08E -:10CC5000CB0200001503000022030000607A059A51 -:10CC60000146904206D0014614277843C018807CC4 -:10CC70009042F8D1627A824208D1617A14225143FB -:10CC8000C918897C61720121A17207E01422424314 -:10CC9000D21814277943927CC9188A7414220C2163 -:10CCA0005043C01881741098007A06281DD20100E4 -:10CCB0007944097949188F440C161412100EE07D3E -:10CCC000002890D093E7002001E0207E401C2076D1 -:10CCD000B5E000210FE0B4210DE073210BE032211B -:10CCE00009E00A2107E0062105E0FF20FDA1E03070 -:10CCF0000EF0E5F90021109802910068401A2860B2 -:10CD00001099097A002912D00221401A0102090A59 -:10CD1000296010980268406810180002000A6860D4 -:10CD20001098807A0228109803D0007B71E00421CB -:10CD3000EBE7007A002812D002220298121810980D -:10CD400043681046103018180A90E948029B407852 -:10CD5000984202D9E378002B03D00A9805E0042218 -:10CD6000EBE7029BC31A0A981818637A10300C2B51 -:10CD70001CD0637A14277B43DE4FDB195B68994232 -:10CD800014D0DD4F617ABC4614235943D94BC918DE -:10CD90004B6889689B1B891B1B0209021B0A090A35 -:10CDA000984237D8634535D8614533D831180A9849 -:10CDB0000123081A0002000A286010998018C96827 -:10CDC0000002000A471ACD4A9B05BC469F4201D289 -:10CDD000384610E00F1A9F4201D260460BE094459E -:10CDE00003D9511A0818401C05E0974206D9101AB9 -:10CDF0004018401C404200285FDC03E0B9A1C04855 -:10CE00000EF05DF929680A9808180002000A6860A7 -:10CE1000002028726868102710300002000A68603D -:10CE20001098407AA8721098007A687203280ED27F -:10CE300000280CD0FFF7D2FC002803D007E0002028 -:10CE400011B0F0BD029842210F1A32200290A84979 -:10CE50000878012801D0032809D14878029988422E -:10CE600005D9E178002902D10299401AC7196B68E7 -:10CE700028689B1B801B9C4601021B029E4A090AD4 -:10CE80001B0A8F4219D81746914216D8BB4214D8B4 -:10CE9000617A0C2915D0677A61460C2203920092C0 -:10CEA0001422944B7A43D21893689B1B834216D862 -:10CEB0000397977C0C2FF3D173E0059801F04CF9A0 -:10CEC000BDE70498022205990274627A0C2A00D008 -:10CED000627A827461720120A07211B0F0BD0C2FD1 -:10CEE0005FD00022384694461422824B4243D21827 -:10CEF00053689B1B8B4225D2907BAB7A98421BD800 -:10CF000004980521059D01747E4C207E16280FD0C3 -:10CF1000207EE17D401C884203D172A17A480EF048 -:10CF2000CEF8207E2554207E162800D0CDE6CAE615 -:10CF3000E07D0028F1D0F4E701208446907C0C28A5 -:10CF4000D2D102E0614600292AD03D46009014204B -:10CF50002A46424367480621161831741C38007E61 -:10CF60001628684816D0017EC07D491C814203D135 -:10CF70005CA166480EF0A3F86248017E4554017E2C -:10CF800016290BD0017E491C0176B57C0098A84279 -:10CF9000DDD106E0C07D0028EAD0EDE70021F3E70F -:10CFA000009704990220534D0874607AB84207D163 -:10CFB000049900988874059860720120A07221E09D -:10CFC00003980C2F0FD00C2803D146A150480EF027 -:10CFD00076F80398142250434019059981740499F6 -:10CFE000009888740EE00C2803D13EA149480EF049 -:10CFF00066F80398142250434019059981740499E6 -:10D000000C208874012011B0F0BD70B50D46424A65 -:10D01000441900210B46101A8B4103D231A13F481D -:10D020000EF04DF83E48854203DD2EA13D480EF03E -:10D0300046F83D48854203DA2AA13C480EF03FF805 -:10D040003B48844205DA002C01DB204670BD38489D -:10D0500000E03848201870BD401E70B5C0B21421E1 -:10D06000484324494418607B062813D201007944C0 -:10D07000097949188F44020C0A080604002067E069 -:10D08000B42010E073200EE032200CE00A200AE009 -:10D09000062008E0FF2013A1E0300EF010F8617BBD -:10D0A0000020002954D00221401861684018000275 -:10D0B000000AF5F71BFD0C256557174A4419002196 -:10D0C0000B46101A8B4103D206A114480DF0F7FF4E -:10D0D0001348854203DD03A112480DF0F0FF12480A -:10D0E000854229E07372635C72656D2E63000000F7 -:10D0F0007A00002054110020FFFF3F00FFFFFF00D7 -:10D100000E0700003811002007020000C5030000D0 -:10D11000DD030000E3030000FF7F841EF503000031 -:10D120000020A107F603000000E05EF8F70300000E -:10D130000080841E00807BE103DAF749F7480DF098 -:10D14000BEFFF748844207DA002C03DB204670BD9F -:10D150000421A9E7F24800E0F248201870BDF0B5BC -:10D16000064683B0F0480190457A029534687068AD -:10D17000001B0702ED483F0A001B00900C2D2DD02C -:10D18000142029464143EA48012208188446416890 -:10D19000E64892058646081B904210D3631A9342D4 -:10D1A0000DD302467046724503D900984018401CC2 -:10D1B00005E073450ED9411A0819401C4042002869 -:10D1C0000CDA60460295857C0198C0790028D5D09C -:10D1D00003B0F0BDD049D7480DF071FF02988542E9 -:10D1E00026D014214843D249012340180290806878 -:10D1F000CE499B058C46011B8646994210D3221AC4 -:10D200009A420DD36346614503D900997144491C84 -:10D2100006E0194662452DD9091A0819401C4142F9 -:10D22000002905DD0298B17A807B814200D37446E3 -:10D230000C2D15D0BE491420454368184268121BB6 -:10D240001202120ABA420BD2B37A827B934200D303 -:10D250008468857C0198C0790028B9D10C2DEAD169 -:10D260003068A042B4D0E0190002000A3460706057 -:10D2700003B0F0BDA849AF480DF021FFD8E7F0B5E5 -:10D28000AD490446486885B0C005C00D1CD01038B3 -:10D2900040B200280CDA0207120F083A92089200F6 -:10D2A0005118C9698007C00EC1400806800F09E007 -:10D2B0008108A24A8900891809688007C00EC14008 -:10D2C0000806800F002808D000272078002806D004 -:10D2D000012804D0002005B0F0BD0127F5E7207932 -:10D2E000062813D201007944097949188F44020CA9 -:10D2F0000A080604002018E0B42010E073200EE0B5 -:10D3000032200CE00A200AE0062008E0FF208249D3 -:10D31000E0300DF0D4FE21790020002905D0022153 -:10D320004618814D002F02D003E00421F8E70020C9 -:10D33000E871694602AAA068F5F7E2FB694608228F -:10D340008A56E06801A980180122C01C1F2801DA52 -:10D35000019209E003AAF5F7D3FB6846007B002899 -:10D3600002D00198401C019000990198401810309B -:10D370000002000A0190881B0002000A00906079F8 -:10D380006946887200980390F5F749FB009A019B63 -:10D39000121A181A6A4912020002120A000A8A4274 -:10D3A00016D8884214D86846FFF7D9FE009903982A -:10D3B000814205D088190002000AF5F797FBA060AA -:10D3C0000120E979002986D0002FB0D005B0F0BD4A -:10D3D0000020F6E7F3B58FB05A480C460B9004F0E6 -:10D3E000E6FE594A0F99504F5618584D203E0028D6 -:10D3F0000BD05748007D002803D056A158480DF0A7 -:10D400005EFE207801287CD05AE1687B16280CD07B -:10D41000687B297B401C884203D14EA151480DF006 -:10D420004EFE2078012804D00CE0287B0028F4D0A0 -:10D43000F7E7F07F002803D046A14B480DF03FFEF0 -:10D440000120F077697B0F981422484E51438919C7 -:10D4500008742078022822D0687B1421484386195A -:10D46000207930726079707232460C323146A06891 -:10D47000F5F746FB0C2030560F2804DD1F383073BB -:10D480003068401C30600C217156301DE2680190FC -:10D490005018C01C1F283EDA01200199F7E02649E8 -:10D4A0004868C005C00D21D0103840B200280CDA01 -:10D4B0000207120F083A920892005118C9698007B2 -:10D4C000C00EC1400806800F09E081081B4A890090 -:10D4D000891809688007C00EC1400806800F00281F -:10D4E00004D105201BA100020DF0E9FD687B142189 -:10D4F000484386190021E0686A460691117006A922 -:10D5000000E0D3E0F5F7FCFA6A46002010560F2839 -:10D510002EDD01202DE0AEE0E4D00000F703000096 -:10D520000080841E00807BE15C120020FFFFFF0072 -:10D53000541100200E07000000ED00E000E400E0C0 -:10D54000FFFF3F0068120020301200201011002061 -:10D55000201100207372635C72656D2E6300000001 -:10D5600011050000EF040000F4040000500F00203B -:10D5700000200699401807900220B072207930727E -:10D5800060797072A068311DC01C06911F2801DAF5 -:10D59000012009E0F5F7B4FA68460078002804D0C5 -:10D5A000069806990068401C0860307A062813D255 -:10D5B00001007944097949188F44020C0A080604CD -:10D5C00000200FE0B4200DE073200BE0322009E0D2 -:10D5D0000A2007E0062005E0FF20FE49E0300DF0BC -:10D5E0006EFD00202179002943D0022140180690C9 -:10D5F0007168103008180799089009180698081AD9 -:10D600000C900020F871F5F70AFA0446306007988C -:10D6100020180002000AF060787A0C2825D0797A68 -:10D6200014204143EC4808184068089902904018BB -:10D630000002000A0390707A6946887402A8FFF716 -:10D640008EFD0299039A091B121B09021202E34B79 -:10D65000090A120A0C98994207D8824205D8029901 -:10D66000069808180002000A3060F8790028C8D12E -:10D6700010E00421BAE704AA0199F5F741FA6846D7 -:10D68000007C002804D0019801990068401C0860C3 -:10D690002078B072687B162806D0687B401C6873BF -:10D6A0000B9804F09CFD47E00020F8E7F07F00288D -:10D6B00004D0A320CAA1C0000DF001FD0120F07725 -:10D6C000CA490F9808742078022803D1C4A1C84819 -:10D6D0000DF0F5FCC54E20793072607970723246DB -:10D6E0000C323146A068F5F70BFA0C2030560F28A3 -:10D6F00004DD1F3830733068401C30600C22B25695 -:10D70000301DE16801908818C01C1F2802DA012032 -:10D7100001990BE003AA0199F5F7F2F96846007B3D -:10D72000002804D0019801990068401C0860207806 -:10D73000B072AE4901200875687B297B884224D0ED -:10D740007C7A0C2C23D0F5F76AF914214C43A249BA -:10D7500061180A7C042A18D00A7C032A15D04B6869 -:10D7600089681B1A081A1B0200029C4A1B0A000A3D -:10D77000102B0AD31146934207D8884205D8687BFC -:10D78000297B884201D0F5F796F911B0F0BD687B8E -:10D79000297B8842F7D111B0F0BD10B50020F5F714 -:10D7A000A0F810BD10B50120F5F79BF810BDF1B53C -:10D7B000009802281ED08F4C607A0C2803D188A1D3 -:10D7C0008D480DF07CFC0026A6710125E572607A7B -:10D7D00003211422804F5043C0190174F5F770F9EA -:10D7E000009800280BD0012829D0032879D07CA1EB -:10D7F000824844E082480078F4F786FDF8BD81480D -:10D80000007F002803D076A17F480DF058FC657199 -:10D810007C4D00202E60F5F777F8A968481C04D0ED -:10D82000012300221846F5F7A5F8607A617A401CBA -:10D83000C0B2142251437A5801219047F8BD01200B -:10D84000F5F762F8607900280DD06E488068401CBA -:10D8500009D0607A617A401CC0B2142251437A58D0 -:10D8600006219047F8BD6748007F01280AD00228AA -:10D8700012D0032822D0042834D059A163480DF0D7 -:10D880001EFCF8BD2079002803D02671F5F71DF99C -:10D89000E5705C480677F8BD207A002802D1F4F7DD -:10D8A00093FD2572607A617A401CC0B21422514304 -:10D8B0007A580021904753480677F8BD514F01230D -:10D8C000397B78680022411A1846F5F753F8207919 -:10D8D000002803D02671F5F7F8F8E57002203877B4 -:10D8E000F8BD19E0474E217870680123411A0022E3 -:10D8F0001846F5F73FF8207A002802D1F4F764FDC6 -:10D900002572607A617A401CC0B2142251437A5861 -:10D91000002190473577F8BD607A617A401CC0B22B -:10D92000142251437A5805219047F8BD10B5314C67 -:10D93000607A0C2803D12AA135480DF0C0FB607A2B -:10D94000617A401CC0B214225143234A5258042128 -:10D95000904710BDF0B583B00C200290F5F75FF84A -:10D96000244C0090617A2B4801900C2920D0617AD8 -:10D970001420414318480918097C042918D0617AF9 -:10D98000142251430818007C03287DD00199009887 -:10D990000B6849681B1A081A1B0200020F4A1B0A6F -:10D9A000000A102B70D3114693426DD888426BD871 -:10D9B00014488068401C03D009A117480DF07FFB74 -:10D9C00000206071607A0C282ED1607800282BD05E -:10D9D000124825E0E4D0000054110020FFFF3F0072 -:10D9E0007372635C72656D2E63000000201100206D -:10D9F0001E0500005C1200204F050000A20500007B -:10DA0000780000203C1200205B0500009605000015 -:10DA1000A90500004C120020E50500007A00002056 -:10DA2000C178417081780170607A0C2815D0607AD5 -:10DA30001421FF4A48438018007C04280DD1607AE5 -:10DA40000290607A01211423584380180174607A8F -:10DA500058438018807C6072A172F64D687B297BE8 -:10DA6000F54F884233D0F54E287B14214843801966 -:10DA7000007CC05D0128287B07D048438019007CCA -:10DA8000C05D02282FD044E0FDE1142148438019F5 -:10DA9000807A01280AD0287B022114225043801961 -:10DAA000007CC155287B162808D009E0287B00217E -:10DAB000142250438019007CC1552AE0002001E067 -:10DAC000287B401C2873687B297B8842CCD1DC4DA5 -:10DAD000287D00284CD0287CC15D012928D0C05D5C -:10DAE000022830D03AE0287B142148438019807AFC -:10DAF000012803D0D3A1D6480DF0E1FA297B0020FC -:10DB00001422514389198872297B51438919097C50 -:10DB1000C855287B142148438219287B4843801923 -:10DB2000017C0098FEF7F6FF287B1628C8D1C5E7D0 -:10DB3000A97A012904D00221C155002028750DE0E1 -:10DB40000021C1550AE0A87A012803D0BDA1C1482F -:10DB50000DF0B5FA0020A872297CC855287D002850 -:10DB600006D0297CB64A0098FEF7D4FF002028751D -:10DB700002980C281ED014214843AD494018017C5E -:10DB8000012917D107210174B34D287E16283CD0F6 -:10DB9000287EE97D401C884203D1AAA1AF480DF040 -:10DBA0008EFA297E02986854287E162831D0287E65 -:10DBB000401C2876607A0C287ED0A07A00287CD081 -:10DBC0000020A072617A1420414399480E18A4499C -:10DBD000B56873680A46F6687C32CB679660556014 -:10DBE000A04D697E002916D00226617A1422904841 -:10DBF00051430818407B06281BD20100794409795B -:10DC000049188F440A1412100E0CE87D0028C4D065 -:10DC1000C7E70020CDE70426E7E700210FE0B421A5 -:10DC20000DE073210BE0322109E00A2107E0062113 -:10DC300005E0FF208C49E0300DF041FA0021297306 -:10DC4000687E022801D0012810D12869009A401866 -:10DC5000821A1202120A422A08D93238032100021B -:10DC60006976000A28613220287308E0322906D23A -:10DC7000207A00280AD1F4F7A7FB012005E0207ADA -:10DC8000002803D0F4F7C9FB002020727749102246 -:10DC9000487820700978012901D0032906D1012193 -:10DCA0002171297B884201D9421A1032A378002BB6 -:10DCB00000D0921C217901E08CE09AE0002901D18A -:10DCC000002B5DD094466A4A00990092019A176829 -:10DCD00052687F1A511A3F0209023F0A090ABC45DD -:10DCE0001BD8634A974218D8009A914215D8297BCD -:10DCF000884223D92B69421A9A1A1202120A101862 -:10DD000080190002000A2A616860002914D00320EB -:10DD100028770006000E3ED14CE000202071A07054 -:10DD2000297B002925D02869401880190002000AA3 -:10DD30006860022028772EE00120E9E781420BD9B4 -:10DD40002A69511889190902090A6960002801D055 -:10DD50000420DDE70220DBE7002B03D139A1454891 -:10DD60000DF0ADF9286980190002000A68600020F2 -:10DD700004E0296989190902090A6960287719E00C -:10DD8000287B00280FD02969081880190002000A92 -:10DD9000686002202877286901238119002218462B -:10DDA000F4F7E8FD09E0286980190002000A6860BC -:10DDB000002028770120F4F7A7FD607A142148435A -:10DDC0001B490C2240188256012300206968F4F791 -:10DDD000D1FD0EE00120F4F797FD0020F4F794FD4B -:10DDE000F4F778FD207A002803D0F4F716FB002022 -:10DDF0002072A078002804D0F4F767FE0020E070BD -:10DE0000A0706078002804D01848C17841708178EB -:10DE100001702079002806D000201449E0700978AC -:10DE2000002900D120710C48017EC07D814223E091 -:10DE300054110020101100202F120020500F00203C -:10DE4000201100207372635C72656D2E6300000008 -:10DE500007060000230600003811002035060000E8 -:10DE6000D01100203C120020E4D000007A000020F5 -:10DE7000FFFF3F008706000003D0C9484078F4F751 -:10DE800043FA0120E07103B0F0BDF0B5C54C074680 -:10DE9000607A83B00C2803D1C3A1C6480DF00FF9F6 -:10DEA000607A1421C44E48438019007C032803D0B3 -:10DEB000BDA1C2480DF003F9C14DA868401C03D0B4 -:10DEC000B9A1C0480DF0FBF8607A142148438119CC -:10DED0000C20085600216A4600911171C01901AA50 -:10DEE0006946F4F70DFE6A46042010560F2801DD3E -:10DEF000012000E0002000994018696840180102E4 -:10DF0000090AA9606079002804D00123002218467C -:10DF1000F4F730FD03B0F0BD70B5AC4CAA4A0B1A53 -:10DF2000A34214D3451AA54211D3934203D9101A20 -:10DF300043185B1C0BE0954204D9511A0818401C89 -:10DF4000434204E0A249A3480DF0B9F80023184663 -:10DF500070BD10B50146012300220220F4F70AFD2E -:10DF600010BD10B50220F4F7CFFC10BD10B5F4F7CA -:10DF700056FD10BDF0B58B4D0446E87A83B00028FD -:10DF800003D189A194480DF09AF8642C4DD393499C -:10DF900000200246091B824147D39148417B007B08 -:10DFA000814242D18F48007D00283ED1687A1421F9 -:10DFB000814F4843824EC519306801AA001969464D -:10DFC000F4F79EFD694604200856002802DD0098FB -:10DFD000401C0090A96800986B680A18D21A1202B7 -:10DFE000814B120A9A4220D8AA7C0C2A08D014230A -:10DFF0005A43D2195268511A0902090A814214D3AC -:10E00000B068401C05D00120F4F77EFC0020C0431E -:10E01000B060306800193060A868009940180002AC -:10E02000000A7061012003B0F0BD002003B0F0BD14 -:10E03000F8B50646401EC5B214205F49684344182F -:10E04000207C002803D158A168480DF038F86448B6 -:10E05000017B407B81420CD0654A14234B439B18C3 -:10E060001B7CB3420CD016290CD0491CC9B281428A -:10E07000F3D15C48017D002964D0007CB04261D1BD -:10E080000020F8BD0021F1E7217C052905D0217C85 -:10E09000062902D0217C072928D101212174C17DC4 -:10E0A0000023027E8A4221D00246565CAE4201D154 -:10E0B000012301E0002B04D0162911D04E1C965DDF -:10E0C000565416290ED0491C167EC9B28E42ECD188 -:10E0D000002B0BD0117E002906D0117E491E04E0D2 -:10E0E0000026ECE70021EFE716211176617C00297C -:10E0F0002AD06774C17D0023027E8A4224D0425C0C -:10E10000AA4201D1012301E0002B04D0162912D02C -:10E110004A1C825C425416290FD0491C027EC9B2A7 -:10E120008A42ECD1002B0FD0027E0146002A06D095 -:10E130000A7E521E04E00022EBE70021EEE71622E1 -:10E140000A7601E02B480027217C01299CD1617CC3 -:10E15000002999D10120F8BD70B505461420164A52 -:10E160000521684380180174224C207E162811D0A6 -:10E17000207EE17D401C884203D115491E480CF0E9 -:10E180009EFF207E2554207E162807D0207E401C2E -:10E19000207670BDE07D0028EFD0F2E70020F7E7A1 -:10E1A000780000205C1200207372635C72656D2E33 -:10E1B00063000000EA06000054110020EB06000096 -:10E1C0003C120020EC060000FF7F841E0020A10707 -:10E1D000E4D000000E0700002D070000FF1FA1077C -:10E1E0001011002020110020FFFF3F006A070000EF -:10E1F000500F0020381100200702000010B509F070 -:10E2000065FC042803D009F061FC052803D106F061 -:10E21000DFFE00280BD104F015F9032803D004F029 -:10E2200017F9032805D109F0B2FD002801D001201B -:10E2300010BD002010BDF0B585B007460026684629 -:10E240000D4606726946384605F069FA00287DD108 -:10E250006846007800280BD009F00BFDB84275D055 -:10E260000022294638460AF0D0FE00283ED120E0A0 -:10E2700006F085FCB842F2D000222946384607F065 -:10E28000FBFE00287DD1019C9020005D28340028F1 -:10E2900004D1607E002801D0012000E0002004901D -:10E2A000204660300390807806F098FB002804D068 -:10E2B00008E0019C2834607EF1E7FF20FDA1DA3000 -:10E2C0000CF0FDFE20462030417B00290FD0817BE1 -:10E2D00089070CD56E7001212970AE70AF80C17BAB -:10E2E000A971218E2981618E6981467349E0039865 -:10E2F00002A9807806F03EFA002804D1FF20EDA1A3 -:10E30000EE300CF0DCFE6846007A002809D06E7012 -:10E310000D202870AF806846007AE8800120A87040 -:10E320002FE0049800282FD006F0C3FB00282BD044 -:10E3300068460078002806D101988030406A4188FC -:10E34000B94200D106700398807800E01CE006F026 -:10E35000D8F8002803D1D7A1DA480CF0B0FE6E70CF -:10E360000A202870AE70AF80A07EA87166766846DD -:10E3700005F08BFA002804D0D248CEA10E300CF064 -:10E380009EFE012005B0F0BD0020FBE77CB5CEA1CC -:10E3900003C9CF4D002401910090AC7001F02FFD16 -:10E3A0002946EC7004204039088710204887C81D92 -:10E3B000C84AF93042800471C280E03844740C705D -:10E3C00084730475C03004771D3005226946044605 -:10E3D0000CF0EBFC28462146BC3007F0FFFF7CBD6B -:10E3E000F8B5BD4C0D466060217006F065F805F08B -:10E3F000DEF8FFF7CBFF207809F03CF9B44984310F -:10E40000084681380F46064606F09AFC606807F019 -:10E41000E0FE284604F07CFC3946304609F059FC01 -:10E4200060680AF08EFE01F0EAFCA9480021C17084 -:10E43000F8BDFEB50E461D46144601A905F06FF95C -:10E44000002839D102988030807A06F087F80028B9 -:10E450000CD0684606F095F8002806D0002C03D0B2 -:10E4600006F02BF8A04206D20020FEBD91A19B48E9 -:10E470000CF025FEF8E7009805F0B8FB314600984F -:10E4800005F0B9FBE2B22946009805F071FD06F0EF -:10E490009DF8002804D1914886A11E300CF00FFE93 -:10E4A00068460079012807D101A801F0AFFC8A482D -:10E4B00000218068803041820120FEBD30B40179A6 -:10E4C000002904D0012907D030BC00207047831DEB -:10E4D00042880488022103E042880488831D0121C8 -:10E4E000204630BCA5E7FFB5794C85B00E460746FF -:10E4F000C034608869460880154602A905F00FF906 -:10E50000002811D00021684605F066F9002823D1C3 -:10E51000684602A9008805F002F9002804D06F4877 -:10E5200064A13C300CF0CBFD68460088388068461A -:10E530000088608066480021C23005F04DF900284F -:10E5400002D00020C043608003988030807A06F0BB -:10E5500045FA002803D007E0002009B0F0BD5F486D -:10E5600054A156300CF0ABFD04A806F04AFA00287E -:10E57000F3D0049805F076FB3070022807D001280C -:10E5800005D056484BA172300CF099FDE4E708998C -:10E59000049805F004FD2880002804D14F4845A1C7 -:10E5A00065300CF08CFD06F053FA002804D1E92008 -:10E5B00040A180000CF083FD0120CEE73EB504466B -:10E5C000831D02AA694601A8FFF78DFF002813D01A -:10E5D00068468088208068460089608000206071DD -:10E5E00068460078012808D0022806D03B4831A1AF -:10E5F00092380CF064FD01203EBD2071FBE7FEB5B2 -:10E60000040004D135482BA17E380CF058FD304D64 -:10E610000026203D687C002808D0667010202070FD -:10E62000A87CA070E87CE0706E7430E0284F403F1A -:10E630003878002808D02C22B91C20460CF0B5FBF5 -:10E640000E2020703E7022E0A87B002809D0012017 -:10E65000E070E87BA070287C60700F202070AE73A3 -:10E6600015E01B480221C630029005F0B5F80028DD -:10E6700071D1174FC037F8880190F888042808D066 -:10E68000052831D02146FFF7D6FD002859D00120BA -:10E69000FEBD0021204606F027FA0028F7D1287D8C -:10E6A00000284ED06670132020701C21A01C0CF096 -:10E6B000D9FB15E07372635C6C6C5F6374726C2ED3 -:10E6C000630000000D020000FFFFFFFF1F000000BD -:10E6D000AC120020FFFF0000800000203903000082 -:10E6E0000220A0702E75D2E70021204609F09AFA88 -:10E6F000002826D020781328C9D1A0783C28C6D17C -:10E70000A088694604F089FF002803D0FD49FE482F -:10E710000CF0D5FC00988030807A05F0F2FE0028DD -:10E7200004D1F948F749001D0CF0C9FC009804F029 -:10E73000ACFF0028ABD0F448F24908300CF0BFFC25 -:10E74000A5E70221029805F047F8002803D1F988CF -:10E750000198814291D10020FEBD50E710B508F02C -:10E7600013FF002804D0E848E649BE300CF0A7FCAF -:10E7700007F027FD06F0A8FA04F089FA002804D073 -:10E780007920E049C0000CF09AFC0AF0D2FC002885 -:10E7900004D03D20DB4900010CF091FC09F072FA35 -:10E7A000002804D0F520D74980000CF088FCFFF742 -:10E7B000EDFD04F0B9FE002804D0F720D149800017 -:10E7C0000CF07DFC05F02AFE01F019FBCF4800217A -:10E7D000C17040380171012141710222C270017083 -:10E7E00010BD10B5C94C403C2078002804D00A2147 -:10E7F0000E2001F0CAFA10BDFFF700FD002801D07D -:10E800000C2002E001F0FBFA002020710120607171 -:10E810000A21E170207010BD70B5BC4C0646403C2A -:10E820002078002804D03A210E2001F0AEFA70BD05 -:10E83000FFF7E4FC002801D00C2010E0B34DE8788D -:10E8400008280BD20001001910223146443001F093 -:10E85000A6FAE878401CE870002000E0072020714C -:10E86000012060713A21E170207070BD70B5A74C35 -:10E870000646403C2078002804D00B210E2001F0F1 -:10E8800084FA70BD3078002803D0012801D012200E -:10E8900015E09E4D80352879082817D2FFF7AEFC89 -:10E8A000002801D00C200AE0984833782979721C9E -:10E8B000883001F0A6FB2879401C287100202071C7 -:10E8C000012060710B21E170207070BD0720F6E718 -:10E8D00010B58E4C403C2078002804D039210E2001 -:10E8E00001F053FA10BDFFF789FC002801D00C207D -:10E8F00002E086490020C870207101206071392132 -:10E90000E170207010BD814810B5403801780029B1 -:10E9100004D00F210E2001F038FA10BD0021017142 -:10E920000E2181700F21C170FF2181710021C94327 -:10E930000181774949680A7882728A888281498888 -:10E94000C18101214171017010BD704910B540397C -:10E950000A78002A04D03C210E2001F016FA10BDDE -:10E960006A4A0088C03250800120107100220A716A -:10E9700048713C22CA70087010BD10B5634C403C11 -:10E980002078002804D02B210E2001F0FEF910BDC4 -:10E990000821A01DFDF7C0FB00202071012060713F -:10E9A0002B21E170207010BD10B5584C403C2078F0 -:10E9B000002804D005210E2001F0E7F910BD05F074 -:10E9C0007CFDE08005F0D4FE207200202071012043 -:10E9D00060710521E170207010BD10B54B4C403CBA -:10E9E0002178002904D031210E2001F0CEF910BD8C -:10E9F00000214156042911D000290FD0081D0DD047 -:10EA0000001D0BD0001D09D0001D07D0001D05D032 -:10EA10000A3003D00A3001D0122003E0084601F08A -:10EA200041FB002020713120E070012060712070D6 -:10EA300010BD30B5354D0446403D28788DB00028D6 -:10EA400005D02A210E2001F0A0F90DB030BD102212 -:10EA50002146684601F0A3F91022A11804A801F08C -:10EA60009EF9684603F019FC10222C46A81D08A93F -:10EA700001F095F9002020710E20A0702A20E0708E -:10EA8000012060712070E0E7F0B5204C85B0403C7B -:10EA90002078002804D03B210E2001F076F971E4A3 -:10EAA0000020A07119486946C0304088888002A9BA -:10EAB00004F035FE002805D0002101A804F08CFEEA -:10EAC000002865D16846114D81880180283D68463F -:10EAD00002A9008804F023FE002803D009490D484C -:10EAE0000CF0EDFA039E04A937468837B87828362B -:10EAF00005F059FE002804D106480249401D0CF0DB -:10EB0000DEFA09E0B4E60000FF020000AC120020CB -:10EB10008000002014050000767EB87805F05EFFC6 -:10EB2000002803D1FB49FC480CF0C9FA05F0C1FFED -:10EB300001214840314601431FD06A461188A2791D -:10EB4000FD23520012191181A2794000515D49083C -:10EB5000490031435155A2791940014351556A4644 -:10EB6000107C002802D00420014301E0FB2001407A -:10EB7000A0794155A079401CA0710021684604F09D -:10EB80002BFE002804D168460188808881429ED1EE -:10EB900000202071012060713B21E17020707EE730 -:10EBA00070B5DE4C05462078002804D034210E20B4 -:10EBB00001F0EBF870BD08F089FF052804D0284665 -:10EBC00008F041FD002000E00C2020710120607160 -:10EBD0003421E170207070BD10B5D04C2078002831 -:10EBE00004D00E21084601F0D0F810BD0622CC4911 -:10EBF000A01D0CF0DAF800202071012060710E21B8 -:10EC0000E170207010BD70B5C44C06462078251DFB -:10EC1000002804D032210E2001F0B7F870BD314633 -:10EC2000002009F034F9287000280CD10021324668 -:10EC3000084606F08EF92870002804D106223146D5 -:10EC4000B7480CF0B2F8012060713221E1702070F9 -:10EC500070BD70B5B14C05462078002804D0302135 -:10EC60000E2001F092F870BD08F075FD002803D168 -:10EC700004F0ECFA00280DD0287804F098F82878F1 -:10EC800006F0CEF900202071012060713021E17082 -:10EC9000207070BD0C20F6E7F8B5A04C0646207831 -:10ECA000251D002804D017210E2001F06EF8F8BDB4 -:10ECB0003146012009F0EBF80127287000280FD118 -:10ECC0003246012106F045F92870002808D1934802 -:10ECD000062231463C300CF068F89048403087708E -:10ECE00067711720E0702770F8BDFEB58B4C0546A4 -:10ECF0002034A07B002804D028210F2001F045F803 -:10ED0000FEBDA8781A2824D00EDC03000CF0F8FA17 -:10ED100016333333333321333333333333333333F2 -:10ED200033333333212121332A2824D00ADC1E38FF -:10ED300003000CF0E5FA0C202020202020202020C9 -:10ED400020200E203A3803000CF0DAFA04150315DF -:10ED500003152888734988420DD81F21E1732821A3 -:10ED600021740120A0732888694604F0D8FC00288B -:10ED700003D0022014E0122012E068460078019FC0 -:10ED800000280FD0C637019E00280DD0C736684630 -:10ED900001F024F8002802D03878002806D00C2092 -:10EDA000E073FEBD9C37EEE79D36F0E7012038703A -:10EDB000A87830700020E073684601F027F8FEBDA7 -:10EDC000F0B5564C0746207885B0002804D02521A0 -:10EDD0000E2000F0DAFF62E6388802A904F09FFCFA -:10EDE0004E4E0021083600280CD0022020713160E0 -:10EDF0003171E1800E20A0702520E070012060714B -:10EE000020704CE6039D28460A30483501900020CA -:10EE1000A8750522304601990BF0C7FFA87D002890 -:10EE2000F5D13888E080E5E7FEB53C4C0646203455 -:10EE3000A07B002804D010210F2000F0A6FFFEBD0B -:10EE40001F20E073102020740127A77330886946C3 -:10EE500004F065FC002810D1684600F0BFFF0028D0 -:10EE60000BD06846019D007828350028019806D00F -:10EE7000CA300178002909D104E0022007E080307F -:10EE8000406AF6E72035697B002902D03A20E0731A -:10EE9000FEBDA97B89070DD1062101706846007867 -:10EEA000002804D1019831888030406A418068464A -:10EEB00000F0ACFF0020E0736F73FEBD70B5174D1E -:10EEC00004462878002804D038210E2000F05DFF89 -:10EED00070BD1F202871012068713821E9702870E9 -:10EEE0002078002808D0012806D0022804D0032862 -:10EEF00002D01220287170BD002606F05FF820783D -:10EF000007F069FA207808F0E8FF20780AF0AEFAF6 -:10EF10002E7170BDB4E600001F0500006C120020C9 -:10EF20008C000020FF0E0000F8B5FF4D0646287843 -:10EF3000002804D01D210E2000F027FFF8BD1F205F -:10EF40002871012068711D21E970287008F0BEFD4C -:10EF50000C27042857D0052855D0B0791224012851 -:10EF600001D000281DD13078002801D0012818D107 -:10EF7000F079002801D0012813D17088EB49021FD5 -:10EF800030248A420DD2B288121F8A4209D22887C1 -:10EF9000B0886887B0790024012804D000280CD0FC -:10EFA00016E02C71F8BDE0484030807800282AD067 -:10EFB000DD4A3C320121084602E0DD4A0021012001 -:10EFC00005F0C7FF040003D0DA49DB480CF077F8FE -:10EFD000F079012801D0002802D105F0D6FF0446BF -:10EFE000002C01D01F2011E03078012802D0002829 -:10EFF00003D00AE00021022001E00021012005F0F9 -:10F00000D4FF002801D02F71F8BD00202871F8BD71 -:10F0100070B5C54C2178002904D01E210E2000F0C7 -:10F02000B4FE76E71F212171012161711E22E27079 -:10F03000217002781221012A01D0002A04D14078DF -:10F04000002803D0012801D0217162E700260C2599 -:10F05000012A09D008F03AFD052803D008F044FA47 -:10F06000002806D0257154E7618F208F08F085FBBA -:10F07000F6E726714DE7F0B5AE490546143103C9F0 -:10F0800087B0A94C059120340490A07B002805D0BE -:10F0900021210F2000F079FE07B0F0BD1F20E073A2 -:10F0A000212020740127A773284600F0BDFE002808 -:10F0B00010D108F00BFD05280BD008F007FD04283F -:10F0C00007D0207D002804D105F059FD9B498842D6 -:10F0D00001D00C20BDE0684604F0EFFA002801D012 -:10F0E0000920B6E001220321009805F028F8009ECF -:10F0F000042170880F3603903046FDF70DF8304636 -:10F10000039905F004F98EA0009E00680690032183 -:10F1100006A81336FCF789FF002006A90A5C3254C2 -:10F12000401CC0B20328F9D30098298A8180698ADB -:10F13000C180A98A01810146002620318E73CE73D9 -:10F140006979002902D0012903D101E0C67600E0E7 -:10F15000C7760622A91D1C300BF027FE0098052259 -:10F1600004A90A300BF021FE0098A030077369460D -:10F170000E72012102A8FCF758FF6946087A410780 -:10F18000C206490F920F80068918C00F08186946F9 -:10F190000872401D009B0928987601D208309876A5 -:10F1A00001220021184604F0CAFF00988A3005F0B9 -:10F1B00086F9002804D160485E49FF300BF07FFFDC -:10F1C000287B002806D0012808D05A495D480BF05A -:10F1D00076FF40E00021564A012008E052484030C6 -:10F1E000807800280FD0504A01213C32084605F0B3 -:10F1F000B0FE00282FD000988030807A05F081F989 -:10F20000002816D01AE000988030807A05F079F94D -:10F21000002804D14B4847490D380BF050FF0098A7 -:10F2200004F01BFB002800D153E746484149093848 -:10F2300041E044483F49C01D0BF041FF009804F0F5 -:10F240000CFB002804D03F483A490B300BF037FF45 -:10F250001F20E07320E72879012801D0002803D17E -:10F2600005F093FE00280CD10320009905F09DFEC7 -:10F27000002806D16A882988009808F02BFA00280F -:10F2800007D000988030807A05F03BF9002805D03F -:10F2900009E00098A0300670E673FDE68520254958 -:10F2A00000010BF00CFF009804F0D7FA0028BBD047 -:10F2B0002448204935300BF002FF0AE738B51A4CD4 -:10F2C0002078002804D022210E2000F05EFD38BDF9 -:10F2D0001F202071012565712220E070257008F043 -:10F2E000F5FB052802D00C20207138BD00202071CC -:10F2F000684608F0A1FA0028F7D100988030807A9B -:10F3000005F0FFF8002804D10E480A4963300BF0DD -:10F31000D6FE009804F0A1FA002804D00948054957 -:10F3200067300BF0CCFE0FE06C120020FD3F0000B8 -:10F330008C000020B4E6000006070000FFFF00007C -:10F34000112233001F080000F8480575F8480078BE -:10F35000F2F7DAFF38BDF8B5F44D0446A87B002873 -:10F3600004D023210F2000F010FDF8BD1F20E8730A -:10F37000232028740120A8736288EE4B911F30204F -:10F3800099424CD2A1888E1F9E4248D28A4246D8CA -:10F39000E288FF23F4339A4241D82289E54E13468E -:10F3A0000A3B361FB3423AD2C9088A4237D961892B -:10F3B000A289914233D800262088694604F0A1F939 -:10F3C000022700280BD1009800F0F6FC002806D098 -:10F3D00000988030416A0A78002A06D101E0EF7374 -:10F3E000F8BD826B1278002A01D03A2017E005227E -:10F3F0008A71416A0E81426AA1885181426AE1881C -:10F400009181426A2189D181406A01894289914270 -:10F4100004D88179082901D8914202D31220E873D7 -:10F42000F8BD2188418000988030406A0770EE73F3 -:10F43000F8BDFEB5BD4C0646203C2078002804D01F -:10F4400024210E2000F0A1FCFEBD012565712420C1 -:10F45000E0702570304604F07CFF002801D00020C9 -:10F4600000E0122020710028EED1B04F0522C037F5 -:10F4700038463D7731461D300BF097FC00263E772D -:10F48000701E69460880684604F073F9002818D198 -:10F4900068460788684601A9008804F032F9002808 -:10F4A00003D0A549A5480BF00AFE0198A0300573CA -:10F4B000684604F05EF9002803D168460088874258 -:10F4C000E8D12671FEBD38B5984C0546A07B0028D2 -:10F4D00004D026210F2000F058FC38BD1F20E07317 -:10F4E000262020740120A0732888694604F009F9B9 -:10F4F00000280BD1009800F05FFC002806D000988F -:10F500008030416A0A78002A06D101E002200DE02D -:10F51000806B0078002801D03A2007E007200870AF -:10F52000009829888030406A41800020E07338BD0F -:10F5300010B57E4C203C2078002804D006210E20F7 -:10F5400000F023FC10BD002020710E20A0700620CA -:10F55000E0700821A01D0BF085FCA179012001437A -:10F56000A1716071207010BD38B5704C0546A07B4C -:10F57000002804D02C210F2000F007FC38BD1F20EC -:10F58000E0732C2020740120A0732888694604F0C1 -:10F59000B8F800280CD1009800F00EFC002807D025 -:10F5A0000098014680314B6A1A78002A06D101E0A2 -:10F5B000022025E0896B0978002901D03A201FE05C -:10F5C0004030007F00281DD00822A91C181D0BF018 -:10F5D000ECFB00986A898030416A8A81406A29463A -:10F5E00010220C310E300BF0E0FB0098032180302C -:10F5F000406A0170009829888030406A418000206C -:10F60000E07338BD0C20FBE770B5484E0446203E41 -:10F6100030780C25002804D018210E2000F0B5FB0E -:10F6200077E402F00FFF03285BD002F011FF0328FC -:10F6300057D06079002801D001282DD1A079002869 -:10F6400001D0012828D1A07B002805D0012803D0B3 -:10F65000022801D003281FD1607B00281CD0C008DD -:10F660001AD1628801208003824202D82188814217 -:10F6700003D9207901280FD119E02079002806D07C -:10F68000012814D0022805D0032805D102E0202A41 -:10F690000BD30CE0A0290AD22079042805D12088B8 -:10F6A000202802D36188884201D9122519E01F4819 -:10F6B000217981756079002802D0012805D010E0F9 -:10F6C0001B4A20460C32002108E018482030807880 -:10F6D000002806D0154A01211C32204608F05DFBA7 -:10F6E00005460120357170711821F170307010E4F9 -:10F6F00010B50E4C203C2178002904D01A210E2090 -:10F7000000F043FB10BD01781F2919D8411C17D008 -:10F71000002121710278411C104608F0E1FB012014 -:10F7200060711A21E170207010BD00008C12002061 -:10F73000800000207B0C0000B4E6000011090000EE -:10F7400012202071EBE710B5FE4C2178002904D07F -:10F7500020210E2000F019FBE6E701781F290ED8C2 -:10F76000411C0CD0002121710278411C104608F088 -:10F77000A6FB012060712021E1702070D4E71220E7 -:10F780002071F6E7F8B5EF4C2178002904D01B2151 -:10F790000E2000F0FAFAF8BD012666710C212171E5 -:10F7A00000780025012804D000285BD012202071A9 -:10F7B00087E002F047FE002834D102F049FE00281D -:10F7C00030D108F056FAE04988422BD108F0AFFA60 -:10F7D000002876D0684603F006FFDC4A0099916065 -:10F7E000002803D0DA49DB480BF069FC0122032131 -:10F7F000009804F04AFC009808F003FC00988A3056 -:10F8000004F05DFE002804D1D248D14908300BF045 -:10F8100056FC009803F0CEFA002851D0CD48CC49D0 -:10F820000C301CE002F00EFE02284AD102F010FE5D -:10F83000002846D1C3482030807D002841D00128CF -:10F840003FD004283DD008F072FA002839D00020BB -:10F8500003F0B0FA002833D0BE48BD4924300BF085 -:10F860002EFC2DE002F0EEFD032804D002F0F0FDA6 -:10F87000032820D025E002F0E8FD0090002003F0EE -:10F8800092F900281DD1257100988030807A04F00B -:10F8900038FE002804D1AF48AD493E300BF00FFCD4 -:10F8A000009803F0F2FE00280BD0A720A849000121 -:10F8B0000BF005FC05E0002003F075F9002800D1ED -:10F8C00025711B20E0702670F8BD38B59D4C0546AB -:10F8D0002078002804D02D210E2000F056FA38BDE3 -:10F8E0002888694603F099FE002801D002200FE025 -:10F8F0000098CA21095C002909D13321095C0F292C -:10F9000001D0102903D1FC21095C00290BD00C2067 -:10F9100020710E20A0702D20E0702888E08001204A -:10F920006071207038BD1022A91CD8300BF03DFA50 -:10F9300000980421C03081720020E9E738B5814C7D -:10F9400005462078002804D02E210E2000F01DFA54 -:10F9500038BD2888694603F060FE002801D00220E7 -:10F960000CE000980146C030827A002A05D120318F -:10F97000C97C0F290DD010290BD00C2020710E202E -:10F98000A0702E20E0702888E08001206071207037 -:10F9900038BD052181720020F0E77CB5694C054631 -:10F9A0002078002804D037210E2000F0EEF97CBD2D -:10F9B0002888694603F0B3FE002807D00220207192 -:10F9C000012060713721E17020707CBD01987F2299 -:10F9D000014628300272427200228272A8782231D7 -:10F9E0008870E878C870287908712271E8E71CB53A -:10F9F000544C2178002904D013210E2000F0C5F9C1 -:10FA00001CBD0088694603F08AFE002801D0022050 -:10FA100006E001982421095C801C012902D00C20F9 -:10FA2000207107E00022019922712831097A2172A0 -:10FA30000088E080012060711321E1700E21A17027 -:10FA400020701CBDF8B53F4C05462078002804D036 -:10FA500035210E2000F099F9F8BDA878002801D0D2 -:10FA6000012804D1A888FF21F531884201D912204C -:10FA700020712888694603F0D0FD0126002806D0B1 -:10FA80000220207166713520E0702670F8BD009864 -:10FA900000270246C0300770AB88014643801046FD -:10FAA00080300677AA78012A00D000220A70407FB1 -:10FAB000002801D003F06EFA2771E3E7F8B5214E74 -:10FAC00004463078002804D03D210E2000F05DF976 -:10FAD000F8BD2088694603F0A0FD002801D002206F -:10FAE00028E0009F6488FD883A896800B988401C36 -:10FAF000844218D317486A384143800050430BF0C2 -:10FB0000BDF9401EFF2180B2F531884200D9084678 -:10FB1000844200D22046691C401C0BF0AFF96D1CDA -:10FB20006843401E85B2E820C05D002800D17D8476 -:10FB3000F58000203071012070713D21F17030702E -:10FB4000F8BD00006C120020FFFF000080000020C4 -:10FB5000B4E600002E0A000070B5D54C05462078AA -:10FB6000002804D033210E2000F00FF958E502F0F0 -:10FB700069FC002801D00C2018E02978002911D058 -:10FB80000A290FD014290DD01E290BD0282909D0FD -:10FB9000322907D04B2905D0642903D0FF2901D091 -:10FBA000122003E0284603F091F900202071012083 -:10FBB00060713321E170207032E570B5BC4C0546B0 -:10FBC0002078002804D03E210E2000F0DEF827E542 -:10FBD00002F038FC002803D102F03AFC002801D0E2 -:10FBE0000C2003E0287808F087F90020207101201C -:10FBF00060713E21E170207012E510B5017801249A -:10FC00000B000BF07DFB3FBFBF21BFBF4C94BFBFBC -:10FC1000BF2427BFBF464F61BFBF59BFBFBF2B9790 -:10FC2000BF9B9FBF797DBFA38185888C6590BF5D99 -:10FC3000BF555275A7ABBF372F33BB6DAFBF7142F6 -:10FC40003F3B4969B3B7C000FEF788FD9BE0FEF774 -:10FC5000C8FD98E0801CFEF709FE94E0801CFFF7C9 -:10FC60001BF890E0801CFEF7B8FE8CE0801CFEF7CD -:10FC7000CAFF88E0801CFEF7ECFF84E0801CFEF7E2 -:10FC8000CBFD80E0FEF724FE7DE0801CFFF716F937 -:10FC900079E0FEF7A1FF76E0FEF7F6FE73E0FEF7EF -:10FCA00083FE70E0FEF72FFE6DE0FEF766FE6AE071 -:10FCB000801CFEF7BEFE66E0801CFFF798FE62E047 -:10FCC000801CFFF712F85EE0801CFFF7ADF85AE0E9 -:10FCD000801CFFF775F856E0801CFEF736FE52E0F8 -:10FCE000801CFEF75DFF4EE0801CFFF756FE4AE0E9 -:10FCF000801CFFF739FC46E0801CFFF715F942E055 -:10FD0000801CFFF785F93EE0801CFFF7B4F93AE06C -:10FD1000FFF7D4FA37E0801CFFF71DFB33E0801CAF -:10FD2000FFF787FB2FE0801CFFF7CDFB2BE0FFF7F1 -:10FD3000FFFB28E0801CFFF767FC24E0801CFFF736 -:10FD4000D7FC20E0801CFFF71DFD1CE0801CFFF7A6 -:10FD5000FAFC18E0801CFFF7B8FD14E0801CFFF7E8 -:10FD6000EDFD10E0801CFFF76DFE0CE0801CFFF73E -:10FD7000A5FE08E0801CFFF720FF04E0801CFFF7D1 -:10FD8000EBFE00E000242046CEE4494A2032537CBA -:10FD9000002B03D19074D17401205074704730B59A -:10FDA000134606E0CC18203CD51AE47F5B1E445570 -:10FDB000DBB2002BF6D130BD017800290CD14121F6 -:10FDC000095C002908D18030017C002904D0007C26 -:10FDD000042801D001207047002070470178406856 -:10FDE000002903D00178002905D100E0E4E7403084 -:10FDF0004078002801D000207047012070472C492E -:10FE000000208031886740310871704710B5017853 -:10FE1000012908D140688030417F002903D00021AA -:10FE2000417703F0B7F87FE410B50388214A191F22 -:10FE3000914223D241880C1F94421FD299421DD86F -:10FE4000C2891D49931F8B4218D2038A9C1F8C4282 -:10FE500014D29A4212D8418AFF22F43291420DD82C -:10FE6000818A154C0A460A3A241FA24206D2DA08B1 -:10FE7000914203D9C18A028B914201D9302053E4C7 -:10FE8000811D017903D0002904D0C9B205E0002901 -:10FE90000AD0FAE74179002901D0012904D1007B79 -:10FEA000002803D0012801D012203DE400203BE4CB -:10FEB0006C120020FD3F00007B0C000070B5FC4D73 -:10FEC00000246C702C70AC616C72AC720120E87212 -:10FED000F8484470C473AC62F7482C6302F05FF9D1 -:10FEE000002804D0FF20F5A14F300BF0E8F82C7764 -:10FEF00070BDF8B5F54902250D60F5490026CE63C1 -:10FF00000127CF63F349C96A09070DD4F24AD36ABE -:10FF1000F2494B62136B8B62536BCB62936B0B6337 -:10FF2000D26BCB051A434A63ED4C002823D001283D -:10FF300025D0FF20E1A1A2300BF0C1F8E948A06371 -:10FF4000FF2004306063276303202061E649962088 -:10FF50004860D7491C2008560B22D243811A904290 -:10FF600037D011DC1C313AD00A2938D0142934D0CA -:10FF7000182911D12FE0DD486061DD4802E0DD483D -:10FF80006061DD48A061D9E708301FD004281BD08C -:10FF9000082817D00C2812D0FF20D8A176300BF0FB -:10FFA0008EF8DB49D9488860DB48DA494160DB4993 -:10FFB0000160DB480560DB4910204860F8BD042083 -:10FFC000E060EEE7E660ECE7FC2000E0F820E060AF -:10FFD000E7E7F420FBE7F020F9E7EC20F7E7D8208B -:10FFE000F5E710B50C460146CF480BF064F9B04870 -:10FFF000047210BDAF4840787047AD4A5170107020 -:020000040001F9 -:100000007047F8B504460D4650791179000208434F -:10001000690009190884501C01460E7801273046F2 -:100020004E78360230438E78C9783604304309065C -:100030000843117800020843A900605028460830A0 -:100040003E468640002B0CD0012B04D0FF209BA104 -:10005000E9300BF034F8206B3043AF403843206375 -:10006000F8BD206BB043F8E770B50D46044608298B -:1000700004D9FF2091A1FA300BF021F80022002DC5 -:100080000CD9AA489100635809180B6053001B193A -:100090001B8C0B62521CD2B2AA42F3D3206BA44930 -:1000A000086070BD10B504460B22D2430C308C4959 -:1000B000944223D008DC1C3026D00A2824D01428EF -:1000C00020D0182809D11BE02046083014D004287D -:1000D00010D008280BD00C2807D0FF2087A176303D -:1000E0000AF0EDFF7248047710BD042000E0002004 -:1000F000C860F7E7FC20FBE7F820F9E7F420F7E712 -:10010000F020F5E7EC20F3E7D820F1E76948007B21 -:1001100070477349C2784A6202461378184653788A -:100120001B0218439378D2781B041843120610431D -:100130000002C8617047252808D0262808D0272843 -:1001400008D041000A2807D8091D06E0022105E071 -:100150001A2103E0502101E0891DC9B2604A916073 -:1001600061494861704752498861704770B50028FD -:1001700016D002224E4C6F4BA27203201860644DC1 -:100180006248686000200126207500290AD00129F4 -:100190000FD002291DD049A167480AF090FF70BD19 -:1001A0000122E7E76548012A01D0466070BD06607C -:1001B00070BD3F48012A006B05D001214905084365 -:1001C0002063696070BD01210905084320636960EF -:1001D00070BDA069002804D1492038A1C0000AF0F0 -:1001E0006EFFA169A06A4018554988604A48554980 -:1001F00081605549C1600120216BC0030143216327 -:1002000068602C48C67370BDF8B54A4801688F080D -:100210004449BF004A68D206D60F10228A600024E3 -:1002200004603B48394981600C2069460870474D9D -:100230002C614249012008610BE000BF00BF00BFF4 -:1002400000BF00BF00BF00BF00BF69460878401E66 -:10025000087068460078002802D028690028ECD091 -:1002600068460078002804D14D2024A1C0000AF07F -:1002700026FF2C610E48012144728472C1722D4800 -:100280000760002E02D0274910204860F8BD0146C3 -:100290000A7810464A78120210438A78C978120404 -:1002A00010430906084300020D49000AC86370475D -:1002B0007413002094130020A81300207372635C51 -:1002C00068616C5F7263732E6300000080E100E080 -:1002D000C01F004080000010C00000100017004048 -:1002E000001500405B0600004015004006010200BA -:1002F00025000302050103001F0003027372635C03 -:1003000068616C5F7263732E63000000004000043C -:1003100000F501404080004080F501401011004090 -:1003200080E200E000130040761300200016004039 -:10033000401600400012004055020000001000402E -:1003400040850040488100401010004000110040EE -:10035000FB4902200860FB4908607047FA49022007 -:1003600008607047F9490870704710B5F84801F007 -:100370001EFF002803D0F749F7480AF0A0FE10BD81 -:1003800010B5F34801F02BFF10BDF44948607047E9 -:1003900070B5F34C0546A06AA84203D3ED49F14875 -:1003A0000AF08DFE01202073EF490020256148608E -:1003B000EE4845600120216B800501432163EC4933 -:1003C000486070BDE64802210173C6210161E64A1A -:1003D00000215160816AE54AC63151600121026BFA -:1003E00089050A430263E248416070470121E04801 -:1003F00089058160DA48026B8A4300210263017338 -:100400007047DC4801214160C160D7490020486045 -:10041000D6494860D24988627047D749402008626F -:10042000D6490A6802430A607047D44801684022EE -:1004300091430160D049002008627047CF480168AD -:10044000102291430160CE49012088617047CD4957 -:100450000020C861C948016810221143016070473B -:10046000C849CA69012A01D000207047C24A92686F -:100470005206520E524202700020C861012070479D -:1004800070B50C00054604D1D920B24980000AF0AD -:1004900016FEE00705D0012C03D0AE49BA480AF099 -:1004A0000EFE002D0DD00221AD4801294172C4720B -:1004B000B24808D002290BD0A649B4480AF0FFFD83 -:1004C00070BD0121F0E7016804221143016070BD95 -:1004D000016808221143016070BDF8B5A04C0025E9 -:1004E000E27A910701D5410713D4D306A849002B1E -:1004F00005DA4B7B002B02D08B7B002B09D0130736 -:1005000002D50B78002B04D1520703D54978002976 -:1005100000D10125677A002201239849002F1BD0C2 -:1005200002263040284348D0084601688E08994981 -:10053000B6004D68ED06ED0F10278F6000210160B9 -:100540008B4A954890600C206A4610708D4F396137 -:100550008B490120086114E0854D8F48A860086828 -:10056000800880000860A272E372F8BD00BF00BF7F -:1005700000BF00BF00BF00BF00BF00BF1078401E1B -:1005800010701078002802D038690028EED010785A -:10059000002804D14D208149C0000AF090FD0020C0 -:1005A00038616072A0720120E07274480660002D0C -:1005B000DBD0784810214160F8BD012F06D0022F12 -:1005C0000CD0644976480AF07AFDF8BD0868042525 -:1005D000A84308606272E372A372F8BD0868082538 -:1005E000A84308606272E372A672F8BD5C490875A0 -:1005F0007047F8B5664D5A49EC7B086B002C58D013 -:1006000001245B4AE4039460A04308635B480768E5 -:10061000604C1021A16000210160001490600C204A -:100620006A461070574C21615548012606610AE060 -:1006300000BF00BF00BF00BF00BF00BF00BF00BFC2 -:100640001078401E10701078002802D02069002811 -:10065000EED01078002804D14D205049C0000AF097 -:100660002EFD0020E060206160606061A061434871 -:1006700007603F4900144860464910204860384CE4 -:10068000A07A01280FD0022810D0444945480AF02A -:1006900016FD0020E873207D022803D1424801683E -:1006A0008907FCD5F8BD36480660F2E73448466055 -:1006B000EFE72F4A906000200863087B2A4E00284D -:1006C00002D07068012809D000222E4C2069012830 -:1006D00006D00023887A012804D006E00122F4E73E -:1006E0004023F7E7E768012F04D000271F430128C4 -:1006F00002D004E02027F9E76368012B05D000232E -:100700003B432A4F022802D007E01023F8E739685C -:10071000012902D1E168012904D0002119430228EE -:1007200002D007E00821F9E73B68002B02D1E3681B -:10073000012B3DD000230B4302283BD03EE00000BC -:1007400080E100E080E200E000E100E092000020B3 -:10075000A8130020BC020100A20200000015004006 -:1007600074130020B3020000408100404085004027 -:1007700000F501400080004040150040001200409C -:100780000010004000110040690300007E030000DB -:10079000941300200013004000400004FC020100FC -:1007A000CF0300005E03000000E200E00014004000 -:1007B0000423C0E7002A01D0022100E000211943F0 -:1007C000022807D16068012804D17068012801D08F -:1007D000012700E0002790480F4301680906090E31 -:1007E00002D06169012900D0002129730068000648 -:1007F000000E02D0A069012800D00020687387484D -:10080000006A002803D000F0DCF9012800D00020A5 -:10081000A8730020E060206160606061A061804991 -:100820004860804E8049307548683C46706209686F -:10083000B1620B46B17A022909D17178002906D03C -:100840007A4A526812780A40317891430ED00021DA -:100850002970774FE10710D03978032908D0022991 -:1008600006D002F0D1FC0121B06A20E00121EFE7BF -:1008700007F016F90121B06A27E0A0060ED53878F6 -:10088000032806D0022804D00221184602F0CBFC2F -:100890000FE00221184607F004F90AE0A00708D586 -:1008A000387803280FD002280DD00021184602F016 -:1008B000BAFC5E4841680622B01C09310AF048FAC9 -:1008C000002805D00DE00021184607F0EAF8F0E70F -:1008D0005648317A40680078C009814201D1012030 -:1008E00000E0002068702046FFF7F7FD3878002808 -:1008F0000DD001281ED002282FD003284AD04D4900 -:100900004D480AF0DCFBB07A022856D075E0A0070B -:1009100001D507F0BAFC200702D5012007F0F1FC51 -:10092000600702D5002007F0ECFCA006EBD507F02D -:100930004DFCE8E7A00701D508F0BCFF200702D571 -:10094000012008F037FE600702D5002008F032FED3 -:10095000A006D8D508F08DFDD5E7A007BF25002853 -:1009600002DA2C4004F022FF200703D52C4001209E -:1009700004F05DFB600703D52C40002004F057FB1A -:10098000A00602D52C4004F061FE6006BBD504F041 -:100990004AFBB8E7A00701D505F0DDFE200702D528 -:1009A000012005F0A1FD600702D5002005F09CFDA7 -:1009B000A006A8D505F016FDA5E7307B00281CD0C1 -:1009C000174900224A60022820D0012803D0194983 -:1009D0001A480AF074FBB16A3069884203D8154995 -:1009E00017480AF06CFB1048316941600120316BF7 -:1009F00080050143316313494860307D012800D0F0 -:100A000050E6114801688907FCD5F8BD3169B06A24 -:100A1000411805484160E9E7401600404015004094 -:100A200040810040741300204085004000150040C4 -:100A300092000020BC020100FD040000120500002D -:100A40001305000000F5014000E200E02E480021FF -:100A500001704170704770B5064614460D4601207E -:100A6000F0F7A0FC28490120284B08709E60DC604C -:100A70001D6170BDF8B504460120F0F793FC2249D2 -:100A80000120087021494C60214900264E60032155 -:100A9000204D0906A960204F002C0AD0012C03D05C -:100AA0001EA141200AF00BFB3E6003200006686097 -:100AB000F8BD386001200006F9E710B5124801784A -:100AC00000290ED00321134A0906916010494A6893 -:100AD0000021002A03D0154A1268427000E04170DC -:100AE00001700020F0F75EFC10BD07480178002976 -:100AF00007D007484068002802D00C480068C0B200 -:100B000070474078704700009300002000F50040D7 -:100B100000F1004000F5014000F200407372635C98 -:100B200068616C5F63636D2E6300000000F4004039 -:100B30003B4800210170417010218170704770B5F1 -:100B4000064614460D460220F0F72CFC01203449DD -:100B5000344A0870E41E14619660556070BD10B58B -:100B60000220F0F71FFC2E49012008702E480021BA -:100B700001604160816001202C49C005486010BDC2 -:100B800010B527480178002917D00121274AC90547 -:100B9000916025490B680022002B05D04B68002B83 -:100BA00002D08968002902D04270102103E001219F -:100BB00041701F490968817002700020F0F7F2FB54 -:100BC00010BD17480178002912D017480168002984 -:100BD0000AD00168002905D04168002902D0806848 -:100BE000002803D000207047022070470120704782 -:100BF000407870470A48017800290FD00A480168F8 -:100C0000002905D04168002902D08068002801D061 -:100C10001020704706480068C0B27047807870475F -:100C20009500002000F5004000F1004000F5014073 -:100C300000F40040FFB593B0044600201D9E0490D0 -:100C400015981C9D1027082806D0E06901F014F8BB -:100C5000002809D03770CCE0288809213843288043 -:100C60001F980227017016E0E169012088710521B3 -:100C7000E269C9029180E1698872E169F9480881F5 -:100C8000E1690020887328882021084328801121E9 -:100C90001F98042701701F980225801C039030784C -:100CA00010900A203070204618301190F5F79FFC04 -:100CB00000206FE01598102809D1022D07D0684652 -:100CC000828A04990398401A8270110AC17068469A -:100CD000C08A1699884203D9E349097A149106E03B -:100CE000884204D11099002901D0317021E0039984 -:100CF0000870000A48701E980088401BC01B83B211 -:100D0000FF20C01B984200D203460398149AC019D2 -:100D10000CA90092019002912020015D6846C08AD2 -:100D20000022F5F7D9FC3070002806D0C0B2832825 -:100D300062D06846C08A208345E00F98002805D01D -:100D4000C948006800790A2830D33CE06846008E24 -:100D5000C119C9B20491022D0FD01F99049A497884 -:100D6000914203D16A46128C824209D0BE48049156 -:100D700000680178032909D027E008461F994870C8 -:100D8000B94800680178042906D008E000790A28EB -:100D90001BD201200F9009E06946C98A818003991E -:100DA0000498081803900498281885B205AA149985 -:100DB0001198F5F71FFC002805D11E980088401BEC -:100DC000B84200DB76E7022D0ED01598102807D127 -:100DD000049A03996846808A891A8870000AC87044 -:100DE0001E980580002030709F4800680078032816 -:100DF00002D0002017B0F0BD0220FBE7F8B5044692 -:100E0000406B0026134600282BD0491F8DB2618FFE -:100E10002A460832278F8A18BA4221D89A78401871 -:100E20005F78110239430170090A41701A79DF783D -:100E3000110239438170090AC1700571290A417193 -:100E40002A46591D801D09F0B0FF608FAD1D401965 -:100E500080B26087626B002110180170417000E061 -:100E600009263046F8BD30B50B88048F9C4212D954 -:100E7000446BE0184478057824022C430BD0447965 -:100E8000057924022C436404640CA41D1B190B80F7 -:100E90001060002030BD822030BDF7B588B000253D -:100EA0006846058205275DE00398417802780E02C6 -:100EB00016434179027908021043000452D40A987B -:100EC0000123068005A802905B020022009701958D -:100ED00030460999F5F700FC04004AD16846018ABA -:100EE000018303984179027909021143437802781A -:100EF0001C021443B4421ED10A041CD44B04012129 -:100F00005B0C890300950B4301970295C1788078AB -:100F10000A02024320460999F5F7FAF9040011D1B3 -:100F2000039948790A79000210430122D203104341 -:100F30000871000A487103AA06A90898FFF793FFF1 -:100F40000400CED00399009501970295487809785E -:100F50000002084369468B8A00220999F5F7D8F9FF -:100F6000822C06D103AA04A90898FFF77CFF04008D -:100F70009AD06846058209E003984179027909020E -:100F800011434904490C0171090A417103AA04A9DA -:100F90000898FFF768FF0028EED0822C02D0204688 -:100FA0000BB0F0BD0020FBE730B50446406B0025D8 -:100FB00097B000280DD00B2268460270228F028164 -:100FC000606B0391019000216846F2F728FB6846A8 -:100FD000057065636587258717B030BDF8B50F4686 -:100FE0000546696B0020069E144600290FD0012B90 -:100FF0000DD1324639462846FFF74FFF002806D16B -:10100000002C04D032463946284600F044FEF8BD94 -:1010100000220280C262831D0263C3614263428771 -:10102000028720300170704710B50022D243028041 -:101030000420FBF7D8FA10BD10B596B00446FFF7B0 -:10104000B3FF208E002808D0012069460870E06AAE -:10105000019000216846F2F7E2FA0020E062206386 -:1010600016B010BD01280000AC130020014609880D -:1010700000200A0700D501200A06120F01D0022223 -:101080001043CA0501D5042210438A0501D5102258 -:101090001043490501D5202108437047FFB5A9B089 -:1010A0000600329D359C2B981F46229016D0007862 -:1010B00041060FD48106890E1E2909D021884A05D0 -:1010C000520E0BD13A88172A08D3FE4A914205D016 -:1010D000C10906D08006800E122802D003202DB050 -:1010E000F0BD20462C302690F7492A98087200203F -:1010F00018AA039010726A46107404AA0A60339A00 -:101100004A6020AA90809081229800780190810600 -:10111000681C1C90701F1D902B98890EC21C249275 -:10112000224620321B92083A401C02920B000AF021 -:10113000E7F81FFDFD11FD1FFD8EFDFCFDFBFDFA17 -:10114000FDF9FDFCFDF8FDFDFDF7FDF6FDFDFDFDE6 -:10115000FDF5FD00032E76D102E018A9087219E30F -:10116000032028701C9917220A7000224A70CFE2CF -:10117000052EF0D14178027808021043208320A97F -:101180008880249A517812780902114361830028DB -:101190007ED088427CD800202072E080401E60848F -:1011A0000298F5F724FA05202870A81C0190022067 -:1011B00000901BAA2A990298F5F71CFA002868D11A -:1011C00018A8807C012803D002206870102002E05B -:1011D0000120687002202490002225A91CA8F1F7A4 -:1011E000A8FD00282BD120A8007D2499814226D17A -:1011F0003A880099801C511A814220DB10A8C18DC9 -:1012000001980170090A417001991CA8891C01917B -:101210000099019A891C009125A9F1F78AFD20A85F -:10122000007D01991BAA091801910099081880B244 -:1012300000902A990298F5F7DDF90028CCD00098A3 -:10124000022826D064E272E018A9087261E2072E33 -:101250006DD341780346027808021043208320A909 -:101260008880249A517812780902114361830028FA -:101270000ED088420CD801202072587919790002CA -:101280000843E08000202073E06900F0F5FC01E0F5 -:1012900098E0A9E000280ED1E169012088710521BC -:1012A000E269C9029180E1698872E1698748088131 -:1012B000E16900208873F01F60842298C01D60627D -:1012C0000298F5F794F907202870681C0090012017 -:1012D0000190002010A9C8852FE00198012814D0A2 -:1012E000E0698079012830D000981E38417F007F66 -:1012F0000902014300980170090A41700098801C9E -:1013000000900198801C80B2019010A8C18D0098B7 -:101310000170090A41700098801C09E00AE296E118 -:101320003BE1DFE004E29BE077E036E016E2AFE08D -:1013300000900198801C80B201901BAA2A99029803 -:10134000F5F758F9002803D007E010A8818DD1E700 -:1013500039880198081A0428BFDA0198012843D077 -:10136000E0698079012804D010A8818D5548814218 -:1013700006D110A8818D00980170090A417009E01A -:1013800000981E38417F027F0802009910430870C0 -:10139000000A48700198801CBAE1072E01D0152E72 -:1013A00076D14178027808021043208320A98880F2 -:1013B000249A51781278090211436183002801D0E0 -:1013C000884201D901203FE7012020720020E080FF -:1013D0002073052E0AD01D982299E269C0B2491DDA -:1013E000F1F781FC002801D00A202DE70020C0433E -:1013F00060841AA8019023A922980297039500916E -:10140000007800238206920E20462A99FFF712FCEC -:101410000390208B20A988807BE1032EC0D140223D -:1014200020A98A814178027808021043208320A9EC -:1014300088802A991EAB1C9A0293019200913988E8 -:101440000022491E8BB21B990978F5F745F918A9B6 -:101450000872002833D10B20287010A8008F3FE0BD -:10146000052E9DD1802220A98A8141780278080228 -:1014700010432083249984464A78097812020A434B -:10148000628420A988801248824202D30720DBE6CA -:10149000AFE03F208002024362842A981FAB1C9970 -:1014A0000293019100903888401E83B21B98017806 -:1014B0006046F5F711F918A9087200280CD08328A6 -:1014C000AAD107E0FFFF0000AC13002001280000B4 -:1014D000010200000220B8E00D20287010A8808FC3 -:1014E000401C15E101990C22C9095143C91CB142A4 -:1014F00004D9019840067CD5002009E142780378A0 -:101500001002184320AA9080844622980078400652 -:1015100009D505206A46107422980078C00905D0C4 -:10152000002010741DE106206A46107424981F9054 -:101530002A9A00900023701A029383B21E9001929F -:101540001B98002201786046F4F7E2FE18A90872A1 -:10155000002269460A74832801D102200390229850 -:10156000007840060DD52088C00506D520A9208B1F -:101570008988884201D100206062002018A9087281 -:10158000C6E0FF21013120A88181808820831E9838 -:1015900060841F9860621320B8E0052E29D341783B -:1015A00002780802104320A98880218F002902D0E8 -:1015B000FE4A914206D10A216A4611740121C943AB -:1015C000218702E007216A46117422992A9A491D4F -:1015D0000192009101221D990023D203029311432D -:1015E0008BB224994A78097812020A431B99097828 -:1015F00000E0C9E0F4F78CFE18A9087200226946E1 -:101600000A740122520220A98A81832808D0002866 -:1016100009D0218FE54881427ED10020208778E0E3 -:10162000888820834DE7606B002808D0314620462B -:10163000229AFFF7E3FB18A90872002869D12B460C -:101640003A463046229900F056FB039061E022981A -:10165000022E407801907DD1002801D0012879D157 -:101660000820694608740198087521A800901B9805 -:10167000002201782046019BFFF7B0FC694600225A -:1016800048758A75002802D10198012809D0208F59 -:10169000002806D0002008740120800220A988813B -:1016A0000EE004A83399F1F7BAFF039000206946D1 -:1016B00008740120800220A988810398022807D09D -:1016C000BB4800688079002805D018A908722BE073 -:1016D000019820831DE00398002803D0812018A9D9 -:1016E000087240E021A800901B9801220178204652 -:1016F000019BFFF773FC18A9087220463499FFF785 -:1017000053FC18A9087A002803D119202870012059 -:1017100038806846007C00E03CE0002804D004A843 -:101720003399F1F77CFF0390039800282ED01AE03C -:10173000062012E52078000713D5012E11D10921CA -:1017400068460174A188818204203499FAF74BFF1E -:10175000082100E005E020A88181CDE6019840063F -:1017600012D50320039020A920888989084320806E -:1017700020A988894005400E04D026992B9808603E -:10178000269886800398AAE40420E6E418A8007A44 -:1017900000280ED00120287022980078687020A8B8 -:1017A0008088A870000AE87018A8007A28710520BF -:1017B000388020A92088898988432080E2E7FFB506 -:1017C0000746A1B000201C903A7801209040794A49 -:1017D0007C68104010AA1087744B22885B1C9A42C8 -:1017E00003D0002804D0100702D5012025B0F0BD99 -:1017F000249E0020307023980025028810A80285BE -:1018000018A805756A4B68461972057404A8186013 -:1018100020462C301B902A985860249E9446387895 -:10182000721C0521039201282DD0022808D003281C -:101830007DD13078800980011D303070B889A0805A -:101840003878022804D13078800980011B3030704C -:10185000F01C1FAA01900292009110A8008D002296 -:10186000C01E83B22020015DB889F4F735FF00283F -:10187000DED10398B9890170090A417010A9888FD7 -:10188000C01C088528E1787B18AA10753A7B012ACC -:1018900002D0022ACCD1FCE022887F231B011A400F -:1018A00010AB1A87802A4AD006DC102A10D0202AD2 -:1018B0000ED0402A0AD124E0FF3A013A65D0FF3A1F -:1018C000013A79D0FF3AFF3A022A76D00525A2E004 -:1018D0002078C00601D5082000E010201C900420CC -:1018E0006A461074002090821AA81DAA1EAB0396A7 -:1018F0000192029000933B8A20461C9AFFF79AF9C6 -:1019000084E0228B3B8A9646934268D10A221C923D -:10191000002839D1039801906046401E1FAA83B267 -:10192000029220200091015D0022704600E0BAE0A2 -:10193000F4F7D2FE014618A801750B201AE0228B9D -:101940003B8A964693424AD10C221C92002862D1CF -:101950000398019060461FAA401E0292009183B234 -:101960002020015D628C7046F4F7B6FE014618A88F -:1019700001750D20307010A8818F491C018504214C -:1019800068460174218B818245E0238B3A8A9C460C -:101990009A4224D112221C9200283CD1606A00286D -:1019A00013D000226B4607C3638C07E0FEFF0000E4 -:1019B000AC13002009F800000DE04BE02020015D91 -:1019C0006046F4F7A5FC18A90875132030700120B3 -:1019D00010A908851FE0398A228B914201D0042585 -:1019E000B6E016211C91002815D11B988188026849 -:1019F0002046FFF703FA18A9087500280BD11B9899 -:101A00003346016880881AAA00F075F90546022855 -:101A10001BD0042D19D01B988088002811D068464F -:101A2000007C002804D004A82A99F1F7F8FD0546A7 -:101A30000120694608741B981B99006805900020D6 -:101A40008880002D48D0052D2ED06846007C0328C4 -:101A500078D07DE018211C91002806D0388A208398 -:101A60002046B968FFF7A0FAD5E720461830009065 -:101A70002020015D237E01222046FFF7AFFA18A93E -:101A800008750028ECD119203070012010A90885B4 -:101A9000E6E7208801214902084010A90887FF389D -:101AA000FF38022806D0052510A92088098F884311 -:101AB00020804DE0208F9849884290D116201C90BC -:101AC0003869002805D06063B88A208700206087C5 -:101AD00002E00020C043208710A8008F7F21090169 -:101AE00002468A430DD0782300220420B968FAF711 -:101AF000D5FC3878A07010A92088098F0843208071 -:101B000002E02188814321806846007C002805D0BE -:101B10008248416804A8F1F782FD054618A8007DB7 -:101B2000002815D01C98707001203070208BB07088 -:101B3000000AF07018A8007D3071052110A80185F9 -:101B400006E0FFE77548416804A8F1F768FD05461F -:101B50007248017A20884005400E22D11B98808867 -:101B600000281ED0239A0026138810AA1385249AD1 -:101B70002A9B6F464CC71B9A039412681AABFFF757 -:101B80008DFA054602280CD00120694608741B987E -:101B90002A990068059004A8F1F741FD05461B98B5 -:101BA000868010A8018D2398018028461EE600B586 -:101BB00097B0042807D102206A46107001910021D5 -:101BC0006846F1F72CFD17B000BD10B5534C0378F3 -:101BD00000222168012B02D0022B42D126E00B7893 -:101BE000002B01D0042B03D10A712268032111704C -:101BF000216883880A79D200921D8B5221680A7964 -:101C0000D20008328918C2880A80216803890A79BB -:101C1000D2000A328B52428920680179C9000C3106 -:101C2000425221680879401C08711EE00A748288BB -:101C30008A802168C288CA8022680189118122684D -:101C400041895181C1682068C1606168F1F7E7FC92 -:101C50000146022807D02068007C002802D1002914 -:101C600003D0812010BD832010BD002010BD406B2B -:101C7000002800D0012070478178012909D100880F -:101C80000521C902884202D0491C884201D10020A6 -:101C9000704705207047F7B586B0002468461546A2 -:101CA0000F46848105261AE00498417802780902DB -:101CB00011432980811D0196029400914179027996 -:101CC0000B021343C178827809020A4341780078F5 -:101CD000090208433946F4F71BFB002806D104AA81 -:101CE00003A90698FFF7BFF80028DDD0822800D1AD -:101CF000002009B0F0BD10B51488844201D205203F -:101D000010BD17241C701080421E581C491C09F07D -:101D10004CF8002010BD0000FEFF0000AC130020B6 -:101D200030B50346002002460DE09C5C2546303D60 -:101D30000A2D02D30020C04330BD0A256843303845 -:101D40002018521CD2B28A42EFD330BD70B50D4676 -:101D5000144608E00A2109F091F82A193031203A96 -:101D6000641ED177E4B2002CF4D170BD10B500230D -:101D700010E0040A00020443A0B2CC5C44402006F8 -:101D8000000F60400407240C44402006C00C604053 -:101D90005B1C9BB29342ECD310BD000010B572B631 -:101DA00000F0DCF800280BD0EFF77AFAFAF7D3FD51 -:101DB00008F04DFB6E490020C86288626D490860DA -:101DC00062B6002010BDF3B5002501200007C06AEF -:101DD00081B0C0430006000E04D167480068401C73 -:101DE00000D1012572B600F0B9F8002802D062B621 -:101DF0000820FEBDEFF7AAF9EFF756FA5F4B604EE9 -:101E000000211A68CA40D2071FD00246CA40D20732 -:101E100018D14AB2002A07DA1407240F083CA40894 -:101E2000A400A419E46904E09408564FA400E4193E -:101E300024689207D20ED4402206920F012A04D0C1 -:101E4000032A02D062B65048FEBD491C2029D8D3CF -:101E50000198030009F054FA142123232323232398 -:101E600023230B0D0F11131F1517191B1D2E0024F3 -:101E700016E0012414E0022412E0032410E00424FC -:101E80000EE008240CE009240AE00A2408E00B24F0 -:101E900006E00C2404E0052402E0072400E0062408 -:101EA000F06901210002000AC9070843F061002D12 -:101EB00004D009E062B601200003FEBD2C4D33487A -:101EC000E862EFF7F1F9A8622A4931480860314920 -:101ED00002980860EFF7E8F9214608F09FFAFAF750 -:101EE000FEFC08F0A5FC08F01BFB0198EFF7A6F933 -:101EF000040062B603D0FFF751FF2046FEBD00206C -:101F0000FEBD10B5044600F029F8002800D00120DD -:101F10002070002010BD204908600020704710B5D7 -:101F20000C46102808D011280BD012280CD01328EA -:101F30000ED00120086010BD03CC083CFFF743FF22 -:101F40000AE0FFF72BFF07E02068FFF7DAFF03E066 -:101F50001149206808600020206010BD05480C4928 -:101F60000068884201D101207047002070470000BE -:101F700000050040640000200010001000E100E0B7 -:101F800000ED00E000E400E001100000002200008D -:101F9000BEBAFECA980000200400002010B5203808 -:101FA0000C46030009F0ACF933A6AAAEB2B8BCC027 -:101FB000C5E0DBE41B1F23272C31373C41474D5044 -:101FC00054585C606D71656974787C8084888C90ED -:101FD00094989C9FA2CACFE9F0F3D3D7F800206869 -:101FE00000F0DDF8D6E0206800F0E1F8D2E02068EB -:101FF00000F0F5F8CEE0207840B208F07FF8C9E0B4 -:10200000207840B208F09DF8C4E02078616840B2C2 -:1020100008F0B0F8BEE0207840B208F0C0F8B9E0AF -:10202000207840B208F0CBF8B4E02078217940B2B3 -:1020300008F0D6F8AEE02078616840B208F000F908 -:10204000A8E008F00CF9A5E0206808F010F9A1E07C -:10205000207808F025F99DE02068FAF72EF899E03D -:102060002068FAF72EF895E021792068FAF730F821 -:1020700090E0206807F08EFF8CE0206807F08FFF6B -:1020800088E0207807F08FFF84E007F099FF81E077 -:10209000207807F09BFF7DE0207807F0ADFF79E026 -:1020A000206807F0C6FF75E0206807F0C8FF71E000 -:1020B000206807F0CAFF6DE0206807F0CBFF69E0F9 -:1020C000206807F0CDFF65E0206807F0CFFF61E0F2 -:1020D000206807F0D0FF5DE00846EFF74FF859E0C1 -:1020E000F0F785F956E0F0F7B2F953E02068F0F721 -:1020F000BAF94FE0206800F0E1F84BE0206800F00A -:10210000E9F847E0206800F0F0F843E02078A268A2 -:10211000616800F0F5F83DE0207800F006F939E05C -:10212000207800F017F935E02078616800F027F991 -:1021300030E02078616800F03AF92BE021792078CE -:1021400008F0BEF926E0206800F06BF822E0206875 -:10215000FAF7F0FA1EE02068FAF7D4FA1AE007CC92 -:102160000C3C08F0A7FA15E0206808F0FAFA11E034 -:1021700003CC083C08F025FB0CE0206808F016FDB5 -:1021800008E009E003E0FFE708F028FD02E020682E -:1021900008F060FD206010BD0120086010BD002126 -:1021A0000170084670470146002008707047EFF341 -:1021B0001081C907C90F72B60278012A01D0012225 -:1021C00000E0002201230370002900D162B6002A3A -:1021D00001D000207047012040037047E7E7EFF38C -:1021E0001081C907C90F72B600220270002900D100 -:1021F00062B600207047F2E710B52848FFF7CFFF1E -:10220000002803D026A11D2008F059FF2348401CB8 -:10221000FFF7C5FF002803D021A1212008F04FFFC0 -:1022200010BDF1B5224D6F6801261C48FFF7BFFFB6 -:102230001A4C002803D10026601CFFF7D0FF1D4A6E -:102240001D490120506000BF00BF00BF00BF00BF9C -:1022500000230B604B60009B6B60106000BF00BFF1 -:1022600000BF00BF00BF0868002802D148680028EE -:10227000F9D048680028E4D1002E04D06F60601CBB -:10228000FFF795FF07E0601CFFF791FF0028D3D10F -:102290000248FFF7A4FF0020F8BDC2E79C00002021 -:1022A0007372635C736F635F6563622E630000002B -:1022B00000E5004000E0004000E100405A495B4B6F -:1022C0000A685B499A42096801D18904890C016056 -:1022D000002070475449554B0A6855499A4201D12C -:1022E0008004800C4860002070474F494F4B0A68BB -:1022F0004F499A4201D18004800C886000207047C9 -:1023000030B5494B494D1C684A4BAC4202D01028AD -:1023100002D203E00E2801D3184630BDC300444862 -:10232000181801614261002030BD3F493F4B0A68E7 -:102330004049491C9A4202D0042802D203E00228F4 -:1023400001D3084670473C4A0121C0008018016053 -:10235000002070473449354B0A683649491C9A4277 -:1023600002D0042802D203E0022801D308467047B5 -:10237000314A0121C000801841600020704770B5CB -:10238000294A2C4B14682D4E284D82005B1C921953 -:10239000AC4203D0042803D2116006E0022801D326 -:1023A000184670BD8804800C1060002070BD70B5A8 -:1023B0001D4A204B1468214E1C4D82005B1C921953 -:1023C000AC4203D0042803D2106806E0022801D3EF -:1023D000184670BD10688004800C0860002070BD35 -:1023E00010B5134A164890600E200021C3009B18B8 -:1023F00019615961401C1028F8D300200F4A05E0EC -:10240000022803D383009B18196005E083009B1802 -:102410001C68A404A40C1C60401C0428F0D310BD4C -:10242000034907488860704764000020BEBAFECAAE -:1024300000F501400820000000F0014000F80140D4 -:1024400000C0FFFFFE48C07E7047FE4840687047EE -:10245000FD48C07E7047FFB5F94E85B0706A34689C -:10246000056860680190306A0390298D0798401ACA -:1024700080B202900898002804D0274638372046BA -:10248000483002E0371D2846A03000900320387104 -:10249000059800281FD001287ED0022863D0032889 -:1024A0007BD0EAA1ED4808F00AFE0898002806D083 -:1024B0003879032803D0E5A1E94808F000FEA16AB5 -:1024C0007069FAF7A2FDB860216A606A814265D935 -:1024D0000099086034E1306A002803D1DBA1E148AB -:1024E00008F0EDFD288BE04948434218069800218A -:1024F000002804D05043DD4908F0C0FC411CA16114 -:102500000191AA88D848002142430698002804D0A7 -:102510005043D64908F0B2FC411CE161306AD24A0E -:10252000801CA062298BD04B5143019A891AD04A52 -:1025300089180918A162AA7D01985A4340008018A1 -:10254000FF30193020626062306A081AC949FF38CA -:1025500015388842A9D2C84988427DD2BBA1C74854 -:1025600008F0ADFD8BE0288BBF4AE16850430A18A4 -:1025700006980021002804D05043BC4908F07EFC96 -:10258000411CA161AA88B84800214243069800284E -:1025900008D05043B54902E03EE073E0CEE008F0D9 -:1025A0006DFC411CE161306A002803D1A7A1B44849 -:1025B00008F085FDA620405BAB4A0028288BE16827 -:1025C00021D050430818A169401AA0622169A0686F -:1025D000A54A4843A1694018A97D400051434018CD -:1025E000FF3017302062A888E1695043411AA5489E -:1025F00008186062A06A316A401A9E49FF3855384F -:1026000088423CD351E750430818A169401A316809 -:10261000D63849684018D8E7284680300190C08CE9 -:10262000002802D0306A002803D188A1964808F01B -:1026300046FDA8888C49E3694843C01AA062019905 -:102640009C46CA8C2169A368521A4B43A169591848 -:1026500063465343C91800E011E0AA7D824B49004C -:102660005A438918FF311731216286494118616246 -:10267000316A401A7F49FF3855388842C2D201205A -:10268000387112E70898002803D03420005D002834 -:102690007ED1A88874494843E169401A02994843A9 -:1026A000A062284680300490C08C0028019825D074 -:1026B000002803D065A1754808F001FD04986A4A16 -:1026C000C18C02980818E16948434000FF30173078 -:1026D0002062A8885043411A6A48081860626C4812 -:1026E0004068002819D0A26A03990120511A614A52 -:1026F000FF395539914285D23871D6E6002802D08B -:102700000398002803D151A1624808F0D8FC019831 -:10271000A16AD6380818A062D0E7FAF7E4F972691E -:1027200001461046FBF7F8FBA16A081A5149FF3829 -:1027300050388842A5D2012009B0F0BD0098016050 -:102740000098554900684018F86028468030028A91 -:102750000799511A09B2002904DD0599022901D00F -:10276000032100E0002179710E99002915D0028F14 -:10277000002A1ED0418F4187A0352B7F491C4B4337 -:1027800093420AD27979491E002906DD012100E031 -:102790000CE07971418F491C41870898387008987E -:1027A000002808D03420005D002804D0022009B0A1 -:1027B000F0BD0021DFE70898012148402034607512 -:1027C000307FF27E3946B37E9A4202D0FAF702FE9B -:1027D00004E00020F076B07630607062002009B02E -:1027E000F0BDF0B52A4F83B038680568416A2E46BF -:1027F0000C682036717D00290AD0698E228D9142A5 -:1028000006D1407A002803D110A1244808F057FCD3 -:10281000FAF769F91E4F39684A6901461046FBF715 -:102820007BFB3F680028796A096807D089880E4ACF -:1028300051433A68D269891A08F020FB698E2FE06B -:10284000B8130020B8000020E01300207372635C0E -:102850006C6C5F6C6D2E73302E6300002B050000D6 -:1028600034050000B1040000E204000040420F0003 -:10287000330400005C0800001D030000CE040000CB -:10288000D604000094FBFFFFEF04000015050000D4 -:10289000A80000200E050000FF0B00001B06000032 -:1028A000228D1318994202DB491C698602E0401C04 -:1028B00010186886B07D002806D19421688E095BC7 -:1028C000884201D1401C6886388BFC4E401C3883FE -:1028D000204640300190C1888088081A218D401E12 -:1028E000401887B2C03418E03068F549406A0023C8 -:1028F00000794000085A009323795B00C95A0818F0 -:1029000081B2287D0023FFF7A6FD00280FD0012803 -:102910000FD0EC49EC4808F0D2FB6A8EB81A00B22E -:102920000028E1DA01980821817005F0B1FF03B0B9 -:10293000F0BD688E401C6886EFE770B5DF4D092951 -:102940002B686A687BD20C007C4424792419A74444 -:102950000463879784A6A675A30000201062D17E29 -:10296000042956D20B007B441B79DB189F4451513C -:102970000147516A0C681168087011684860106856 -:102980002030407D002808D1FAF7ADF86968096861 -:10299000096CFBF7C1FA002817DC6868228D016812 -:1029A000498E914205D123468033998A8A1ADA8268 -:1029B00004E0891A962211530168498E2185026824 -:1029C000C1681164C168416111E068680168098EDD -:1029D000228D8B1A22468032D3820168098E21858E -:1029E00001680B6CC3600B6C4361886C10622046FD -:1029F00006F0BEFB002821D0B4A1B8482AE0D06878 -:102A0000506105F07CFA002818D07720AFA1C000F3 -:102A100020E0AEA1B2481DE0D07E042817D201000C -:102A20007944097949188F441212010B06F0DAFC37 -:102A3000002803D0A5A1AB4808F041FB70BD2EE0F3 -:102A400005F093FB0028F9D0A0A1A74802E0F720E9 -:102A50009EA1800008F033FB70BDFDF7CAFD70BD7C -:102A6000D87E022806D0D87E032806D0FF2097A162 -:102A7000A9300EE0FFF7B5FE70BD00F012FC70BD8E -:102A8000D87E0228F6D0D87E0328F6D0FF208FA16A -:102A9000B43008F014FBF0E7FAF70AF870BDFF2035 -:102AA0008AA1C230D6E7F3B50126844C8F4D81B0A0 -:102AB0000F46092945D20800784400790018874458 -:102AC000042D38382D40403838000121874800F067 -:102AD000CFFB39460198FFF730FFE87E022826D168 -:102AE00060680468406A0768F9F7DBFFB988804AC4 -:102AF0005143E269891AD639E162B72803D28320AB -:102B00000001081A02E0081A7A494018E0627A487F -:102B1000E16A814200D80846E06205E00198FFF7CB -:102B20000CFFE87E022802D128682030067503B029 -:102B3000F0BD25600198FFF700FF0020206003B082 -:102B4000F0BDFF2061A1623008F0B9FA03B0F0BD1A -:102B500070B506460C4609291FD208007844007952 -:102B600000188744040D11110D1A1A1111000121CA -:102B7000624800F07DFB21463046FFF7DEFE70BD67 -:102B80003046FFF7DAFE70BD4C4D5C482860304699 -:102B9000FFF7D3FE0020286070BDFF204BA18830D6 -:102BA00008F08DFA70BDF0B5504985B0CA7E002698 -:102BB000424C032A03D02831CA7E032A64D100255F -:102BC0002160002824D001280ED040A14C4808F0F4 -:102BD00076FA2068002E05604562256054D0494889 -:102BE0004560002005B0F0BD0320887600E020BFDE -:102BF0002068C17E002903D0C17E827E9142F6D03A -:102C0000C17E002902D000268576E2E70126FBE797 -:102C10000026032708468F76C97E032903D0C07E8D -:102C200000282DD02DE0007F002803D127A13648B1 -:102C300008F045FA2068067F684607714771F9F782 -:102C400052FF0290FF20F530039001216846017089 -:102C500069463046FAF7BEFB2068007FFBF7E8F9CB -:102C600000280BD02068007FF9F722FF2068057745 -:102C7000C576857605600126456202E020BFEBE758 -:102C8000012620688576A4E70C2005B0F0BD10B5BC -:102C9000164800F04CFB194800F049FB1B49002086 -:102CA00008751849487011494861144A506188767E -:102CB000907602494860086010BD0000A80000201E -:102CC0009CB301004C280100550600007372635C40 -:102CD0006C6C5F6C6D2E73302E630000B2030000CD -:102CE000BF030000D1030000D5030000B81300208B -:102CF000E204000087F8FFFFEC060000E01300206C -:102D00001A030000B80000207A0200000814002016 -:102D1000F8B5FF4E05463068002401270004810FF6 -:102D2000FC480068800F814204D0FF20FA49CC3073 -:102D300008F0C5F93068F94E0004810F30680006CC -:102D4000800F814204D0FF20F349CD3008F0B7F95D -:102D5000F348C0693168800F0904890F884204D0A4 -:102D6000FF20ED49CE3008F0AAF9EE480570EE4D8F -:102D7000EC76AC76ED4EF476B476ED4807710460EF -:102D80006C6274622C60EB4F346028467C6000F00B -:102D9000CEFA304600F0CBFAE74804757C706C61DF -:102DA0007461AC76B476E54844600460F8BDE049EF -:102DB00008717047F8B5DC490546CA7EDB48DF4C30 -:102DC000002A02D1C27E002A03D0C97E022907D080 -:102DD00009E0DB482160F9F717FE216808770AE06F -:102DE000C17E002901D00C20F8BD2060D548F9F73C -:102DF0000BFE21680877CF48456021680860D248FB -:102E0000486228460121BC30F9F786F9A035287FB1 -:102E10008007800F401C28772068007F002803D19E -:102E2000BD49CA4808F04BF9F9F73BFEC84988424A -:102E300000D20846C749401886B221680320C876E8 -:102E400004F078FF2168086104F09CFF0127002549 -:102E5000002826D004F096FF21684A6A10600868AE -:102E6000012107706846F9F7E0F868460078BA492A -:102E7000000208F003F80F46F9F735FEF119FAF7EA -:102E8000C4F82168C860226803201072507215715E -:102E9000107FD37E111D967EB3420ED0FAF79AFAB8 -:102EA0000FE0F9F720FE3146FAF7AFF82168C86065 -:102EB0000868057008684770E5E7D576957615606F -:102EC00055622068058300202560F8BD7047F8B57D -:102ED000954EF17E002903D19449C97E002901D085 -:102EE0000C20F8BD0221F176914F934D7762356049 -:102EF000002438602C7500943979C0304A00974915 -:102F000000798A5A4000085A2346101881B2224696 -:102F10002046FFF7A0FA002803D07F49904808F028 -:102F2000CEF82C610120AC6028756C862C868D480B -:102F300084753968088D401E088534830020F8BDEB -:102F400010B57E4801244068817E03290CD00168B9 -:102F50004978002906D0006A8349884202D90024B2 -:102F600005F030F9204610BD0024FBE773484068A7 -:102F700002681178491C1170016A0068C26A9142A6 -:102F800004D8007D012801D001207047002070473F -:102F900000207047F8B5694D63482860416A0027F2 -:102FA0000C680068342126460F548036B17F002912 -:102FB00027D1007D032824D1F9F795FD29684A69B6 -:102FC00001461046FAF7A8FF00281ADD2D68674B66 -:102FD0006A6A2968126892880091C9695A43511A2D -:102FE00007F04CFF218D401C4218009953480A8677 -:102FF0002968B28A0B8ED21A12B2002A03DC07604B -:10300000F8BD2F60F8BD012220318A75214640317C -:10301000CA888988514F511A228D491E89188EB24B -:103020000546C03419E0496A09794900795A0022F5 -:103030000092028E2379007D5B00FB5A591889B2F9 -:103040000123FFF708FA00280ED001280FD002282C -:103050000AD03149464808F032F829680868028EDB -:10306000B21A12B2002ADEDA00202860F8BD286801 -:103070000068018E491C0186EFE770B52F490024D6 -:103080004D68062876D202007A4412799218974445 -:103090001820020E240D002000F08FF9EC76AC769B -:1030A0002C60002108466C6200F0E2F870BD1D48FB -:1030B0000D680078EFF728F9EC76AC762C606C623E -:1030C00070BD012000F079F90021084600F0D0F829 -:1030D00070BD29680320087570BD686A296800689A -:1030E000CA698A608188214A51432A68D1600146B1 -:1030F000C0310A8A02838A7B82754A8A82808A8AE0 -:10310000C280C98A018129680220087570BD31E03A -:1031100000E400E008E400E0CC2C010018E400E04A -:1031200000ED00E0A0000020B8130020E013002014 -:10313000B0000020B800002008140020A8000020E3 -:10314000A72A0100512B0100A4000020C5020000A5 -:10315000F6050000BB020000102700009CB3010030 -:103160004E03000028140020D9821300E20400005E -:10317000010600007520DD49000107F0A0FF70BDC9 -:1031800070B500280AD00024D94D01280DD002289E -:103190002ED0D649D74807F092FF70BD00F06BF9EA -:1031A0000021084600F064F870BD686801684C7042 -:1031B000C47684760460D04E446201220021706897 -:1031C00000F063FF71680846C0318C72CC72FFF763 -:1031D0007EFE002803D0C549C84807F070FFF9F704 -:1031E000CDFBC7486C600078EFF78EF86C6070BD5F -:1031F00000F041F96868C476847604600021446276 -:10320000084600F035F870BDB9494968CA7E022AFF -:1032100008D10A681378002B04D150600968CA6A83 -:103220001018C862704710B5B14A002952680BD017 -:10323000012906D0022906D0AC49B24807F03FFF69 -:1032400010BD801E00E0401F106210BD08B50020B8 -:10325000C04369460880AC48C07E002801D00020E9 -:1032600008BD084600F0F5F90028F9D0012008BD96 -:1032700070B59F4C05466268002908D0002A04D02A -:10328000FF209A490D3007F01AFF656070BD002AD3 -:1032900004D1FF209549133007F011FF0020606032 -:1032A00070BD38B5924C20680168497801291FD05B -:1032B00001216846F8F7B9FE684600789349000294 -:1032C00007F0DCFD2068426AC06812685118F9F7FF -:1032D0009CFE2168C8608C4822680321824202D08B -:1032E000108B0A2810D2108B401C108351720DE0F5 -:1032F0007D21C068C900F9F788FE2168C86004F024 -:1033000019FD21680861E6E702205072117200235E -:103310001371107FD47E111D957EAC4202D0FAF756 -:1033200059F838BDD37693761360536238BDF8B53B -:103330006F4C05461F27EE7E042E2DD230007844B8 -:10334000007900188744312801237148854203D051 -:103350006649704807F0B3FE02202560A87600E0B9 -:1033600020BF2168C87E002803D0CA7E887E8242A2 -:10337000F6D0CA7E002A04D000228A760C2722606A -:1033800010E000228A760A604A6222600DE0012085 -:10339000FFF709FC074603E054495F4807F08FFE3A -:1033A000002F02D0E87EB042C5D1E87E002803D0CD -:1033B0004E495A4807F083FEF8BDF8B54C4D012838 -:1033C0006A68516A0C6846D10879554940000B5A21 -:1033D0001068077D0126032F06D0027D022A13D034 -:1033E000007D012824D036E000270761106887603F -:1033F00094200096025BC420005D4000085AC0186B -:1034000081B23B4603201EE022468032D78C076102 -:103410000096C420005D928A4000085AC01881B20C -:1034200000230220FFF717F8696809680E750CE0A1 -:1034300094200096025BC420005D4000085AC0182A -:1034400081B200230120FFF706F8002803D02749A6 -:10345000344807F034FEF9F791FA29480078EEF77E -:1034600053FF6968002008830B68228D5A8609681B -:1034700020318875F8BDF8B51D4D002168680C46EF -:1034800000684278002A01D0447027E000780028C4 -:1034900009D001216846F8F7EDFD684600781B4920 -:1034A000000207F0EBFC6868426AC06812685118B5 -:1034B000F9F7ABFD6A68D060147103205072107F79 -:1034C000D37E111D967EB34202D0F9F783FF03E04D -:1034D000D47694761460546268680483F9F74EFADF -:1034E00007480078EEF710FFF8BD0000CC2C010073 -:1034F000A800002072070000B8000020FD060000B0 -:10350000A000002097070000E01300201027000013 -:10351000B8130020030200000F0200001502000093 -:103520009CB30100B6060000F8B50024E948FEF798 -:103530003EFE002825D1E84FC02026464643F51917 -:103540000146284607F090FC0120B8556C80E349FD -:1035500000200870E24A4A8080356962E149641CB3 -:103560000870A962E049E4B208704A80A963032C9C -:10357000E2D3D848FEF733FED648FEF718FE0028FF -:1035800001D00C20F8BDFF211931D84807F06CFCA0 -:10359000D648012101704480D54900200872087581 -:1035A000D4498872CB48FEF71AFE0020F8BD10B54A -:1035B000C848FEF7F4FD002803D0CFA1282007F06B -:1035C0007EFDC448FEF7EBFD002803D0CAA12D20E4 -:1035D00007F075FDFFF7A8FF002803D0C6A1332030 -:1035E00007F06DFD10BD10B50446BA48FEF7DFFDCB -:1035F000002801D00C2010BDBC490878002807D055 -:1036000000200870B3482160FEF7E9FD002010BDDE -:10361000B048FEF7E4FD1F2010BD70B505460C460E -:10362000AC48FEF7C4FD002801D00C2070BDAF4AA5 -:103630005088A84202D11078002804D0A548FEF78F -:10364000CEFD122070BDA3482260FEF7C8FD002009 -:1036500070BD10B504469F48FEF7A9FD002801D0B3 -:103660000C2010BDA1480178002907D00020C043DC -:1036700020809848FEF7B3FD122010BD40882080BE -:103680009448FEF7ACFD002010BD10B504469148EB -:10369000FEF78DFD002801D00C2010BD20780028F9 -:1036A00004D08C48FEF79BFD0C2010BD012020703B -:1036B0008848FEF794FD002010BD10B504468548EB -:1036C000FEF775FD002801D00C2010BD824A0021B4 -:1036D000C0204843105C00280AD0C0230020594372 -:1036E0005054881820607B48FEF779FD002010BDFB -:1036F000491CC9B20329EBD37648FEF770FD1F20A1 -:1037000010BD032805D2C0225043734A135C002B1E -:1037100001D012207047801808600020704710B553 -:1037200000220C46032809D2C02148436A490B5C99 -:10373000002B14D122704018606018E003280ED1CD -:103740006448FEF734FD002809D168484188032900 -:1037500002D10178002904D05E48FEF740FD122016 -:1037600010BD60605B48FEF73AFD0120207000202C -:1037700010BD10B504465748FEF719FD002801D0CA -:103780000C2010BD2088544A032804D2C02148438D -:10379000105C002801D00020208000202188491CD6 -:1037A00089B22180032900D300212180C0235943FD -:1037B000515C00290BD0401CC0B20328EED300207E -:1037C000C04320804348FEF70AFD122010BD414847 -:1037D000FEF705FD002010BD70B505460E463D48BC -:1037E000FEF7E5FC002801D00C2070BD2888341DB0 -:1037F000032804D303D0A04201D300202880002056 -:10380000361D1DD0394B34492A88521C92B22A8069 -:10381000A24200D300222A80042A02D3A24217D354 -:1038200001E0032A05D0C02672438A5C002A0FD02B -:1038300002E01A78002A0BD0401CC0B2A042E3D3A9 -:103840000020C04328802348FEF7C9FC122070BD29 -:103850002048FEF7C4FC002070BD10B504461D488A -:10386000FEF7A5FC002801D00C2010BD2078002810 -:1038700004D01848FEF7B3FC0C2010BD01202070C6 -:103880001448FEF7ACFC002010BD10B504461148EA -:10389000FEF78DFC002801D00C2010BD21780120FE -:1038A000002902D0012905D008E061680A78002AC1 -:1038B00009D003E061680A78002A04D00548FEF7C1 -:1038C0008EFC0C2010BD08700248FEF788FC00201A -:1038D00010BD0000C00000205814002098160020E1 -:1038E000FFFF0000C1000020C6160020D8160020EF -:1038F000B8170020D81700207372635C6C6C5F648B -:10390000622E630010B5282107F0ACFA10BD70B527 -:10391000054600780A0700090001120F10432870BD -:1039200007290ED20800784400790018874403055F -:10393000030503070300062408E00C2406E0222404 -:1039400004E00024F8A1572007F0B9FB687880094B -:1039500080012043687070BD00780007000F704739 -:1039600010B5C01C07F0A7FC10BD0A4610B5C11C5D -:10397000104607F0A0FC10BD10B5093007F09BFC05 -:1039800010BD0278BF23C9071A40490E0A430270CE -:10399000704700784006C00F704702785206520EFA -:1039A000C9010A430270704770B50C460546C11C38 -:1039B0002046093007F07FFC20784006400E20703A -:1039C00029784906C90FC9010843207070BD70B538 -:1039D00015460E4604461F2A03D9D3A1A82007F096 -:1039E0006EFB20462A463146093007F0DEF9607842 -:1039F000AD1D80098001A906890E0843607070BD65 -:103A000070B5054640780E468406A40E062C03D2F7 -:103A1000C5A1B82007F053FBA41FE4B21F2C00D9A6 -:103A20001F24294622460931304607F0BEF92046B8 -:103A300070BD70B515460E4604461F2A03D9BAA1BB -:103A4000CC2007F03CFB20462A463146093007F0DF -:103A5000ACF96078AD1D80098001A906890E084384 -:103A6000607070BD70B5044640780E468506AD0E98 -:103A7000062D03D2ACA1DD2007F021FBAD1FEDB276 -:103A80001F2D03D9A8A1E12007F019FB21462A46E2 -:103A90000931304607F089F9284670BD0A78C273AB -:103AA0004A7802748A784274C978817470470A78B7 -:103AB000C2744A7802758978417570474176090A5F -:103AC00081767047C176090A017770474177090A04 -:103AD00081777047C175090A017670478175704713 -:103AE00020300279C90652095201C90E0A430271F7 -:103AF000704720300279D206D20E49010A43027182 -:103B0000704710B51F3007F0CBFB10BD417800782F -:103B10008906890E0007000F06D0012808D0022868 -:103B200009D0062810D10AE0891F1F290AD90BE005 -:103B30000C2907D008E0891F1F2903D904E0891F39 -:103B40001F2901D801207047002070474178007874 -:103B500089060007890E000F042805D1062903D322 -:103B6000252901D8012070470020704770B40178E2 -:103B70000907090F03292ED0052931D1411C827E66 -:103B80000C46437E11021943037FC27D1D02037E52 -:103B9000C67E1B021343827D407835438006800E2B -:103BA00022281DD106291BD31920C001814217D814 -:103BB000FF26F436B54213D8002A11D0082A0FD8B0 -:103BC0008A420DD28B420BD8617F227F09021143BA -:103BD000814208D904E040788006800E0C2802D08B -:103BE00070BC0020704770BC0120704710B52221C6 -:103BF00007F038F910BD10B502788B0792089200D3 -:103C00009B0F1A43027042785209520142700129F7 -:103C100008D0022906D0032905D0FF2042A1E830B0 -:103C200007F04DFA10BD01210A43427010BD10B5D6 -:103C300002788B07920892009B0F1A430270427819 -:103C4000520952014270012907D0022905D00329E7 -:103C500004D035A1384807F032FA10BD01210A43DB -:103C6000427010BD00788007800F70470278EF2304 -:103C7000C9071A40C90E0A43027070474178C078DC -:103C8000C906C90E0E2835D202007A44127992185C -:103C9000974406090C0F1215181B1E2124272A2DE4 -:103CA0000C2929D02AE0082926D027E0022923D090 -:103CB00024E0172920D021E00D291DD01EE0012984 -:103CC0001AD01BE0012917D018E0022914D015E002 -:103CD000092911D012E009290ED00FE001290BD0DB -:103CE0000CE0012908D009E0062905D006E00229E8 -:103CF00002D003E01B2901D8012070470020704743 -:103D000070B50546C1700E2926D2080078440079A6 -:103D10000018874406131517191B1B151D1D1B1BA7 -:103D20001F150C241DE000007372635C756C5F70DE -:103D300064752E630000000001020000082410E0FA -:103D400002240EE017240CE00D240AE0012408E010 -:103D5000092406E0062404E000249A499A4807F062 -:103D6000AEF96878400940012043687070BDC078A2 -:103D70007047C171090A01727047017AC27908025D -:103D8000104370474172090A81727047817A427A02 -:103D9000080210437047C172090A01737047017B22 -:103DA000C27A0802104370474171090A8171704755 -:103DB0008179427908021043704701717047007998 -:103DC00070474173090A81737047817B427B080207 -:103DD0001043704770B4017AC37909021943431C38 -:103DE000857A1C46467A2B023343657926792C0264 -:103DF0003443C21C754E00798D1FB54215D8FF257E -:103E0000F435AB4211D800280FD008280DD88842CD -:103E10000BD28C4209D8507A117A00020843B11DA6 -:103E2000884202D870BC0120704770BC00207047E7 -:103E300010B5001D07F034FA10BD0A4610B5011D7B -:103E4000104607F02DFA10BD4172090A81727047C1 -:103E5000817A427A080210437047017170470079F5 -:103E6000704710B5001D07F033FA10BD0A4610B5B3 -:103E7000011D104607F02CFA10BD0A78027349782C -:103E800041737047027B0A70407B4870704710B5E1 -:103E90000E3007F01DFA10BD0A46014610B50E316E -:103EA000104607F015FA10BD0A7882754A78C27577 -:103EB0008A780276C97841767047827D0A70C27D21 -:103EC0004A70027E8A70407EC870704710B5001D2F -:103ED00007F0FEF910BD0A4610B5011D104607F0A7 -:103EE000F7F910BD0A7802734A7842738A788273B0 -:103EF000C978C1737047027B0A70427B4A70827B2B -:103F00008A70C07BC8707047017170474171090A9F -:103F100081717047C171090A017270470079704759 -:103F200081794279080210437047017AC279080208 -:103F300010437047017170470079704701717047F5 -:103F400010B5001D07F0C4F910BD0A4610B5011DDB -:103F5000104607F0BDF910BD10B5001D07F0B8F907 -:103F600010BD0A4610B5011D104607F0B1F910BD8D -:103F700070B515460E4604461B2A03D9114914484C -:103F800007F09DF82A463146E01C06F00EFF6078E7 -:103F9000E90640094001C90E0843607070BD70B564 -:103FA000054640780E46C406E40E1B2C03D905498D -:103FB000084807F084F82246E91C304606F0F5FE72 -:103FC000204670BD283D0100A10200007A0C0000CF -:103FD000F1030000FD03000070B504460020A0833B -:103FE000208C1E4648431546114606F055FF208496 -:103FF000F000294606F042FF401C80B2014619221B -:1040000069439202E083914201DD401EE0837D20FE -:104010002946000206F032FF401CA08470BD70B536 -:104020000A7BD206D20E0A73002282758B181B7A85 -:10403000DC075B08DD07E40FED0F2C195B08DD07DB -:10404000ED0F2C195B08DD07ED0F2C195B08DD0760 -:10405000ED0F2D195C08E307DB0F5B196508EC0712 -:10406000E40FE4186B081B1984186374847D521CD8 -:10407000E318D2B28375052AD8D3D8B2252803D93C -:10408000E1A18A2007F01BF870BD70B504460B460D -:1040900025462646214600202835C0368031032B90 -:1040A0000AD0002B3AD0012B41D0022B03D1A11C06 -:1040B0002846FFF7B4FF70BD2880A871E871E87248 -:1040C00028736873A873A870E8702871687168769F -:1040D000A8832B4668842033987128859872E875E8 -:1040E0002876E8732874D872187398731A75288420 -:1040F000FF226035AA709875088248828882C8823B -:10410000088348834877C884A422105508874887C5 -:104110002421085560843070B07170BDC8848877E0 -:10412000A18823890A462846FFF756FFBFE7C884BF -:10413000F38A728AA1882846FFF74EFF70BD70B5DA -:104140000446034628348033054603290AD0002953 -:1041500033D0012938D0022903D1A91C2046FFF70A -:104160005EFF70BD00202080A071E071E0722073BE -:104170006073A073A070E070207160716076A0839E -:10418000214660842031887120858872E075207610 -:10419000E0732074C872087388730A752084FF2244 -:1041A0006034A27088751883987618742421586139 -:1041B00048551877A035287370BDA9882B890A4601 -:1041C0002046FFF709FFC8E7586AA988C3894289D2 -:1041D0002046FFF701FF70BD70B5867D0D46044691 -:1041E000002E01D0252E01D9122070BD002A18D032 -:1041F000287EE17D50430818252106F03FFEE17539 -:104200000846CA084907490F834BAA18595C127A15 -:10421000914308D0314606F031FE491CCAB2002055 -:104220000AE0002070BD2076002070BD002803D079 -:104230002118097C511ACAB22118497C91423AD3FB -:104240002918097AC943CB07DB17D21A521E120666 -:10425000120E35D08B07DB17D21A521E1206120E21 -:1042600032D04B07DB17D21A521E1206120E30D074 -:104270000B07DB17D21A521E1206120E2ED0CB06D7 -:10428000DB17D21A521E1206120E2CD08B06DB1729 -:10429000D21A521E1206120E2AD04B06DB17D21A61 -:1042A000521E1206120E28D00906C917511A491EAD -:1042B0000A06120E26D0401C0528B7DB1F2070BD51 -:1042C000C0002076002070BDC000401C2076002079 -:1042D00070BDC000801C2076002070BDC000C01CD6 -:1042E0002076002070BDC000001D2076002070BD2B -:1042F000C000401D2076002070BDC000801D2076CB -:10430000002070BDC000C01D2076002070BD70B5BB -:104310000D460446072904D9FF203BA15D3006F075 -:10432000CEFEE078502108406907490F88300843E5 -:10433000E070A078A72108401830A07060785E2156 -:104340000840203060702078BC2108404030207048 -:1043500070BD0179490901D000207047002230B4B6 -:104360001146445C491CE3076408E507DB0FED0FC9 -:10437000EB186408E507ED0FEB186408E507ED0F8F -:10438000EB186408E507ED0FEB186408E507ED0F7F -:10439000EB186408E507ED0FA407EB18E40FE3182A -:1043A000D218D2B20529DCDB002A02D030BC0120B1 -:1043B000704730BC0020704738B505460C4668464B -:1043C000FCF74EF800281ED06946002008562072DF -:1043D000092161560022411A00D549422035EB7867 -:1043E0008B420FDCFF2B0DD0A17A491CC9B2A17200 -:1043F0002B79994202D8617A7F2903D1607200201B -:10440000A0720122104638BD7372635C6C6C5F75DC -:1044100074696C2E63000000ACB30100F8B5002491 -:10442000F74EFF20B470F0702546F64F06E0042DDD -:1044300004D3FF20F4A1AB3006F041FEFF21284653 -:10444000A0314843FF213331C0194A1C0C540146A6 -:10445000FF31145421310C754C75F178A94202D109 -:10446000B470FF21F170FF219D314A1C6D1C0C546A -:10447000EDB21454042DDAD30020FF21A0314143C2 -:10448000C919FF3181318C77401CC0B20428F4D3A4 -:10449000E048FFF7ABFB0021DE48FFF7E7FB012117 -:1044A000DC48FFF7A8FBDC49FF20087048708870E3 -:1044B000C87008714871F8BDB0E71B20704710B490 -:1044C000D04A0021FF23A0334B439B18FF33813395 -:1044D0009B7F002B04D0491CC9B20429F2D30DE004 -:1044E00004290BD2FF23A0334B439A180124FF3237 -:1044F000813294770170204610BC704710BC0020B8 -:10450000704730B40025042825D2FF220146A0328E -:104510005143BC4A89180B46FF3381339A7F002AE6 -:1045200019D0FF243334621C655455541A46603A3E -:1045300015755575B24AD478844202D19570FF2022 -:10454000D070FF209D304554FF319E310D709D7716 -:1045500030BC0120704730BC0020704704280ED2C8 -:10456000FF220146A0325143A64A8918FF3181310A -:10457000897F002903D0A849487101207047002095 -:10458000704710B4A449FF224979A03251439D4A93 -:1045900082B089180A46FF322132937C6C46237020 -:1045A000D27C2271237822795A40802A0AD022783C -:1045B00022235206520E5A435118016002B010BC19 -:1045C0000120704702B010BC002070479248FF21C4 -:1045D0004079A03148438B4981B041180846FF30EB -:1045E0003330FF312131CA7C69460A7003780922D1 -:1045F0000978594080290ED0037869460B700978F4 -:104600004906490E491C914208D26A461178491C54 -:10461000C9B2117009E0002001B0704769460978FD -:10462000090601D5002100E080210170012001B0C0 -:10463000704704280ED2FF220146A0325143714A2E -:104640008918FF318131897F002903D072490871AF -:10465000012070470020704710B46F49FF2209798C -:10466000A0325143674A82B089180A46FF3221328C -:10467000947C6B461C71D27C1A701C781A79944217 -:104680000AD01A7822235206520E5A43511801605A -:1046900002B010BC0120704702B010BC002070476F -:1046A00038B55D480179FF20A030414355480818CE -:1046B0000146FF3121318A7C6C4622700922FF308D -:1046C000343003782478A34223D004786B461C70DE -:1046D0001B785B065B0E5B1C934205D26B461A7817 -:1046E000521CD2B21A7006E06A461278120601D540 -:1046F000002200E080220270087D401C0875087DC1 -:10470000497D884203D140A1444806F0D8FC0120ED -:1047100038BD002038BD4048FF210079A031484312 -:1047200038494018FF302130C17C807C814201D162 -:1047300001207047002070473748FF210079A031E1 -:10474000484330494018FF302130817CC27C092029 -:1047500013464B40802B0AD049065206490E520E92 -:10476000914201D3881A01E0511A401AC0B2704731 -:10477000092070470022042813D2FF23A033584396 -:10478000204BC018FF239F331B5C002B09D0FF3048 -:104790000A702130027D437DD31A0B7042750120CF -:1047A000704700207047042811D2FF22A0325043E6 -:1047B000144A8018FF229F32125C002A07D0FF3073 -:1047C0002130027D407D101A0870012070470020C2 -:1047D000704710490160704704280ED2FF2201463D -:1047E000A0325143074A8918FF318131897F00295E -:1047F00003D009490870012070470020704700006D -:1048000010180020141800207372635C646D5F71CF -:104810002E630000901E0020C70000205A020000F6 -:10482000AC49CA78FF2A03D00021016008467047CE -:104830008A78A949012A02D001600120704700202E -:104840007047A6480178012907D001210170A448CA -:104850000178A048C17001207047002070470428EB -:104860000ED2FF220146A03251439E4A8918FF31E1 -:104870008131897F002903D0994948700120704710 -:10488000002070479349964BCA785B789A4206D1CC -:104890008A782039002A02D0016001207047002068 -:1048A00070478C488E4AC1785278914209D1FF21D5 -:1048B000C170801C0178002903D000210170012003 -:1048C0007047002070478348854AC17852789142EA -:1048D00004D18078002801D0002070470120704763 -:1048E00004280ED2FF220146A03251437D4A891886 -:1048F000FF318131897F002903D07949C8700120B7 -:1049000070470020704710B47549FF22C978A03263 -:104910005143744A82B089180A46FF328132147FAB -:104920006B461C70527F1A711C781A79FF316240F5 -:104930003731802A0AD01A7822235206520E5A435F -:104940005118016002B010BC0120704702B010BCC9 -:10495000002070476248FF21C078A0314843614978 -:1049600081B041180846FF309D30FF3181314A7FC8 -:1049700069460A70037803220978594080290ED0CD -:10498000037869460B7009784906490E491C914223 -:1049900008D26A461178491CC9B2117009E000209A -:1049A00001B0704769460978090601D5002100E089 -:1049B00080210170012001B070474948FF21C07873 -:1049C000A031484347494018FF308130417F007F84 -:1049D000814201D1012070470020704704280ED287 -:1049E000FF220146A03251433E4A8918FF318131EE -:1049F000897F002903D03A49887001207047002040 -:104A0000704710B43649FF228978A0325143354AA5 -:104A100082B089180A46FF328132147F6B461C71BE -:104A2000527F1A701A781B79FF3137319A420BD0B6 -:104A30006A46127822235206520E5A4351180160D8 -:104A400002B010BC0120704702B010BC00207047BB -:104A50002348FF218078A0314843224981B0401883 -:104A6000FF219D31095C6B4619700321FF309E3098 -:104A700002781B789A4219D003786A46137012782C -:104A80005206520E521C8A4205D26A461178491CBF -:104A9000C9B2117006E069460978090601D50021FE -:104AA00000E080210170012001B07047002001B0BA -:104AB00070470B48FF218078A031484309494018CE -:104AC000FF308130417F007F814201D1012070475A -:104AD0000020704710180020F01700201218002046 -:104AE000C700002014180020F8B5FD4F0A46044600 -:104AF00000207978FB4D0646002902D0012909D013 -:104B00000FE0F949497A00290BD0002A08D1012089 -:104B1000787005E0A97F002903D0002A00D17E70BB -:104B2000012079782B23594349198B7F034311D0F6 -:104B3000002A22D12A22A01C1F3106F036F9667005 -:104B4000042020700120A07078782B214843401960 -:104B5000867712E02878012801D00020F8BD002ACD -:104B60000BD16670132020701C22A91CA01C06F01B -:104B70001CF9A6712E70DD48C6770120F8BDD94812 -:104B80000178002901D080887047D9487047F8B56E -:104B9000D44E0746B07F00282DD13846FEF7DCFE04 -:104BA00000210125D34C072824D202007A4412792F -:104BB000921897440305081F1F1F0A00217006E082 -:104BC0002570217208E0032000E002202070CA490D -:104BD0003846FEF715FF20723846FEF7DAFE6070A1 -:104BE000C6493846FEF7C1FEBD4CC54F20787F2828 -:104BF00007D101E02172F8BDFF20C2A1543006F0B8 -:104C00005EFA207838707F202070B577032002F09C -:104C1000DBFEF8BD10B5002002F066FE002812D0C1 -:104C2000FBF79CFB00210120FBF7A0FABA48FBF739 -:104C3000ACFBAE4CA06AFBF7ABFB2079032805D098 -:104C4000022803D006E000F0F3FD10BD0121002092 -:104C5000FBF716FCFBF7FBFBB04C6078002803D099 -:104C6000FBF77DFFFBF7D9FB0320E07010BD70B5AB -:104C70009E490028CA8D08D0FF2A0DD25004000C8E -:104C8000C885FF2808D9FF2005E0012A04D950086B -:104C9000C88501D10120C88591484268012A01D008 -:104CA000002A01D10D224260D24317239B4C5A4364 -:104CB000637B3B25DB436B43D2184260C98D900C6C -:104CC00006F0DCF8617370BDF8B5944CE07802280A -:104CD00004D0E078012801D00C20F8BD0020814AE2 -:104CE00005462B21414389188D77401CC0B202280C -:104CF000F7D315706078002804D0FBF796FBFBF71C -:104D00003FFF6570794845778577C5778449257079 -:104D100001228A770571A570CA760A774A77714EA3 -:104D200001463246736F7432B46FF66FD7688B608A -:104D3000CC600E614F6112698A6105770020F8BD71 -:104D400010B5764A0023D3701371684B596318630A -:104D50000120D070FFF7B8FF002803D069A1714887 -:104D600006F0ADF910BDF1B582B00C2001906B4892 -:104D70000090C078012806D00098C078022802D0A0 -:104D80000C2003B0F0BDFBF7F0FA0020FBF7B1F800 -:104D9000564C207F002837D0524920460F46826863 -:104DA0007437C368056946694A678B67CD67FE60DB -:104DB0008069386100266677A677594DE87E00281D -:104DC00005D1287F002802D1687F00281AD00098DA -:104DD0000078002816D02079032802D0022805D0B8 -:104DE00008E00521504800F040FD03E003214E4853 -:104DF00000F03BFDA97E3846FBF7F3F80020019058 -:104E000026770CE0267703E00098C078022804D0CB -:104E10000098C078022828D00AE00020019000986D -:104E2000C078012804D10099087300980221C1704C -:104E3000606B0178002903D00178001DFBF714F99D -:104E4000206B0178002906D0384A401CFBF777FE1A -:104E50000099012048700298A0623548FBF717FAC4 -:104E6000FBF78EFA019803B0F0BD00990120C870DD -:104E70000C2003B0F0BD70B5FBF777FA274CE07853 -:104E8000022803D0FBF77CFA0C2070BD01201749E3 -:104E90006073C8850220FBF765FA2648FBF739F9ED -:104EA000254E0025A0780321401C05F0E7FFA170E6 -:104EB000885D012844D06D1CEDB2032DF2D3FFF7BD -:104EC000A9FE2079002809D0012807D002283DD06A -:104ED00003283BD00BA1194806F0F1F8002070BD63 -:104EE000D0000020B41E0020F41E0020341F00203B -:104EF000FFFF0000D41E0020DD1E0020D61E002073 -:104F0000FC1E00207372635C6C6C5F64645F73638F -:104F1000616E2E63000000006C1F0020541F0020F3 -:104F2000141F002051030000941F00206F1F002059 -:104F3000B4B30100BAB301002F1F0020EA03000040 -:104F4000C8B2FC49085CFBF7F6F8B8E7EEF760F882 -:104F5000C4E770B5F84C0125A577E37F002B01D09D -:104F60003A2070BD0026002802D1A07B884209D1DA -:104F7000A17366771146F14806F09DF96577F04810 -:104F800005702577A677002070BD0246002001231A -:104F9000E949002A03D0012A03D0122070478B74FC -:104FA00000E088740B774A767047E34A032800D103 -:104FB000516110760120107700207047E0490128E8 -:104FC00003D0032801D0002000E0012008717047C1 -:104FD000D948017F002903D0407E002803D17047C3 -:104FE00040790028FBD00120704710B5FBF709FA83 -:104FF000FBF7FCF9FBF708F9FBF7AAF9D04C60784E -:10500000002805D0FBF711FAFBF7BAFD002060700D -:10501000012020730220E070FBF7B2F9002010BDE0 -:10502000C7494871704710B500F002FC10BDF0B5DB -:10503000C44EC34D83B0002810D0C348FEF766FDB0 -:10504000002804D1C048FEF781FD002806D0BA4CE4 -:10505000207903280DD1A07F00280AD0E878052800 -:105060006BD201007944097949188F44666666F766 -:10507000F600E87805287AD20100794409794918C0 -:105080008F4475757502EE00AF48FEF765FCAD49BB -:105090008870AE480190807F002803D1FBF736F876 -:1050A000002800D0012000906878002813D0052641 -:1050B000761EF6B2FBF785FD0746022805D1002EC5 -:1050C000F6D1A349A34805F0FAFF0098002810D1B3 -:1050D000012F0ED000909B4F9F4EB878072871D2B9 -:1050E00001007944097949188F446DFE056C6C6C98 -:1050F00028000120EEE76878002803D0FBF795F937 -:10510000FBF73EFD8F48FBF7ABF9002801D17F206C -:105110003870FBF793F9009800280AD0207901280D -:1051200001D0022805D1FBF76FF88748FFF72FFD64 -:1051300037E2FBF769F8FFF76DFD34E26878002885 -:1051400003D0FBF772F9FBF71BFD7E48FBF788F9EC -:10515000002801D17F203870FBF770F900980028F3 -:1051600079D02079022803D001287AD047E221E2C1 -:105170007548FFF70CFD012002F0B6FB00286ED049 -:1051800076497148FEF710FC7448FBF7FEF8607F23 -:1051900000280ED06848019902898A824289CA8211 -:1051A0008089088331466D48FEF7DAFB002060777E -:1051B000A07701210846FBF763F9FBF703F9052007 -:1051C000E870F0E15BE16878002803D0FBF72DF987 -:1051D000FBF7D6FC5B48FBF743F9002801D17F20A1 -:1051E0003870FBF72BF90098002834D0207902287A -:1051F00008D0012835D0032837D05549584805F044 -:105200005EFFD0E15048FFF7C2FC012002F06CFBCA -:10521000002824D051494C48FEF7C6FB4F48FBF705 -:10522000B4F8607F00280ED04348019902898A8231 -:105230004289CA828089088331464848FEF790FB3C -:1052400000206077A07701210846FBF719F9FBF7EA -:10525000B9F8052001E10EE103E0BFE1ADE1B3E003 -:1052600022E13948FFF793FC9BE137482168C27877 -:105270000B7F9A421DD102794B7F9A4219D1427914 -:105280008B7F9A4215D18279CB7F9A4211D10A46FF -:105290002032C3791778BB420BD1037A52789342FC -:1052A00007D10078CA7E4006C00F904201D101208C -:1052B00000E000206279012A30D0002800D138E7D0 -:1052C000022002F011FB00287ED0012002F07CFBBE -:1052D00022491D48FEF768FB2068018B1F48FEF736 -:1052E000F9FB2068817D00E03CE01C48FEF7F6FBFE -:1052F0001A48FBF74AF8607F002866D00E480199EB -:1053000002898A824289CA82808908833146134889 -:10531000FEF726FB00206077A0779BE00028CFD126 -:1053200009481C31FEF721FB0748FEF732FB2168D4 -:10533000C876C5E7B7B30100341F00203C1F00202A -:10534000541F0020D00000206C1F0020141F0020DC -:10535000044F0100D4040000281F0020941F0020E7 -:10536000CC0500006878002803D0FBF75EF8FBF757 -:1053700007FCF948FBF774F8002801D17F2038704A -:10538000FBF75CF80098002875D0FAF733FE002888 -:1053900071D020790328F14804D0FFF7F8FBFAF721 -:1053A00033FFFEE02168C2780B7F9A4220D1027958 -:1053B0004B7F9A421CD142798B7F9A4218D18279D5 -:1053C000CB7F9A4214D101E056E043E00A462032F6 -:1053D000C3791778BB420BD1037A5278934207D135 -:1053E0000078CA7E4006C00F904201D1012000E043 -:1053F00000206279012A32D0002800D199E60220EB -:1054000002F072FA002837D0012002F0DDFAD44908 -:10541000D248FEF7C9FA2068018BD148FEF75AFB43 -:105420002068817DCE48FEF759FBCD48FAF7ADFFE5 -:10543000607F00280ED0CB4901980A8982824A8970 -:10544000C282898901833146C548FEF789FA002066 -:105450006077A0770120E0770620E870A3E00028BD -:10546000CDD1BE481C31FEF780FABC48FEF791FA58 -:105470002168C876C3E7C2E000F0DAF993E0687803 -:10548000002803D0FAF7D1FFFBF77AFBB248FAF70E -:10549000E7FF002801D17F203870FAF7CFFFFAF735 -:1054A000B3FEFFF7B7FB7EE0AC48FEF755FAB070ED -:1054B000AA48AB49C3784A7A93421CD103798A7AC5 -:1054C000934218D14379CA7A934214D183790A7BE3 -:1054D000934210D1C3794A7B93420CD1037A8A7BE1 -:1054E000934208D1007809784006C00FC909884264 -:1054F00001D1012400E00024FAF786FEB0780428E8 -:105500003ED1002C3CD09448FAF7AAFF002801D1E4 -:105510007F203070FAF792FF287B002802D000200D -:10552000FFF7A5FB0120904C28738C4F607A002870 -:1055300037D10420E0723846FEF72BFA002801D05C -:10554000012800D1207389493846FEF70EFA8849B0 -:105550003846FEF787FAE0741F2801D91F20E0744F -:105560003078844F7F2804D1FF208349543005F0E0 -:10557000A6FD307838707F2030700120607210E016 -:105580007548FAF76DFF002801D17F203070FAF7D7 -:1055900055FF287B002802D10120FFF768FB00207F -:1055A0002873FFF737FBE87802283DD0E878042815 -:1055B0002DD127E07049714821E66878002803D092 -:1055C000FAF733FFFBF7DCFA6348FAF749FF0028E4 -:1055D00001D17F203070FAF731FF10E05E48FAF712 -:1055E0003FFF002801D17F203070FAF727FF287B8A -:1055F000002802D10120FFF73AFB00202873FAF7B8 -:1056000003FECEE737205C49400105F058FD2879BC -:10561000002809D001280ED0022807D0032810D076 -:105620005549574805F04BFD03B0F0BDE878032815 -:1056300007D003B0F0BDE878062802D0E878052846 -:10564000F7D10120FAF7D2FF03B0F0BD70B54D4C91 -:10565000E07807285FD201007944097949188F441E -:105660005A5A5A5A5A030B003C48FAF78EFEFAF778 -:10567000EEFE0420E07053E0FAF7C3FEFAF7B6FE40 -:10568000FAF7C2FDFAF764FE012626730220E070E5 -:10569000FAF776FE3C4D2878002803D036493B487F -:1056A00005F00DFD0020A8702E4800684188A980F3 -:1056B000C17EE971818B2981C18B6981018CA981AE -:1056C0008188E982C1882983008968836079287785 -:1056D0002F483049807EA8732F4805F0ECFD607894 -:1056E000002803D0FBF76DFA012808D0687F400836 -:1056F000400068772E70022002F066F910E0687FA3 -:1057000030436877FBF776FA697F4000C907C90F15 -:1057100001436977EEE775201749000105F0CFFCDA -:10572000E078022816D0E078032806D0E078042834 -:1057300003D01149194805F0C2FC2079002809D08E -:10574000012807D002282DD003282BD00A4914485D -:1057500005F0B5FC70BD0000D00000206C1F0020DB -:10576000941F0020341F0020F41E0020011F002081 -:10577000081F0020271F0020044F01009E06000084 -:10578000F5060000541F0020B41E00202907000069 -:10579000141F0020281F0020C31E002056070000F1 -:1057A000620700000120FAF721FF70BD10B55C4CC4 -:1057B000E078052820D201007944097949188F44FE -:1057C0001B1B1B1902005748FAF74AFE002802D19A -:1057D00054497F200870FAF731FE207B002802D15F -:1057E0000120FFF744FA00202073FAF70DFDFFF7C0 -:1057F00011FA01E000F01CF8E078022813D0E078FC -:10580000032803D04849494805F059FC207900286D -:1058100009D0012807D0022806D0032804D0424925 -:10582000434805F04CFC10BD0120FAF7DFFE10BD27 -:1058300010B5FAF7E6FDFAF7D9FDFAF7E5FCFAF745 -:1058400087FD374C6078002805D0FAF7EEFDFBF7AE -:1058500097F900206070012020730220E070FAF7B1 -:105860008FFD002002F0B0F810BD70B5314C054638 -:10587000264660367434032943D0052940D1FEF70B -:1058800041F805212846FEF742F8B17E2846FEF78A -:1058900078F821462846FEF763F8274C2846216809 -:1058A0000F31FEF7FBF8216828461331FEF7FFF8A9 -:1058B0002068817D2846FEF711F92068018B284673 -:1058C000FEF708F9206881882846FEF7F7F8206877 -:1058D000C1882846FEF7F6F8206801892846FEF7B9 -:1058E000F5F8216828460A31FEF70BF92068817E19 -:1058F0002846FEF7F5F80A4841792846FEF7F9F8F8 -:1059000070BDFDF7FFFF03212846FEF700F8B17ECA -:105910002846FEF736F821462846FEF721F870BDE6 -:10592000541F0020D0000020044F01009907000000 -:10593000A5070000B41E0020341F0020F8B5FEF7B4 -:10594000FBFE0446FEF7BFFFFE4E0546F068203022 -:10595000407B002826D0012867D0022869D0032880 -:1059600071D0FF20F8A1773005F0A9FB3069F7224C -:10597000017811400170F2682032937BDB071B0F26 -:105980001943FB2319400170D37BDB075B0F1943DD -:105990000170577BEF23022F60D0012F63D0032FBC -:1059A00065D06AE0EC48FEF76DFF002827D030692B -:1059B0000090F168088DC9884018801D87B2009852 -:1059C000FEF7D5F9012805D00098FEF7D0F9002898 -:1059D00008D00FE0F06839468030C7850098FEF7A0 -:1059E00033FA07E0F06839468030406A87800098D3 -:1059F000FEF7E7F9F168032020314873B6E7D6488F -:105A0000FEF72AFE002804D0F0685321095C002923 -:105A100007D0D148FEF7DDFEF16801202031487340 -:105A2000A4E7022120304173A0E7CB48FEF7D1FE66 -:105A30009CE7C948FEF710FE002897D1FF20C2A1BD -:105A4000693008E0FFE7C448FEF71CFF00288DD14D -:105A5000FF20BDA1713005F032FB87E7012C08D88B -:105A6000002D06D009E06D1E2C4302D105E0002C6C -:105A700003D019401023194300E019400170D17D73 -:105A8000002915D0517B012912D0B448FAF77DFCCA -:105A9000B34801210176F268116E526E42610161D4 -:105AA000AE493269FAF7D7FF0020FAF7E3FF03E0C7 -:105AB000FAF76BFCFBF701F801210846FAF7E0FC66 -:105AC00003203070F8BD08282FD203007B441B79D7 -:105AD000DB189F4403060B0E11152528002926D03C -:105AE00023E0022923D0032921D01EE007291ED05C -:105AF0001BE008291BD018E00A390C2917D914E03B -:105B00000D2914D00C2912D0002A04D00D290CD351 -:105B100016290CD909E0112907D3162907D904E061 -:105B2000092904D001E0012901D00020704701209B -:105B3000704730B5054683B08748FEF771FE0028F0 -:105B400004D1672080A1000105F0B9FA7D4C2069DD -:105B5000FEF74CF803212069FEF769F82069EF226F -:105B60000178114001702946FEF7CAF80D2D76D252 -:105B7000280078440079001887441F160644808066 -:105B8000840E7280848460006E48C1680069803130 -:105B9000497FFEF762F975E06A48C16800698031A3 -:105BA000497AFEF7CBF96DE06648C168006980313B -:105BB000896A491CFEF73CF964E0624CE068803079 -:105BC000406A81792069FEF7F8F8E0688030406A21 -:105BD00001892069FEF7E8F8E0688030406A418971 -:105BE0002069FEF7C6F8E0688030406A8189206944 -:105BF000FEF7C8F8E0688030406AC1892069FEF786 -:105C0000CAF83FE04F4CE0688030416A2069091DC6 -:105C1000FEF727F9E0688030416A20690C31FEF711 -:105C20002CF9E0688030416A20691E31FEF72FF9B7 -:105C3000E16820698031FEF737F923E0414CA06923 -:105C400001782069FEF760F9A06981882069FEF774 -:105C50005DF9A06941882069FEF75CF912E00DE06A -:105C600000200090694601900878012108436946A8 -:105C7000087034480069FEF763F903E032A139483F -:105C800005F01DFAFEF7DDFD002803D12EA13648F0 -:105C900005F015FA0C2D0ED0072D0ED0012D0AD0CF -:105CA000002D08D0022D06D026480021C0684030C3 -:105CB00041810121817303B030BD22480021C068B9 -:105CC0004030018203B030BDF8B5FAF79AFBFAF71D -:105CD0008DFBFAF799FAFAF73BFBFAF7EEFEFAF7C3 -:105CE0004FFB184CE06820300079012801D1FAF709 -:105CF000A5FBE068012502462032917D002908D1EC -:105D0000E178CB0701D1890703D59575012101F011 -:105D100017FEA0790026002863D100F0A0FD0E48F0 -:105D2000FEF77EFD00285CD06079002859D1E0683C -:105D300054210A5C2030417D0120FFF7C4FE002879 -:105D40004FD113E0D80000207372635C6C6C5F6D00 -:105D500061737465722E6300E8000020E21F00206A -:105D600008200020B4060000BA060000E0680246E1 -:105D70008032117F002901D0022050E003462033F9 -:105D8000D97C052929D0F74F0C292DD00D2929D0F0 -:105D9000132943D01B7D012B4BD0052B42D0526AD7 -:105DA0001378002B61D0528843889A425DD14030ED -:105DB000027D0020FFF787FE00287FD0E068A42145 -:105DC00009580978891E062978D20A007A4412797E -:105DD000921897443A3C7373658EE3A1E64805F048 -:105DE0006EF9B8E00B201AE0F6F743F90C287DD3E2 -:105DF000E06808218030406A1E30F6F73BF9002841 -:105E000006D0E06804218030F6F734F9002803D189 -:105E1000D5A1384605F053F9032000E00620FFF72E -:105E200088FE98E00720FFF784FEE06820300675C2 -:105E300091E00C20FFF77DFEE06801464030827D56 -:105E40002A43827520310E7585E000200BE020305A -:105E5000C17D00290AD0007E002803D1C2A1C74815 -:105E600005F02DF90A20FFF764FE27E0F6F701F9A7 -:105E70000C2823D3E06808218030406A1E30F6F7F2 -:105E8000F9F8002806D0E06804218030F6F7F2F82F -:105E9000002803D1B4A1384605F011F90320E2E748 -:105EA0004030807D800709D10C20FFF742FEE0687A -:105EB000403046818573817D29438175B048FEF766 -:105EC000AFFC002847D0E06854210A5C2030C17C38 -:105ED0000020FFF7F8FD00283DD0E168AC20405CD1 -:105EE000002838D0E0690078002800E033E002D0D4 -:105EF00031E00820B7E7088D0A282CD905220A319D -:105F0000206A04F025FF002822D0E0688030816AF2 -:105F1000087800280CD00522491C206A04F018FFDC -:105F2000002818D1E0688030806A0078002806D107 -:105F3000E068216A8030806A401C05F0B1F9E068B1 -:105F40008030806A0178491C01700120FFF7F1FD63 -:105F5000E068A0300673E078C007E06802D0403007 -:105F6000868003E040308188491C8180E0689C2164 -:105F7000095C002908D154210A5C2030417D0120B0 -:105F8000FFF7A1FD002804D0E06840300189491CDA -:105F90000181A0793D21002804D0E0684030817063 -:105FA00045705BE0E07902280AD001280AD06079C8 -:105FB00000281BD0420701D4C2060AD51E21ECE7F7 -:105FC0001621EAE7E0689E21095C40308170457047 -:105FD00044E00207E1D4C10706D1800704D423209E -:105FE00061A1000105F06BF82A21D6E7E0680246BE -:105FF0004032917B002905D05389591C51819189E8 -:106000008B4213D2917C002905D0118A4B1C13823C -:10601000938999420AD21789D3889F4203D39C213E -:10602000095C002902D191898F4203D3222090700C -:10603000557013E03621095C0029918805D09942FA -:1060400009D308209070557008E0062903D33E203C -:106050009070557002E05178002908D0E068014640 -:106060002031CE740E758E752570022101E02570E9 -:10607000002101F065FCF8BDF7B582B00C46694619 -:1060800016460889FDF73DFB00287DD100980025C4 -:106090008030816B0A78072A23D0A11C0C2A30D0CB -:1060A0000B2A3BD0062A48D068460689354F00980F -:1060B0000146A030027C002A68D06570122222704E -:1060C000009AA032127C002A08D0A23105740A8AF4 -:1060D00062804A8AA280027C002AF7D1012005B0A2 -:1060E000F0BD002EFAD1657007212170816B0A2264 -:1060F000A01C091D04F059FE00988030806B0570CB -:10610000ECE7002EEAD165700C212170816B8A8842 -:106110006280C988A180806B0570DFE7002EDDD129 -:1061200065700B222270826B93880B80D3884B8022 -:1061300012898A80806B0570D0E7002ECED1657001 -:1061400006222270826B93880B80D3884B80138940 -:106150008B805389CB8093890B81D3894B81806B52 -:106160000570BBE7350700007372635C6C6C5F6D94 -:1061700061737465722E6300AC0500006705000052 -:10618000E8000020DA07000018E0FFE702A8FDF7AA -:10619000F0FA002803D0FE49384604F090FF694623 -:1061A0000889FDF7AEFA002803D0F949F94804F050 -:1061B00086FF68460089B04200D078E7002005B02D -:1061C000F0BDF5480078012801D00C207047002070 -:1061D000704770B5F04C05462078002804D0FF20A9 -:1061E000EB49C00004F06BFF0020A5612072012084 -:1061F00020702078012803D0E549E84804F05FFFCB -:1062000070BDF8B5E44C2178012901D00C20F8BD0F -:10621000E0608030807AFEF70CFA00283AD0E0681F -:106220008030807AFEF75CFB002833D0E068803055 -:10623000807AFEF7D1FA00282CD0E0688030807A8E -:10624000FEF70DFB002825D0FAF78FF80026A6717F -:106250000120F9F74EFEE068014640318A7B002AB2 -:1062600003D04A898B899A4211D28A7C002A03D0B2 -:106270000A8A8B899A420AD20B89CA88934206D22B -:1062800036231B5C8988002B06D0914206D301205F -:10629000A0703BE01220F8BD0629F8D2A67013309A -:1062A000F9F7F5FFE0680F30F9F733FF0320FAF74D -:1062B00059F8E06805462030017E002902D1C07DF2 -:1062C000002809D0294670318EC9B5488EC02946AC -:1062D000B448803104F0FCFF9820405BA91C401CAE -:1062E00082B228462830FDF777FF002803D0A8495E -:1062F000AD4804F0E4FEE06840300078F9F71BFF99 -:10630000FAF72CF801210020F9F730FFE67026712A -:106310006671E67102202070E06880300683FAF72B -:106320002FF80020F8BD10B5FAF71FF89A4C207826 -:10633000022803D0FAF724F80C2010BDA07800281A -:1063400002D0FFF7C1FC17E0FAF73CF8FFF7F6FAC6 -:10635000E06820300079012801D1FAF778F8207A36 -:10636000002809D0012809D0022805D0032805D02B -:1063700087498E4804F0A3FE002010BDECF748FECC -:10638000FAE770B505468030018B2C46491C018325 -:106390004034A188491CA180A17B002902D06189D9 -:1063A000491C6181A17C002902D0218A491C2182DB -:1063B000007F002807D13520415D227D0120FFF7B5 -:1063C00082FB002802D02089401C2081284600F052 -:1063D000DEF9002070BD7049087270476E4A116284 -:1063E000D0617047F8B56C4C2078032803D0684919 -:1063F0006F4804F064FEE16804272031887A0025A4 -:10640000002803D08D72207938432071206901263D -:106410000278D2439207002A18D1CA7A002A15D1ED -:10642000CE722179022211432171FDF7A0FC0628CA -:1064300002D00B280AD106E0E06800218166C1661F -:106440002030067602E0E0682030057620794007AB -:1064500004D5E0682030407D022802D06079002811 -:1064600002D0FFF731FC2AE05248FEF74CFA002830 -:1064700001D0657002E066704F486061E0682030CE -:10648000007E002811D04D48F9F77FFF444805767B -:10649000E268916ED26E42610161484A6169FAF721 -:1064A000DAFA0120FAF7E6FA04E06069F9F76DFF1D -:1064B000FAF703FB02210020F9F7E2FF27702078AA -:1064C00001280CD0207A002809D0012807D0022802 -:1064D00006D0032804D02E49394804F0F0FDF8BD59 -:1064E0000120FAF783F8F8BDF8B52B4C0546207863 -:1064F000042803D02649334804F0E1FD002D7DD067 -:10650000FAF7F3FA0125002812D1E0682030017E65 -:1065100000290DD061694A78D20609D00978C07B7C -:106520000907C90F814203D1A571FFF7CDFBAAE08E -:10653000E06820300079012811D1F9F77FFFE16888 -:10654000881C2831FDF738FF002808D0E068B22108 -:1065500042880A523121095CA030017505746069D6 -:10656000002600784007C10FE0682030827B91420E -:1065700056D0407B002853D002282ED1FEF790F849 -:10658000002803D10249104804F099FDE2681DE09B -:1065900068610100DE070000D80000200408000048 -:1065A000082000202120002043080000830800006C -:1065B000B8080000EC000020C01F0020E21F0020EF -:1065C000F5080000FD080000EB050000106E516E9C -:1065D0000023401C594151661066E0682030467324 -:1065E000C17A012916D1C672207908210843207189 -:1065F000FEF757F9002805D1FA4900E0A2E0FA4871 -:1066000004F05DFDE2680023106E516E401C59419C -:1066100051661066E0682030817B012944D0857383 -:10662000606901788C460907CF0FE1680A4620317E -:10663000CB7B9F420CD16746BF07BF0F012F4BD0CA -:10664000022F49D0032F31D06079042108436071B3 -:10665000E0782843E07020690078C00604D46069BF -:106660000078C00600D460E720790028FBD160786C -:106670000028F8D101F059F90028F4D060790028F9 -:10668000F1D1FFF75BF9207801280CD0207A00289F -:1066900009D001285BD0022805D0032857D0D14962 -:1066A000D24804F00CFDF8BD8673B9E7FDF7E6FAB1 -:1066B00000280CD0E06820308572217929432171AF -:1066C000C17B012901D1C673C2E7C573C0E76079F8 -:1066D000102108436071BBE74078C7062CD063786F -:1066E000002BB5D1C006C00E1B28F0D84032127D59 -:1066F000C97C0520FFF7E7F9002804D0607908215C -:1067000008436071A4E7E07804210843E070FEF7D5 -:1067100021F9002803D1B349B54804F0D0FCE06862 -:106720000023816EC26E491C5A41C26681662030C8 -:10673000C17B0129C9D1C6E7012B01D0CD7387E701 -:10674000CE7385E7E07802210843E070EDE6012092 -:10675000F9F74CFFF8BD10B5A6480078042803D01F -:10676000A049A54804F0ABFCFFF7AEFA10BD3621F6 -:106770000A5C40308188091D002A04D0C08881420B -:1067800003D3012070470629FBD200207047F8B5DB -:10679000054606462036F07C2C4600278034072824 -:1067A0001FD1288DE18D401C884257D1A16A28460F -:1067B0000A30491C04F074FD012202212846FDF72D -:1067C000BEFCF77401215E204155A06A00780028C4 -:1067D00003D18449894804F072FCA16A0878401EFC -:1067E0000870F07C082839D1616A288D8988401C9E -:1067F000884233D1A06B0178002904D079498048C0 -:1068000004F05DFC15E06988C180606AA16B408975 -:106810000881606AA16B80894881606AA16BC08928 -:106820008881A06B0771A16B07200870A16B688835 -:106830004880012211462846FDF781FC03212846A5 -:1068400001F07EF8606A69884088884203D0654913 -:106850006C4804F034FC606A0770F774F8BD70B5DA -:10686000644C6079002877D1207901264007002503 -:1068700000284ADAE0683321095C11293ED004DCA3 -:10688000022907D0052939D107E0132936D0152967 -:1068900034D107E053495C4801E052495B4804F0B9 -:1068A0000EFC2BE001464031CD748D73A4210958B4 -:1068B00040884988814203D04A49554804F0FFFB8B -:1068C000E06801468030426A1570826B1378002BB5 -:1068D00004D044494F4804F0F2FB0CE04B88D380CD -:1068E000836B027A1A71826B1572836B0B221A709A -:1068F000806B49884180E0682030C574E0682030B2 -:10690000417D022901D1E67145752079800741D585 -:10691000607900283ED12069C0780D2861D201003D -:106920007944097949188F44493606A4FEFEBE18F9 -:1069300023FE7D93CC00E06854210A5C2030417D29 -:106940000120FFF7C0F8002824D1E0680322352198 -:106950000A5440308573E4E0FCE0E06854210A5CAE -:106960002030017D0020FFF7AEF800286FD1DEE077 -:10697000E06854210A5C2030C17C0020FFF7A3F8B6 -:10698000002803D11749244804F099FBE068092145 -:106990002030C174CBE0E06854210A5C2030C17C17 -:1069A0000020FFF790F8002803D10E491B4804F09F -:1069B00086FBE06807212030C174B8E0E06854210C -:1069C0000A5C2030C17C0020FFF77DF8002803D14D -:1069D0000449134804F073FBE06808212030C174B7 -:1069E000A5E0A0E068610100FC050000510900007D -:1069F00044060000D800002059090000820200006F -:106A00008F020000A3020000390400003D040000D2 -:106A10004C040000510400009A0400009F04000090 -:106A2000A4040000E06854210A5C2030C17C0020EE -:106A3000FFF749F8002803D1FB49FC4804F03FFB6D -:106A4000E06853210E540A212030C1746FE066E0E3 -:106A5000E0682030C07C0D2804D04B20F2490001B2 -:106A600004F02DFBE06854210E540C212030C17439 -:106A70005DE0E06854210A5C2030C17C0020FFF713 -:106A800022F8002808D1E0684030007D002803D1BA -:106A9000E549E74804F013FBE06853210E540E214A -:106AA0002030C17443E0E0682030C07C132803D05C -:106AB000DD49E04804F003FBE06816212030C17492 -:106AC00035E0E068A421095843884A889A421CD1DD -:106AD0000978062919D154210A5C2030C17C002094 -:106AE000FEF7F1FF002803D1CF49D34804F0E7FABD -:106AF000E068014640318A7D920702D42030C67496 -:106B000003E08D738030406A0570E06854210A5CB0 -:106B10002030017D0020FEF7D6FF002807D0E06876 -:106B20004030857403E0C049C44804F0C8FA2079B5 -:106B300000070AD56079002807D1E0682030417D40 -:106B4000032902D10221E171457500F004F8E068E3 -:106B5000FFF71DFE70BDF0B5B94C8DB02079C007B0 -:106B60007ED0607900287BD16069C0780E2878D209 -:106B700001007944097949188F44737306732747D4 -:106B8000A78E73FE731EE992E06854210A5C2030E0 -:106B9000417D0120FEF797FF00287DD16069FDF758 -:106BA0005EF9E1689E2250540222352042540020B2 -:106BB000403188748873CFE1E0682030C17C0A29B5 -:106BC0006BD10021C1750D211DE0E0683321095C06 -:106BD0000E297FD1A421095840884988814203D0D9 -:106BE0009149984804F06BFAE0688030416A606926 -:106BF0002631FDF770F9E16860698431FDF77BF9B2 -:106C0000E06811212030C174A6E1E1683320405CC6 -:106C100011285FD180318C464B6A8B4810260022A8 -:106C2000082168440E33B51AED18203DEF7F4770F8 -:106C3000AD7F8570801C491E921C0029F3D16146EE -:106C40004B6A03A810260022082103301E33B51A10 -:106C5000ED18203DEF7F4770AD7F8570801C01E00F -:106C600082E15AE1491E921C0029F0D16846FBF7E7 -:106C700014FB08AD8DCDE16800260E664E660D460C -:106C800070318DC101262035EE75704E8DC670486D -:106C900004F01EFB132001E0C4E01BE0E8745BE19C -:106CA000E0683321095C112901D00E2912D140304E -:106CB000007D00280ED16069FDF73EF9E168882269 -:106CC000505415202031C87446E1E0683321095C36 -:106CD000162902D0022060713EE1014600254031B4 -:106CE000CD748D73A421095840884988814203D00E -:106CF0004D49584804F0E3F9E06801468030426AA3 -:106D00001570826B1378002B02D047495248E6E099 -:106D10000B4640331E7D002E0BD01D754B88D38053 -:106D2000826B1571836B0C221A70806B49884180CD -:106D3000EFE04B88D380826B1571836B01221A724E -:106D4000836B0B221A70806B49884180E1E0E06818 -:106D500054210A5C2030017D0020FEF7B4FE00289B -:106D60000FD1E06854210A5C2030C17C0720FEF777 -:106D7000AAFE002805D100E072E0607901210843F5 -:106D80006071607900284DD1E0684030807D8007D7 -:106D900015D46069FDF7C2F8E1684031C8756069D3 -:106DA000FDF7BEF8E168403108836069FDF7BDF882 -:106DB000E168022240314883887D10438875E0688D -:106DC000014640318A7DD20716D10A7D2030017DEF -:106DD0000020FEF778FE002803D113491F4804F075 -:106DE0006EF9E0680121342211540623A0221354C5 -:106DF0004030817400210182E068014620310A465A -:106E0000C97C012903D10021D1744E221154A4213F -:106E1000095840884A88824204D10878062801D15E -:106E20000020087098E0000068610100A9040000DB -:106E3000B6040000BE040000CA040000E404000020 -:106E4000D800002002030000FFFFFFFF0820002001 -:106E5000212000205203000057030000920300008D -:106E6000E06854210A5C2030C17C0620FEF72BFE2E -:106E7000002803D1607901210843607160790028FE -:106E80006AD169466069FDF76CF868460078C10709 -:106E9000C90F6846017004D0E068012140300177D5 -:106EA00003E0E068002140300177E06800254E21D2 -:106EB0000D54A421095840884988814204D00F20EC -:106EC0002A49800104F0FBF8E06802468030416AFC -:106ED0000D70816B0B78002B04D02449244804F0FA -:106EE000EEF816E05388CB80816B6B460D71816B99 -:106EF0001B880B816B465B884B816B469B888B8123 -:106F00006B46DB88CB81836B06211970806B5188BF -:106F10004180E0682030C5741EE0E06854210A5CBE -:106F20002030017D0020FEF7CEFD002803D16079DE -:106F3000012108436071607900280DD16069FCF778 -:106F400016FFE16889225054052234204254002063 -:106F50004031088201208874E1680023886ECA6E7F -:106F6000401C5A41CA6688660DB0F0BD68610100D8 -:106F7000C5030000F7B582B006460398174681881E -:106F8000FE48FE4A41430398039D008B0024504372 -:106F9000009080352A7C002A0CD0F948012A4068EC -:106FA0003CD0022A1FD0032A38D0F6A1F94804F0B9 -:106FB00086F84BE0002F04D17D20F2A1C00004F040 -:106FC0007EF8EF4C6068002803D1EEA1F24804F08F -:106FD00076F86068A168001D0918F04A00988018CA -:106FE0000C18012018E0791E084303D1E5A1EC48F4 -:106FF00004F065F8EB48016800980C18002F0AD0DF -:10700000DF484168E8480818A04204D98120DDA182 -:10701000C00004F054F80320287415E00C46002F3B -:1070200012D0D74F002806D17878002803D0D5A1F8 -:10703000DE4804F044F8DC4879680818A04203D917 -:10704000D0A1DB4804F03BF8002C03D1CDA1D948F6 -:1070500004F035F821466869F5F7D7FF686100202C -:107060003070012434716869B0600398FFF77FFBCA -:10707000002801D0747104E0287C012805D0032089 -:107080007071CD48F06005B0F0BD0220F8E7F0B5B2 -:10709000054687B00F46012000F01BFDC4B20B204F -:1070A00000F017FDC0B2844204D0FF20B5A14D30DE -:1070B00004F005F8012000F00CFDC4B2182000F027 -:1070C00008FDC0B2844204D0FF20AEA14E3003F0D0 -:1070D000F6FF3846B94F6C1E6900CD190026403DB9 -:1070E00009287DD201007944097949188F44044167 -:1070F00050504CE9E9E9A0000B2C04DBFF20B0A1C3 -:10710000213003F0DCFFE88F6946FCF7FAFA00282B -:1071100004D0FF209BA1563003F0D1FF0B2C04DBE1 -:10712000FF20A7A1213003F0CAFF0099E88F49880A -:10713000884204D0FF2093A1583003F0C0FF00988C -:107140008030007C002804D1FF208EA1593003F04C -:10715000B6FF8B484660467086600098FFF751F88E -:10716000002804D0FF2087A1603003F0A8FF07B0FB -:10717000F0BDFFF7D8F80028F9D0FF2081A16630D4 -:1071800003F09DFF07B0F0BDF9F733FA07B0F0BD8B -:107190000420C04300F09DFCC6B2192000F099FC09 -:1071A000C0B2864204D0FF2076A1723003F087FF80 -:1071B0000B2C04DBFF2082A1213003F080FFE88F3D -:1071C0006946FCF79EFA002804D0FF206DA17630B6 -:1071D00003F075FF0B2C06DBFF2079A1213000E0C6 -:1071E0006FE003F06CFF0099E88F4988884204D073 -:1071F000FF2064A1783003F062FF0098FFF7C1F828 -:10720000002804D0FF205FA17B3003F058FF009CD2 -:107210000022214602A8FFF7ADFE8034A07E02A91D -:10722000F6F7D8F80099088D401C088507B0F0BD26 -:107230000B2C04DBFF2062A1213003F040FFE88F1C -:107240006946FCF75EFA002804D0FF204DA1863085 -:1072500003F035FF0B2C04DBFF2059A1213003F094 -:107260002EFF0099E88F4988884204D0FF2045A16D -:10727000883003F024FF00988030007C042804D07C -:10728000FF2040A1893003F01AFF009C803426744F -:10729000A57E4F4F681E0B2804DBFF2048A1273036 -:1072A00003F00DFF4548690008184038C787A07EE5 -:1072B000F5F7FEFB4748A6760078EBF725F807B010 -:1072C000F0BDFF202FA193304FE770B5424C06462A -:1072D000E08B0025401C80B2E08323780A46002B17 -:1072E00009D021464968042B0BD0052B17D03D202F -:1072F00024A1000102E0ED2022A1800003F0DFFEC6 -:1073000014E00A2801D3022000E003207071002A53 -:107310000BD00320226900F0F5FB054606E00220B1 -:107320007071002A01D02D4D00E00D4629462069DC -:10733000F5F76BFE00212061317001213171B060E1 -:10734000A068FF303130F06070BDF0B5074685B001 -:107350000E46012000F0BDFBC4B20B2000F0B9FBCB -:10736000C0B2844204D0FF2006A19E3003F0A7FEE5 -:10737000012000F0AEFBC4B2182031E0E2040000AE -:10738000302000207372635C6C6C5F6C6D2E6D300E -:107390002E6300001C040000E903000055040000F7 -:1073A00003040000000100205F0400001604000038 -:1073B000170400001F040000F60400005C200020F9 -:1073C0007372635C6C6C5F6C6D2E6D302E630000AD -:1073D000FFFF0000FC0000203C200020B80B000054 -:1073E00000F077FBC0B2844204D0FF20FD499F30FB -:1073F00003F065FE00250120FB4C092E70D2310000 -:107400007944097949188F44041A3737336B6B185C -:10741000520060732073607800280ED1F3484560F5 -:1074200085602573A068C338FDF79DFC002804D053 -:10743000FF20EC49B33003F042FE05B0F0BD6178A7 -:10744000002909D0207B002801D1FDF7CEFD65730E -:10745000F5F794FA05B0F0BDA073FDF70CFD002818 -:10746000F8D0FF20DF49C73003F029FE05B0F0BD9A -:10747000F9F7BFF805B0F0BD0420C04300F029FBC8 -:10748000C4B2192000F025FBC0B2844204D0FF2012 -:10749000D449D53003F013FE012200216846FFF7DE -:1074A00014FF69463846F5F795FF05B0F0BD207822 -:1074B000052804D0FF20CB49E13003F000FE207FF7 -:1074C000002804D1FF20C749E23003F0F8FD2577FA -:1074D0002570207DF5F7ECFA257505B0F0BDFFE7C6 -:1074E000FF20C049ED30A6E7F0B5BF4C87B020784B -:1074F0000026042805D02078052802D00C2007B0EB -:10750000F0BD01276770607B0025002827D072B688 -:10751000607B002808D0A07B002805D0FDF765FD22 -:107520006573A573F5F72AFA62B6207DF6F780FD3C -:10753000002827D0207F002808D02577207805282C -:1075400003D0A849AA4803F0BAFD0C26657025703F -:10755000207DF5F7ADFA2575304607B0F0BD207DEA -:1075600000900320694608734873F5F7BCFA04904D -:107570000020C043694605900F7202A90098F5F7F4 -:1075800029FFD2E720BFD0E7F0B5974883B0007855 -:10759000002801D0FFF7A8FF944F01203870FF2684 -:1075A000944D2D36002405E00B2C03D39249304630 -:1075B00003F085FD204601A9FCF7A3F8002838D187 -:1075C00001988030007C002833D00B2C03D38A49EB -:1075D000304603F074FD2046AC422ED06946FCF7DD -:1075E00090F8002803D08449844803F068FD00988F -:1075F0008030807EF6F71CFD002822D00098002104 -:1076000080300174847E0C2C04D3FF207A4927300B -:1076100003F055FD7A48610008184038C587009886 -:107620008030807EF5F744FA00990020803188761A -:10763000B8E7641CE4B2032CB6D30020387003B062 -:10764000F0BD20BFD3E710B500786E4C00280FD0F6 -:1076500001280CD068496C4803F031FDA0686B49E3 -:10766000884203D364496A4803F029FD10BD694884 -:10767000A060F3E710B55D4900220A70614C2070EC -:1076800059480270427002770273427382738261BA -:1076900002752030574B0380052143808380001DF5 -:1076A000491EFAD1100004D0002A04D05948A06025 -:1076B00005E0A26003E05049534803F000FDA068D4 -:1076C0005249884203D34C49514803F0F8FCFFF774 -:1076D0005BFF10BD70B5444C0E46217884B0154652 -:1076E000002902D00C2004B070BDA0618030007C65 -:1076F000002803D03B49484803F0E1FC4748464393 -:1077000045434748ED1C30186660A560854200D8A7 -:107710002846A060354900208860052121706070EE -:107720002077E0833F48F5F76FF92075002803D1F3 -:107730002C493D4803F0C3FCF5F7D5F92061002240 -:1077400001216846FFF7C1FD207D6946F5F742FE3D -:10775000002004B070BD08B50020C0436946088011 -:1077600021480078002801D0002008BD0846FCF719 -:1077700000F80028F9D0012008BD10B51A4C84B0DB -:107780002278002A02D00C2004B010BD234A5143B5 -:107790005043C91C224AA16060608018814200D811 -:1077A0000846A0600020607004212170E0831D481D -:1077B000F5F72AF92075002803D10A491B4803F080 -:1077C0007EFCF5F790F91A49F5F71FFC20610022BD -:1077D00001216846FFF779FD207D6946F5F7FAFD3E -:1077E000002027E0847301003C200020302000208E -:1077F00076020000FFFF0000C073010019030000C3 -:107800005C200020FC000020510500006A180000E8 -:107810005A050000C40900008B020000710200003C -:10782000B3FBFFFF4B73010097020000C60200008C -:10783000B80B000004B010BD10B5E14CA1690160A7 -:10784000FFF752FE0021A16110BD70B5DC4C84B081 -:107850002078052802D00C2004B070BDA069002853 -:1078600003D1D849D84803F02AFCA0698030007CB5 -:10787000002803D0D349D54803F021FCA06980300B -:10788000807E002803D0CF49D14803F018FCD148AE -:10789000F5F7BAF8A1699A22505405464E88401E61 -:1078A0000B2804DBFF20C749273003F008FCCA4936 -:1078B000680040184038C687A0698030807E002864 -:1078C00003D1C049C54803F0FAFB01226846A1690B -:1078D000FFF750FBA06969468030807EF5F77AFD9E -:1078E0000020A06104B070BD10B5BD494C6898344B -:1078F00000280ED001280FD0022811D03520B94918 -:10790000000103F0DCFBAE488068A0420BD90120E7 -:1079100010BDFF347934F6E7B12080002418F2E777 -:10792000FF346134EFE7002010BDAD4841780029F5 -:1079300002D10078002801D0002070470120704754 -:1079400070B504460422A84E803484B000290DD0BE -:10795000012923D0022907D0032921D0A149A34816 -:1079600003F0ADFB04B070BD227410E005469C48E6 -:1079700000780028F8D1294601226846FFF7FAFA74 -:10798000A07E6946F5F726FD288D401C2885F4F772 -:10799000F5FF3078EAF7B8FC04B070BD032010E0C2 -:1079A0008188934A5143934A1160616A0A8902832C -:1079B0008A7982754A8982808A89C280C9890181CF -:1079C0000220207404B070BDF0B5874E01463078B7 -:1079D00000257B4C85B0002908D0012916D002294A -:1079E00042D0032958D07F49834839E0E583EAF73C -:1079F0008BFC6078002849D1002211466846FFF7C9 -:107A000064FC207D6946F5F7E5FC3FE0744F206992 -:107A10007968774B401879494218A0698188408875 -:107A2000594300F06FF8B1680546884205D2A16954 -:107A30006F4A88884243551903E06D4903F01EFAE6 -:107A4000A1690883A06905218175008B68494843B5 -:107A5000281A6B49B860884204D32520594940014F -:107A600003F02DFB05B0F0BDE583EAF74DFC0120E6 -:107A70002077A0692169803041610574FFF7E5FE38 -:107A8000002803D04F495F4803F019FBF4F776FF55 -:107A90006573A57305B0F0BDEAF736FC05B0F0BD1F -:107AA000704710B54E4A00290ED0012906D0022990 -:107AB00006D04C49544803F002FB10BD401E03E0C1 -:107AC0005178491C5170001F506010BD3C4800782F -:107AD00070478107C90E00280BDA0007000F08382D -:107AE00080084A4A80008018C069C8400006800F9C -:107AF00070478008464A800080180068C840000629 -:107B0000800F7047F7B582B00D460646414F0024FE -:107B100006E00B2C04D3FF202A492D3003F0CFFAC6 -:107B2000204601A9FBF7EDFD00280ED10198803019 -:107B3000007C002809D00B2C04D3FF2021492D30D4 -:107B400003F0BDFABC4204D006E0641CE4B2032C8E -:107B5000DFD3002005B0F0BD69462046FBF7D1FD1C -:107B6000002803D017492C4803F0A9FAA64204D1F3 -:107B7000DD201449800003F0A2FA2848341B444356 -:107B80000098803041690498F6F7C6F9041908D5C1 -:107B9000281B66422946401E03F07EF96843841B79 -:107BA00005E02946204603F077F96843241AAC42E1 -:107BB00003D904491A4803F082FA204605B0F0BD03 -:107BC0003C200020C0730100E7020000E902000031 -:107BD000EB0200008F7001005C200020EE0200002C -:107BE0003020002084730100FC000020ED04000020 -:107BF000E204000000010020190500004E0600000C -:107C00006A180000B30400003605000000ED00E033 -:107C100000E400E0FFFF00007103000077080000AF -:107C20008903000070B5F84E0446B079002501289C -:107C300005D0F64E307A01280CD0002070BD002906 -:107C400015D1657014202070F149A01C03F040FB91 -:107C5000B5710CE000290AD16570132020701C2238 -:107C6000EC49A01C03F0A1F80120A071357201209D -:107C700070BDE648007A002802D0E748808D704742 -:107C8000E6487047F8B5E6480178002902D00C268E -:107C90003046F8BD0026E04D34462E756E75EE7503 -:107CA0002E76AE75DF496E734E73D84F7F217E718D -:107CB0008170687E002804D0F8F7B7FBF8F760FF02 -:107CC0006C763C72D848FBF71DFED848FBF71AFECD -:107CD000DEE770B5D24A00251570CC4ED44B357115 -:107CE0001966D8651078002805D0FF20D1A17A3018 -:107CF00003F0E5F970BDC84C25756575E575257609 -:107D0000A575C8486573457375717F209070607E56 -:107D1000002804D0F8F789FBF8F732FF6576357252 -:107D2000C148FBF7EFFDC148FBF7ECFD70BDBA4859 -:107D3000007D704710B5B849C87B897B420783072F -:107D4000D20FDB0FC007D218C00F10184000052952 -:107D500011D20A007A44127992189744090509024F -:107D60000700B849085A10BDB74810BDB74900E030 -:107D7000B749085A10BDFF20AEA19A3003F09FF911 -:107D8000002010BDA448B349008A484370479F486B -:107D90008079002800D001207047F8B506469E4C37 -:107DA000407BE07330790027A073012825D030880C -:107DB00020829648B37B83719D4DA7482970114658 -:107DC00003F079FAB0796873F11DA44803F073FAEF -:107DD000607B0126002800D066759248407B002811 -:107DE00000D0A675A07B05284DD201007944097901 -:107DF00049188F440409262B09002782D9E700215E -:107E00008948FBF784FD25E001218748FBF77FFDCA -:107E1000E91D8548FBF7B0FD687B002807D00128E5 -:107E20000AD0FF2083A1E83003F049F912E00021D5 -:107E30007D48FBF7B2FD0DE001217B48FBF7ADFD6E -:107E400008E006217848FBF762FD03E0022176484E -:107E5000FBF75DFDE7752776691C7348FBF780FD2E -:107E600029787148FBF78DFD04217048FBF74FFD21 -:107E7000691C6E48FBF774FD29786C48FBF781FD9F -:107E800026750020F8BDFF206AA1F230CCE770B55E -:107E9000614C012525765D4A127A002A01D03A20EC -:107EA00070BD634A13780022834205D1E2756A48A7 -:107EB00003F001FAE57500E02276002070BD70B590 -:107EC0000446554D0020A8752246654802F06DFF16 -:107ED000544844730120A87570BD4C49087170471F -:107EE00010B54D4C00226275607302465D4802F089 -:107EF0005CFF0120607510BD444948717047F8B5BA -:107F0000474D287800282CD1434C207D002828D0CC -:107F1000F8F72BFA0026A674E6746E703046F8F770 -:107F200021FA0020F7F7E5FF4F48F8F7F2F84F483D -:107F3000F8F7ADF9F8F746FAE07B0127C107002909 -:107F400002D0A17CC9070ED0810712D5A17C890778 -:107F50000FD42620F8F7EFF8A07C02210843A07484 -:107F600013E00C20F8BD2520F8F7E5F8A07C384395 -:107F70000AE0400709D5A07C400706D42720F8F77F -:107F8000DAF8A07C04210843A074F8F7E7F901218E -:107F90000020F8F7EBF80F210520F8F72EF8244D14 -:107FA0002978681CF8F71DF8A07B01280AD004285E -:107FB00008D0607D002805D0627B2A491A48FBF76B -:107FC00006FD6675A07D002806D016482449427B30 -:107FD0009830FBF72EFDA675286E0178002903D096 -:107FE0000178001DF8F740F8E86D0178002904D009 -:107FF0001F4A401CF8F7A3FD6776F8F7C1F9002087 -:10800000F8BD074948607047F4200020D4200020C4 -:10801000FB200020DE200020B4200020FFFF000015 -:108020000801002094200020042100202C210020A1 -:10803000742000207372635C6C6C5F6164762E63E5 -:1080400000000000CEB301009A891300D6B30100EE -:10805000C6B3010071020000752000207B200020C3 -:1080600082200020A2200020C1B30100BEB3010085 -:1080700057210020F8B50126FE4C0546002824D0E3 -:10808000E07B2146C207897C002A01D0CA070BD0B9 -:1080900082070FD58A070DD42620F8F74CF8A07C6C -:1080A00002210843A07410E02520F8F744F8A07CD2 -:1080B0003043F7E7400708D5480706D42720F8F7EC -:1080C0003AF8A07C04210843A074E07C00280AD080 -:1080D000A07B012804D14B20E749000102F0EFFF0B -:1080E00000F0BDFAF8BD002D0CD002210020F8F7F9 -:1080F0003DF8E2480079032801D0012802D102208E -:10810000F8F774FAE07D002700280AD0DC4DDD483E -:10811000691CFBF725FC691CDB48FBF721FCE775B4 -:108120002776D848F8F731F9A07B05280CD2010052 -:108130007944097949188F440202020B0200012197 -:108140000846F8F79DF903E0CB49D04802F0B7FFA5 -:10815000E07BA17C884303D1A07B012803D0E67497 -:10816000CB480670F8BDA774FAE710B5F8F7FDF82C -:10817000C7480078002816D1BE48007D002812D0DC -:108180000020FFF777FFBD480079002809D00128BB -:1081900015D0022805D0032811D0B749BD4802F0F8 -:1081A0008EFF002010BDF8F72CF9F8F71FF9F8F74B -:1081B0002BF8F8F7CDF8F8F7E3F80C2010BDEAF744 -:1081C00027FFEEE7B249012048707047F8B5002458 -:1081D000FAF7B6FE002822D0FF202D30F7F7C3FFB4 -:1081E000AB4D2878A54F01281CD0022801D00328C8 -:1081F00031D0CF20A049800002F061FF287800280C -:108200000CD03879002809D0012807D0022835D0B1 -:10821000032833D09849A04802F051FFF8BD00F080 -:108220001EFAF8BD934EB07B032814D0707E002850 -:1082300003D0F8F794FCF8F7F0F89848F8F7A5F8A9 -:10824000B07B012812D0042810D0B879012806D0BC -:10825000032804D004E00120FFF70CFFCEE7102430 -:1082600021460E2001430020F8F70AF97879012809 -:1082700001D1F8F7ECF802202870BFE7287802282F -:10828000CFD10120F8F7B2F9F8BD70B57B48804C2A -:108290004079012808D18248F8F7E2F8002801D196 -:1082A0007F20A070F8F7CAF8724D687E002803D0CE -:1082B000F8F7BBF8F8F764FCFAF742FE00280BD099 -:1082C0002078022804D0DD206B49800002F0F7FE00 -:1082D000A87B012803D006E000F0C1F970BD992009 -:1082E0008000F7F740FF0120FFF7C4FE2078002848 -:1082F000F4D020780128F1D05F496A4802F0DFFE0F -:1083000070BDF0B5044689B0002006900190F7F7E3 -:10831000FDFE03905E480078022803D0564962486B -:1083200002F0CDFE554D6879012809D15C48F8F777 -:1083300097F8002802D156497F208870F8F77EF818 -:108340005648FBF709FB4B4E0746002C6FD05348AD -:10835000FBF70CFC00286AD0F7F74CFE002866D02B -:10836000707E00280AD00524641EE4B2F8F729FCC8 -:10837000022811D0012800D000200190474A4B4C20 -:10838000D01C0290062F52D2380078440079001891 -:108390008744B4B4B409B44E002CE5D144A1484894 -:1083A00002F08DFEE8E7B07B012840D004283ED0E3 -:1083B00001990398084304D1A879002801D0022824 -:1083C00035D1687901281AD1A079002817D1012068 -:1083D000A07110784006C00FE0713A48029902F08F -:1083E0006AFF2B4C384FA0787F2804D1532030A14E -:1083F000000102F064FEA07838707F20A07022484F -:10840000F7F7C3FF2248032101702879002877D0AD -:10841000012808D0022873D0032804D024A12B48B7 -:1084200002F04DFE6CE00120F8F7E0F868E065E04E -:108430001348D178C07981424AD111481179037A21 -:10844000994245D15179437A994241D19179837AC0 -:1084500099423DD1D179C37A994239D1117A037BBE -:10846000994235D11178407B4906C90F81422FD1FD -:1084700001212EE0B420002034800100D42000200F -:1084800074200020042100202C210020DE040000A4 -:1084900008010020D10200005103000054210020F7 -:1084A0000A01002083030000C1030000F420002023 -:1084B0007372635C6C6C5F6164762E630000000015 -:1084C000AB030000FC200020022100200904000072 -:1084D0000021B07B012801D0042801D100290AD154 -:1084E00000280BD101990398084304D1A8790028EA -:1084F00001D0012802D1307E00281FD00120069033 -:10850000707E002803D0F7F790FFF8F739FB069844 -:10851000002802D00120FFF7ADFD73480178002943 -:108520000AD00178012907D00078032804D0492017 -:108530006E49000102F0C3FD09B0F0BD6A486C4FFE -:108540004068397BC173797B0174B97B4174F97BD5 -:108550008174684909784906C90FC1761C300299AF -:1085600002F0A9FE6048397C4068C174797C0175CD -:10857000B97C4175F91E897D817502994A7D0B7D13 -:10858000110219430183F91E8A7E4B7E12021A439F -:108590008280029A537E177E1A023A43C2808A7FF3 -:1085A0004B7F11021943018153490A3002F078FED2 -:1085B00052480179CA064C49D20E49688A76007938 -:1085C0004009C0310871287A002803D047494C4837 -:1085D00002F075FD0020A87243484B49476878882F -:1085E000B085F87EE873B88B2882F88B6882388C67 -:1085F000A88244480078A875444802F05CFEB88818 -:10860000F087F888208038896080C03738792071F9 -:108610000198002860790BD0012108436071F8F7B8 -:10862000E9FA61794000C907C90F0143617102E0AD -:10863000400840006071012028722B4C00202070FF -:10864000F7F7DFFEF7F7D2FEF7F7DEFDF7F780FE6C -:10865000F7F796FE01206168FAF792FD50E7F8B54A -:10866000F7F7CFFEF7F7C2FEF7F7CEFDF7F770FE8C -:10867000274E0027707E002804D0F7F7D6FEF8F7C3 -:108680007FFA7776184D2F70F7F77AFEB07B0128C6 -:1086900004D000210846FAF773FDF8BD002102203E -:1086A000FAF76EFD1B4C207A002803D00F491A48B8 -:1086B00002F005FD68780028EFD01248417BE17395 -:1086C0000078A0751549164802F0F5FD0E490F48CF -:1086D00002F0F1FD3C20A07268684088B08501205E -:1086E00020726F70F8BD000008010020B084010006 -:1086F00057210020542100207321002074210020E4 -:108700003D0400007420002075200020EB20002094 -:10871000B4200020D42000204F0200007B20002045 -:10872000E4200020F8B5FCF707F80446FCF7CBF886 -:10873000FD4E054670692030407B002826D0012878 -:1087400044D0022846D003284DD0FF20F7A19A300C -:1087500002F0B5FCB069F72201781140017072692E -:108760002032937BDB071B0F1943FB231940017059 -:10877000D37BDB075B0F19430170577BEF23022F7D -:108780003CD0012F3FD0032F41D046E0EB48FCF70F -:1087900079F8002804D07169032020314873D9E7A3 -:1087A000E648FBF759FF002804D070695321095CA3 -:1087B000002907D0E148FCF70CF87169012020314D -:1087C0004873C7E7022120304173C3E7DB48FCF759 -:1087D00000F8BFE7D948FBF73FFF0028BAD1FF20D8 -:1087E000D2A18C3007E0D548FCF74CF80028B1D175 -:1087F000FF20CEA1943002F062FCABE7012C08D838 -:10880000002D06D009E06D1E2C4302D105E0002C9E -:1088100003D019401023194300E019400170D17DA5 -:10882000002915D0517B012912D0C548F7F7ADFDBD -:10883000C448002101767269116E526E4261016175 -:10884000BF49B269F8F707F90020F8F713F903E018 -:10885000F7F79BFDF8F731F9B0690078C00606D448 -:10886000F0690078C00602D4F079002806D0B0790B -:10887000002803D101210846F7F702FE03203070DB -:108880003079002803D1F7F79DFD01203071F8BD44 -:1088900010B5A5490023486902462030C37483758A -:1088A0000120412398548032927F002A03D008701F -:1088B0000021022001E000210320FAF7DEFB10BDB9 -:1088C00006281AD202007A441279921897440205B7 -:1088D000090D101000290ED00FE0891E02290AD9B7 -:1088E0000BE0891F012906D907E0082903D004E01D -:1088F0000B390C2901D8012070470020704730B592 -:10890000044683B08D48FBF78BFF002803D187A175 -:108910008D4802F0D4FB844DA869FBF767F9032169 -:10892000A869FBF784F9A869EF220178114001706A -:108930002146FBF7E5F90E2C5BD220007844007944 -:1089400000188744565606561F5A5A175642565A0A -:10895000312B75485D224169525C002A04D0062102 -:108960008069FBF77AFA48E0C031C9798069FBF782 -:1089700074FA42E06C48416980698031497AFBF7BA -:10898000DDFA3AE0684D6969A869B031FBF79EFAF3 -:108990006969A8698431FBF7A5FA2EE062480621CF -:1089A0008069FBF7C7FA28E05F4D28690178A8695C -:1089B000FBF7AAFA28698188A869FBF7A7FA286952 -:1089C0004188A869FBF7A6FA17E000200090019003 -:1089D000554841694031097F002905D06A46117820 -:1089E000012211436A46117069468069FBF7B4FAA7 -:1089F00003E04EA1554802F062FBFBF722FF00287E -:108A000003D14AA1524802F05AFB0C2C0AD0072C81 -:108A100006D04548002140694030418101218173E1 -:108A200003B030BD4048002140694030018203B0AE -:108A300030BDF0B53C4D064668698DB020300079F8 -:108A4000012801D1F7F7FAFC0024012E1ED1686934 -:108A50002030017E002902D1C07D002801D0F8F726 -:108A60002CF8F7F7CEFCF7F7C1FCF7F7CDFBF7F7DB -:108A70006FFCF7F785FC6879C006686902D580301D -:108A8000048703E08030018F491C01876879022642 -:108A9000C107002901D1800713D568692030817D85 -:108AA000002902D0032907D00BE0012181750021A4 -:108AB0000120FAF7E2FA04E0867500210120FAF7B6 -:108AC000DCFA68692030817D012903D169790907C1 -:108AD00000D586751448407A002865D100F0F7FE6D -:108AE0001648FBF79DFE00285ED00F4D287A00281F -:108AF0005AD16869C621095C00290ED02030C17C9A -:108B00000120FFF7DDFE002807D168692030C17C15 -:108B10000420FFF7D5FE00281CD06869CB21095C32 -:108B200006291DD023E00000100100207372635C51 -:108B30006C6C5F736C6176652E6300002801002009 -:108B400080210020A821002089070000CB07000019 -:108B5000D1070000686940300481447702204DE06D -:108B60002030C17C0420FFF7ABFE002815D06869D7 -:108B70002030C07C801E16287ED2010079440979FD -:108B800049188F449B9B9B1C9B9B9B979B1E9B9B6D -:108B90009B243E9B9B9B9B9B9B9068695621095CF9 -:108BA000C90702D0C030C472AEE00C20FFF7A7FEA8 -:108BB000686901224030817D11438175A4E007205E -:108BC0001CE0FBF7FAFE00286CD00B2016E0F3F750 -:108BD00050FA0C2866D368690821B030F3F74AFAD6 -:108BE000002806D0686904218430F3F743FA00288E -:108BF00003D1F4A1F74802F062FA0420FFF77FFEE8 -:108C000082E068698446C030807A042802D0052852 -:108C100039D079E06046E030007D002874D1EE491B -:108C20006046102600230822D8306944F51A2D1812 -:108C3000203DEF7F4F70AD7F8D70891C521E9B1CB5 -:108C4000002AF3D103A86346102608210330A83375 -:108C5000B51AED18203DEF7F4770AD7F8570801C01 -:108C6000491E921C0029F3D16846F9F716FB08AF9C -:108C70004ECFDA4D686900E020E070304EC005202C -:108C8000FFF73DFE0BE060464030017D002903D038 -:108C900001214177022000E00D20FFF730FE6869D6 -:108CA000C030847230E00620FFF729FE686940304A -:108CB000847329E00920FFF722FE25E06869CA21B4 -:108CC000095C002920D0062906D02030C17C002074 -:108CD000FFF7F6FD002817D068690146C0318A7A8F -:108CE000072A11D213007B441B79DB189F440C0C1C -:108CF0000C0C0C0C03004030807DC20700D154E7FF -:108D0000C043800700D18C72B44D2879002868696F -:108D100002D08030048303E08030018B491C018342 -:108D20006879C007686904D0A4210C54403084805D -:108D300003E040308188491C8180E879002806D012 -:108D40006969A0310879022806D8401C0871686951 -:108D5000A0300079022806D9686901468030048372 -:108D60004483A0310C7168692030C17C0020FFF77A -:108D7000A7FD002804D168692030C07C07284CD1A9 -:108D800068690146C0318A7A062A46D0C97A06291E -:108D900043D03621095C02293FD1A0300079002858 -:108DA0003BD1FBF7B8FC002837D0FBF78CFD00283F -:108DB00033D06869014680314A8A012A2DD90122BF -:108DC0004A77024640329688D288931E9E4201DB43 -:108DD000012302E0921B521E93B20A8BAE89B2426B -:108DE00001D3012202E0B21A521C92B2934200D97E -:108DF0001346012B00D14C77C0300278002A10D0E6 -:108E0000498B4088814201D3012102E0401A401C75 -:108E100081B28B4205D90B4603E06869012380309B -:108E200044776A69118D1646C81883B2104680309F -:108E300083822036B77D002F25D0012F23D0022F2B -:108E40000CD0032F0AD05FA1654802F038F9687989 -:108E5000C006686919D58030C4841BE0F67C032EF7 -:108E600009D0082E0FD04032D1889288891A891EE5 -:108E700059180182EBE740329688032E03D3D2883B -:108E80008918491CF5E70382E1E78030C18CC28A6A -:108E90008918C18468690246C0329179002906D0D8 -:108EA0000146403196230E891B5AF3180B81697ACB -:108EB0000426002913D002463D214032917001461C -:108EC0002031CC748C75012151708030807F002856 -:108ED00070D0297000210220FAF7CFF85EE0014639 -:108EE0002031CB7C042B48D02B7A002B1ED05A0784 -:108EF00001D4DA0604D51E2240308270CE743CE0E4 -:108F00001A0704D53D2240308270CE7435E0D80770 -:108F100005D1980703D42BA1324802F0D0F8686934 -:108F20002A21422211542030C67426E04030837B2F -:108F3000002B05D047897B1C438183899F420FD238 -:108F4000D37A062B02D0927A062A05D1038A5A1CBC -:108F500002828289934203D20389C288934203D357 -:108F600022228270CE7408E08B7D002B23D0838870 -:108F700093423CD308228270CE7468694122014634 -:108F80002031CC748C75012111548030807F0028F1 -:108F90002AD0297000210220FAF76FF8F9F7F8FFBC -:108FA00000282DD068690146FF300130827A002AFE -:108FB00022D025E018E08288062A18D33E2282704B -:108FC000CE74DAE77372635C6C6C5F736C617665A8 -:108FD0002E63000029060000FFFFFFFF10010020A4 -:108FE0005A0800004302000000210320D4E70120BA -:108FF000287000210846CFE74988818101218172CC -:109000006869803084770DB0F0BDF8B50C4617461E -:109010006946FAF702FB002801D00020F8BD00984D -:109020000146E030027AFE4E0025002A17D0002FBC -:109030007DD1657007212170007A00280DD07169FB -:10904000E8204D8445540A22A01CEA3101F0ADFE0F -:109050000098E030007A0028F1D1A57067E0027D29 -:10906000002A2AD0002F62D1017D0D2920D20A00CA -:109070007A441279921897441B1B1B1B1B1B1B1B4A -:109080001B1B1B0F060065700C212170817DA170D8 -:1090900071694988A18009E065700B212170817D8B -:1090A000A17071694988A180817EA17105753EE03A -:1090B000DC49DD4802F003F839E0027F002A15D0D0 -:1090C000002F34D16570082222707269FF315288F6 -:1090D000628001310A88A2804A88E2808A882281DF -:1090E000CA8862810989A181057720E0FF310131B9 -:1090F000887A002808D0002F19D1657011202070BF -:10910000888960808D7212E0887B002886D0002FCD -:109110000DD1657012202070887B002807D08D73D8 -:10912000088A6080488AA080887B0028F7D10120C7 -:10913000F8BDBB480078012801D00C207047002002 -:10914000704770B5B64C05462078002803D0B54965 -:10915000B64801F0B4FF00202561A0720120207004 -:109160002078012803D0AF49B14801F0A8FF70BDB5 -:10917000F8B5AB4D2978012901D00C20F8BD0126A6 -:10918000686180308677807AFBF753FA00282ED00A -:1091900068698030807AFBF7A3FB002827D06869D4 -:1091A0008030807AFBF718FB002820D06869803077 -:1091B000807AFBF754FB002819D0F7F7D6F86869D6 -:1091C00000248030408A002825D09A48FBF728FBED -:1091D000002820D06869C621095C00291BD02030F6 -:1091E000C17C0120FFF76CFB002802D013E01220A5 -:1091F000F8BD68692030C17C0420FFF761FB0028BE -:1092000009D168694030048144770220FFF777FB79 -:109210006869803044776869E821095C002905D1D4 -:10922000418CC288914201D9A98101E0C188A981FC -:1092300001468031CA8A521E93B20A8BD21892B26A -:109240000A830F7F002F02D04C830C7702E04F8BF4 -:10925000FF184F8305464035AF88FF18AF804D8A11 -:10926000012D01D86D1C4D82002B01D0A4231C546C -:109270002030C07C6A4D042817D0487F002816D0C3 -:10928000A889824213D2FBF746FA00280FD06869FA -:109290000146C0300278002A09D08031498B4088CD -:1092A000814204D3AC70EE7003E0AE7001E0AC70AC -:1092B000EC7068699D210C543321095C062901D0AA -:1092C000072917D1CC21028D095A511A09B2002958 -:1092D00010DB0146CE310A3002F00BF801220221E8 -:1092E0006869FAF7D2FE6869CB210C5433210C541B -:1092F000403086774A4D962168690A5A811C283089 -:10930000FAF76AFFA87800284DD16869C021095C86 -:10931000002901D0803044830120F6F7EAFD404D5A -:1093200068691330F6F7B3FF68690F30F6F7F1FE9E -:109330000120F7F717F8686901462030027E002AFD -:1093400002D1C07D002806D07031ACC93A48ACC00B -:109350003A4801F0BDFFF7F701F801210846F6F79A -:1093600005FF2F4D68698030006AF7F711F834481F -:10937000FBF7C9FA002801D06C7002E06E7031482A -:10938000E86168692030007E002802D068780028F3 -:1093900016D0E869F6F7F9FFF7F78FFB68694030F8 -:1093A0000078F6F7C8FE1E4802214471C47184712A -:1093B0000472447204710170F6F7E2FF0020F8BDF8 -:1093C0002048F6F7E2FF1C4806766A69916ED26E75 -:1093D000426101611B4AE969F7F73DFB0120F7F79C -:1093E00049FBDBE710B50E4C2078022801D00C2099 -:1093F00010BDA078002803D00020FFF71AFB30E052 -:10940000F6F7B3FF01210020F7F73AF804202070A7 -:10941000606920300079012801D1F7F718F813E0CE -:1094200010010020C48F0100BE0800000E090000DA -:109430001909000028010020A8210020C1210020D6 -:109440002C01002080210020A07A002809D00128CA -:1094500007D0022807D0032805D0FD49FD4801F0B8 -:109460002EFE002010BDE9F7D3FDFAE7FA49887215 -:109470007047F8B5F84C2078032803D0F449F74832 -:1094800001F01DFE616901252031887A002806D08F -:10949000002088720D73A07904221043A071A06986 -:1094A0000278D243920724D1C97A002921D1FAF750 -:1094B0005EFC042816D0052802D00B2812D10DE03E -:1094C000616900208866C866382045547031CCC96F -:1094D000E348CCC0E34801F0FBFE03E061690020F3 -:1094E00020310876606902212030C572A0790843D6 -:1094F000A071A0690078C00606D4E0690078C006B3 -:1095000002D4E07900280CD06078002809D1A07935 -:10951000002806D1F9F72AFD002802D0207A002879 -:1095200003D00120FFF785FA1DE0CF48FBF7EBF9E8 -:10953000002802D00020607002E06570CB48E06136 -:1095400060692030007E002802D0607800281BD09F -:10955000E069F6F71AFFF7F7B0FA01210020F6F7F5 -:109560008FFF04202070207801280CD0A07A0028DA -:1095700009D0012807D0022818D0032816D0B449F2 -:10958000BB4801F09CFDF8BDB848F6F7FEFEB448B4 -:1095900005766269916ED26E42610161B34AE169FA -:1095A000F7F759FA0120F7F765FAD6E70120F7F740 -:1095B0001DF8F8BDF8B5A84D04462878042803D056 -:1095C000A349AC4801F07BFDA34A102751793943E8 -:1095D0005171002C7ED0F7F788FA0125002814D1AC -:1095E0009D48416920310A7E002A0ED0C269537815 -:1095F000DB060AD01278C97B1207D20F8A4204D147 -:1096000045720120FFF715FA3EE1934CE0780028FF -:109610001ED0E0694178C9061AD10078C00617D477 -:1096200060692030007901287ED1F6F707FF616973 -:10963000881C2831FAF7C0FE002875D06169C81D62 -:109640004A88F93002822031097C81748573FBE0FD -:10965000606920300079012811D1F6F7EFFE6169C9 -:10966000881C2831FAF7A8FE002808D06069C11DBF -:109670004288F9310A822030007C88748D73E06959 -:10968000002600784007C10F60692030827B91423C -:1096900042D0407B00283BD002280FD1FBF700F8D6 -:1096A000002803D16A49744801F009FD626900236A -:1096B000106E516E401C5941516610666069203031 -:1096C0004673017B012903D10673A1793943A17146 -:1096D000C17A00E0A1E0012914D1C672A079082165 -:1096E0000843A071FBF7DDF8002803D1584963480F -:1096F00001F0E5FC62690023106E516E401C594177 -:109700005166106660692030817B01292ED08573F7 -:1097100060790821084360714F49C8694969037835 -:109720001A07D40F203100E08EE0CA7B94420CD19E -:109730009B07494C9B0F012B40D0022B3ED0032BA3 -:1097400016D0207A042108432072434841792943E6 -:109750004171C6718179090704D541692031C97CFD -:10976000032971D0007A00286ED18BE08673CFE791 -:109770006378002BE9D18D72A3792B43A371012A61 -:109780000CD0CD73FAF7F3FA062809D00B28DCD1F8 -:10979000606937210E5440300575D6E7CE73F1E786 -:1097A00061690020086648663720455470319CC9BD -:1097B0002B489CC0093001F08BFDC6E74078C306FA -:1097C00025D061780029C0D1C006C00E1B281BD847 -:1097D0006079042108436071FBF7BCF8002803D1CD -:1097E0001B49274801F06BFC60690023826EC16E43 -:1097F000521C59418266C1662030C17B012901D0CB -:10980000C573A2E7C673A0E7207A38439CE7012A14 -:1098100001D0CD7399E7CE7397E70F480222114329 -:109820004171C179491CC9B2C17101290CD8406983 -:109830002030007E002825D00C484078C106C90E93 -:1098400005291FD2C0061DD00120FFF7F2F81BE04A -:10985000C48F0100EE09000010010020170A00006B -:10986000A8210020C12100202C01002080210020FF -:109870006A0A0000820A0000FB06000013070000CD -:109880005E070000FEF74EFFFB48017801290CD06F -:10989000807A002809D0012808D0022805D00328A2 -:1098A00004D0F649F64801F00AFCF8BD0120F6F7AD -:1098B0009DFEF8BD10B5F0480078042803D0EF49AC -:1098C000F04801F0FCFB0120FFF7B3F810BDF8B53C -:1098D000E94C0025A0790007002831DA207A002819 -:1098E0002ED160692030C07C801E132828D2010050 -:1098F0007944097949188F442309232323232323F7 -:10990000232323232323232323231C0060690146CD -:1099100040318D734A7F002A05D006228A700421C7 -:109920002030C1740CE016228A7004212030C174EA -:1099300006E0616908464031CD748D732030C574EE -:10994000607940070BD560692030C17C0520FEF7A7 -:10995000B7FF002803D0207A08210843207200F0C6 -:1099600035F9A27901265007002822DA207A00284A -:109970001FD16069014620310F46C97C891E072925 -:1099800017D20B007B441B79DB189F440312121281 -:109990000C120F00034640339D73C030017A99705A -:1099A0000420F87405E0C030C67202E00221C03025 -:1099B000C17290070327002849DA207A002846D18F -:1099C00060692030C17C0120FEF77AFF00283ED17B -:1099D000A069C0780E287CD2010079440979491821 -:1099E0008F44A5A506A53646620AA517A526955457 -:1099F00060692030C7749EE060692030C07C052813 -:109A000003D09E49A04801F05AFB60692030C5741C -:109A100091E060692030C07C092803D097499B48B9 -:109A200001F04DFB60694E210D542030C57482E079 -:109A300060692030C07C0B2803D09049944801F025 -:109A40003EFB606953210E540C212030C17472E03A -:109A500060692030C07C0F2803D088498D4801F010 -:109A60002EFB606953210E5410212030C17462E036 -:109A700060692030C07C102803D08049864801F0FE -:109A80001EFB606912212030C17454E060692030EF -:109A9000C07C102803D07949804801F010FB606930 -:109AA00014212030C17446E060692030C07C172842 -:109AB00003D072497A4801F002FB606901464030E8 -:109AC000C5748573E031087D002805D06B49754861 -:109AD00000E02CE001F0F3FA6069014640310A7DB4 -:109AE000002A08D00D754288F8210A520146E0315B -:109AF0008D750C2207E04188F82211520146E031B1 -:109B00008D758E760B220A752030C57413E060695E -:109B10000146C030827A062A04D14031897D890706 -:109B200000D58572C17A062905D1C57203E0534973 -:109B30005D4801F0C4FAA079C00613D5207A002848 -:109B400010D160692030C17C07290BD20A007A4409 -:109B500012799218974406060606060603000721A6 -:109B6000C174F8BD60693321095C0829F9D1014647 -:109B7000028DC0318B89521C9A42F2D1227A002A7E -:109B8000EFD14A8A83889A4207D18B8AC488A3423C -:109B900003D1CB8A0489A34208D043888B85CA8528 -:109BA0008A8A0A86CA8A4A86E8210E540122114608 -:109BB000314CFAF76AFA00210420F9F75EFA60697D -:109BC000CB210D542030C5748775F8BD30B52A4CB3 -:109BD00083B0A079C0076BD0207A002868D1606973 -:109BE0002030C17C0120FEF76BFE00287ED1E069A9 -:109BF000C0780D287BD201007944097949188F4437 -:109C0000581506DF7676FD75FC76B6D0FB00E06968 -:109C1000FAF725F96169C8225054022233204254D0 -:109C200000204031488101208873A3E16069203021 -:109C3000C17C0020FEF744FE0028207A02D00028D4 -:109C400054D103E001210843207293E1E069FAF75F -:109C5000FFF86169CC2250520A8D801A134A00B273 -:109C600090427DDC00287BDDCE31E069FAF7E5F833 -:109C7000606906212030A1E010010020C48F01009E -:109C8000E40A0000EC0A0000150500001B050000B6 -:109C9000220500002A0500003105000037050000FC -:109CA000490500004E050000AB050000FE7F0000E6 -:109CB00068E160692030C17C0020FEF701FE0028C9 -:109CC00003D1207A012108432072207A00280DD187 -:109CD000E069FAF77FF8002831D0E069FAF775F803 -:109CE0006169CC2250520A8D801A01E0AEE029E170 -:109CF000A54A00B2904233DC002831DDE069FAF772 -:109D00005EF86169C0318873E069FAF751F86169FA -:109D1000C0310882E069FAF730F86169C0314882E1 -:109D2000E069FAF733F86169C0318882E069FAF7CF -:109D300036F86169D62250520820203197E06069D8 -:109D40002030C17C0020FEF7BBFD002803D1207A23 -:109D5000012108432072207A002877D101E1FFE732 -:109D600028204222505404202031C87402E1606946 -:109D70002030C17C0020FEF7A3FD002803D1207A0B -:109D8000012108432072207A00285FD160690022F7 -:109D9000014640304281012282730B202031C87479 -:109DA000E8E060692030C17C0C2903D0217A0222CE -:109DB00011432172217A002948D10D21C174D9E0C3 -:109DC00060692030C17C0020FEF77AFD002808D1B0 -:109DD00060694030007D002803D1207A01210843CA -:109DE0002072207A002831D160690022014640307B -:109DF00042810125857302E03BE075E027E0A83150 -:109E0000E069FAF749F86169E0698031FAF755F8D5 -:109E10006069E030007F002803D05C495C4801F0B5 -:109E20004EF96169FE204A884252FF310131E069F2 -:109E3000FAF71CF86169E069FF310931FAF722F895 -:109E40006069FC210D540F212030C17492E06069DB -:109E500001462031CA7C122A03D0227A02231A43F7 -:109E60002272227A002A6CD1403082731720C87483 -:109E700080E060690146C031CA7A002A06D0897A3A -:109E8000062903D0217A012211432172217A002967 -:109E900070D14030807D800715D4E069FAF73EF834 -:109EA00061694031C875E069FAF73AF86169403193 -:109EB0000883E069FAF739F8616902224031488382 -:109EC000887D1043887560690146C0318A7A062A08 -:109ED00001D100228A724030827DD2074AD1062207 -:109EE000CA720021018245E060692030C17C0020F7 -:109EF000FEF7E6FC002803D1207A012108432072F6 -:109F0000207A002836D16946E069FAF71EF86846DB -:109F10000078C107C90F6846017004D0606901214B -:109F20004030017703E060690021403001776069CB -:109F300000220146403042810122827309202031F3 -:109F4000C87417E060692030C17C0020FEF7B8FCBF -:109F5000002803D1207A012108432072207A0028AA -:109F600008D1E069F9F703FF61698922505405209F -:109F70002031C87461690023886ECA6E401C5A4142 -:109F8000CA66886603B030BDFE7F0000C48F010042 -:109F90000E040000474909680160002070474549E8 -:109FA0000860002070470121434A002803D001289F -:109FB00003D042487047916300E0D16300207047AE -:109FC0003F49012008603D48801C704704223D4BFA -:109FD0003B49002805D05A600869012210430861F6 -:109FE00008E008694008400008619A603249002092 -:109FF000C03188600020704731490622002808D00F -:10A00000012809D002280DD003280FD02B48401C6E -:10A0100070470869904302E008699043801C08611A -:10A020000020704708699043001DF8E70869104355 -:10A03000F5E723494A6A02434A62002070472049F3 -:10A040004A6A82434A62002070471D49496A01609A -:10A05000002070471A49CA690243CA61002070474C -:10A060001749CA698243CA61002070471449C96907 -:10A070000160002070471249024600204031002A4A -:10A0800003D0012A01D0072070478A6370470D4929 -:10A090000420886008490020C03188600A480168AF -:10A0A0008022090A09021143016008490120086061 -:10A0B0007047000000040040400000400420000001 -:10A0C000000500400003004000E400E000E100E083 -:10A0D0008107C90E002808DA0007000F0838800839 -:10A0E000814A80008018C06904E080087F4A8000AF -:10A0F00080180068C8400006800F704710B50446FD -:10A1000000F0DBF8002813D02046FFF7E1FFC0B2D3 -:10A1100000F0E1F800280DD07549E2060B78D20E68 -:10A1200001209040002B08D04A681043486006E0A8 -:10A13000704810BD6F48401C10BD6F49086000207A -:10A1400010BD10B5044600F0B8F800280BD06849DF -:10A15000E2060B78D20E01209040002B05D04A6811 -:10A1600082434A6004E0634810BD6349803108605F -:10A17000002010BD70B50D46044600F09EF8002882 -:10A180000BD05E480068E206D20E012191400840E3 -:10A1900000D001202860002070BD564870BD10B569 -:10A1A000044600F08AF8002807D0E106C90E012015 -:10A1B000884052490860002010BD4E4810BD10B5BF -:10A1C000044600F07AF8002808D0E106C90E012004 -:10A1D00088404A4980310860002010BD454810BDC4 -:10A1E00070B50D46044600F068F8002819D02846DE -:10A1F00000F071F8002816D0A007C10EFF228A4097 -:10A20000A807000E8840002C10DA2107090F083932 -:10A210008B0835499B005B18D96991430143D9618B -:10A220000CE0344870BD3348401C70BDA3082F4972 -:10A230009B005B181968914301431960002070BDB1 -:10A2400070B50C46054600F038F8002805D02846C1 -:10A25000FFF73EFF2070002070BD264870BDBFF3A1 -:10A260004F8F21492648C860BFF34F8FFEE770B576 -:10A270001F4C05462178012000290ED1207072B6AE -:10A2800000F0F4F81C4E803631688143616000F0C4 -:10A29000EDF8C043306062B600202870002070BD29 -:10A2A00013490A78002A06D0002804D1124A4868C7 -:10A2B0001060002008700020704710B50446202868 -:10A2C00007DA00F0D3F80121A140084201D10120B2 -:10A2D00010BD002010BD012803D0032801D00020AC -:10A2E000704701207047000000ED00E000E400E04E -:10A2F000300100200120000000E100E000E200E069 -:10A300000400FA05F8B50446800700250126002858 -:10A3100004DA5848C563C66302208443E00404D5C8 -:10A320005548C563C66380148443600003D5534811 -:10A33000456080058443E00504D55148C563C66384 -:10A3400080158443A00404D54E48C563C6634014F9 -:10A35000844360042704C00FF90F884203D04AA148 -:10A36000612000F0ACFEB80F0AD04C49CD634C48D8 -:10A37000C563C563CE63C663C6630320800384439D -:10A3800020050AD5474FFD632F20E6F70DFFFE633A -:10A390002F20E6F709FFF8148443F8F721F8424824 -:10A3A000044203D038A18D2000F089FEF8BDF0B53D -:10A3B00000210A46FF230446CC40E4072AD04CB2D1 -:10A3C000E606F60E0125B540384E3560384E35604C -:10A3D000002C11DA25072D0F083DAE08354DB600CB -:10A3E0007719FD69A407E60E1C46B440A543144640 -:10A3F000B4402543FD610DE0A6082F4DB600761947 -:10A400003568A407E70E1C46BC40A5431446BC4073 -:10A4100025433560491C2029CDD3F0BD70B5274CAC -:10A420000D462060FFF76EFF2068FFF7C0FF28464B -:10A43000E8F7AEF8F7F7E0FEF1F7D2FDF7F7D0FF57 -:10A44000FFF725FEE7F72AFF00F06AF870BD10B5A8 -:10A450001A4C2068FFF756FF2068FFF7A8FFF7F7B0 -:10A46000BFFFE8F70FF90020206010BD1348006817 -:10A4700070470000C01F0040C0CF004000E5014011 -:10A48000C08F0040C0DF00407372635C736F635F16 -:10A49000636F6E6669672E6300000000C0EF0040C6 -:10A4A000C0FF0040C0BF0040FEFF0FFC80E100E0A5 -:10A4B00080E200E000ED00E000E400E03801002070 -:10A4C00070B5002402460D4620462146002A1ED0C3 -:10A4D000012A04D0022A04D0032A1ED103E001205D -:10A4E00002E0022013E003202B0000F009FF071612 -:10A4F0000507090B0D0F1600012108E0022106E0F7 -:10A50000032104E0042102E0052100E00621F2F726 -:10A5100094FA002801D0204670BD0724FBE7000014 -:10A52000B348002101708170704770B5B14D0123AF -:10A530006B60B14B1C68002CFCD0002407E00E6857 -:10A5400006601E68002EFCD0001D091D641C94428C -:10A55000F5D30020686018680028FCD070BD70B585 -:10A56000A34C0E466178884203D0A4A16F2000F06E -:10A57000A6FD0325330000F0C3FE09520624245231 -:10A580005252524952002078022803D09BA17320D6 -:10A5900000F095FD2570A078022802D0012804D093 -:10A5A00008E0A068E8F70EFD04E02046083007C880 -:10A5B000FFF7BBFF0020A070F2F7E0F90420207045 -:10A5C00070BDF2F790FA01466068F3F7A5FC064605 -:10A5D0002078022803D089A1872000F070FD8B4AE3 -:10A5E0008B498C48964205D86269032A02D2521CD4 -:10A5F000626102E0864207D84D71801BC8608449C1 -:10A600006078F2F7E7FE70BD032003E0A078002831 -:10A61000FAD10220F2F7BAF800F0E1F870BD77A1A4 -:10A62000B12000F04CFD70BD70B50546F2F75BFA45 -:10A630006F4C60602078012803D070A1B82000F032 -:10A640003EFD73490220087000220A718D600422C9 -:10A650004A71704ACA6020706078F2F7BBFE70BD24 -:10A6600010B5634CA078002802D12078002801D0D2 -:10A67000112010BD6848F2F7C7F9607060780028B3 -:10A6800004D0012020700020606110BD032010BDA7 -:10A6900010B50124020B64040121604BA04202D2D8 -:10A6A0009140186802E0203A58689140084000D074 -:10A6B000012010BDF8B50E46910005464F1914460D -:10A6C0003F1F0091E8F78FFC009980028919091F4C -:10A6D000B14201D2012200E00022002C03D0FF2170 -:10A6E00001318C4201D90920F8BD4D498D4219D361 -:10A6F000AF4217D3854205D2874203D22846304362 -:10A70000800701D01020F8BD8E420BD3002A09D15A -:10A710002846FFF7BDFF002804D13846FFF7B8FFF1 -:10A72000002801D00F20F8BD3E483F49006888420C -:10A7300005D0224631462846FFF7F7FE0FE0FFF727 -:10A740008FFF0028EFD12A480121C660856004618F -:10A7500081702046302148431830FFF765FF002004 -:10A76000F8BD10B504462E48800A84420BD3E8F7A2 -:10A770003AFCA04201D8102010BDA0020446FFF709 -:10A7800087FF002801D00F2010BD26482649006809 -:10A79000884203D02046E8F715FC0AE0FFF760FF87 -:10A7A0000028F1D112480221846081701F48FFF710 -:10A7B0003BFF002010BD1A48010B01208840401EBD -:10A7C000704700B50B460246FFF7F5FF104201D077 -:10A7D0000F2000BD114802604360002000BD10B58D -:10A7E000034C6078F2F764F900202070A07010BD6F -:10A7F0003C01002000E5014000E401407372635C0D -:10A80000736F635F666C6173682E63003075000060 -:10A81000D0210020D0FB01005FA501000006004010 -:10A8200000D0010064000020BEBAFECA3A56000003 -:10A83000F74805218170002101704170C17081606D -:10A84000704710B5F3490A78022A07D0CA68101871 -:10A85000C860C8689638F3F718FB10BD8A681018EE -:10A8600088608868F6E70378EB49EC4A002B02D051 -:10A87000012B10D014E00379002B01D0012B0FD154 -:10A880004379002B01D0012B0AD18368643B8B42B2 -:10A8900006D2C06810E00379002B03D0012B01D051 -:10A8A000002070474379002B01D0012BF8D1C368F9 -:10A8B000643B8B42F4D280689042F1D8012070470B -:10A8C000F8B504460226F2F76DFF0068002803D0B1 -:10A8D000D3A1BD2000F0F3FB0127CD4D002C08D003 -:10A8E0002078002817D0012805D0022811D003288D -:10A8F00013D02F710DE06068C82808D3F3F73AFB36 -:10A90000002804D06068FFF79CFF012603E00026C2 -:10A9100001E000F0F9F93046F8BD28780028F8D1B8 -:10A920006068FFF7A0FF0028E3D060680078002887 -:10A9300026D0A878042803D0B9A1F72000F0BFFBE7 -:10A94000B44F0020387060680079012800D00020E2 -:10A95000387160684079002837D0042078716068C9 -:10A960008168E868F2F751FBB8606068C0689630AB -:10A97000F8600320A870A749E878F2F72BFDC8E734 -:10A98000A4480221017061680979012919D00021C8 -:10A99000017161684979002915D00421417161680C -:10A9A0008968963181606168C968C160C068984CE7 -:10A9B00014346060F2F797F820606F700220A8707E -:10A9C000A7E70321E4E70321E8E70320C6E7F8B59A -:10A9D0008F4C0D46E178884204D0FF2090A11930B9 -:10A9E00000F06DFB28468A4F00250126143703002E -:10A9F00000F086FC090612375A7C8D97C4A0C4006B -:10AA0000A078032807D0A078022804D0FF2084A1D2 -:10AA10001D3000F054FBF8BDA078032807D0A078C3 -:10AA2000022804D0FF207EA1213000F048FB042042 -:10AA3000A07025712078002810D1FFF702FFE07880 -:10AA4000F2F70AFBE0607D49886A7D4A0240226194 -:10AA50007B4AD24310408862002050E000F054F955 -:10AA6000F8BDA078032807D0A078022804D0FF20E2 -:10AA70006BA1423000F023FB2078002802D000F0C8 -:10AA80004FF9F8BDA07803281FD104202AE0091A45 -:10AA90006048C1600146E078F2F79CFCF8BD0420F4 -:10AAA000F1F774FEA570F8BDA078032807D0A07850 -:10AAB000022804D0FF205AA1633000F000FB207868 -:10AAC0000028DCD1A07803280BD0F2F70CF801465F -:10AAD0003868F3F721FA0028E1DB79688142DEDB90 -:10AAE000D5E70520F1F752FEA670F8BDA07804283E -:10AAF00004D0FF204AA1843000F0E1FA0220A168CE -:10AB00008847FFF7DDFEFF260546BD3642E0A07808 -:10AB1000042804D0FF2042A1893000F0D0FA01209F -:10AB2000EDE7A078042899D0FF203DA18E3000F0F9 -:10AB3000C6FA93E7A07804280AD06078002802D0EB -:10AB4000A078022804D0FF2035A1933000F0B7FA96 -:10AB50002078002893D12079002804D00620F1F72E -:10AB600015FE2571C0E76078002805D02949E078F6 -:10AB7000F2F730FC6570F8BD0720B3E7FF2028A18D -:10AB8000AE3046E7002D0AD0012D06D024A1304674 -:10AB900000F095FA022DF5D1F8BD042000E0032065 -:10ABA000A1688847FFF78CFE0546F3E770B50500FE -:10ABB00005D0174CA078052803D0112070BD1020B7 -:10ABC00070BD2048F1F720FFE070E078002803D046 -:10ABD000A5600020A07070BD032070BD10B50C48AA -:10ABE0000178002901D0112010BD817805292BD0D2 -:10ABF000817801292AD08178002927D0012101708C -:10AC00008178012922D0807800281FD020E0000020 -:10AC100054010020E02100203D860100FF1FA10714 -:10AC20007372635C736F635F726164696F5F746991 -:10AC30006D65736C6F742E630000000000050040AA -:10AC400002810000CFA901000F2010BD00F068F8BC -:10AC5000002010BDF8B5394E0446B078002801D068 -:10AC600001280DD1002C0DD02046FFF7FCFD002857 -:10AC70000AD02078324D002808D0B078012823D09F -:10AC80000F20F8BD1020F8BD0720F8BD02272F7057 -:10AC90002079012814D0002028716079002811D073 -:10ACA00004206871A0689630A860E068E860E868F1 -:10ACB000224C14346060F1F716FF2060B77019E081 -:10ACC0000320E9E70320ECE7002028702079012821 -:10ACD00016D0002028716079002813D004206871F4 -:10ACE000A168F068F2F791F9A860E0689630E86032 -:10ACF0000320B0701249F078F2F76CFB0020F8BD29 -:10AD00000320E7E70320EAE710B50E48816A0E4A00 -:10AD100011400A4A126911438162F1F72FFE10BDFA -:10AD200010B5064CE078F1F7C3FE0820F1F72EFDD0 -:10AD30000520A07000202070607010BD540100201C -:10AD4000E021002000050040FD7EFFFF70477047B6 -:10AD5000034610B50B439B070FD1042A0DD308C837 -:10AD600010C9121FA342F8D018BA21BA884201D9DB -:10AD7000012010BD0020C04310BD002A03D0D3071E -:10AD800003D0521C07E0002010BD03780C78401C53 -:10AD9000491C1B1B07D103780C78401C491C1B1B4A -:10ADA00001D1921EF1D1184610BDF8B5042A2CD35A -:10ADB000830712D00B78491C0370401C521E830776 -:10ADC0000BD00B78491C0370401C521E830704D023 -:10ADD0000B78491C0370401C521E8B079B0F05D03B -:10ADE000C91ADF002023DE1B08C90AE0E6F7ECF9E8 -:10ADF000F8BD1D4608C9FD401C46B4402C4310C098 -:10AE0000121F042AF5D2F308C91A521EF0D40B7887 -:10AE1000491C0370401C521EEAD40B78491C037075 -:10AE2000401C012AE4D409780170F8BD01E004C097 -:10AE3000091F0429FBD28B0701D50280801CC9079A -:10AE400000D00270704700290BD0C30702D00270F7 -:10AE5000401C491E022904D3830702D50280801CAE -:10AE6000891EE3E70022EEE70022DFE7020A08700E -:10AE70004A70020C8A70020ECA70704700220309E1 -:10AE80008B4273D3030A8B4258D3030B8B423CD3C0 -:10AE9000030C8B4221D312E003460B437FD40022E4 -:10AEA00043088B4274D303098B425FD3030A8B425E -:10AEB00044D3030B8B4228D3030C8B420DD3FF22C8 -:10AEC000090212BA030C8B4202D31212090265D096 -:10AED000030B8B4219D300E0090AC30B8B4201D349 -:10AEE000CB03C01A5241830B8B4201D38B03C01A90 -:10AEF0005241430B8B4201D34B03C01A5241030B07 -:10AF00008B4201D30B03C01A5241C30A8B4201D3B7 -:10AF1000CB02C01A5241830A8B4201D38B02C01A62 -:10AF20005241430A8B4201D34B02C01A5241030AD9 -:10AF30008B4201D30B02C01A5241CDD2C3098B42BE -:10AF400001D3CB01C01A524183098B4201D38B013B -:10AF5000C01A524143098B4201D34B01C01A5241DE -:10AF600003098B4201D30B01C01A5241C3088B4223 -:10AF700001D3CB00C01A524183088B4201D38B000E -:10AF8000C01A524143088B4201D34B00C01A5241B0 -:10AF9000411A00D201465241104670475DE0CA0F87 -:10AFA00000D04942031000D34042534000229C4647 -:10AFB00003098B422DD3030A8B4212D3FC22890151 -:10AFC00012BA030A8B420CD3890192118B4208D327 -:10AFD000890192118B4204D389013AD0921100E089 -:10AFE0008909C3098B4201D3CB01C01A524183099D -:10AFF0008B4201D38B01C01A524143098B4201D3CA -:10B000004B01C01A524103098B4201D30B01C01AF4 -:10B010005241C3088B4201D3CB00C01A524183086E -:10B020008B4201D38B00C01A5241D9D243088B42C4 -:10B0300001D34B00C01A5241411A00D20146634667 -:10B0400052415B10104601D34042002B00D54942CB -:10B05000704763465B1000D3404201B50020C046F4 -:10B06000C04602BD70477047704710B500F058F8F1 -:10B0700010BD30B58C180278401C13071B0F01D18E -:10B080000378401C120906D10278401C03E00578C1 -:10B09000401C0D70491C5B1EF9D101E00B70491C6E -:10B0A000521EFBD1A142E6D3002030BD012308CBC4 -:10B0B000134B1860134B1960134B1A607047134AF7 -:10B0C000134B13607246053AF0E7114A0F4B1B68A9 -:10B0D0009A420ED10D4B0020186001980D4B04B51B -:10B0E00098470CBC9E460246029800990A4B1B6882 -:10B0F000184706980599094B1B68DB68184700003C -:10B10000780100207C0100208001002070010020D7 -:10B11000EFBEADDE4D2F000098000020040000209F -:10B120001D481E497047FFF7FBFFE6F707F800BD13 -:10B1300001200007C06AC0B2FF2804D1184819498D -:10B140000968884202D0184818490160184819490E -:10B150000968884203D1184A13605B68184700BD2C -:10B1600020BFFDE712481349096888420ED1134BEE -:10B1700018680B498842F3D080F308881049884248 -:10B1800004DD1048026802210A4302600E4880472D -:10B190000E4880470E480047F0210020F021002093 -:10B1A000FFFFFFFF001000102C050040080000000A -:10B1B00000100000000000200400002000D001006A -:10B1C0000020002024050040632F000031B1010061 -:10B1D000ADB001001348704502D1EFF3098101E0E1 -:10B1E000EFF30881886902380078102814DB2028E2 -:10B1F00010DB2B280BDB0C4A12680C4B9A4203D154 -:10B20000602804DB0A4A1047022008607047094A98 -:10B2100010470000084A1047084A12682C3212688A -:10B2200010470000FDFFFFFF64000020BEBAFECA09 -:10B23000AD1200009D1F01001F1F0100040000202F -:10B240000D4B0E4908470E4B0C4908470D4B0B4957 -:10B2500008470D4B094908470C4B084908470C4B58 -:10B26000064908470B4B054908470B4B034908475C -:10B270000A4B024908470000B12500005122000096 -:10B28000D52B0000772A0000252A0000D7270000D0 -:10B29000B912000017140000392B000047230000EA -:10B2A0000A7802704B7843708A788270CA78C270CC -:10B2B0000B79037170470A7802704B7843708A7873 -:10B2C0008270CA78C2700B7903714A7942717047F3 -:10B2D0000A7802704B7843708A788270CA78C2709C -:10B2E0000B7903714A7942718A798271CB79C37182 -:10B2F00070470A8802804A8842800A790271704742 -:10B3000030B47446641E2578641CAB4200D21D46DE -:10B31000635D5B00E31830BC18470000FFFFFFFFD0 -:10B320000000FFFF0100030000000100000000001A -:10B330000000000000000000000000008700000086 -:10B3400000000000000000000000000000000001FC -:10B35000020304000D0E0F10000000000F69000032 -:10B360002D6B0000F56B00004F6C0000A36C00001B -:10B370000B6D000069690000216A0000AD6D0000DE -:10B38000BB790000100110013A0200001A0200000F -:10B39000040104013C00170044000E00F401FA000F -:10B3A000960064004B0032001E00140001020408E5 -:10B3B00010204080555555252627D6BE898E5555D7 -:10B3C00055D6BE898E0000007006120DB413000021 -:10B3D00014035A06A00900006004F208840D00005E -:10B3E00010B401000800002010000000041100004B -:10B3F00020B40100180000206C01000072B00100B0 -:10B4000040B40100840100206C20000020110000E5 -:10B41000024801688907FCD57047000000E200E09F -:10B4200001353601000100543720FB349B5F80B4A6 -:10B43000800010026801337F0102A029E4B1B0014D -:00000001FF diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0_softdevice.hex b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0_softdevice.hex new file mode 100644 index 00000000000..39d4e59629d --- /dev/null +++ b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s130_nrf51822_1_0_0/s130_nrf51_1.0.0_softdevice.hex @@ -0,0 +1,6861 @@ +:020000040000FA +:10000000C0070000D1060000D1000000B1060000CA +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000005107000078 +:100030000000000000000000DB000000E500000000 +:10004000EF000000F9000000030100000D010000B6 +:1000500017010000210100002B0100003501000004 +:100060003F01000049010000530100005D01000054 +:1000700067010000710100007B01000085010000A4 +:100080008F01000099010000A3010000AD010000F4 +:10009000B7010000C1010000CB010000D501000044 +:1000A000DF010000E9010000F3010000FD01000094 +:1000B00007020000110200001B02000025020000E0 +:1000C0001FB5C046C04600F0EFFA04B00FB41FBD24 +:1000D00008205A49096809580847382057490968CB +:1000E000095808473C2055490968095808474020E5 +:1000F0005249096809580847442050490968095875 +:10010000084748204D490968095808474C204B4981 +:10011000096809580847502048490968095808479C +:100120005420464909680958084758204349096836 +:10013000095808475C204149096809580847602068 +:100140003E4909680958084764203C49096809582C +:100150000847682039490968095808476C20374919 +:100160000968095808477020344909680958084740 +:100170007420324909680958084778202F490968CE +:10018000095808477C202D490968095808478020EC +:100190002A490968095808478420284909680958E4 +:1001A0000847882025490968095808478C202349B1 +:1001B00009680958084790202049096809580847E4 +:1001C00094201E4909680958084798201B49096866 +:1001D000095808479C201949096809580847A02070 +:1001E0001649096809580847A4201449096809589C +:1001F0000847A8201149096809580847AC200F4949 +:10020000096809580847B0200C4909680958084787 +:10021000B4200A49096809580847B82007490968FD +:1002200009580847BC2005490968095808470000D3 +:1002300003480449024A034B7047000000000020B5 +:10024000C0070000C00700000122D84B5A6000BF61 +:10025000D74A1268002AFBD0016000BFD44A126856 +:10026000002AFBD00022D14B5A6000BFD04A12684E +:10027000002AFBD07047F0B505460E46174600240D +:1002800006E0A200B158A2005019FFF7DDFF641C80 +:10029000BC42F6D30020F0BD0120C043C549086030 +:1002A000401048607047014601229204086890425D +:1002B00001D9102070470020FCE7F0B505460C4638 +:1002C0001646002706E028462168FFF7BDFF2D1DD2 +:1002D000241D7F1CB742F6D3F0BD70B505460C4611 +:1002E0002E460BE0304600F075F9FF2C01D80024B3 +:1002F00001E0FF3C013C012080023618002CF1D1C6 +:1003000070BD0146012212044868904201D90920BB +:100310007047A9484069401C01D10F20F8E7002030 +:10032000F6E7FEB504462068030000F037FA05043E +:100330002B4249598B00201DFFF7E3FF0546002D96 +:1003400001D02846FEBDFFF7A7FF0120C00200F044 +:1003500041F9042221469948FFF78DFF002801D07A +:100360000320EFE708222146944800F06DF90028A9 +:1003700006D1002192480068FFF766FF00F00CF9F3 +:100380000320DFE7A768E6686068019031463846D9 +:10039000FFF7A3FF324638460199FFF78EFFB20000 +:1003A0003846019900F050F9002800D1CAE703202F +:1003B000C8E700F0E3F9834800688349086041E03A +:1003C00060680190E668A0680090B200009901980A +:1003D00000F03AF90746002F00D1B3E70E20B1E74D +:1003E000201DFFF760FF0546002D01D02846A9E734 +:1003F0006068002807D1FFF74FFF0320800200F05C +:10040000E9F800F0C9F8FFF747FF0120C00200F04B +:10041000E1F8042221466948FFF72DFF002801D0AA +:1004200003208FE708222146644800F00DF90028D8 +:1004300006D1002162480068FFF706FF00F0ACF823 +:1004400003207FE700BF00207CE770B505460C461F +:10045000182D04D12068FFF764FF206002E001201E +:10046000206000BF00BF70BDF0B589B05248406940 +:1004700003905248806881000398081802900398FE +:10048000000B01900121090302984018401E000B47 +:1004900000900124002520462946019A00F0C4F866 +:1004A0000022401E91410791069001260027304608 +:1004B0003946009A00F0B8F80022401E914105919B +:1004C0000490049BDB43059AD2430698184307998E +:1004D00011430791069037490698086007984860CD +:1004E00009B0F0BD70B53448446934488568466841 +:1004F000AA003146204600F0A7F8002801D00020CD +:1005000070BD0120FCE72D484068002801D0012083 +:1005100000E000200546FFF7E5FF002807D0FFF7C1 +:10052000BBFE0320800200F055F800F035F8FFF71D +:100530009BFF002D0ED020484669204884684768FC +:1005400021463046FFF7C9FE224639463046FFF7BE +:10055000B4FE00BF00F020F810B5184844681A48EF +:100560000460204600F0DCF810BD15480068006803 +:10057000401C01D100BFFEE710480068002802D0EF +:10058000042806D101E0FFF7BEFFFFF7E5FF00BF3B +:10059000FEE700BF00BFFEE7BFF34F8F0B480C49DB +:1005A000C860BFF34F8F00BFFEE7000000E50140C9 +:1005B00000E40140000600400010001000080000A8 +:1005C000B8070000BC070000000000200400FA0586 +:1005D00000ED00E010B50146104B1A6808460223F2 +:1005E0000F4C636000BF0F4B1B68002BFBD0531CEC +:1005F00004D0904202D20A4B186101E0084B986087 +:1006000000BF084B1B68002BFBD00023044C636029 +:1006100000BF044B1B68002BFBD010BD0010001066 +:1006200000E5014000E4014010B5202A04DB01464A +:10063000203A9140002010BD914020239C1A03468F +:10064000E3401943904010BD034610B50B439B0790 +:100650000FD1042A0DD308C810C9121FA342F8D025 +:1006600018BA21BA884201D9012010BD0020C04328 +:1006700010BD002A03D0D30703D0521C07E000208E +:1006800010BD03780C78401C491C1B1B07D1037854 +:100690000C78401C491C1B1B01D1921EF1D118463D +:1006A00010BD70477047704710B500F007F810BDD7 +:1006B000014B1B68DB6818470000002019481A49E5 +:1006C0007047FFF7FBFFFFF7FBFC00BD20BFFDE716 +:1006D0001649174C24688C420BD1164B1B68994263 +:1006E0000CD1154B154A1360186810498842EDD09B +:1006F0000AE0134880F30888124B18470F4A13602A +:1007000018680A498842E1D080F308880E49884277 +:1007100004DD0E48026802210A4302605B68184744 +:100720000346DFE7C0070000C0070000FFFFFFFF30 +:10073000000C000014100010001000000000002049 +:10074000000400206B05000000200020240500406C +:100750000D48704502D1EFF3098101E0EFF3088104 +:10076000886902380078182802D1C046074A104725 +:10077000074A12682C3212681047000000B5054B7A +:10078000054A9B58984700BDFDFFFFFF4B04000042 +:1007900000000020001000000400000030B4744687 +:1007A000641E2578641CAB4204D3635D5B00E318D0 +:1007B00030BC18471D46F8E7000C00000010000090 +:10100000F0210020FDB101005D22000063B101006C +:1010100000000000000000000000000000000000D0 +:101020000000000000000000000000006DB20100A0 +:1010300000000000000000005D2200005D220000B2 +:10104000D9B20100DFB201005D2200005D22000084 +:101050005D2200005D2200005D2200005D22000094 +:10106000E5B201005D2200005D220000EBB201004C +:101070005D220000F1B20100F7B20100FDB20100F3 +:101080005D2200005D2200005D2200005D22000064 +:101090005D2200005D2200005D2200005D22000054 +:1010A00003B3010009B301005D2200005D220000CE +:1010B0005D2200005D2200005D2200005D22000034 +:1010C00000F002F81AF07BF80CA030C80838241899 +:1010D0002D18A246671EAB4654465D46AC4201D170 +:1010E0001AF06DF87E460F3E0FCCB646012633420D +:1010F00000D0FB1AA246AB46334318477CA301003D +:10110000ACA30100103A02D378C878C1FAD85207CC +:1011100001D330C830C101D504680C6070470000AD +:101120000023002400250026103A01D378C1FBD803 +:10113000520700D330C100D50B6070471FB5C046C1 +:10114000C04619F0DEFF04B00FB41FBDF0B4404636 +:10115000494652465B460FB402A0013001B506482D +:10116000004700BF01BC86460FBC804689469246B8 +:101170009B46F0BC70470000C11000008269024924 +:101180008161024810447047911100000100000085 +:1011900001B41EB400B501F000FF01B40198864609 +:1011A00001BC01B01EBD0000401E00BF00BF00BF5B +:1011B00000BF00BF00BF00BF00BF00BF00BF00BF37 +:1011C00000BFF1D17047000070B505460C461646C9 +:1011D00002E00FCC0FC5103E102EFAD2082E02D31B +:1011E00003CC03C5083E042E07D301CC01C5361F2E +:1011F00003E021782970641C6D1C761EF9D270BD45 +:101200008307FF22DB0E9A408907090E99400028C8 +:101210000BDA0007000F0838830828489B001818CD +:10122000C36993430B43C3617047830824489B0001 +:101230001B181868904308431860704710B504469F +:1012400000210120FFF7DCFF00211820FFF7D8FF65 +:1012500000210B20FFF7D4FF02211920FFF7D0FF58 +:1012600002210D20FFF7CCFF02210E20FFF7C8FF5F +:1012700002210F20FFF7C4FF0221C81FFFF7C0FFA4 +:1012800003211620FFF7BCFF03211520FFF7B8FF4D +:10129000204600F019F8002010BD6721018070473A +:1012A00010B500F020F810BD0648704710B500F0EA +:1012B00022F810BD704770477047000000ED00E055 +:1012C00000E400E003F9004370B505462D4C08200A +:1012D0002070A01CFFF7E1FF5920A080294620467E +:1012E00000F0B3FB70BD10B500F0B8FB254900203D +:1012F000891E087010BDF8B5224E0446B61E30781F +:1013000001270D46002807D0204660380B2808D852 +:10131000204600F059FF2BE0602CF9D01A480860F5 +:10132000F8BD20466C38032803D8204600F08DFF16 +:101330001EE0204670381F2803D8204600F047F9E9 +:1013400016E0204690380F2803D8204600F0EAF82F +:101350000EE02046A0380F2803D8204600F076F88B +:1013600006E02046B0380F2804D8204600F0E2F905 +:10137000286000E02F60602CD2D128680028CFD1EF +:101380003770F8BD1A000020013000000120254907 +:10139000C003086024490020087007202349C005C5 +:1013A0008860704770B5204D04462878A04207D069 +:1013B000002C05D0002803D01DA14D2019F0CBFE34 +:1013C0002878A0420ED000211E4A18482C70002C0C +:1013D0001BD01D4B012C06D0022C0DD014A168206F +:1013E00019F0B9FE70BD1160022111605361032133 +:1013F00009068160416070BD116003211160536175 +:101400000121C9058160416070BD11601160072133 +:10141000C905816070BD10B505A1712019F09BFE52 +:1014200010BD000080E100E02000002000F5014038 +:101430007372635C68616C5F63636D5F6161722E80 +:101440006300000000F500408401002010B5A038C2 +:10145000030019F0A1FF0B070E172028313A414B6A +:10146000525C65004B6808788A68194603F0D9F920 +:1014700010BD88888A6883B20888194680B203F054 +:10148000DFF910BD08884C68CB688A6880B22146B5 +:1014900003F0DAF910BD08884B688A6880B21946F3 +:1014A00003F0EEF910BD88888A6883B2088819466F +:1014B00080B203F0FAF910BD88888A6883B2088880 +:1014C000194680B203F034FA10BD08884A6880B229 +:1014D000114603F073FA10BD088982B2888883B27E +:1014E0000888194680B203F074FA10BD08884A686B +:1014F00080B2114603F091FA10BD08894C6882B29F +:101500000888CB6880B2214603F00AFB10BD08882A +:101510004C68CB688A6880B2214603F01BFC10BD82 +:10152000012010BD10B59038030019F035FF0906F1 +:101530000F161D242C363F464E0088888A6883B2D9 +:101540000888194680B204F01DF910BD08884A6861 +:1015500080B2114604F051F910BD08884A6880B283 +:10156000114604F056F910BD08884A6880B2114649 +:1015700004F05CF910BD08884B688A6880B219468F +:1015800004F067F910BD088982B2888883B20888A0 +:10159000194680B204F066F910BD08894B6882B222 +:1015A0000888194680B204F07CF910BD08884A68A2 +:1015B00080B2114604F087F910BD888882B208888D +:1015C000114680B204F0DBF910BD012010BD10B54A +:1015D0007038030019F0E0FE1B0F15192125282F84 +:1015E000363B4044484C53585F68707881889095EA +:1015F000999CA2A5AC004A680878114607F019FC2E +:1016000010BD086807F066FC10BD0C790B7B8A687A +:101610000868214607F06FFC10BD086807F000FD60 +:1016200010BD07F08CF910BD08884A6880B21146D9 +:1016300007F034FE10BD0A790888114680B207F021 +:10164000C4FE10BD087840B207F0CDFE10BD08887A +:1016500080B207F0E1FE10BD086807F0EFFE10BD94 +:10166000086801F0ECFB10BD086801F016FC10BD25 +:10167000088982B209C9194607F0F8FE10BD05C9EC +:10168000114607F042FF10BD08884A6880B2114633 +:1016900009F0FAF910BD0C790888CB688A6880B225 +:1016A000214609F0CDFA10BD0B7908888A6880B20E +:1016B000194609F07DFC10BD08884B688A6880B225 +:1016C000194609F0EEFC10BD08884C68CB688A68A2 +:1016D00080B2214609F053FD10BD08884A6880B2E7 +:1016E000114609F08CFD10BD0B7908880A7A80B28A +:1016F000194607F02DFF10BD088880B207F02DFFB6 +:1017000010BD086807F030FF10BD07F0FCF810BDF1 +:101710008A6809C9194607F08CFF10BD07F0DCF88C +:1017200010BD08884A6880B2114608F05BF810BD09 +:10173000012010BD10B5B02805D0B12808D0B228BE +:101740000BD0012010BD088880B20AF056F910BDF8 +:10175000088880B20AF070F910BD08884B688A6862 +:1017600080B219460AF079F910BD000010B50300E7 +:1017700019F012FE0A0609060C0C0F0F06060612D7 +:1017800007F005F910BD09F027FF10BD01F042FA7E +:1017900010BD06F075FA10BDFAA1FE4819F0DBFC89 +:1017A00010BD7FB5FC49054603C901900291132085 +:1017B000800169468881F94A0F2310460A2128389A +:1017C0000AF043FE0024F6480AF05DFE641CE4B211 +:1017D0000A2CF8D304200090F04801231A4603A9EC +:1017E000F0300AF05DFA002804D0FF20E5A1533064 +:1017F00019F0B1FC686800F024FC00211E220846A4 +:1018000004F040F907F0C6FA02222421E54801F06D +:101810007FFBE44801222C214C3001F079FBE149A7 +:101820000B20B03901F000FA002804D0FF20D5A128 +:10183000673019F090FC09F09FFE02F075F901ABDA +:1018400000220821D8A007F085F9002804D0FF2045 +:10185000CCA16D3019F07FFC284602F0C2FC0028B4 +:1018600004D0FF20C7A16F3019F075FCDB2189007F +:10187000D04819F045FBCF48012141710221817107 +:101880000621C1717FBD10B5CA4CA078092804D3C8 +:10189000FF20BCA1A73019F05EFC207860214843EE +:1018A000001900210173417BF722C908C900C91C36 +:1018B0001140EF22114041730121E1700C3010BD45 +:1018C00070B50E4600211C4619801546030019F01C +:1018D00063FD0723050B1711231D2300224629460C +:1018E000304609F096FE70BD22462946304606F085 +:1018F00098FE70BD22462946304601F0C2FF70BDF9 +:1019000022462946304603F0C0FD70BD22462946D6 +:10191000304600F010FC70BD9E489AA1D53819F0F1 +:101920001AFC032070BD70B5A24CE078002818D0D6 +:101930002078602148430019407B00254007400F74 +:1019400001190879401E08712078401CC0B220702F +:10195000092800D12570A078401CA0700AF01DFF56 +:10196000E57070BD9348C079002800D08BE77047C0 +:1019700070B5904DA86800280CD0FFF7F3FF002841 +:1019800062D06022A968FFF71FFCFFF7CCFF0020A0 +:10199000A860EFE76879002856D0FFF774FF044687 +:1019A00080484C3001F0C4FA6060002804D1C9209E +:1019B00074A1800019F0CFFB60680AF0EAF80028F3 +:1019C0000DD0204606F011FD6078010703D5C00850 +:1019D000C000401C2BE0734861684C302DE071481A +:1019E00061684C3001F0ADFA00F05AFB00282BD1B1 +:1019F000FFF749FF04466B4801F09AFA606000283F +:101A000004D164485FA16D3019F0A5FB60680AF04D +:101A1000C4F8002814D0606800886080204609F06F +:101A20002BFE6078010706D5C008C000801C6070DE +:101A3000FFF779FF9EE75B48616801F082FA99E75A +:101A40005848616801F07DFA70BD10B55A4CE160EC +:101A5000A0605A4800F034FC607010BD5649002068 +:101A60000870704770B5564E0546706A94B00C46C3 +:101A7000401C04D1B06AC0430004000C0BD0306A93 +:101A8000C007C00F2870706A19F03CFAB06A207164 +:101A9000000A607114E02B206946087009A96846A5 +:101AA0000AF04BF8002804D0972036A1800019F0E6 +:101AB00052FB0120287006220AA9204619F0C1F91C +:101AC0002878002803D06079C0210843607114B0E1 +:101AD00070BDF0B53A4C0646206895B00D463746C5 +:101AE0000837401C08D16068401C05D1A068401C24 +:101AF00002D1E068401C11D02068314619F002FA8A +:101B00006068311D19F0FEF9A068394619F0FAF93C +:101B1000E06831460C3119F0F5F925E02B206946D3 +:101B2000087009A968460AF008F8002804D0194886 +:101B300014A1553819F00FFB08220AA9304619F0F4 +:101B400080F92B206946087009A9684609F0F5FF5D +:101B5000002804D0A3200BA1800019F0FCFA082271 +:101B60000AA9384619F06DF920692E460836401C3E +:101B700029D16069401C26D1A069401C23D1E069AD +:101B8000401C1FE07372635C686F73745F636F72F5 +:101B9000652E6300DA020000B4B30100D801002012 +:101BA0006D170000A40B00206E52463531383232DA +:101BB00000000000880700202400002071190000A8 +:101BC0008000001012D02069294619F09BF9606945 +:101BD000291D19F097F9A069314619F093F9E069C8 +:101BE00029460C3119F08EF915B0F0BD2B2468464A +:101BF000047009A909F0A1FF002803D0F649F748AD +:101C000019F0A9FA082209AF28460AA919F019F90A +:101C10006846047009A909F090FF002804D0EF4835 +:101C2000ED49C01D19F097FA0822391D304619F008 +:101C300008F9D9E770B5EA4C0546A068002804D039 +:101C40000320E549000219F086FAA56070BD10B5C1 +:101C50000146E44801F075F9E1498879401CC0B2B9 +:101C60008871012803D1E048407800F04DFB10BD99 +:101C700070B50446DD4816460D46814204D1D7486A +:101C8000D549CB3019F067FA012E05D0E120D249B1 +:101C9000800019F060FA70BD66202070002020726C +:101CA000A5810120A07370BD70B515460C4606468F +:101CB000FFF758FE00280CD06621017046800121F4 +:101CC000017221680161A18881820573FFF72BFEF3 +:101CD00070BD1321304607F078FB70BDC2494968DA +:101CE000884201D210207047032101700020704704 +:101CF00070B5BD4C05462078002694B0002801D070 +:101D00000820E4E6BA4A6260954201D21020DEE67D +:101D10006868002809D00921D82804D3C31C9B086F +:101D20009B00834205D00846D1E60320400268604C +:101D30000EE0012109074B6B896B4B43AD49511AEA +:101D40000122591AD202891A814201D20421EAE7FA +:101D500000F052FF6178A0680CF04EFBE068401E76 +:101D600007280BD8302269460A70887068460DF043 +:101D700088FF002802D009A80CF0FBFC2846FFF7DA +:101D800010FD012020703046A1E6F8B504469648C3 +:101D90000F464068814208D3002C01D0844204D30E +:101DA000E01C80088000A04201D01020F8BD8C48C3 +:101DB0008178002911D039880091417860225143FF +:101DC0000D18287B0C350007000F3B4600222946E2 +:101DD000FFF776FD060004D015E0002038800520CE +:101DE000F8BD002C13D039880098814201D90C2607 +:101DF0000DE028783B460007000F22462946FFF7F2 +:101E00005FFD060005D00C2E01D000203880304642 +:101E1000F8BD734C6078401CC0B26070092801D1D5 +:101E200000206070A078401EA07068784107490FBC +:101E300001290ED0022906D003291AD066496E481E +:101E400019F089F9E3E7C006E1D46868FFF7FFFEFF +:101E5000DDE7644869684C3001F073F86079401C34 +:101E6000C0B260710128D2D15F48407800F04CFACE +:101E7000CDE7E079401CE071C9E7604A10B59042B7 +:101E800009D3594A0124A4045268A04201D39042C4 +:101E900001D3914201D2102010BD00F0FEFE10BD12 +:101EA000564B10B5994209D34F4B0124A4045B68EB +:101EB000A14201D3994201D39A4201D2102010BD10 +:101EC000022803D0102801D0092010BD00F00BFF1C +:101ED0000028FAD0052010BD484B10B598420DD30C +:101EE000414B0124A4045B68A04201D3984205D36E +:101EF000994203D3002A03D09A4201D2102010BD88 +:101F000000F017FF0028FAD0072010BD10B50446D6 +:101F1000354894B04068844202D2102014B010BDFD +:101F20000F2008A9087369460BA809F006FE0028CF +:101F3000F4D16846007A207068464089608068461F +:101F40008089A0800020E9E710B500290BD0264A3F +:101F50005268914202D30B68934201D2102010BD07 +:101F60008A88002A02D001F037FE10BD092010BD7A +:101F700010B5224A94B091420ED31B4A01239B0410 +:101F80005268994201D3914206D3441E1E2C41D877 +:101F9000994203D3914201D21020BFE7012837D1E3 +:101FA00008780024C007C00F002803D0032069462A +:101FB000887001E06846847038206946087009A975 +:101FC000684609F0BAFD002804D004480CA18B38FB +:101FD00019F0C1F82046A1E7841B0000AA02000006 +:101FE00088070020A40B002024000020FFFF000031 +:101FF00000220020000000202104000000C0010099 +:102000007372635C686F73745F636F72652E6300D5 +:10201000072083E70246203A1F2AF9D806F001FE7E +:102020007CE710B5604A5268914201D2102010BD81 +:102030000246203A1F2A02D806F068FE10BD07208B +:1020400010BD70B50546594C002020702046461939 +:1020500055484660E01C80088000A04204D0FF2064 +:102060005349293019F077F801200007C06AC043AE +:102070000006000E03D14F480068401C03D04E48B4 +:102080004E49301AC862A8B20422214604F00DF964 +:10209000002804D0FF204649393019F05CF870BDA3 +:1020A000F0B595B03B2008A9087369460BA809F064 +:1020B00044FD002804D0FF203D49813019F04BF841 +:1020C0003F4E00246D4630E02F19B87DC10706D081 +:1020D000400704D460004019C08809F0E9FB394882 +:1020E000807900281FD0B87D80071CD5600040197A +:1020F000C0880022062109F0F7FB002813D03C21FC +:1021000008A8017360004019C1886846C185694606 +:102110000BA809F012FD06000BD0FF2024499630D1 +:1021200019F019F805E0641CE4B268460079A04291 +:10213000CAD8304658E5F7B50546007800270009AB +:102140000C463E46062804D0FF201949BF3019F03E +:1021500002F8287A00280ED0012814D0FF20144954 +:10216000E03018F0F8FF0298002C068001D027809C +:1021700066800020FEBD02270926002C10D0A88909 +:10218000A080A87B0AE003271426002C08D06888CA +:10219000A0802869E060A88A2082287B2072E2E77C +:1021A00002980680E5E700002400002000220020BD +:1021B000002000000010001000000020000500407A +:1021C000043000008807002010B56038030019F0C3 +:1021D000E3F80A060A0F13181F252930353A086854 +:1021E000FFF786FD10BD05C91146FFF7CEFD10BDF6 +:1021F0000868FFF773FD10BD05C91146FFF73DFEE6 +:1022000010BD4B6808788A681946FFF749FE10BD73 +:102210008A6809C91946FFF75FFE10BD0868FFF715 +:1022200075FE10BD08884A6880B21146FFF78CFE23 +:1022300010BD05C91146FFF79BFE10BD05C911462B +:10224000FFF7EFFE10BD012010BD01207047000018 +:102250000E4A12680C498A420AD118470B4A126882 +:10226000094B9A4204D101B500F08EFE03BC8E46A4 +:10227000074909680958084706480749054A064BAF +:102280007047000000000000BEBAFECA64000020D3 +:1022900004000020F0210020F021002001203F490F +:1022A000400608603E4908603E490A68FF231B0259 +:1022B0009A4383121A430A6038498039086070478C +:1022C00010B502460420384904E0C3005B181B79AE +:1022D000002B0AD00346401EC0B2002BF5D133A11B +:1022E000432018F038FFFF2010BDC300CA50002261 +:1022F00059184A718A7101220A7110BD2A4A0021B7 +:10230000C00080180171704710B50446042803D33B +:1023100026A1522018F01FFF2348E1000C18207955 +:10232000012803D021A1532018F015FF6079A1796D +:10233000401CC0B2814200D06071012017494006A4 +:102340008031086010BD70B5164804250068164E2F +:102350000004800F1B4C02281AD014A1692018F029 +:10236000FAFE15E02078C10088190279012A07D108 +:10237000427983799A4203D04279827170588047BA +:102380002078401CC0B22070042801D300202070A7 +:1023900028466D1EEDB20028E4D170BD80E100E05A +:1023A00080E200E018E400E0200C00207372635C1F +:1023B000736F635F7369676E616C6C696E672E63C0 +:1023C000000000003400002010B5EFF31080C407B7 +:1023D000E40F72B6D2484178491C41704078012818 +:1023E00001D10AF0FFF9002C00D162B610BD70B522 +:1023F000CB4CE07800280AD10125E570FFF7E4FF17 +:102400000AF0F8F9002804D000200AF0CBF90020E7 +:1024100070BDC44865714560F9E770B5EFF3108091 +:10242000C507ED0F72B6BE4C6078002803D1BEA17F +:102430008F2018F090FE6078401E60706078002851 +:1024400001D10AF0D3F9002D00D162B670BD10B5EC +:10245000B348C178002904D000214171C170FFF751 +:10246000DCFF002010BD10B504460AF0C3F9AC49EA +:10247000C978084000D001202060002010BDF8B5C8 +:102480000246A74C0026A67108200421012510272A +:10249000130018F081FF0D080A0C0E101214161EFE +:1024A000262123252800257122E0022001E0217148 +:1024B0001EE020711CE027711AE02020F9E70126B8 +:1024C00016E0FFF781FF0AF095F90028FBD00226FD +:1024D0000EE02171A5710BE02771FBE7202000E0E1 +:1024E00040202071F6E7FF208FA1763018F033FEF0 +:1024F0000AF08CF9002809D00AF08EF9B04205D113 +:1025000030460AF08CF90028FAD02CE00120800730 +:10251000C560894900224A60884A9661814B02223F +:102520005A60856086480269D243D206D51702698F +:1025300010231A4302610F466D1C00E020BF78682B +:102540000028FBD030460AF06AF90028FAD0002DA6 +:1025500004D17B48026910218A430261714902203B +:10256000886000207860A07900280CD00AF042F939 +:1025700005460AF09FF8734A002D02D0A260E06081 +:1025800001E0E260A060002E01D100F0A5F8F8BDE6 +:1025900010B504460AF034F9002805D0604901203E +:1025A000C8704A78521C4A702046FFF768FF10BD79 +:1025B000F8B5614DA8680026012802D1AE600AF086 +:1025C000F1F86868012800D16E6028680127544C32 +:1025D000012812D12E606079002803D000200AF073 +:1025E000E1F866712078002807D00AF003F9002886 +:1025F00003D0012080070761A770286901282AD12C +:102600002E6100F05FF8012080074761A079002863 +:1026100015D00AF0EFF800900AF04CF80099002964 +:1026200001D0E16800E0A168411A022901DA8A1CA0 +:1026300011DC0099002901D0E06000E0A060FFF704 +:10264000C3FE0AF0D7F8002804D0012080070761F4 +:10265000A77000E02770E868012812D100F032F876 +:1026600000F030F800F02EF8A078002804D1FF2008 +:102670002DA1033018F06FFDEE60A6702670FFF7F5 +:10268000CCFEF8BD10B5264CE078002801D10AF048 +:10269000ADF801208107886100F014F8A0780028C7 +:1026A0000BD0254CE068002803D10AF0B8F80028C8 +:1026B000F8D10020E06000F005F800201949C0437F +:1026C000886010BD08B55020694608806A461088A9 +:1026D000411E1180FAD208BDF8B51248192787604B +:1026E000154900200860C8600AF084F8BE0701247C +:1026F0000B4D002802D03461AC7000E02C70FFF765 +:1027000063FE084847600D4928798863FFF7DAFFC0 +:10271000B461FFF7D7FF0849002008617461F8BD74 +:1027200038000020000300407372635C736F635FC6 +:10273000636C6F636B2E6300000100400005004076 +:1027400000ED00E0FFFFFF7F8107C90E002808DAD7 +:102750000007000F083880082E4A80008018C069E2 +:1027600004E080082C4A800080180068C8400006F9 +:10277000800F704710B50D20FFF7E6FFC4B20420AC +:10278000C043FFF7E1FFC0B2844203D023A11A2067 +:1027900018F0E1FC26490120486010BD0121254ABE +:1027A00048031060244B00221A60244A5160244AD6 +:1027B0001060244A11601F49803908607047012168 +:1027C0001C4A480310601F4A51601B4A00211160D7 +:1027D0001B490860704710B517490868012804D0E4 +:1027E0000EA1572018F0B7FC10BD114880680022D8 +:1027F000C0B20A6009F0BEFC10BD10B50E480168F9 +:102800000029FCD0FFF7E7FF01200D4940030860D5 +:1028100010BD000000ED00E000E400E07372635CB6 +:10282000736F635F68616C5F726E672E6300000098 +:1028300000D5004080E100E000D1004000D300401E +:1028400080E200E000D0004030B40121BC48C90261 +:102850000160CD1005604A030260BA4803681B029C +:102860001B0A036004680023240A24020460B6489B +:102870000468240A24020460B4480124446084608B +:10288000B34C23606360A360B24B19601D601A6093 +:10289000B14B19601A600121016030BC704710B45F +:1028A0000121A748CA0202600B0203600C06046003 +:1028B000A64841608160A94841680029FCD1A4492B +:1028C0000020086048608860A248026003600460DD +:1028D00010BC704701219F48C9020160C910016006 +:1028E0007047002805D0012805D0022805D19C4852 +:1028F00070479C4870479C48704710B59BA18B203F +:1029000018F029FC002010BD70B500219E4C9F4D91 +:102910009F4A8F4B002808D001281DD0022822D0C2 +:1029200092A1B32018F017FC70BD01200004A06034 +:10293000A86011601960974BC2039A60964A906034 +:102940007F4A0012106095480160864801609448F3 +:1029500001609448017070BD01204004A060A8602F +:102960005160596070BD01208004A060A860916032 +:10297000996070BDF8B59446834A8B4F834D00240F +:102980000126002808D0012832D0022840D077A1A3 +:10299000E82018F0E0FBF8BD891E0902090A0120B1 +:1029A000000490603C6468606C4A1164012B1DD087 +:1029B00000217C4A7D4B51706146DC63DE637C4BB9 +:1029C0005C6002249C6004241C61744B3D311960DE +:1029D00073490E605F4B891519606F4B58605E48F4 +:1029E00001606C49C00548601670F8BD0121E0E740 +:1029F0000120704E4004704F012B04D134645060AC +:102A000068603964F8BD9060346468603964F8BD0A +:102A100001206A4E80046A4F012BF4D1EEE74F4843 +:102A20004068704770B54A4D28680026564C01280A +:102A300006D1A068C00303D501200004A0602E6069 +:102A40006868012809D1A068800306D501204004E8 +:102A5000A0606E6001200AF0B9FEA868012809D1C3 +:102A6000A068400306D501208004A060AE6002206B +:102A70000AF0ACFE70BD10B54A490878002818D09D +:102A80000120444AC0079060434AC00B90602C4A22 +:102A900000121060414A00201060324A1060404A23 +:102AA000106008704A78002A02D048700AF08EFE42 +:102AB00010BD0320FAE70120424900060860704774 +:102AC0000120244900060860704701203D49400567 +:102AD0000860704701201F4940050860704733496E +:102AE0000020C86388151B4908607047410A364AB0 +:102AF000C005C00D5043801C5143400A0818704760 +:102B000010B4324C430B63431B0C5C020C602E4C24 +:102B10006343C31A2E485C0258432B4B400D43437A +:102B2000E31A0124DB0324041B191B1613700A6823 +:102B30001018086010BC704710B50AF01BFF10BDDC +:102B400080E100E008E400E018E400E000B00040AC +:102B500040B1004080E200E000E100E000B500404C +:102B600048B100404081004044B100407372635C52 +:102B700072656D5F68616C5F6576656E745F7469C0 +:102B80006D65722E6300000000B3004040B300404A +:102B900040B5004000F50140008300404085004002 +:102BA000008200404800002000B10040C08F00407B +:102BB0000085004004B1004004B5004008B1004069 +:102BC00008B5004000E200E0093D00003786000043 +:102BD0006F0C010010B50AF0B9FE10BD00200449C9 +:102BE000C863012001218140024A116000BF704783 +:102BF000C01F004080E200E010B50DF05DF909F063 +:102C0000F7F9FEF7C3FB0FF0F5FA0DF08FFF0DF0AB +:102C10001BFF10BD70B50C46054603F0A7FA214610 +:102C200028460EF0C2FF70BD70B50D46040012D0EC +:102C3000002D10D02101284618F060F910225449C7 +:102C4000284618F0FEF852480121083801804480D7 +:102C50004560002070BD012070BD70B54C4E002451 +:102C60000546083E11E0716820014018817BAA7B6F +:102C7000914209D1C17BEA7B914205D10C222946C0 +:102C800018F0B2F8002806D0641C30888442EADBD1 +:102C90000020C04370BD204670BD70B50D460600D3 +:102CA0000AD0002D08D03A4C083C20886188401C8E +:102CB000884203D9042070BD102070BD3046FFF754 +:102CC000CCFF002801DB401C0AE02088616800017D +:102CD00040181022314618F0B4F82088401C20809B +:102CE0002870002070BD70B514460D001FD0002C58 +:102CF0001DD00021A170022802D0102817D108E0B1 +:102D0000687829780002084311D00121A170108051 +:102D10000BE02846FFF7A1FF002808DB401CA0704D +:102D2000687B297B000208432080002070BD0120C1 +:102D300070BD70B5054614460E000AD000203070F4 +:102D4000A878012807D004D9114908390A88904287 +:102D50000BD9012070BD002C04D028782070288861 +:102D6000000A50700220087010E0002C0CD0496856 +:102D70000001411810222046103918F062F8287816 +:102D800020732888000A607310203070002070BD06 +:102D9000540000205A4910B5884207D30121890404 +:102DA000884205D357490968884201D2102010BDD6 +:102DB0000146012005F0CBF810BD30B5044693B0B4 +:102DC00000200D46079014210BA818F099F81C213B +:102DD000684618F095F86A46112010770020507761 +:102DE000107802210843107007A80C90012008AA4F +:102DF000907245486A4610850AA80B902088108476 +:102E000060885084A0889084E088D084907FF921E5 +:102E10000840801C4008400090770820908610876A +:102E200008A80F9010AA0BA9684600F05CFF0028C4 +:102E300003D110A800882880002013B030BD3EB513 +:102E400004460820694608802D48844207D30120A3 +:102E50008004844205D32B480068844201D21020AC +:102E60003EBD2146012005F072F80028F8D12088E7 +:102E7000694688806088C880A0880881E088488189 +:102E800005F065FE01AB6A46002101F0BBFB694617 +:102E900009880829E4D003203EBD1FB50446002060 +:102EA000029008206946088115480391844207D39F +:102EB00001208004844206D312480068844202D272 +:102EC000102004B010BD05F042FE014602AA0F48D2 +:102ED00001F02EFD0028F4D169460989082901D0A6 +:102EE0000320EEE7694609882180694649886180A8 +:102EF00069468988A1806946C988E180E1E70000C8 +:102F000000C0010028000020042A0000FFFF00008C +:102F100010B5031D03600020521E04E05C181C6005 +:102F2000401C2346C0B29042F8DB0020186010BD60 +:102F300001460A680020002A02D0104612680A6082 +:102F4000704702680A6001607047000010B50146D2 +:102F50002022094817F075FF07490020C877084666 +:102F600010BD0649012048610548064A01689142A2 +:102F700001D1002101607047B00E00200005004023 +:102F800064000020BEBAFECA0C4908784A78401C8A +:102F9000C0B2904200D008707047094A074820BF6D +:102FA00040BF20BF4178037843701368002B02D1E3 +:102FB00003788B42F3D00020704700006B000020A4 +:102FC00000E200E00A4A022151600A490B68002B26 +:102FD000FCD0906008680028FCD000205060086891 +:102FE0000028FCD0704701200007406970470000AE +:102FF00000E5014000E401407047704770477047AA +:1030000010FFFFFFDBE5B15100C001006700FFFFCB +:1030100003B40148019001BD09000020002803D03D +:103020008178012939D101E0102070470188FE4ADA +:10303000881A914233D01BDCFC4A881A91422ED068 +:103040000BDC00292BD00320C002081A27D001284E +:1030500025D001210903401A07E001281FD00228CA +:103060001DD0FF281BD0FF380138002815D116E0ED +:10307000FF220132811A904211D008DC01280ED0C3 +:1030800002280CD0FE280AD0FF2806D107E001292B +:1030900005D0022903D0032901D0002070470F205A +:1030A000704700B50B2826D009DC030018F074F92E +:1030B0000B1D2125251B25292325271F1B00112832 +:1030C0001BD008DC0C2816D00D281CD00F2814D0DB +:1030D000102808D10FE0822809D084280FD0852835 +:1030E0000FD0872811D0032000BD002000BD05208F +:1030F00000BDCF4800BD072000BD0F2000BD04204B +:1031000000BD062000BD0C2000BD0D20800200BDCA +:1031100070B500290BD0CB1FFA3B81241E46CDB2DF +:10312000112B1BD2012805D0022806D009E000206F +:1031300010701DE0FF20043001E0FF2003308142C9 +:1031400018D0330018F028F9111613131613161699 +:103150001316161613131313161316000846FF380A +:1031600081381F2803D9FF39FE39022902D815708A +:10317000002070BD1470072070BD00B5030018F06A +:103180000BF9060406040C080A0C002000BD1120EF +:1031900000BD072000BD082000BD032000BD007851 +:1031A0000207120F04D0012A05D0022A0AD10EE02C +:1031B000000907D108E00009012805D0022803D042 +:1031C000032801D0072070470870002070470620B0 +:1031D0007047002807D0012807D0022807D003280D +:1031E00007D007207047002004E0112002E02120D2 +:1031F00000E0312008700020704738B50C4605000B +:103200004FD06946FFF7CBFF002822D12088032149 +:1032100089028843694609788907090D0843208097 +:103220006946681CFFF7BBFF002812D121880320E4 +:1032300000038143684600788007800C01432180A9 +:10324000A8784007820F2020012A03D0022A03D049 +:10325000072038BD814300E00143218088B2010589 +:10326000890F08D0012189038843A9780907C90F6C +:1032700089030843208080B28104890F0AD0A9788D +:103280004004C906C90F400CC903084320808004CC +:10329000800F02D12088400403D5208840210843B4 +:1032A0002080002038BD70B50446002008801546F7 +:1032B0006068FFF7A2FF002815D12189A08981420B +:1032C00010D861688978C90708D00121490288426D +:1032D00008D8491C17F01EFE298009E0FF21FF31A4 +:1032E000884201D90C2070BDFF30FF3003302880A8 +:1032F000002070BD10B5137804785B08E4075B000C +:10330000E40F23431370FD2423400478A407E40F43 +:10331000640023431370FB24234004786407E40F04 +:10332000A40023431370F724234004782407E40FF8 +:10333000E40023431370EF2423400478E406E40FF1 +:10334000240123431370DF2423400478A406E40FF0 +:103350006401234313700078BF244006C00F23404C +:10336000800103431370002906D00878C10701D1FA +:10337000800701D5012000E00020C0015906490E58 +:103380000843107010BD30B50A8803239B020488DF +:103390009A4323059D0F02D1A3049C0F01D09B0FDC +:1033A00000E001239B021A4303230A801B039A4374 +:1033B00003889804840F02D11805830F01D0800F71 +:1033C00000E00120000302430A8030BDF3B593B052 +:1033D0000D000FD0139800280FD01221284617F0A7 +:1033E0008DFD03AAFF21012003F0D5F80024264615 +:1033F00037467AE0102015B0F0BD0720FBE768469D +:10340000807D01280BD16846818A0520C002081AF8 +:1034100010D0012810D0022812D0032812D0042C7A +:1034200014D0052C15D113E002290000012800005A +:1034300003300000012400E002246846468A08E0C8 +:10344000032406E068460424478A02E0052400E0DD +:1034500006246846418A1398814246D12C74002E76 +:1034600041D00DAA0EA905200292019100901023CF +:103470000022FF21304603F02FF9002823D16846AF +:10348000808E2A46C0B20EA9FFF72DFC00281AD163 +:10349000AE81002F27D00DA9052008AE0291009023 +:1034A000132300220196FF21384603F015F9002866 +:1034B00009D16846808EF11CC01EC0B22A1DFFF7DC +:1034C00012FC002801D0032095E708A881784278F3 +:1034D00008021043E881062C05D16846807DA87259 +:1034E0006846808A2881002085E703A803F05CF8FD +:1034F000002884D0FFF7D5FD7DE7002805D0FE4ADF +:10350000012903D0022903D003207047518800E02D +:103510009188814201D1002070470720704770B523 +:103520000C4605461C21204617F0E8FC00202080B0 +:10353000002D08D0012D04D0F0A1F54817F00BFEA6 +:1035400070BD062000E00520A07070BD70B592B07F +:103550001546064601206A461071107453740846D9 +:1035600008300395029048889082FEF7FBF904002A +:1035700019D06580172069468883203600940AABED +:103580007178023307AA01A80EF017F90646607891 +:10359000000701D5FEF7C7F9002E0AD03046FFF725 +:1035A000ECFD12B070BD1321284605F00EFF03207C +:1035B000F7E708A800906846838B0422012128467B +:1035C00007F0B3FEEDE770B506468AB000200D4661 +:1035D00007900590069003A90490052402460291E5 +:1035E0000190102300942946304603F075F8002816 +:1035F0000DD108A804A9009102900194684683891E +:1036000000222946304602F083FE002801D0FFF751 +:1036100048FD0AB070BD10B50EF0D5FA10BDF0B57A +:1036200089B000260546059600780C460827030059 +:1036300017F0B2FE0CFD070C390B75759BBEFCD361 +:10364000E3FD68680A38FEF702FB07E1A88800225C +:1036500080B20421009008F067FB0290002C04D097 +:10366000AB48A6A16E3017F076FD0298002804D171 +:10367000A748A2A16F3017F06EFD0298009908309C +:103680000DF0D0FCFEF76EF9040007D060783843E7 +:10369000607000986080FEF746F9E1E01321009821 +:1036A00005F093FEEAE0002C04D1BD2093A1800038 +:1036B00017F051FD60880022042108F035FB0090CE +:1036C000002804D192488DA1883017F044FD00995C +:1036D000002008802A7994461EE0C3005B199B688D +:1036E00007936B469B8B1A0708D5DA0606D560460A +:1036F000C20050194038C08F088006E05B0409D52D +:103700000871C2005019C0884880607838436070E2 +:103710000226A3E0401CC0B28445DED89EE0E888C3 +:10372000694608800090002C04D1794873A1983034 +:1037300017F011FD2878062813D10098C00B10D07F +:1037400060880022042108F0EFFA060004D17048D6 +:103750006AA1A23017F0FFFC00203071A8887080A9 +:1037600039E060783843607078E0002C04D1684814 +:1037700062A1B43017F0EFFC60880022042108F049 +:10378000D3FA0090002804D161485CA1B73017F04B +:10379000E2FC009808300EF068FA0121484002D19E +:1037A000E888C00B5AD0009861880226C180D8E70B +:1037B000002C04D1564851A1D03017F0CCFC6088C1 +:1037C0000022042108F0B0FA002804D150484BA18F +:1037D000D33017F0C0FC0226C3E7002C04D14C48BC +:1037E00046A1DC3017F0B7FC022661880122204692 +:1037F000FEF73EFA01200590B3E7A889002280B2C7 +:103800000421009008F090FA0746002C04D04048AC +:103810003AA1EE3017F09FFC002F04D13C4837A1AD +:10382000EF3017F098FC6868029001E009E010E0C2 +:10383000288969468881012202A90098FEF734FA96 +:103840000CE0002C8DD16D202CA1C00017F083FC62 +:1038500087E72F4829A1FE3017F07DFC002C0DD002 +:10386000607800070AD50598002807D184202070C9 +:103870002046582229460830FDF7A6FC304609B0FC +:10388000F0BDF7B50C460546007A224688B00A32EC +:103890000492921C01920027811E16323E4602922B +:1038A0000B0017F079FD08F405F348488ED0F2F3C9 +:1038B00068880022042108F037FA0190002803D11B +:1038C0000EA1144817F047FC01980088002802D088 +:1038D0005227072600E151271E26002C70D0688849 +:1038E000A0800120A071019804990079C0004019BE +:1038F000C089FFF76BFD0FE0400C00207372635C22 +:1039000067617474735F636F72652E6300000000FB +:103910006F0200008603000000287DD10198007925 +:10392000C0004019C089208101980079C000401969 +:10393000408AA083F0E0698A0091062820D1E889B6 +:10394000C00B1DD008462230512786B2002CC5D0AE +:10395000A8890199FFF73AFD002872D16888A080F4 +:103960000220A071A88920810120A072288AE0830A +:10397000009820846969009A029817F062FACBE0F7 +:1039800008462030502786B2002CA7D0A889049979 +:10399000FFF71CFD002854D16888A080A889E0802A +:1039A000287A06280AD002202072288AA08300984C +:1039B000E083204669692030009ADEE70120F3E7C2 +:1039C0008FE068880022042108F0AEF90690688A2A +:1039D00000900698002803D1FD49FE4817F0BBFB74 +:1039E000069808300EF041F90121484002D1E889DB +:1039F000C00B25D000985127223086B2002C7AD0F7 +:103A00006888A080A8890199FFF7E0FC002818D1F8 +:103A10000220A071A88900E013E020810420A07298 +:103A2000288AE083009820846969009A029817F038 +:103A300008FA0699002008710698A98941806BE070 +:103A400003200BB0F0BD688804F0DDF900906888B1 +:103A50000022042108F068F901900098002804D1A0 +:103A6000DC48DB492C3017F076FB0198002804D1A4 +:103A7000D848D7492D3017F06EFB0198D649C08839 +:103A8000884205D05127222604E01EE03FE035E0C1 +:103A900050272026002C2ED06888A080502F07D0D9 +:103AA0000220A0712146287B0831FFF738FD33E062 +:103AB000287BA11DFFF733FD6A8800230199009838 +:103AC000FFF744FD0028BCD126E0C449A889C98875 +:103AD000814207D154270626002C0CD06888A0808C +:103AE0001AE008E053270826002C04D06888A0803C +:103AF000A889E08010E00A98068013E05527072681 +:103B0000002CF8D0A889A0800020A07104E08D20AE +:103B1000AF49C00017F01FFB0A98002C068001D0A7 +:103B20002780668000208CE7AC4900200870704731 +:103B300030B585B00C4601F0DBF90546FF2804D10D +:103B4000A448A349953017F006FB0020208020717F +:103B50006080401EE0802046294608300DF056FA6D +:103B60006A462946012002F016FD102412E068463C +:103B7000808800070ED56846C0882946FFF723FDD8 +:103B800068468188FF2321438180C0882946019AA5 +:103B900002F02CFE684602F007FD0028E7D005B0D1 +:103BA00030BD0A46014610B5104608300DF042FA05 +:103BB00010BD70B505460022042108F0B5F80400D8 +:103BC00004D184488249B73017F0C5FA2046294607 +:103BD00008300DF027FA70BDF0B591B00C460746DD +:103BE00004F011F9050005D02878222804D2082015 +:103BF00011B0F0BD7A48FBE700220421384608F0F6 +:103C000093F80646002C02D0A08800280CD0012092 +:103C1000694608710220087400204874002C05D001 +:103C2000A0880883206802E00920E1E70883059066 +:103C30003046083003970290FDF794FE040018D038 +:103C40006780172069468883203500940AAB69781D +:103C5000023307AA01A80DF0B0FD05466078000701 +:103C600001D5FDF760FE002D09D02846FFF785FA43 +:103C7000BEE71321384605F0A8FB0320B8E708A8E3 +:103C800000906846838B04220121384607F04DFBE3 +:103C90000021C943F180ABE7FFB585B00E9E778860 +:103CA000384604F0B0F8054600220421384608F0F2 +:103CB0003BF80446002D03D145494A4817F04BFA1A +:103CC000002C04D147484249401C17F044FA0834FC +:103CD000089869460394C1C105A80DC820356978C4 +:103CE0000DF0DAF9CBE5F0B50446002099B00D46A9 +:103CF00001460D9010A88181164601818180374AC6 +:103D000068469180018510A80180684601878185F9 +:103D100081841078012808D0022806D0032804D016 +:103D2000042802D0082019B0F0BD2F4A944273D362 +:103D30002E4F0121890438688C4201D3844278D304 +:103D4000294A954275D3012189048D4201D38542C8 +:103D50006FD36168002913D0234A914269D30122AD +:103D60009204914201D3814263D3608921898842C0 +:103D700003D801225202914201D90C20D3E70D90C1 +:103D800016AA0EA92846FFF78EFA0028CBD168683C +:103D900080784007800F02280AD16846008F80048F +:103DA000800F05D02869002802D03968884240D3A6 +:103DB0000AA92069FFF721FA0028B4D12069002858 +:103DC0001CD0607880076846008D14D580040FE011 +:103DD000FC380000EE030000FFFF0000400C002054 +:103DE000023000000C05000000C001002800002087 +:103DF000800F68D002E08004800F64D16846008D97 +:103E0000810618D58004800F606806D0002812D083 +:103E1000396888420DD302E00BE000280BD0FE4940 +:103E2000884206D301218904884204D33968884234 +:103E300001D2102077E709A96069FFF7DEF90028B1 +:103E40009CD16069002808D06846808C0105890FE4 +:103E5000012938D18004800F35D00BA9A069FFF764 +:103E6000CCF900288AD16846808C80062BD468461D +:103E7000808D810627D4A169002906D00105890F0C +:103E8000012920D18004800F1DD0E068002804D0D3 +:103E90000078002817D01C2815D204AA611C2046DF +:103EA000FFF728FA0121890210A80180012768463E +:103EB0008773DA49818104AA033217A92868FEF7BB +:103EC00038FF002801D007202DE710A8007F15A992 +:103ED000C01CC2B200200C920190FF320090034639 +:103EE0000291FF3203A80332109902F0ACFA0028C5 +:103EF00026D110A9888A0F902A892969C84801917A +:103F00000092029010A90A8B6B8928680E9902F022 +:103F10009AFA01007ED1C2480025001F81886846B8 +:103F20004174090A8174052104A86A4623C210A8B5 +:103F30002A46FF21808A0C9B02F0EAF9002802D071 +:103F4000FFF7AFF8EFE66846007C0322C1090020C6 +:103F5000920290430122920280181490002928D0E6 +:103F6000014610A8018068462921877309028181D2 +:103F7000058608A8007C0023410860784900C00736 +:103F8000C00F014308A80174FD2001406078A54AD4 +:103F90008007C00F4000014308A801740CA902204B +:103FA00001910090029503A8109902F04CFA0100CB +:103FB00030D16068002828D0206900280DD10AA9D6 +:103FC0000EA8FFF7E0F96078800706D46946088DEF +:103FD0000321090388436946088590496846877329 +:103FE000FE3181818F492089891E16F093FF626816 +:103FF0000D9811AB0192009002930A46002303A88A +:104000000A9902F020FA010004D12078C10603D4F5 +:10401000800600E085E02AD56846058660690028AC +:104020000DD109A90EA8FFF7AEF96846818C0320CF +:104030008002814301208002091868468184694614 +:10404000888CC82108436946888474488F73FF3080 +:10405000888112AA0CA902200292019100900023EB +:10406000704A03A8099902F0EEF9010059D12078AD +:10407000C00729D068460586A06900280DD10BA984 +:104080000EA8FFF780F96846818D032080028143E6 +:10409000012080020918684681856846818D40208C +:1040A00001436846818587735F49818113AA0CA902 +:1040B000022002920191009000235A4A03A80B9912 +:1040C00002F0C1F901002CD1E06800282DD010A821 +:1040D00014990180544968468773491C8181E168BD +:1040E00008A80A78027449784174E068412241883E +:1040F00068464186E0680023017908A80175E068F8 +:10410000D200C18808A84175090A81750CA8072149 +:1041100001900091029503A8109902F094F9010012 +:1041200003D00F9800F0E8FEFDE53D480321001F95 +:104130000170002E0AD08088308010A8808870809E +:1041400010A80089B08010A88089F0800020EAE5DE +:1041500030B501248BB015460B46012802D0022849 +:104160001CD104E0684605218473C90203E02B4991 +:1041700068468473891E8181002B12D003210020A0 +:10418000890288430121890240186946888405AA6A +:1041900004A91846FEF7CDFD002804D007200BB077 +:1041A00030BD1020FBE76A46127C1D480092801E3D +:1041B00005A9FF3201910290FF32002303A80332C8 +:1041C000099902F040F9002802D0FEF76AFFE6E7FD +:1041D0001348001F002D01D0418829800470002061 +:1041E000DDE770B592B00446012608A886700F4935 +:1041F0006846018410AA08A93046FFF7A9FF0028E5 +:104200004ED12078064DC00700242D1F002849D02C +:104210001C2168460CE0000000C0010003280000DB +:10422000440C0020030200000329000001180000D4 +:1042300016F066FE6846017820200143684601704A +:1042400008A88670F9496846018411940794817F13 +:10425000F92001406846891C8177002001466846A4 +:104260000177002001466846417704218185C48595 +:10427000018607A80A9011A80D9008A809900EAA17 +:1042800009A96846FFF72FFD002809D16846008F6D +:10429000E8806846808F2881401C68812C7000204F +:1042A00012B070BDEC802C8110A80088F4E7F7B53F +:1042B000DF4900260A789EB0012A04D0022A02D0E3 +:1042C000082021B0F0BD4A88824201D00620F8E7DC +:1042D0001F98824201D10720F3E7012210A98A75B5 +:1042E000D4488882002003239B020146994393020D +:1042F000CB1810A90B8669468A81CF4ACA8118A9B2 +:10430000887110A9888419A904916946CA82069007 +:10431000FF20087503A802F06AF900242546274605 +:1043200008AA052103A802F065F9002810D0822808 +:104330006FD1002C6FD0002D6DD010A88480C58067 +:104340000021017418A8807B11AC012865D06DE0B4 +:1043500008A88079002F21D0012857D16846818C88 +:10436000B44881421CD113AA0DA905206B4607C38E +:104370006846408C10230022FF2102F0ADF900288E +:1043800068D110A88089042801D006284CD168463D +:10439000818E1F98814239D10F2092E7012835D1B3 +:1043A0006846808C0521C902884202D0491C884297 +:1043B0002CD19F4841886846408C814201D1012719 +:1043C00000E00027002C01D0002D10D01F9988425A +:1043D0001CD113AB0DAA05216E460EC60446102350 +:1043E0000022FF2102F078F9002833D101E03546A0 +:1043F0000CE010A88089022801D0102814D1C0B286 +:104400001BAA0DA9FEF76FFC00280DD16846468C4B +:1044100086E71FE0FFE7052053E714A91BA8221D2C +:10442000FEF787FC002801D003204AE710A8007C93 +:104430000023001DC2B210A80274209802900194BB +:10444000009215A81C9901F0FEFF002802D17849BE +:1044500002220A70FEF725FE33E710B50B46401E18 +:1044600086B084B203AA00211846FEF743FF04AACF +:10447000052103A802920191009001230022FF214F +:10448000204601F045FF04466846008A012804D012 +:104490006D206A49000116F05EFE2046FEF701FE1F +:1044A00006B010BDF0B5624F0446387887B00E46AE +:1044B000032804D0042802D0082007B0F0BD04AAC5 +:1044C00003A92046FEF7EFFE0500F6D1606880786C +:1044D0004007800F02280DD1684680898004800F34 +:1044E00008D02069002805D055490968884201D2C2 +:1044F0001020E2E7208905AA6B46216907C36946B7 +:104500000A8A63892068039901F09DFF002802D080 +:10451000FEF7C7FDD1E7002E02D06846808A3080C2 +:10452000042038702846C8E738B50C00054609D085 +:1045300000236A46FF2102F031F9002804D0FEF77B +:10454000B0FD38BD102038BD69462046FEF755FE47 +:104550000028F8D1A078FF21C307DB0F2846009A76 +:1045600002F044F9EBE73EB50C0009D002AB6A4615 +:10457000FF2102F013F9002804D0FEF792FD3EBDA2 +:1045800010203EBD0321204616F0B8FC6846008886 +:1045900001A90005800FFEF71CFE00280BD168461C +:1045A000007920706846008801A98004800FFEF71A +:1045B00010FE002801D003203EBD684600796070DF +:1045C000A278EF20024068460088C10B09010A4327 +:1045D000F7210A404104C90FC9000A43A270F9211A +:1045E0000A40800601D5022000E001204000694613 +:1045F0000243097A50084000C907C90F0843A07058 +:1046000000203EBD7FB514460522019203AD029500 +:1046100000930A462388FF2101F07AFE69468989C2 +:104620002180FEF73EFD04B070BD0000052A0000A9 +:10463000400C002002280000FFFF0000FC380000B2 +:1046400028000020F3B5002799B068460C4607877C +:104650003D4600291DD0E068002806D0A06800284B +:1046600017D001886A4611870780199803F0CBFBA1 +:10467000002811D0007822287ED3199800F038FC49 +:10468000009000220421199807F04EFB060009D182 +:1046900004E010201BB0F0BDFC48FBE7FC49FD48DE +:1046A00016F059FDA078012803D0022801D0072078 +:1046B000F0E72088002808D0401E80B203AA0099A5 +:1046C00001F069FF002859D11DE0F048401CE1E7E6 +:1046D0006946498A228891420BD26846807D00252E +:1046E000012810D16846808AEB4988420BD1012508 +:1046F00009E0914203D1002D2AD06D1C01E0022D6A +:104700000BD0032D04D203A801F04EFF0028DFD008 +:1047100082281BD0002831D11DE06946897D0129FE +:10472000F1D16946DC4B8A8A5B1ED11A9A420FD0BE +:1047300005DCDA48101A0BD00128E4D108E0012981 +:1047400006D0FF390129DED10325E1E7022D15D17D +:104750000D2080029EE7E068002816D00EA90522F1 +:1047600002910192009069460B8FA2882088FF2158 +:1047700001F0CEFD002800E01DE002D0FEF791FC24 +:1047800088E76846A168008F08806846008AC006EE +:1047900001D5C3487EE70798002803D06846008B00 +:1047A000022801D0032075E70798A1780078012935 +:1047B00003D0800710D408206CE7C007FBD000228C +:1047C0000721199807F090F8002802D00725022049 +:1047D00004E0AE48801C5DE70225032008A90870AC +:1047E000218868468185199808360A90099617210C +:1047F0006846818712AB02330FAA052108A80097EB +:104800000CF0DBFF002802D0FEF7B7FC42E710A84F +:1048100000906846838F04222946199806F085FD8A +:1048200038E770B5064615460C460846FEF7F6FB17 +:10483000002804D12A4621463046FFF789FCF3E6DA +:1048400010B5FFF734FD10BD70B51E4614460D00BF +:1048500014D0002C12D0616800290FD00121FEF77E +:104860004CFE002809D12068FEF7D8FB002804D1AF +:10487000324621462846FFF736FAD5E61020D3E621 +:1048800070B515460C000ED00221FEF736FE00284A +:1048900008D12068FEF7C2FB002803D12946204634 +:1048A000FFF700FEC0E61020BEE6F8B506467D48DC +:1048B0000D46016814468A4231D36068002808D04A +:1048C000794A90422BD301229204904201D388422C +:1048D00025D37648864204D0304603F094FA002867 +:1048E0000CD0304600F004FB0646284600F0BDFA26 +:1048F000002804D16068002802D012E06348F8BDA7 +:1049000000236A463146284601F048FF002802D0BD +:10491000FEF7C7FBF8BD68460088800601D410206A +:10492000F8BD6188224628466368FFF76BFEF8BD34 +:10493000F7B55C4E0746306886B01446824202D214 +:10494000102009B0F0BD384600F0D2FA05465748AD +:10495000874201D0FF2D08D0002304AA29460798DA +:1049600001F01CFF002826D101E04848E9E768462D +:10497000008AC00601D54A48E3E703A90020029156 +:104980000527019000976288484B2946079801F057 +:10499000A3FE00280FD161683268914208D30191CB +:1049A00002900097238862882946079801F094FEB8 +:1049B000694689892180FEF774FBC2E7002907D088 +:1049C0003B4B0A881B899A4202D83048401C7047EA +:1049D00038E610B586B004236C46A382344BDC88DD +:1049E000002C07D01B898B4201D2914204D9274861 +:1049F000401C55E5062053E56B4619825A8200217A +:104A0000009101911C800221997005A9029104A9CD +:104A100003916946FFF716FE42E5F3B50C4685B0F3 +:104A2000812069460873002C1AD0059803F0EBF931 +:104A3000070017D03878222868D3059800F058FA74 +:104A4000049000220121059806F04EFF00280BD0AB +:104A500000220421059807F067F905000AD105E056 +:104A600010202AE5094828E5112026E508491148C3 +:104A700016F071FB284608300CF0F6FA064620784E +:104A8000012819D0022838D0072016E5023000008E +:104A9000FC380000E10800000328000000280000A6 +:104AA000013400002800002000C00100FFFF0000CA +:104AB000400C0020840A0000A18803AAFEF728FB0E +:104AC0000028CED1B00721D56846007B00281FD131 +:104AD000A079C0071CD0E068002205216B4607C3FF +:104AE000638922896888049901F012FC6946087379 +:104AF00000280DD0FEF7D5FADFE4A18803AAFEF75F +:104B000007FB0028ADD13420064201D10820D4E4AF +:104B10006846037B29463846059AFEF717FDCCE424 +:104B2000FFB597B0002001901F4615460C460E4673 +:104B3000179803F068F9002804D00078222803D2DF +:104B40000820A7E5F348A5E5B80801D00720A1E5AE +:104B5000032F00D10027179800F0CAF90890002C05 +:104B60001BD0022D77D3EC48006884427CD36119B6 +:104B70000091012902D0491E814275D3AD1EAAB20F +:104B80002146E6480DF0F0F800991E394A7F0B7F68 +:104B900011021943884267D1ADB2E148B90702D585 +:104BA0000189491C00E0012189B20091F90701D077 +:104BB000078900E0D94F03AA0899009801F0EBFC9F +:104BC0000DE0F078B1780002084310284CD8019924 +:104BD000091D401880B20190A84245D82618002E21 +:104BE00060D0707831780002084300998842E8D399 +:104BF00058E06946098A0A0754D5002C3FD0019A2B +:104C0000A618121D92B20992F278B37812021A43D2 +:104C10009446102A28D8099A6244AA4224D8727865 +:104C2000337812021A4390421ED1C8061ED5099845 +:104C30000AAA052120186B4607C370783178000254 +:104C4000084363460022089901F062FB002803D064 +:104C5000FEF727FA1EE507E0F078B1780002084376 +:104C60006946098D884201D00B2013E5F078B178B0 +:104C7000000208430999401880B2019006E0C90675 +:104C800004D50899FEF79FFC0028E3D16946088AFD +:104C90001021884369460882488AFF23049A0899AC +:104CA00001F0A4FD03A801F07FFC002803D16846B1 +:104CB000408AB8429DD900220421179807F034F8A1 +:104CC000040003D19749984816F045FA2088002837 +:104CD000C0D0012108A80170017300264673218805 +:104CE0006846018620460830099017980A90FCF71C +:104CF00039FE05001BD01798688017206946888008 +:104D000010AB023301AA052108A800950CF055FD4F +:104D100007466878000704D583488249223016F098 +:104D20001AFA002F09D03846FEF727FAB2E4132109 +:104D3000179804F04AFB0320ACE40EA800906846E4 +:104D4000838804220121179806F0EFFA00288CD1FD +:104D500026809FE4F0B500248DB01F4615460E4610 +:104D6000002A04D0B90804D007200DB0F0BD1020EF +:104D7000FBE7032F00D1002700F0BAF80390FF28CB +:104D800004D06749B80703D5488902E06148ECE7D9 +:104D90000120FA0702D04989491E00E05F4906AAAE +:104DA0008FB2039901F0F7FB38E06946898B090758 +:104DB00034D504AB05210022029300910192574B98 +:104DC000039901F089FC002821D1002E21D06A46E8 +:104DD000128A2988A2183019121D914234D36946CB +:104DE000CA8B0270120A42700A8A8270120AC2705A +:104DF00004A90522001D0092029101906946C88B0A +:104E00000B8A0022039901F067FC002801D00320DF +:104E1000ABE76846008A2018001D84B206A801F09E +:104E2000C3FB002804D0822806D0FEF73AF99CE79D +:104E30006846C08BB842B8D9002C07D0002E10D0DD +:104E40002988A01C814203D20C208EE705208CE724 +:104E50002246314631480CF087FF31190870000AAC +:104E60004870A41C2C8000207FE700B585B06946FF +:104E7000FEF7ACFA00280AD16846007C030016F061 +:104E80008BFA08052F2F2F2F08080531032005B0B6 +:104E900000BD68468078012807D168460088032154 +:104EA000C902401A1CD001281AD06846807901280E +:104EB00006D16846808815214902401A05280FD975 +:104EC0006846807A012811D16846018929200002AC +:104ED000081A05D0022803D0032801D0042805D1E0 +:104EE0000F20D4E711A1164816F035F90020CEE7BF +:104EF00010B506F00FFF10BD10B50C4601F01EFBFB +:104F0000002803D009A10F4816F025F92046FEF726 +:104F1000C8F810BD0230000028000020FFFF00008C +:104F2000400C0020FC3800003F0B00007372635CF3 +:104F300067617474735F636F72652E6300000000B5 +:104F400022020000BB060000F8B500780C461646A9 +:104F500010340E36069F022809D0032836D00528C3 +:104F60007ED0FF20F6A1E53016F0F5F8F8BDCD892A +:104F70000A2068430E30188031203880002AF5D08E +:104F8000087B9581801FC7B21AE020886168308055 +:104F900048780A7800021043F080C8788A780002C6 +:104FA00010433081B21C3846091DFDF79CFE002FCE +:104FB00001D0002802D000203071708008340A36F9 +:104FC00028466D1EADB20028DFD1F8BDCD890A207C +:104FD00068430E30188032203880002AF5D0087BD4 +:104FE0009581401FC7B243E0616822880878F2804B +:104FF0003279C30752085200DB0F1A43FD231A40CF +:105000008307DB0F5B001A43FB231A404307DB0FC8 +:105010009B001A43F7231A400307DB0FDB001A43F8 +:10502000EF231A40C306DB0F1B011A43DF231A408C +:105030008306DB0F5B011A43BF231A404306DB0FD5 +:105040009B011A433271C00970718A784B78100243 +:105050001843308132463846C91CFDF744FE00E053 +:105060000CE0002802D00020B070308008340A36EE +:1050700028466D1EADB20028B6D1F8BD087BCD899B +:10508000801E86B2304608306843103018803420C5 +:105090003880002AF1D0174695811037E800D68174 +:1050A000C01900900DE02088388000987860324662 +:1050B0006168009815F0C5FE00980834801908371B +:1050C000009028466D1EADB20028ECD1F8BDFFB5AA +:1050D00081B00A9D1E460C46002A05D0607AFF303A +:1050E0000130D080E089108101980E2700780300FC +:1050F00016F052F90B7E0719293541536C787878F0 +:105100007E000092087B082805D0032803D091A1D7 +:10511000954816F020F8378030200FE000990020E5 +:10512000888105B0F0BD0092087B042804D08E4829 +:1051300088A1143016F00FF83780312028800098AD +:105140000028EBD1EDE70092087B042804D09320DF +:1051500080A1800015F0FFFF37803220EEE700923B +:10516000087B022804D080487AA13A3015F0F3FF7A +:1051700037803320E2E7087B1746042804D07A48BA +:1051800074A14C3015F0E7FF1020308034202880C7 +:10519000002FC6D00020B88116E0207B17460528D6 +:1051A00006D0062804D070486AA1603015F0D3FFFD +:1051B0001220308035202880002FB2D0E089B881BD +:1051C0000020388201984088F881AAE70092087B85 +:1051D000072804D064485FA1713015F0BCFF378008 +:1051E0003620ABE733460095019800F00AFC98E7BB +:1051F0002F2053A1000115F0AEFF92E770B50C46C9 +:10520000054602F000FE002804D00078222803D2D0 +:10521000082070BD554870BD00220521284606F0C3 +:1052200083FD2060002801D0002070BD032070BDE8 +:10523000FFB58BB00D4607461720694608850E98C6 +:1052400003261446002805D10EA93846FFF7D6FFDD +:10525000002834D1002D0BD000220321384606F05F +:1052600043FB002834D00E980078002830D108E0A5 +:105270002078092819D00F2823D031A13C4815F0F7 +:105280006AFF0E98A760801D03AA606002320AA917 +:10529000204600F00CFC002827D0030016F07CF814 +:1052A000071A182323211C1E23000726002231463B +:1052B000384606F019FB0028E3D12C48801C0FB0BB +:1052C000F0BD00220321384606F00EFB0028D8D19D +:1052D0001120F4E70020F2E70820F0E72348401C03 +:1052E000EDE70720EBE70320E9E701A80090684617 +:1052F000038D04223146384606F017F80028DED127 +:10530000002DDCD00E990D70D9E730B587B01D4661 +:105310000C46002A11D0042369460B7013888B8138 +:105320005288CA81A2788A7422880A8200236A4637 +:105330002946FFF77DFF07B030BD1020FBE70000D6 +:105340007372635C67617474635F636F72652E630D +:10535000000000007372635C67617474635F636F65 +:1053600072652E630000000025020000023000007C +:105370004F030000F3B581B001980C460078082671 +:10538000030016F009F8125E46461B134A0A0A0A81 +:105390000A0A0A0A0A0A0A0A0A5E002C02D1F64917 +:1053A000F64808E06078304360703BE0002CF9D1AB +:1053B000F248F149083015F0CEFEF3E701980022DB +:1053C0008088052187B2384606F0AEFC0546002CE1 +:1053D00004D07520E849C00015F0BDFE002D04D1B1 +:1053E000E648E549143015F0B6FE3946A81D00F030 +:1053F00055FBFCF7B7FA040006D0607830436070C4 +:105400006780FCF790FA0FE01321384603F0DDFFC8 +:1054100015E0DA48D849283002E0D848D6492D307E +:1054200015F099FE002C0AD06078000707D593206C +:1054300020702046582208300199FBF7C5FE002055 +:10544000FEBDCE48CC493130EAE710B500210170ED +:10545000801D00F020FB10BD0A4610B50146901DCE +:1054600000F024FB10BD70B505460022052106F0B2 +:105470005BFC040004D1F920BF49800015F06BFEED +:105480002946A01D00F00AFB70BDF7B5054684B0A3 +:105490000C4600206946088188806F8802460521F5 +:1054A000384606F041FC060004D1FD20B2498000D8 +:1054B00015F051FE002C03D0A7800020E080208151 +:1054C000297A20461230C91E142700900B0015F0CF +:1054D00063FF0FFDFCFB3809A95E657A2FB2C9E9AD +:1054E0009191FB003078012804D0A3497020143139 +:1054F00015F031FEA9896A46C8000E309080302030 +:105500001081002C13D0A18100200DE0C100327960 +:1055100009190A747288CA8182005319DA894A8289 +:105520001A8A401C8A8280B2A1898142EED8F1E0B9 +:1055300002A8009001AB22462946304600F02AFA24 +:10554000E8E03078042804D08B49BD20143115F0F0 +:1055500002FEA8890622014650436A460E3090801A +:1055600033201081002CE2D0A18100200BE0062125 +:1055700041434F190919FA89CA81BA7C8A743A8A57 +:10558000401C0A8280B2A1898142F0D8C2E0307802 +:1055900006280BD078491431D72005E0307806284A +:1055A00004D07549EB20143115F0D5FDE889694622 +:1055B0001230888035200881002CB8D0A989A181BB +:1055C0007188E18126E03078072804D06A49FF20FD +:1055D000143115F0C0FDA8896A4601460E3090804E +:1055E00036201081002CA2D0A1812046AA890E303D +:1055F000296954E0E8896946123080B238228880EF +:105600000A81002C7ED0A989A181287A102807D090 +:105610000221A173E9892182EA89296900983EE083 +:105620000121F6E702A8009001AB22462946304648 +:10563000FFF78AFC6EE03078082805D04E49FF203D +:105640001431EE3015F087FD6846372187800181DF +:10565000002C5FD0A989A1810020608220820120D6 +:10566000A07357E03078092805D04349FF20143152 +:10567000FF3015F070FD288A694614308880372085 +:105680000881002C46D00421A173A989A181E98950 +:105690002182298A618220462A8A1430696915F09C +:1056A000D0FB37E030780A2804D03349344814312D +:1056B00015F051FD6846372187800181002C29D0E3 +:1056C0000521A173002002E01FE004E00DE0A081AD +:1056D000208260821EE002A8009001AB224629468B +:1056E0003046FFF7F4FC15E00CE00D206946392246 +:1056F00088800A81002C05D00120E08000202081D4 +:10570000207307E00699088019E01C481A49A43064 +:1057100015F021FD6846069980880880002C0ED07F +:10572000684600892080684680886080287A03283F +:1057300005D0102803D0112801D00020307000209F +:1057400007B0F0BDF7B5568815460F4682B0002267 +:105750000521304606F0E8FA040004D1074806495E +:10576000C43015F0F8FCA41D33462A46394600948F +:10577000029800F022FBD4E440530000950300009F +:1057800013020000F7B58CB00D46144607A90C981B +:10579000FFF734FD002812D1B64E0127002C0FD0A0 +:1057A0000321684601701021818208A802460690F4 +:1057B000204605A9FDF7BDFA00280BD007207EE59D +:1057C0000821684601708581C68105218774C90258 +:1057D00001820BE00798A178017121884180684619 +:1057E00005218774C90201828581C6810246012193 +:1057F000079B0C98FFF71CFD61E508B501236A467D +:1058000093709D4B13800A4602236946FFF77DFD86 +:1058100008BD08B501236A469370974B5B1C138043 +:105820000A4603236946FFF770FD08BD00B587B03F +:1058300000290CD002236A4613700B889381498893 +:10584000D18100230421FFF7F3FC07B000BD102035 +:10585000FBE710B5002903D00523FFF756FD10BD67 +:10586000072010BD70B588B00D461446064607A93E +:10587000FFF7C4FC00280DD1002C0DD0062168468E +:1058800001708581C481079B02465C8006213046F9 +:10589000FFF7CEFC08B070BD052168460170858118 +:1058A000F1E710B588B000290BD007246B461C70B7 +:1058B0009A81049100236A462146FFF7B9FC08B09B +:1058C00010BD1020FBE770B50024172288B0002916 +:1058D00014D00D782B0015F05FFD06230505190483 +:1058E0001B231522D21E93B2CA88002A02D08E68CA +:1058F000002E03D09A4203D90C20CBE71020C9E731 +:10590000042D05D08A88002A0AD101E00620C1E7CB +:10591000012D11D0022D05D0042D18D0052D23D036 +:105920000720B7E709236A4613704B889381CB8819 +:10593000D381896804911DE00C236A4613704B885B +:105940009381CB88D38189680824049112E00D23C8 +:105950006A4613704B8893818B88D381CB881382DE +:1059600089680924059105E00E236A461370497879 +:1059700011730A2400232146FFF75AFC8AE700B579 +:1059800087B00F236A461370918100231946FFF7F1 +:105990004FFC5AE7FEB50078089D1C4616460F4698 +:1059A000012803D03549912015F0D5FBF889C000B6 +:1059B0000E30208030202880387B001FC0B201903C +:1059C000002E1DD0F889B081002516E0E80084196A +:1059D000C0190090224641690E320198FDF783F903 +:1059E000002802D000202074E08100986D1C008AFD +:1059F00060820098ADB2408AA082B089A842E5D802 +:105A0000FEBD70B514461425049A1D8037231380FB +:105A1000002C0ED0CA89A281002262820078082858 +:105A200008D0092810D00A2819D01449144815F0B4 +:105A300092FB70BD087B0C2804D011480F490C382C +:105A400015F089FB012008E0087B0D2804D00C48E4 +:105A50000A49083815F07FFB0420A07370BD087B4D +:105A60000E2804D006480549001F15F074FB0520D8 +:105A7000F3E70000FFFF000002280000545300007D +:105A8000BB02000010B5FE4B586019721A80C900A5 +:105A900015F036FA10BD00210180704710B50022C4 +:105AA000D2430280032006F0A8FD10BD7047F0B578 +:105AB0000E460446017801208840F24999B008401A +:105AC0000090616815460888EF4A904206D0009A17 +:105AD000002A06D0EB4A521E104202D0012019B013 +:105AE000F0BD009A10430880002D12D000202870CD +:105AF0002178EA1C0027681C01920B0015F04CFC71 +:105B000010F30E16233A59616F3CB4B08AB8F2F123 +:105B1000F0F320780B28EBD00420E0E70221297075 +:105B2000A1890170090A4170032097E004212970BE +:105B3000A1890170090A41700198E1890170090A7F +:105B4000417005208AE006212970A1890170090AA7 +:105B500041700199E2890A70120A4A70218A017122 +:105B6000090A4171A28AE81DA16915F06AF9A08AA3 +:105B7000C01D73E0082129702178082901D1102166 +:105B80002970A1890170090A41700198E1890170A9 +:105B9000090A41700520308020466A1D02A9103094 +:105BA000FDF7C7F800287DD169463088097A40188A +:105BB00054E00A212970A1890170090A417003206B +:105BC0000BE00C212970A1890170090A417001982C +:105BD000E1890170090A4170052030809CE0A089AC +:105BE00084464000401C81B2308888425AD305293F +:105BF00058D30E202870002008E0236942009B5AE9 +:105C0000521953701B0A401C937080B26045F4D344 +:105C10003180B9E09A48417A002973D0491E417217 +:105C2000217B4068C9004518A988286808224018C7 +:105C30000838216915F005F9022168460171002133 +:105C4000417128680390A98868460181002101A854 +:105C5000FFF790FB0020A880002E00D0308093E05A +:105C60002978802211432970297840221143297014 +:105C700029788909890112312970A1890170090ADD +:105C80004170E289E81C216915F0DBF8E089C01C4D +:105C90003080287841063FD5C00975D0012168467B +:105CA000017200E02CE0002141723188091D8181E0 +:105CB0000495E189019808180590001D0690704828 +:105CC000017A68460177002102A8FFF753FB0746D7 +:105CD00030880C303080022F06D0002F54D065E081 +:105CE0003DE033E01CE05EE065486946097F4268BC +:105CF000CB00D218037A994202D29188002902D0AF +:105D0000042753E02FE0417A491C41721560308826 +:105D100090800020308049E06168A089888033E06D +:105D200029788909890116312970A1890170090A28 +:105D300041700198E1890170090A4170228A681D49 +:105D4000616915F07EF8208A401D46E728788009B1 +:105D5000800118302870207B687002207EE7606820 +:105D60000188090401D4052720E0C088A189884260 +:105D700001D006271AE01E202870012030806068BC +:105D800001884904490C0180009800280ED03C4845 +:105D900000220088A1688300032006F087FB616869 +:105DA0002078887007E00020308003276068009921 +:105DB00002888A430280384691E6FFB59FB0289D4D +:105DC0000E46002805D0172803D82A882E4B9A4261 +:105DD00002D1072023B0F0BD3278530601D4D20996 +:105DE00001D00820F6E700226B461A715A7114465A +:105DF0003278431E1D939BB2189303AB1A939706F8 +:105E0000CB1CBF0E1B93821E711C3B0015F0C4FA05 +:105E1000209011EE66EE74EEB0EED4EEEDEEECEE08 +:105E2000EBEEEAEEE9EEEEEEE8EEE7EEE6EEE5EEBC +:105E300090EE05287CD1042168460171A978017291 +:105E4000F078B2780102114368464181317941719D +:105E500070788006800E0C282ED009DC801E03008E +:105E600015F09AFA0919661C6621662466276600F1 +:105E700012282AD00ADC0E2821D01028DAD121E0FD +:105E80004C0C0020FF710000FFFF000016281FD0FF +:105E90001828CFD11FE02878800701E02878400734 +:105EA000002845DA45E128780007F9E72878C00698 +:105EB000F6E728788006F3E728784006F0E72878A8 +:105EC0000006EDE72888C005EAE72888C004E7E770 +:105ED00028888004E4E728884004E1E72A789207CC +:105EE00026D50328A6D105206A461071487809787E +:105EF0000002084310811CE129784907F0D50628E3 +:105F000016D3717890B2012902D0022992D101E012 +:105F1000022100E01021189106216A46117100212A +:105F2000118102AF189AB11C0237921C1B921AE021 +:105F3000B3E04A780B7812021A433A80801E891C1B +:105F40001790BA1C1A911898FCF7CDFE1A99189858 +:105F5000189A091817986B46801A1A8980B2521C31 +:105F60001A811B9ABF1D8242E3D9002886D1E0E046 +:105F700028780007B4D51D98694682B207200871B9 +:105F800000200881701C0A3111E0437807781B0259 +:105F90003B430B80C37887781B023B434B806F46A3 +:105FA0003B89121F5B1C001D92B23B81091D042A14 +:105FB000EBD2002A71D1BCE02978C9066DD5022840 +:105FC0006BD30820694608710020488170780872F8 +:105FD000844692B2B01C1A9919E089E090E07EE004 +:105FE00067E05BE030E025E019E013E0BCE04378D7 +:105FF00007781B023B430B80831C4B606346D21A1D +:106000006F467B8960445B1C92B27B81083194456A +:10601000EDD9CEE7287880063FD5092203E028781D +:1060200040063AD50A2268460271AA880281189A67 +:10603000428107E0287800062FD50B206A461071B0 +:1060400018981081039174E02988C90525D5022884 +:1060500023D30C20694608710020488170780872AB +:10606000844692B2B01C1A9914E0437807781B0258 +:106070003B430B80C37887781B023B434B80031D57 +:106080004B606346D21A6F467B8960445B1C92B2B8 +:106090007B8108319445E8D98BE763E02988C904FE +:1060A00060D501285ED10D2168460171A988018162 +:1060B0003FE02988890455D5052853D30E22694627 +:1060C0000A71AA880A811B99401F4A78097812022E +:1060D0000A4369464A818881701D049029E0298815 +:1060E00049043FD501283DD10F206946087120E0C1 +:1060F0002A88120436D44A780B7812021A43EA80AE +:1061000003282FD332789206920E1B2A26D0112212 +:106110006B461A712A880123DB031A432A804A78C6 +:10612000097812020A4369460A81C01E48811B98F9 +:10613000039030788006800E1B2809D01D2807D0D8 +:106140000320229906F059FA2888C00BC003288042 +:1061500001A82199FFF70EF920463BE610226B4675 +:106160001A71DCE70724F7E70824F5E700B597B0D4 +:10617000032806D16A461070019100216846FFF796 +:10618000F9F817B000BD000010B58B78002B11D0C6 +:1061900082789A4207D10B88002B0BD003E08B79D1 +:1061A000091D002B08D08B789A42F8D103880C88FF +:1061B000A342F4D1002010BD812010BD052826D0B7 +:1061C000002A02D0012A0DD102E00988090501E068 +:1061D00009888904890F07D0012918D0022909D01C +:1061E00003290ED081207047002A01D00320704778 +:1061F0000220704703280AD0042808D0002804D0C1 +:1062000007E0042803D0022803D0052070470020AF +:1062100070470F20704770B51388054614460B80F1 +:1062200018061DD5FE481022807AA84203D81343D1 +:106230000B80002070BDA06893430078E840C00741 +:10624000C00E03430B802078A1788007800D08439F +:10625000F44914F05FFEA06869430818401C70BD43 +:10626000906870BD37B569468B88138019061BD5B9 +:10627000EB4C0125A47A9168844209D8FE280FD1FD +:10628000D80602D5A5406D1E00E000250D7007E080 +:1062900085400C78DB06DB0FAC4383401C430C705D +:1062A00010881021884310803EBDF8B50746C81CF1 +:1062B00080080E468000B04201D08620F8BD082A32 +:1062C00001D90E20F8BDD64D00202E60AF80288168 +:1062D000AA723446E88016E0E988491CE980810604 +:1062E00010D48007A178800D0843CE4914F012FE27 +:1062F000206800F0BAFA2989401880B22881381A3B +:106300008019A0600C3420884107E5D40020F8BD36 +:10631000FFB589B09F041646139DBF0C01930998E1 +:1063200000F095FA04000AD02078000609D5BC4890 +:10633000817A0A98814204D887200DB0F0BD0120EF +:10634000FBE7224669460A98FFF765FF06900020A2 +:1063500069460872052D14D0012221462846FFF710 +:106360002DFF0028E9D1207840060AD50221684691 +:106370000172099981810188C18106824782129840 +:1063800005900198000404D500273E460125079793 +:1063900009E02078A1788007800D0843A149079083 +:1063A00014F0B8FD0D46019840040AD50798A8429C +:1063B00007D12088E1788005800F00020843B042B1 +:1063C00001D3AE4201D90720B7E7B81980B20190D6 +:1063D000A84201D90D20B0E76846007A002804D011 +:1063E00002A8FDF718F90028A7D10798A8420BD1F9 +:1063F000208803210902884301998905890F090230 +:10640000084320800198E0701498002800D007808D +:106410001298002815D006983A468019129914F05F +:1064200010FD224669460A98FFF7F5FE694608887E +:106430001021884369460880224600990A98FFF790 +:1064400011FF002079E7FFB5754D0C22E888296817 +:10645000504383B00C180D9F7249059814F05AFDF3 +:106460000091049800F001FA29682A898E46611A81 +:106470000C310918944651188AB2A988914202D861 +:10648000842007B0F0BD6A46168A320603D5B206EC +:1064900001D58520F5E7EA88521C92B2EA800E9B6E +:1064A000002B00D01A80B20601D5A76006E0604438 +:1064B00080B22881091A70460818A0602246FE2082 +:1064C0000499FFF7CFFE0598A0700098E07020882F +:1064D0000599800889058000890F08430321090276 +:1064E000884300998905890F09020843042108435C +:1064F000208003988078A07103980088A0800020F5 +:106500002073310601D5AC7A00E00124B10600D534 +:10651000002700260EE0052100200191029000973F +:10652000E88831460C9B069AFFF7F2FE0028A8D1B6 +:10653000761CF6B2A642EED30020A2E7F1B5009891 +:1065400000F085F9060002D00025009C14E001202F +:10655000F8BD204600F07BF90746007831498007F6 +:10656000820DB878104314F0D5FC386800F07DF93E +:106570004019641C85B2A4B22948C188601E8142BA +:10658000E7DC00992648491EC1800189491B018129 +:1065900000203070F8BD002804D0401E108091709B +:1065A000002070470120704710B5044601881C4840 +:1065B000C288914201D3822010BD00680C22514351 +:1065C00042189079A072908820811088D178800537 +:1065D000800F00020843A081A078211DFFF71BFE59 +:1065E00020612088401C2080E080002010BD012117 +:1065F00001827047F7B50546002084B0C043108083 +:1066000068681746817868468170686801886846BE +:10661000018000218171288A2C88A04205D303E0E3 +:10662000580C00200102000004462C8235E0288A24 +:10663000401C2882301D6968FFF7A6FD00282AD17A +:1066400039889248814201D1601E38806888A04212 +:1066500028D33088F1788005800F0002084302902B +:106660006946301DFFF790FD002814D169898748DD +:1066700081421BD0002231460598FFF79FFD00287C +:1066800009D16A890298824205D1E968B06814F09C +:10669000ABFB00280AD0641CA4B2204600F0D7F857 +:1066A0000600C4D1641E2C828220EAE67C80B07988 +:1066B000B871B088B8803078B1788007800D084311 +:1066C00078810298B8813946287A32460831FFF736 +:1066D000A2FD38610020D4E6FFB585B01C460F4608 +:1066E000059800F0B4F8050009D02878000608D510 +:1066F0006748807AB84204D8872009B0F0BD0120ED +:10670000FBE707982A468605B60D69463846FFF727 +:1067100082FD07460E98052816D000222946FFF76D +:106720004DFD0028E9D1287840060DD501216846A5 +:10673000017105990181018841818681C48101A887 +:10674000FCF769FF0028D8D12888AA788107890D2D +:1067500011438005800FEA7800021043079A9642A1 +:1067600007D04C4A914204D3611E814201DD0B20C7 +:10677000C3E7864201D90720BFE7801B82B2A2424D +:1067800000D922461098002800D002800F980028D7 +:1067900002D0B91914F055FB0020AEE7F8B51D463C +:1067A00017460E4600F053F8040008D02078000683 +:1067B00007D53748807AB04203D88720F8BD01203A +:1067C000F8BD224639463046FFF725FD002D0BD097 +:1067D0002078A1788007800D08432E49884201D295 +:1067E000012000E0002028700020F8BDF8B51E460A +:1067F00017460D4600F02BF8040008D0207800065C +:1068000007D52348807AA84203D88720F8BD012005 +:10681000F8BD224639462846FFF724FDFF2E14D046 +:106820002588A178A807800D08431A4914F072FB47 +:10683000002E03D1FF31FF31033189B2A170A808C6 +:1068400080008905890F084320800020F8BD104989 +:10685000CA88824207D3002805D00C220968504319 +:106860000C38081870470020704703B50846694681 +:1068700009888A0607D4090604D50549897A41435F +:10688000491C88B20CBD00200CBD0000FFFF0000B9 +:10689000580C002001020000F8B507780D460446A8 +:1068A000012F19D0072F02D00C2F19D114E0A068A6 +:1068B000216906780B2E0BD0052005F09EFE052ED3 +:1068C0000ED0782300220520216905F0EFFD07E0B6 +:1068D000782300220620F8E70520216905F08DFEC7 +:1068E000002D0ED0002028702946204603F0E2F942 +:1068F000FE482978C05D884201D10320F8BD0220FE +:10690000F8BD0021204603F0D5F90020F8BD70B590 +:106910000E460C462036317901208AB015460029F2 +:1069200009D0012905D12978042902D10520107048 +:1069300000200AB070BD6068019005A802900D218A +:10694000C01C14F0DBFA032205A8A16814F079FA40 +:1069500001203071062069460870206A049029469B +:106960006846FFF799FFE4E770B50C4615462031FD +:106970000A790120062686B0002A2CD0012A28D1C7 +:106980002978042925D169681022A06801F0B5F999 +:106990006868C07B000606D5D44AA0681023103A68 +:1069A000014601F09FF91022A168E06801F0A5F905 +:1069B000A068C07B000606D5CC4AE0681023103AD8 +:1069C000014601F08FF92E70A0686860E068A86049 +:1069D000002006B070BD60680190C4482038029065 +:1069E0000120087168460670206A049029466846AE +:1069F000FFF752FFEDE7027B032A06D00022242393 +:106A00005A540B78092B02D003E0042070470A7611 +:106A1000CA61027B9300521C0273C150032070476D +:106A2000F0B50E4615460C46203602463179012057 +:106A3000072393B000290CD0012924D002292ED09D +:106A4000032904D12978042901D12B70002013B027 +:106A5000F0BD01203071606800280DD0A1690B7075 +:106A600060684860206988606069C860206A086260 +:106A70001046FFF7C0FFEAE706202870206968602B +:106A80006069A86009E029780629E0D10220307108 +:106A9000042028709548203868600320D7E72978BB +:106AA0000429D4D1A08910280AD9103880B2A08135 +:106AB000A1681023091805A86A6801F013F923E0FA +:106AC00010282FD0C2B21020801AA1680DAF1190EB +:106AD000C01914F0B6F911980006000E06D0401E39 +:106AE000C1B280207854384614F008FA6269102345 +:106AF0000DA909A801F0F6F8102309A905A86A68EC +:106B000001F0F0F8032030716068019005A8029050 +:106B1000062069460870206A049029466846FFF7F7 +:106B2000BBFE94E710232269A168E2E7F0B50E46A8 +:106B30000C4620363179012006278FB015460029F2 +:106B40000BD0012932D0022905D12978042902D19C +:106B50000820107000200FB0F0BD217D08A8CA07E2 +:106B6000D20F02718807C10F08A801716846027030 +:106B700041700722801CE16814F063F902A8072223 +:106B80000130216914F05DF9606805900AA806904B +:106B900010236A46A16801F0A5F80120307168460B +:106BA0000774206A0890294604A820E0297804295F +:106BB000D1D1062205A8E16914F043F906A80622FE +:106BC0000230A16914F03DF900200890606801903E +:106BD00009A80290102305AA696801F083F8022031 +:106BE000307168460770206A049029466846FFF7AE +:106BF00053FEB0E770B50D460C46203529790120CB +:106C00008CB01646002909D0012905D13178042914 +:106C100002D10920107000200CB070BD6068019096 +:106C200006A802900822E16814F00BF9082208A8CF +:106C3000A16814F006F90120287106206946087041 +:106C4000206A049031466846FFF726FEE4E770B5F7 +:106C50000D460C462035297901208CB016460029B6 +:106C600008D00129D8D131780429D5D10A20107053 +:106C70000020D1E76068019006A802900822A16870 +:106C800014F0DFF8002008900990012028710620F8 +:106C900069460870206A049031466846FFF7FCFD9B +:106CA000BAE730B50B4620331C7901208BB0002C9D +:106CB00009D0012C05D11178042902D10B201070C4 +:106CC00000200BB030BD4868019005A802908C6888 +:106CD00068462578057564784475CC68257885758F +:106CE0006478C47500200690079001E0E4B30100C9 +:106CF000089001201871062368460370086A049002 +:106D000011466846FFF7C8FDDBE770B50C46203436 +:106D1000034625790120002D0AD0012D14D0022D23 +:106D200005D111780A2902D10C201070002070BD05 +:106D300001202071C868052202704A684260F84A42 +:106D40008260921CC2600BE015780B2DEFD10220FF +:106D50002071C86804240470526842608A688260A6 +:106D6000096A016201461846FFF745FE70BD30B55D +:106D7000011D02463132947803258379ED432C437B +:106D800023408371DB070DD04B79547923404B713D +:106D90000B79127913400B718278C9788A4200D935 +:106DA000817030BD00224A710A71F5E7F7B50C46D3 +:106DB00086B00020694626460870203631790127C2 +:106DC0001E2015461F2977D24B007B449B885B0011 +:106DD0009F441E0017023E025602690288029A0270 +:106DE000D102F5022E03590371037F03AE03C303DF +:106DF000CC03F7031A0464049A04AB04DF04FE0412 +:106E000010052A0565059B05C605830587058B05C5 +:106E10006069002802D0007813287DD0A068059012 +:106E2000002849D0012168460170206A049003219E +:106E3000684601710A214171E069029020790028B9 +:106E4000EFD0059909780029E7D00C2964D20B000E +:106E500014F0A2FA0CFD1A4B90B5E8FCFBFAF9F815 +:106E600007FD022828D16069002802D00078082890 +:106E700052D1022168460170206A04900598417839 +:106E8000684601710021B9E20620216A05F0B5FBD0 +:106E900020790728E6D1606900F051FF02280CD064 +:106EA000606900F04CFF042807D060690028B8D062 +:106EB00000780128D6D103E01BE261690120087047 +:106EC00005980079C11F0A2901D30A2050E06169A1 +:106ED0000722887060690599303013F0B2FF0120F5 +:106EE000307161690320087034E00728BAD1606905 +:106EF000002896D001780929B4D10599C978890765 +:106F000007D1059949790029DFD1059989790029A7 +:106F1000DBD105994A7900E04EE2014620314B7DF4 +:106F20009A43D2D1059A8B7D92799A43CDD1059A15 +:106F30001279D31F0A2BC8D20979914236D8072279 +:106F4000C01C059913F07DFF0120307161690A2092 +:106F50000870032069460870206A04906069313027 +:106F600001906069001D029060691C300390A1E2ED +:106F70002076F2E311288DD1606900F0E0FE04284C +:106F800004D0606900F0DBFE0B2893D1606905999D +:106F900010223730491C13F054FF6069017804292E +:106FA0007CD12421095C8278914201D90620DFE757 +:106FB000052101700320307168460170E2E3112859 +:106FC00094D1606900F0BBFE062804D0606900F02F +:106FD000B6FE0C288AD1E068002813D0206900286A +:106FE00010D060690178062910D00D210170606908 +:106FF000059910225730491C13F023FF6069573060 +:1070000009218CE100206946087072E107210170B6 +:107010006069059910224730491C13F012FF60691E +:107020004730EDE70228F0D1606900F088FE0028C3 +:10703000EBD0606900F083FE0128E6D0606900F0C3 +:107040007EFE05E0B1E08DE06CE02AE00AE0D6E0EB +:107050000828DAD00521684601710598417868460C +:10706000417146E11128D0D160690028CDD0017866 +:107070000E29CAD1C16A4078022810D000201422FB +:1070800050431430085805991022491C13F0D9FEBA +:107090000520216A00F041FE0F205EE0F1E10120B1 +:1070A000EDE70B28B1D160690028AED001780F2937 +:1070B000ABD1C16A4078022826D000201422504368 +:1070C0000C300958059842780A70807848706069D9 +:1070D000C16A4078022819D0002014225043103091 +:1070E000085805990822C91C13F0ABFE0520216A37 +:1070F00000F013FE60694178022909D000220832AD +:10710000825C5208520073E00120D7E70120E4E7D7 +:107110000122F4E7012100E0002108314254BCE3E0 +:10712000BEB3010011289CD16069002899D0017874 +:10713000102996D1C16A4078022811D0002014226B +:1071400050431830085805991022491C13F079FE55 +:107150000520216A00F0E1FD112061690870B4E3A7 +:107160000120ECE7082884D1606900289DD00178CF +:10717000112997D10599C06A49780170606905990C +:10718000C06A0622401C891C13F05BFE0520216AA0 +:1071900000F0C3FD60694178022904D00022083262 +:1071A000825CFD2323E00122F9E71128BBD160694D +:1071B0000028BBD001781229B5D1C16A40780228D5 +:1071C00019D00020142250431C3008580599102271 +:1071D000491C13F036FE0520216A00F09EFD60690F +:1071E0004178022909D000220832825CFB231A4030 +:1071F000022991D18EE70120E4E70122F4E707207C +:10720000B6E6287801288ED16069696814221C309E +:10721000F9F7DAFF6069017F002901D02176ACE33C +:107220000178032901D0032037E00227C770817954 +:107230004907490F8171017A4907490F0172417A63 +:107240004907490F41726069FFF791FD377196E276 +:1072500028780F28E3D1072069460870216A049135 +:10726000916802916946087161690722C91C0298F8 +:1072700013F0E7FD61690420087000203071BBE065 +:1072800028780328CBD1606901780529696807D07F +:107290000822473013F0D5FD0420307105206FE23D +:1072A00008225730F6E728780328B8D160690178BA +:1072B0000529696811D008224F3013F0C2FD05205E +:1072C00030716069006A00280AD00220287000200E +:1072D00028716069006AA860F9E008225F30ECE775 +:1072E00004204DE22878022899D12879002801D07D +:1072F000207642E36069A96801626069002901D1D2 +:10730000F949016206200BE228780F2887D1A86886 +:10731000E0616069017805292BD047300721317180 +:10732000E16802220A706269126A4A6088606069D4 +:107330003030C8606069C01C08616269087D926A6B +:10734000400812784000D207D20F104308756269D6 +:10735000926A521C8A61FD2210406269D26A1278D8 +:10736000D207920F104308756069C06A401CC8615B +:1073700053E25730D2E728780828BAD160690178FB +:1073800005291AD00B210170072069460870206A70 +:107390000490E069029011200871029803210170A5 +:1073A00051681022401C13F04CFD00216846FFF785 +:1073B00073FA00203071E06187E20621E3E7287864 +:1073C0000F2896D1072069460870206A0490A868A3 +:1073D00002901120087102980421017061690A78F5 +:1073E000072A0ED0002232710C220A706169102225 +:1073F000401C473113F025FD00216846FFF74CFA89 +:1074000063E21022401C573113F01BFD0021684637 +:10741000FFF742FA0A203071E168032008706069C2 +:10742000006A486060695730886060694730F3E1FE +:1074300028780828A1D1606969681022373013F0D4 +:10744000D3FC002801D0042092E560690078072869 +:1074500017D00A203071E168032008706069006A63 +:10746000486060695730886060694730C860206A4A +:1074700008620698FFF7BFFA07466069FFF777FCD6 +:107480006BE208207AE1287809289AD10B20307124 +:1074900061696868897810224018511A13F02EFD2E +:1074A000082069460870206A049068680190606945 +:1074B0008078087268E129780D29BBD161698979E2 +:1074C000C90703D00C20307109203EE0307103273A +:1074D00070E228780E28ADD160691422291D1C3075 +:1074E000F9F772FE6069018DC06A4172090A817202 +:1074F00060698178C06AC1716169CA6A081D117AC0 +:10750000C909C90111724379626919438378D26A42 +:107510009B079B0F012B00D0002300799B01C0002B +:1075200003431943117260694078012876D0B4E1B1 +:1075300060694178022901D0012100E00021083171 +:10754000405CC00707D00E20EAE069460870206A58 +:107550001146049019E11320B8E728780F2894D138 +:10756000A868E0610F2030710520EEE72878032835 +:107570008BD16069C16A4078022801D0012000E007 +:10758000002014225043103008580822696813F074 +:1075900058FC10203071E16806202269087060698B +:1075A000406A48606069C36A4078022801D00120BF +:1075B00000E000201427784310301858CA60886013 +:1075C0002BE128780C2886D16069C26A40780228AD +:1075D00001D0012000E00020142148430C30105855 +:1075E00002230932696800F07DFB11203071E168E7 +:1075F000052008706069006A48606069C06A0930E7 +:1076000088603948001F07E128780B28A7D16169F5 +:107610004878CA6A022802D0012001E059E100201E +:1076200014235843143010588A78696813F009FC01 +:1076300060694178C26A022901D0012100E000217D +:107640001423594314315258817850181022511A7A +:1076500013F054FC072069460870206A0490E06922 +:107660000290112008710298062101706169CA6AAE +:107670004978022901D0012100E000211423594357 +:10768000143151581022401C13F0DBFB00216846D6 +:10769000FFF702F90020E06112206FE028780F2840 +:1076A00091D1072168460170206A04909068029089 +:1076B0000B2268460271029801706169CA6A4978B2 +:1076C000022901D0012100E00021142359430C318B +:1076D00051580A784270497881706169CA6A49785C +:1076E000022903D0012102E0C4B3010000211423C8 +:1076F0005943103151580822C01C13F0A2FB00213D +:107700006846FFF7C9F826E760694178022901D089 +:10771000012100E000210831405C800703D51420DE +:1077200030710A2011E71620D0E628780F287AD188 +:10773000A868E061072069460870206A0490E06943 +:107740000290112008710298082101706169CA6ACB +:107750004978022902D0012101E011E1002114231E +:107760005943183151581022401C13F06AFB002174 +:107770006846FFF791F80020E061152030710A207B +:1077800069460870206A049029466846FFF784F825 +:107790002BE028780F2846D1072069460870206A18 +:1077A00004909068029008200871029809210170E5 +:1077B00061690622C969097841706169801CC969DB +:1077C000491C13F03EFB00216846FFF765F8AAE765 +:1077D00060694178022901D0012200E000220832CC +:1077E000805C400703D51720C8E70746B5E00129AC +:1077F00053D070E028780F2815D1A868E0611820D0 +:107800003071E168052008706069006A486060694D +:10781000C06A09308860F848C860206A0862069823 +:10782000FFF7E9F8E1E76FE028780B286CD1606991 +:10783000C16A4078022801D0012000E00020142213 +:1078400050431C3008581022696813F0FAFA0720D8 +:1078500069460870206A0490E0690290112008715E +:1078600002980A2101706169CA6A4978022901D027 +:10787000012100E00021142359431C3151581022EA +:10788000401C13F0DEFA00216846FFF705F80020DF +:10789000E0616069407801281DD1192016E6606911 +:1078A0004278022A09D000210831411809780029BC +:1078B0000DD0CA0703D00E2106E00121F4E78907A5 +:1078C00001D5102100E012210170002772E0012A89 +:1078D00001D00D20FAE51C20F8E51D2030710B20A9 +:1078E00033E62978102948D1F0E56069017801294B +:1078F00043D0082941D00021317100F01AFA0C2040 +:1079000069460870206A049037E028780F2805D06F +:107910001020107003271B2030714BE007216846B0 +:107920000170206A0490A8680290022168460171E3 +:10793000029805210170217E417000216846FEF702 +:10794000ABFF0B2168460170206A04902946684607 +:10795000FEF7A2FF07461B203071012F0DD029E052 +:10796000012168460170206A049004216846017173 +:10797000217E41710020207612E0207E00280FD069 +:107980006169132008701A2030710A206946087056 +:10799000206A049029466846FEF77EFF074609E004 +:1079A0006069002801D01421017068460078002821 +:1079B00000D021E5384609B0F0BDF7B50F462037B5 +:1079C0003879012686B00C46002804D0012828D03A +:1079D00002281CD197E02079012804D0022811D078 +:1079E000032814D10AE0A068407801280ED10620AF +:1079F000216A04F0DCFD00287FD10CE0A16813208F +:107A0000087008E0A0684178022901D0052674E0DA +:107A10000078082871D1012038710A206946087061 +:107A200033E0089800780F2867D107216846017075 +:107A3000206A049008988568029522790220012A1C +:107A400004D0022A29D0032A57D10FE006466846FF +:107A500006710B202870207B00214007400F6870C2 +:107A60006846FEF719FFA068067045E006466846BE +:107A7000067105202870207B687000216846FEF79B +:107A80000BFF3E710B2168460170206A0490684626 +:107A90000899FEF701FF06462FE0684601710120B4 +:107AA0002870207C6870607CC007C00FA870A07C24 +:107AB0004007400FE870E17C2971C0071FD0207D8E +:107AC0004007400F6871607D4007400FA87100219A +:107AD0006846FEF7E1FEA06807222946303013F021 +:107AE000B0F9E068017AA06820300171A1682879B6 +:107AF0008870A16809200870002630465BE70020E6 +:107B0000A8716871E3E7A168142008700121684634 +:107B10000170206A0490042168460171217B417143 +:107B20000021FEF7B9FEE7E7F0B585B00F46054640 +:107B30000124287B800040198038C66F3078411EB0 +:107B40000A290AD22C498000323140188038C36F8C +:107B50003A463146284698470446002C01D0012C6D +:107B600011D1287B401E0006000E287301D003248B +:107B7000DFE70D2069460870306A04900021019605 +:107B80006846FEF789FE032CD3D0204605B0F0BD31 +:107B900070B515460A46044629461046FFF7C4FF4D +:107BA0000646002C0FD0207814280CD1207E002807 +:107BB00006D000202870204629460C30FFF7B4FF7D +:107BC000204600F0B6F8304670BD704710B5012968 +:107BD00003D0022901D0052010BD417000F0A9F8A2 +:107BE000002010BD002809D0027E002A06D00A46D7 +:107BF00001460C31CCE70000C2B301000120704700 +:107C000030B5044687B00D46062004F0F6FC294640 +:107C1000052004F0F2FC2078142805D000206946E5 +:107C200008702046FFF7DEFF07B030BD7FB50E4677 +:107C300000216A4611730178092903D00A2903D06B +:107C4000002407E0446900E08468002C02D0217E13 +:107C5000002912D0154601462846FEF7CCFE03281F +:107C600009D1324629462046FFF792FF6946097B33 +:107C7000002900D0042004B070BD25460C35EAE789 +:107C800000B50023012285B005280CD0062808D1B4 +:107C90006846027004910221017143710021FEF7D0 +:107CA000FBFD05B000BD6846027004910271F4E767 +:107CB00010B590B00C4605216B4619700190234811 +:107CC00002900892001D03900AA96846FFF7AEFFD4 +:107CD000002805D1102220460B9913F0B2F800209D +:107CE00010B010BD30B505E05B1EDBB2CC5CD55CDE +:107CF0006C40C454002BF7D130BD10B5002409E00E +:107D00000B78521E5B00234303700B78401CDC0988 +:107D1000D2B2491C002AF3D110BD70B50C460546FD +:107D200004F06BFC782300222146284604F0BEFBB9 +:107D300070BD4178012900D00821017070470028EA +:107D400001D000787047082070470000BCB30100E4 +:107D500070B5F84D040008D0012C10D0022C07D0CB +:107D6000032C05D0F4A1752007E0F3A16C2004E0FA +:107D70002878012803D0F0A1722013F0ECF92C70C0 +:107D800070BD70B5EB4D044610280AD0112C16D0EA +:107D900028468178122C07D0132C0AD0E6A1A42003 +:107DA0000BE0E5A1992008E0112908D0E2A19E206E +:107DB00003E0112903D0E0A1A12013F0CCF9AC70AD +:107DC00070BD10B5DB4894B0007B002819D0172097 +:107DD00069460870D74900A806220D31023013F019 +:107DE00030F809A9684603F0A8FE0446112805D01A +:107DF000002C03D0D0A1C02013F0ADF9204614B060 +:107E000010BD3220E4E710B50022022103F08CFF00 +:107E100010BDFFB595B01D460E460746FFF7F3FFB0 +:107E200004000AD02078222804D3A07F8006C00F47 +:107E3000A84204D1082019B0F0BDC348FBE73721A0 +:107E4000684601704780002D05D0012101714671FF +:107E50001799817102E000206946087109A96846F6 +:107E600003F06BFEA07FDF21084069010843A07783 +:107E70000020E0E770B50446084620380D460300B0 +:107E800013F08AFA0A060A11232C3342495057612B +:107E9000FF20A9A10D3052E02078202851D1FF20E9 +:107EA000A5A110304BE0A3480178032949D0807880 +:107EB000132846D02078242843D0252841D02328D1 +:107EC0003FD0FF209CA1133039E02078222838D001 +:107ED000232836D8FF2098A11A3030E020782228B5 +:107EE0002FD0FF2094A11E3029E02078222828D00E +:107EF000242826D0262824D0272822D0292820D07C +:107F0000FF208DA121301AE02078252819D0FF20EC +:107F100089A1283013E02078252812D0FF2086A1DF +:107F20002B300CE0207825280BD0FF2082A12E30AA +:107F300005E02078282804D0FF207FA1313013F0FD +:107F40000AF9257070BDFF207BA13430F7E730B50A +:107F50007E4C0B887E4A022801D0934204D09D1F9C +:107F6000A54225D2022802D04D88954203D04D88E3 +:107F7000AD1FA5421CD24C88A34219D88B88FF257F +:107F8000F435AB4214D8022802D0C888904205D0FC +:107F9000C8886E4D0A382D1FA84209D2C888904261 +:107FA00008D0944206D05B1C63438000834201DB0F +:107FB000072030BD002030BDF0B56649884245D36A +:107FC000654A0125AD041368A84201D398423DD308 +:107FD0000279002A06D0082A02D8067B082E05D985 +:107FE0000720F0BD047B002CFAD0F6E7002A06D06B +:107FF00004688C422AD3AC4201D39C4226D3002E83 +:1080000006D084688C4221D3AC4201D39C421DD35C +:1080100000240CE00568A700ED598D4216D3012716 +:10802000BF04BD4201D39D4210D3641CE4B2A242FE +:10803000F0D800220125AD040CE084689700E459D3 +:108040008C4203D3AC4203D39C4201D21020F0BD3A +:10805000521CD2B29642F0D80020F0BD10B5028971 +:108060003E4B111F994213D24189042910D3DB1CC6 +:1080700099420DD891420BD80178890706D54068FE +:10808000002803D0FFF798FF002800D1002010BD82 +:10809000072010BDFFB50022099B002802D099429D +:1080A00005DC6EE0002902D1002004B0F0BD0920FB +:1080B000FBE7845C002C12D087187D78112D59D0F5 +:1080C00010DC2B0013F068F90A561726262C2C2EEC +:1080D0002E4C4C56835C002B46D1521CD2B28A42A5 +:1080E000F8DBE1E71C2D45DA123D2B0013F054F9C3 +:1080F000044242121A42022CD9D1BB78039C072BAE +:10810000237001D25B0701D40A20CEE7029B012431 +:108110001B782CE0E343DB0708E0012C08D029E0C2 +:108120000620C2E70F2523072D075B19002BF4D08B +:108130003046BAE7640C00207372635C6761705F5D +:10814000636F72652E630000023000007B0C00003C +:10815000FFFF000000C0010028000020FD3F0000DC +:10816000029B1B789C0701D50B209EE7022423432A +:10817000029C2370835C521C9A18D2B28A4202DDA0 +:1081800095E7192676028A4293DB8DE710B50478CD +:108190000B46002C08D00121F94A012C07D0022CF3 +:1081A0000BD0032C13D10EE00021197011E01970CF +:1081B0008179890903290AD10BE01970817989092C +:1081C000012904D105E019708179890901D010468F +:1081D00010BD411C0622581C12F033FE002010BDB9 +:1081E00008B51346002806D0E6A00068009048793C +:1081F0006A468009105C18700622581C12F021FE95 +:1082000008BD30B50C46097895B0222902D2082065 +:1082100015B030BD282369460B704880132A03D05F +:108220003B2A01D00720F3E708460A7109A903F0A9 +:1082300084FC050003D121212046FFF71BFE2846C0 +:10824000E6E700B595B0232369460B704880108897 +:1082500088805088C880D088488190880881002014 +:108260008881C88109A9684603F067FC15B000BD84 +:1082700070B50C00064610D0FFF7C5FD050003D110 +:10828000C149C24812F067FFA6802889E08028898A +:10829000208168896081A889A08170BD70B50E4673 +:1082A000050003D00021092004F0A7F90120B84CF3 +:1082B000022E207324D0032E04D0D320B249800094 +:1082C00012F049FFB24806210D3003F02DFFA07CCB +:1082D0008006800EA074FFF774FDA08B00280ED0DE +:1082E000002D0CD0830001220021092004F0DEF8CB +:1082F000092804D0A548A449283012F02CFF70BDED +:10830000A3480321103003F00FFFA07C402180061A +:10831000800E0843A0749E480C3002F04EFBDAE752 +:108320007FB501A9022003F06EFD002851D09748C7 +:108330009549673012F00FFF4BE0029C207821280E +:1083400047D0A07F01072BD52046223000906846F9 +:108350002346628E80882146343301F084FC050078 +:1083600005D011282ED089488749843028E0A07F85 +:10837000F7210840A077E17F480889074000C90F2E +:1083800008432021095D4007400FC9000843E077FA +:108390002078282824D129212046FFF76BFD1FE0F3 +:1083A000400716D568462246808821460E32FFF7E0 +:1083B00048FF050008D0112804D074487249933052 +:1083C00012F0C9FE00250BE0A07FFB210840A0773A +:1083D00006E001A803F025FD0500AED0052D02D072 +:1083E000284604B070BD0020FBE7F8B5040004D1B6 +:1083F00066486549A13012F0AEFE722020706068B8 +:1084000008260178091F0B0012F0C6FF11FD0A466D +:1084100068FC460EFCFC4746464646FD92FD46007B +:108420007B205949C00035E087883846FFF7EBFCD0 +:10843000050004D11F205449400112F08CFE6078E1 +:10844000042130436070524CA07F0843A077212163 +:108450002846FFF70FFDA87F8007800F012801D174 +:10846000801EA080384603F0B1F83846FCF7FBFFC9 +:108470003846FBF79EFB3946022004F0BEF8A87F81 +:10848000EF210840A877FFF74BFF002804D03F48B2 +:108490003D49C93012F05FFEF8BD85882846FFF7D8 +:1084A000B2FC002804D139483749D33012F053FECA +:1084B00060688078012804D034483349D53012F000 +:1084C0004AFE60688179284603F09CF90028E3D0D1 +:1084D0006178314361706168C880F8BD878838462B +:1084E000FFF791FC050004D128482749E63012F037 +:1084F00032FE60783946304360706068C0882881F9 +:1085000060680089688160684089A881022004F061 +:1085100074F80020A875A87F8007800F0228DCD19E +:10852000FFF7FEFE0028D8D0212017494001B1E70F +:1085300080783C2803D00025022814D000E00125D3 +:108540000027002808D03C2806D0022804D00F4875 +:108550000D49FF3012F0FFFD002F06D002263046F5 +:1085600001F06CF9F8BD0127EBE7607830436070EB +:108570000748817F31438177002D0BD00126EEE73C +:10858000023200000302FF01388100002E030000C8 +:10859000640C002060688788384601F07BF9054646 +:1085A00060688079012832D00226A87F06228008E0 +:1085B00080003043A8776068C08A28816068008B9B +:1085C00068816068408BA8816068C079E8756168DF +:1085D00028461830083112F034FC60680622807B8F +:1085E00068706168A81C0F3112F02BFCA87F81070E +:1085F000890F384602F0D4FFA87F8007800F01283A +:10860000ADD101E005E008E0FE488780A7E701263C +:10861000CBE7204601F01EFEF8BD60783043607065 +:10862000F8BDF7B505460078002700090C463E4620 +:1086300001287DD00022F44902287AD0072804D0EE +:108640000A2877D0F149F24839E1686803780D2BA0 +:1086500035D006DC042B6ED0072B3AD00A2B69D11B +:1086600006E0122B3CD0132B44D0142BF7D1BEE0E4 +:1086700011270726002C7CD08088A0806968FB2306 +:108680008979A171DF4905468A7F1A408A770421DA +:1086900003F071FB0521284603F06DFB00212846FD +:1086A00003F069FB0121284603F065FB03212846FE +:1086B00003F061FB0221284603F05DFB01E1012785 +:1086C0000926002CD7D08088A08068688079207225 +:1086D000F7E012270E2680882146FFF7C9FDF0E05B +:1086E0001A270726002CC6D04088A0806868007929 +:1086F000A071E6E081783C293ED010271E26002C90 +:10870000B9D08088A0806868C08A20836868C08AE1 +:10871000E0826868008B60836868408BA08369682A +:10872000607D497F40084000C907C90F084303E046 +:108730006CE097E0BAE029E060756968C007497F9E +:10874000C00F49084900084360756968A21DC879CF +:108750000831FFF745FD69682246887B0D320F31ED +:10876000FFF73EFD68688079002803D0012020755E +:1087700007E076E00220FAE719270726002C70D0E0 +:10878000A271A048F722817F11407DE01B272E2691 +:10879000002C66D0A1806968A21D0879491DFFF7E9 +:1087A0001FFD68682030C07A60736868C07804284C +:1087B000A07B19D040084000A073F92108406968E7 +:1087C0001F22C9788907490F0843A07369684007C9 +:1087D000C97A400FC9000843A073696820460F306A +:1087E0000C3112F02EFB6CE001210843E4E71E2758 +:1087F0000E26002C6DD0A1806868E21D407AA07121 +:1088000069688878C91CFFF7EBFC5AE0287A0128D0 +:1088100005D0022815D07E487C4932384FE01D270C +:108820000E26002C55D06888A080A889E080E889B1 +:108830002081288A6081688AA0817248DF22817F36 +:10884000A2E712270E266888FFF712FD002C40D001 +:1088500068784007400F032833D16A48FD22817FA2 +:1088600092E736E0287A030012F096FD0604101015 +:108870002020202619270726002C2AD0A180614815 +:10888000A271817F4908490081771AE019270726DC +:10889000002C1ED0A180287A012805D00320A071C9 +:1088A0005848EF22817F6FE70220F8E721462846EB +:1088B000029A01F068FEFEBD55485449801F12F02F +:1088C0004AFC0298002C068001D027806680002098 +:1088D000FEBD02980680FAE710B54A4894B0807849 +:1088E000132802D0082014B010BD22206946087059 +:1088F00009A9684603F021F904460021072003F086 +:108900007CFE2046EFE700B53E4895B080781228FF +:1089100001D00820AAE41E21684601700021817060 +:10892000C17009A903F009F90028F3D1002107203B +:1089300003F063FE1120FFF724FA002096E400B54F +:10894000304895B00078022801D0032818D11B21A7 +:1089500008A801730021817369460BA803F0EDF8A4 +:10896000002804D1684640781B2801D003207DE40C +:108970000021084603F041FE68468078002801D0B7 +:10898000082073E40120FFF7E3F900206EE4F8B556 +:108990001C4C030012F000FD0A06791779797979E9 +:1089A00044356779FFF7CBFF00282AD1F8F7DAFFC3 +:1089B000002826D02221017000210172F8F7B3FFB0 +:1089C000A07F01214BE08EB23046FFF71CFA050074 +:1089D00004D10F480D492E3012F0BDFB2878212814 +:1089E0000FD0F8F7BFFF002814D012210170022722 +:1089F000077246800020A875F8F795FFA07F3843DE +:108A0000A077F8BD640C0020FFFF00003881000053 +:108A10005F050000132229463046FFF7F2FBF0E71E +:108A2000A578122D06D0132D07D0F849F84812F07A +:108A300092FBE6E7FFF767FF01E0FFF74DFF002835 +:108A4000DFD1F8F78FFF0028DBD022210170122D33 +:108A500007D002210172F8F766FFA07F10210843BA +:108A6000CEE70121F6E7A07C810901290BD080091E +:108A700004D0E748E549223012F06DFB03210020C5 +:108A8000FFF70CFCBDE70221F9E7E148DF49293097 +:108A9000CDE7F7B514460D0004D1DD48DB49313090 +:108AA00012F059FB28780827012807D002281FD088 +:108AB000D748D649623012F04EFBFEBD0098FFF752 +:108AC000A2F9060004D1D248D049383012F043FB55 +:108AD0000220B0751030207060783843607007CD88 +:108AE000083407C4CB482022817F11438177FEBD23 +:108AF0000098FFF788F9060004D1C548C3494630FD +:108B000012F029FBA988C448814208D1EA88824230 +:108B100005D1132231460098FFF773FBFEBD814259 +:108B200002D1E888002809D01220207060783843EC +:108B3000607007CD083407C4002006E078230022C7 +:108B40000220009903F0B2FC0120B075FEBDB148CF +:108B500040897047FFB591B01498FAF71BF90028C7 +:108B60005DD10124684603218471C90281800022FD +:108B700001A92046FBF7ECFA002850D168461521E0 +:108B800084714902818000261C2102A8009612F0FF +:108B9000B7F90120014668461031017000200146F6 +:108BA000684641708178F9273940891C21438170DA +:108BB000017A02252943017212998186C6861F21F6 +:108BC00001870C9011980F9001A80B9009AA0BA98E +:108BD00002A8FBF788F8002821D168468D4E808CCA +:108BE000F080684684718D498180807809AA384078 +:108BF000801C41084900684681708586058713A856 +:108C00000F900BA902A8FBF76EF8002807D1684661 +:108C1000808C308131460A311498FAF7CEF815B0BD +:108C2000F0BD30B50C467E4995B08C423CD37D49B1 +:108C3000012292040968944201D38C4234D3203833 +:108C400000220125030012F0A7FB06042A44484E27 +:108C5000575F0021082003F0AAFC002802D0112051 +:108C600015B030BD24206946087000A80522A11C5B +:108C7000023012F0E6F809A9684602F05EFF05002E +:108C80002FD1082300221146184603F00FFC0828B4 +:108C900027D05F485D49D63012F05DFA21E0606868 +:108CA000002803D0884201D21020D9E73D21684630 +:108CB0000170218841806188818009A902F03DFF0F +:108CC00005000ED1606800280BD06946098D01802F +:108CD00007E0206801F0B2FE02E0204600F024FE2A +:108CE00005462846BCE73E2007E0857000E082701C +:108CF00009A902F022FFF3E73420694608702078C2 +:108D0000C0076846F3D0F0E70720A9E730B50C4666 +:108D1000444995B009688C4201D21020A0E7203860 +:108D2000030012F039FB05042121232132002088A1 +:108D3000FFF769F8002804D00078222803D2082021 +:108D40008EE739488CE725216846017021884180EB +:108D500009A902F0F2FE050015D10AA90522023187 +:108D6000A01C12F06EF80EE006250CE0206800282A +:108D700005D0884201D2102505E001F055FE2548B6 +:108D80000025808BA08028466AE7072068E72148F5 +:108D90001330704710B520211E4812F0AFF80120A3 +:108DA000FEF7D6FF1120FEF7ECFF00211948C9435A +:108DB000818000218176E1218900818301460C3088 +:108DC0000D310446F8F74EFE1248072221461330B3 +:108DD00012F037F8FEF7F5FF002803D00B491348CF +:108DE00012F0B9F901F0E5F910BD10B504463C21C7 +:108DF00012F084F8A07F80088000A07720202070E7 +:108E00000020A0752034607010BD00003881000083 +:108E1000B5050000640C0020FFFF0000012A0000DF +:108E200000C0010028000020023000001C070000E4 +:108E30007047FEB50546FF480C46814207D3012026 +:108E40008004844205D3FC480068844201D210208B +:108E5000FEBD002D02D0012D32D126E0F7490822B7 +:108E60000F46684611F0EDFF39462046FFF78EF9B0 +:108E70000028EDD1FEF7A5FF060006D007226946BF +:108E8000384611F0DEFF3046FEBD2078002801D0C4 +:108E9000012805D1E94807223946C01D11F0D1FF4C +:108EA0000021092003F0A9FB0FE00978002907D071 +:108EB000012905D0022905D0032903D0E048FEBDD1 +:108EC0000720FEBD0120FFF7E9F9DC480C38857664 +:108ED0000020FEBD10B5D8490968884201D2102093 +:108EE00092E7D64902460C390B7B0D311846FFF745 +:108EF00077F9002088E7FFB599B00546002008A95A +:108F000008746946087108A908730875CA481446A8 +:108F10000121C84A890400681E46002D05D09542EB +:108F20000BD38D4201D3854207D3002C08D0944245 +:108F300003D38C4204D3844202D210201DB0F0BD72 +:108F40002846204318D01F270BAB0CAA00972846B1 +:108F50001A99FFF79FF80028F0D10DAB01AA31460E +:108F600020460097FFF796F80028E7D16846007979 +:108F7000C00703D00A20E1E70720DFE702AF002D9A +:108F80000FD01A20694608721A9888722946F81C70 +:108F90001A9A11F056FF0EA902A802F0CEFD002881 +:108FA000CCD1002C0ED02021684601728672324648 +:108FB0002146F81C11F045FF0EA902A802F0BDFDE4 +:108FC0000028BBD19D4908A8007B0C3948700020BF +:108FD000B4E770B506460A200C46087015461146DF +:108FE000204602F0AAFD002807D139212170204631 +:108FF000294602F0A2FD002804D0082801D190489B +:10900000401C70BD2A462146304600F0B9FC04469B +:10901000082803D18B498C4812F09DF8204670BD7A +:10902000F0B5044689A003C897B0824D002715917A +:109030001490AC4211D380480121890403688C420A +:1090400001D39C4209D32078012809D16268AA4241 +:1090500003D38A4204D39A4202D2102017B0F0BD43 +:1090600076490C390A78012A0CD18A88794B9A42C0 +:1090700003D0002806D0012804D08A7F13079B0F55 +:1090800006D101E00820E9E7D30701D1910701D516 +:109090001120E3E7218A704B0A46203A9A4207D30F +:1090A000012877D1002975D1628A002A72D111E096 +:1090B000022801D0032801D1A0296BD3012809D0AF +:1090C0005E4A0C3A5278D20704D0628A002A61D0F4 +:1090D000B42A5FD8002806D0012808D0022804D07E +:1090E000032857D117E0002518E0022516E00029D3 +:1090F00002D1608A00280CD004256068007800281E +:109100000CD0012809D0022807D0032805D04C48EC +:10911000A4E70125F1E7032500E00127207A0028D4 +:1091200006D0012806D0022806D0032867D105E022 +:10913000002604E0012602E0022600E00326002DBE +:1091400001D0022D16D1002E14D0E068002803D0E3 +:10915000FEF732FF002881D138480C38407880076C +:1091600002D03748401E79E7022D03D1022E46D0A7 +:10917000032E44D0182168460170218A4180218A3B +:10918000818085712D480C38007B002803D0012890 +:109190006FD104E033E000216846C17102E0012094 +:1091A0006946C8716846077221780930012920D0C4 +:1091B000062111F0A3FE69460E74207D8207C107C7 +:1091C000D20F4007C90F5200C00F11438000014366 +:1091D00014A8405C6946C873002810D009A96846E5 +:1091E00002F0ABFC002893D1002D0AD0022D08D04C +:1091F00012E061680622491C11F023FEDBE707201C +:109200002CE7002E08D0E068002805D009AA69469E +:10921000FFF7DFFE0028A6D11B2069460870012059 +:10922000887009A9684602F088FC00289BD108A82C +:10923000407913E000C0010028000020700C0020DD +:1092400002320000388100002708000007060504EC +:1092500003020100FFFF0000E13F00001B2819D1BD +:109260002B0012F099F80504040707040A000320F4 +:1092700001E00FE00220FEF76BFD012D0CD0608AAB +:10928000002809D0002283001146104603F00EF991 +:10929000002801D00320E1E60020DFE6F3B5032635 +:1092A00087B00D4600290AD0FE4885426FD30120C1 +:1092B0008004854203D3FC480068854267D3079841 +:1092C000FEF7A1FD040005D02078222804D2082052 +:1092D00009B0F0BDF548FBE7A07F8707BF0F002D61 +:1092E00005D029463846FEF732FE0600F0D1394651 +:1092F0000027EF48012907D0022931D0ED49EE4877 +:1093000011F029FF3046E3E7A27D2946012A02D069 +:10931000827F920701D51120DAE700291BD10821AD +:109320006A46049711820592418904AAE348FBF733 +:10933000FFFA0028CCD16846008A082801D0032013 +:10934000C6E7684601880181418841818188818121 +:10935000C188C18102A9079802F0E7F90646D1E762 +:10936000A17D022916D1807F800613D4002D04D060 +:10937000A07F40070CD4002100E00121079802F0F3 +:1093800014FA0600BED1A775002DBBD004E01AE088 +:109390001126B7E7002D16D02A4621460798FEF77A +:1093A00050FF06461128ADD1A07F4007AAD4204621 +:1093B000082229460E3011F044FDA07F0421084305 +:1093C000A07700269EE7102082E770B50C46054680 +:1093D000FEF719FD010004D022462846FEF711FFD2 +:1093E00070BDB24870BD00B50146143195B0192961 +:1093F00001D2810707D001461E3104D00A3102D0C4 +:10940000072015B000BD312269460A70887009A98D +:10941000684602F092FBF4E701B582B0022069468B +:109420000880A34802AB00896A460021FBF7EAF8EE +:1094300069460988022900D003200EBD1CB5002111 +:10944000009102216A46118097490190096888427B +:1094500001D210201CBD964801899848FBF768FA94 +:10946000694609880229F5D003201CBDF0B50E46D7 +:109470008C4985B0174605468E4207D38A4801229B +:1094800092040068964204D3864202D2102005B0AE +:10949000F0BD1F2F01D90C20F9E7854C8D4226D352 +:1094A000954201D3854222D3E08803A9FBF75BF8FC +:1094B0000028ECD1287869464873E08803A9FBF7B7 +:1094C00033F80028E3D16946009008780221084368 +:1094D00069460870497B090703D00821084369469B +:1094E0000870E0886946FAF7B8FF0028CFD16946CE +:1094F0008F80E088334601AA0021FBF783F8694694 +:109500008988B942C3D00320C1E71CB50C460021AD +:1095100000910191228869460A8063490190096897 +:10952000002801D0884201D38C4201D210201CBDFA +:10953000002801D0002A09D05D486A46C1885F48EA +:10954000FBF7F6F96946098821801CBD0C201CBD7B +:1095500010B50123FEF75DFC56E4002310B51A4652 +:109560001946FEF756FC4FE470B504464D4894B0DA +:10957000844207D301208004844206D34A4800680D +:10958000844202D2102014B070BD2046FEF766FD62 +:109590000028F8D146488178112901D00820F2E747 +:1095A000817FC90601D51120EDE71D2269460A70A9 +:1095B00021780025CA07D20F69468A7022898A80DD +:1095C0006289CA80217801268907CA0F69464A72D2 +:1095D000007B002803D0012804D00320D3E70846ED +:1095E0000D7201E008460E7209A902F0A6FA0028E1 +:1095F000C9D12078800708D56068002805D009AA5D +:109600006946FFF7E6FC0028BDD11E2168460170BF +:109610008670C57009A902F090FA0028B3D1A0891C +:1096200000F073F90400AED11220FEF7AAFB204629 +:10963000A9E7F0B516461C4A0C4605001948204912 +:10964000126899B005D085420FD38D4201D395425F +:109650000BD3844209D38C4201D3944205D3864272 +:1096600003D38E4204D3964202D2102019B0F0BD2B +:109670000F4FB87FC106890F01D1400701D51120D6 +:10968000F4E72046FEF7EAFC0028EFD120788107B6 +:10969000C90F294303D0800714D5002D12D007200D +:1096A000E4E7000000C001002800002002300000B4 +:1096B000640C002038810000F3090000FFFF000067 +:1096C0000000040031460220FEF741FC0028CDD105 +:1096D000C9488078112803D0122801D00820C5E796 +:1096E0000220002714A9189002F08DFB00280DD04D +:1096F000C2A1C64811F02FFD08E01598807F8107B0 +:109700001898890F814201D17F1CFFB214A802F082 +:1097100088FB0028F1D0032F01D30420A6E7B64828 +:109720008078122803D1FFF7EEF800289ED1207828 +:10973000800708D56068002805D009AA6946FFF7A8 +:1097400048FC002892D1212168460170218941807E +:1097500061898180207800278007C10F6846817168 +:1097600020788007002815DB2878002807D00128FA +:1097700008D0022806D0032804D0A54876E768461A +:10978000C77102E001206946C8710622691C02A85F +:1097900011F057FB9848007B002803D0012804D023 +:1097A000032063E76846877302E0012069468873F7 +:1097B00031886846018271884182B1888182F1884E +:1097C000C1820783478309A902F0B7F9002886D12F +:1097D000A08900F09AF80400A0D11320FEF7D1FA76 +:1097E000204643E730B505468A4895B000680C46E8 +:1097F000814202D2102015B030BD2846FEF703FB8F +:10980000002807D00178222902D3807F800603D464 +:109810000820F0E78048EEE7132168460170458094 +:1098200009A902F08AF90028E5D108AA0A215156AF +:109830007F2901D02170DEE70520DCE710B56E49F5 +:10984000012807D0022815D0FF206CA14D3011F05F +:1098500082FC81E60878032804D0FF2067A143300A +:1098600011F079FC0021084602F0C7FE0120FEF746 +:109870006FFA71E68878132804D0FF205FA1483082 +:1098800011F069FC0021072002F0B7FE1120FEF75D +:1098900078FA61E6F8B504460122022102F044FAA2 +:1098A000074601220321204602F03EFA0646012225 +:1098B0000521204602F038FA0546012204212046FF +:1098C00002F032FA0446002F04D1AF204BA18000F1 +:1098D00011F041FC002E04D14C4848A11A3811F077 +:1098E0003AFC002D04D1494844A1193811F033FC49 +:1098F000002C04D1454841A1183811F02CFC22213C +:109900003846FEF7B7FA3846F8BD10B5002809D03A +:10991000830000221146072002F0C8FD072801D06D +:10992000032019E6002017E610B504460068002859 +:109930000CD03A49884207D301218904884205D3D3 +:1099400034490968884201D2102005E601F060F828 +:10995000A088294CA083A07E01280DD100210920D8 +:1099600002F025FE002800D00120A17C89090129F0 +:1099700004D00321FEF792FC0020EDE50221F9E777 +:10998000F7B500260C4605460B271AE02968B000FB +:1099900009580978002903D0012901D00720FEBD0C +:1099A000A170296806220958E01C491C11F049FAE7 +:1099B00027702046029902F0C0F80028EFD1761CEB +:1099C000F6B22879B042E1D800263A270FE0A8681D +:1099D000B10041581022A01C11F033FA2770204624 +:1099E000029902F0AAF80028D9D1761CF6B2287B99 +:1099F000B042ECD80020FEBD640C00207372635CA2 +:109A00006761705F636F72652E630000D7020000AC +:109A100002320000280000200230000000C00100D7 +:109A200030B5FE4B9A4207D301239B049A4205D3DB +:109A3000FB4B1B689A4201D2102030BD1578EB0613 +:109A40005B0F042B07D85478072C04D39378102B82 +:109A500001D8A34201D2072030BDD3785B0702D4DE +:109A600013795B0701D5062030BDC37FAC075B08C7 +:109A70005B00E40F2343C3770878EF231840137883 +:109A80009B06DB0F1B0118430870F1231840137865 +:109A9000DB065B0F5B0018430870507808730020EA +:109AA00030BD30B500240C70C378DB07DB0F0B70C2 +:109AB000C578AD07ED0F6D002B430B70C5786D07B2 +:109AC000ED0FAD002B430B7014700179C907C90F5E +:109AD000117003799B07DB0F5B001943117000794C +:109AE0004007C00F80000143117030BD70B51446AF +:109AF0000D460646F7F736FF002809D0A22101706F +:109B0000142221460830F7F75FFBF7F70CFF70BD12 +:109B1000132229463046FEF774FB70BD70B514461B +:109B20000E460546F7F71EFF002809D022210170D6 +:109B300045802178017261784172F7F7F4FE70BDBB +:109B4000132231462846FEF75CFB70BD10B5B54CBC +:109B5000207C00280DD12046B34A21461038FEF75C +:109B6000A7F8002803D0B1A1F12011F0F4FA0120E8 +:109B7000207410BDFFB581B00A9D06461C461746ED +:109B80001421284611F0BCF90B9800210160F80758 +:109B90000ED0A34920680968884239D31230286062 +:109BA0002068143068602068A8600B982168016004 +:109BB000B80726D56068002803D09949096888420B +:109BC00026D3029900290AD0FC3600280ED031464F +:109BD0001030FEF7DBFA00281BD1606810E0002887 +:109BE00016D0E86080366068B0670AE0FFF7CFF80B +:109BF00001460722304611F024F9FFF7A7FF8948F4 +:109C0000E860780708D58649A0680968884202D2CA +:109C1000102005B0F0BD28610020FAE770B50546B8 +:109C200011200C460870002161702121495D002936 +:109C300008D003290ED0042910D0FF207BA1523078 +:109C400011F089FA20780009012802D9E87FC008BC +:109C5000607070BD0007000F203002E00007000FA9 +:109C600030302070EEE770B594B015460C462C22CB +:109C70006946189E0A704880002B17D008221946A2 +:109C800001A811F0DEF868468581102231460E30B9 +:109C900011F0D7F809A9684601F04FFF002803D159 +:109CA000A17F10221143A17714B070BD0020019054 +:109CB0000290E8E7F0B50646008A97B080B20D46FC +:109CC0000190FEF7A0F804465648317848385B4FBB +:109CD00009900B0011F060FB0EFEFD43084A7283F1 +:109CE000B8D9FCFBFAF9F8FEA07F8007800F0128A5 +:109CF00007D000210022019802F016F8050007D1D4 +:109D000001E00121F6E7FF2048A1943011F023FA89 +:109D1000387CC00904D049484038406DA86112E041 +:109D20002B20694608720BA902A801F006FF002843 +:109D300004D0FF203DA19F3011F00DFA40490C984E +:109D400011F0E8F8A9617068A862B068E86220784C +:109D5000252804D0FF2035A1A53011F0FCF93246AA +:109D600021460198FFF7C2FE17B0F0BDA07F800723 +:109D7000800F012807D000210022019801F0D4FFB4 +:109D8000060007D101E00121F6E7FF2027A1AF304F +:109D900011F0E1F92078252804D03078012108431A +:109DA0003070E1E702202870B068A860B068002831 +:109DB00002D000202871D7E70120FBE72B2069465D +:109DC0000870184968464C3901F0B7FE002804D0E5 +:109DD000FF2016A1CE3011F0BEF903201BE02A208F +:109DE0006946087000A810220230716811F029F845 +:109DF00004A810220230B16811F023F8094968461E +:109E00004C3901F09AFE002804D0FF2007A1DF3072 +:109E100011F0A1F904202870099813E000C0010096 +:109E200028000020300D0020FFFF00007372635CEB +:109E30006761705F7365632E63000000500E002041 +:109E400040420F0068608FE7B068002804D1FF200F +:109E5000F649EB3011F07FF9E07F400704D5FF2091 +:109E6000F249EC3011F077F9B06806220A38009018 +:109E700033790421019801F058FA002891D0FF208D +:109E8000EA49F13011F067F96EE7002C04D1FF20A8 +:109E9000E649F93011F05FF92046223010220546DC +:109EA000716810F0CEFF28212046FDF7E3FFA07F68 +:109EB0008007800F022814D100231A4621460095FE +:109EC0000198FFF7D0FE06E055E1B6E0ACE089E08E +:109ED0002CE065E069E111280BD029212046FDF72F +:109EE000C9FFE07F317A4007400FC9000843E0779F +:109EF0003AE7A07F000703D5CC49CD4811F02BF9F4 +:109F0000A07F08210843A0770020608620463430D7 +:109F100010F0F4FFE07FFD220146C9071040890FD1 +:109F20000843E077307A203420701DE7A07F800757 +:109F3000800F012807D000210022019801F0F4FED3 +:109F4000040007D101E00121F6E7B948B7491D3007 +:109F500011F001F92B2069460872B64902A801F0F8 +:109F6000ECFD002804D0B248B049223011F0F3F8DB +:109F7000B0488188204621300176090A41760E21B9 +:109F800029702146FC316960017E2974407E687425 +:109F9000A8482C30A860103030346C61E860E3E6EB +:109FA000002C04D1A248A149363011F0D4F8207811 +:109FB00021289DD93079012802D0022808D103E058 +:109FC000E07F04210843E077387C0121084338749E +:109FD000324621460198FFF789FD23212046FDF7EF +:109FE00049FFC1E601220421019801F07DFC00280F +:109FF0009BD0A07F8007800F012807D0002100227E +:10A00000019801F091FE040007D101E00121F6E77B +:10A0100087488649543011F09EF80F202870172089 +:10A0200028716E34AC609FE60421019801F0ABFC0E +:10A030000028B4D11020287096E6A07F8007800FFA +:10A04000012807D000210022019801F06DFE0500D3 +:10A0500007D101E00121F6E7754874496D3011F030 +:10A060007AF82E462036307E41064DD5A17F8F07E7 +:10A07000BF0FC00713D02A468032516F00290ED07F +:10A08000087CF37DC007C00F5B0018430874516F54 +:10A09000E27F40084000D207D20F10430874307EA0 +:10A0A000000713D528468030026F002A0ED0117C9D +:10A0B000F37DC907C90F5B0019431174E27F49089A +:10A0C0004900D207006FD20F11430174307E800720 +:10A0D0000BD5F8204259002A07D0012F05D0294678 +:10A0E000307C31311032FEF77BF8307EC0060BD564 +:10A0F000F8204259002A07D0012F05D12946307C8B +:10A1000031311032FEF76CF8052368460370357E56 +:10A110004570484822226038019902704278D2087E +:10A12000D200D21C4270418003724572F7F782FD63 +:10A130002078252809D021280BD0AD203B4980006C +:10A1400011F009F82078222803D922212046FDF7B2 +:10A1500091FEA07F8007800F01280AD0002101987E +:10A1600001F009FE002800D1FEE5AF202F49800054 +:10A1700088E60121F3E774682E4D207860350928C0 +:10A1800002D00A28F0D10BE0E168002902D028466D +:10A19000F8F7D7FE2169002902D02846F8F7D1FE4A +:10A1A00021462846F8F7CDFEDEE521481F49DC3080 +:10A1B00068E6204810B5072228216030F8F7A8FE8D +:10A1C0001D480024017C4906490E0174403844654D +:10A1D000FDF7FBFC17493C3108461038F7F779FCCE +:10A1E00014484C30047410BD70B50D46FDF70BFEDD +:10A1F000040004D103200D49000210F0ACFFFF2140 +:10A200000531284610F07CFEA07F8007800F0128D2 +:10A2100016D0022128468830FDF7D8FC002803D04C +:10A220000249064810F097FF70BD00002C9E000008 +:10A2300005020000E40C0020500E00200503000081 +:10A240000121E7E70A46014610B510468830FDF7C0 +:10A25000D7FC10BDF0B505464068082601789BB0D4 +:10A2600008290DD00B2903D00C293FD10121817180 +:10A27000686887883846FDF7C6FD040041D13BE099 +:10A2800047883846FDF7BFFD040003D1FD49FE486D +:10A2900010F061FF2078212828D0282828D168686C +:10A2A00002210C3000F0BEFF002821D06868082190 +:10A2B000001D00F0B7FF00281AD02D21684601705C +:10A2C000478021461022223101A810F0BAFD0FA9C3 +:10A2D000684601F032FC002804D0CB20E949800018 +:10A2E00010F039FF29212046FDF7C4FD1BB0F0BD59 +:10A2F000687830436870F9E7E348E2492D3010F0A0 +:10A300002AFFA07F8107890F022902D1EF2108408F +:10A31000A0772078212810D068688179002902D0A0 +:10A320008078002818D0A07F8007800F022864D092 +:10A330000720D449C00110F00EFFA07F8007800FD6 +:10A340000228D3D1FDF7ECFF0028CFD0CE48CD496D +:10A35000733010F000FFC9E7687830436870E07F21 +:10A36000C00701D0042100E00321212001552078FD +:10A37000292818D02428E0D13946062002F03DF9DA +:10A3800022212046FDF776FDA07F8007800F01285F +:10A3900031D00021384601F0EEFC0028CDD0BA487B +:10A3A000B8495830C7E7A07F8007800F012807D041 +:10A3B00000210022384601F0B7FC050007D101E07A +:10A3C0000121F6E71B20AF49400110F0C4FE252112 +:10A3D0002046FDF74FFD0D2008A90871284609A960 +:10A3E0008830FDF7FFFB0228A7D00028A5D0A6489B +:10A3F000A4494D309FE70121CCE76878304368706D +:10A400009BE7F7B58AB00A98FDF7FDFC050056D02A +:10A410002878222853D3232851D0E87F40074ED4F0 +:10A42000A87F8007800F01280ED0002201280DD0C0 +:10A4300000210A9801F078FC064694480290F8F74B +:10A4400077FD040009D103E00122EFE70121F0E7E5 +:10A4500075208C49C00010F07EFE002E0FD088368B +:10A4600066610298F8F764FD07460298F8F760FD08 +:10A4700006462878222807D0242805D008E00020A6 +:10A4800007460646606103E025212846FDF7F2FCF9 +:10A49000092020700A9820620C9820710B98E760C0 +:10A4A0002661A06004A92046FDF7C0FB022806D063 +:10A4B000002804D074487349AF3010F04CFE0DB042 +:10A4C000F0BD30B587B00446FDF79DFC0546807FA2 +:10A4D0008007800F01280BD000210022204601F0C8 +:10A4E00023FC0446287822281ED9002C07D101E03D +:10A4F0000121F2E764486349BB3010F02CFE0F21C4 +:10A50000684601701721017120466E30029069463D +:10A510001A30FDF767FB022806D0002804D05A48FD +:10A520005849C03010F017FE07B030BD30B587B0C5 +:10A530000446FDF768FC0546807F8007800F0128F0 +:10A540000BD000210022204601F0EEFB04462878C3 +:10A550002228E9D9002C07D101E00121F2E74A487D +:10A560004849CD3010F0F7FD1020694608702046AC +:10A570008830FDF737FB0028D6D043484149D0301A +:10A5800010F0E9FDD0E7F7B505460078002700098F +:10A5900082B00C463E4602287CD0072802D00A280A +:10A5A00049D149E068680178082906D00B292FD0E5 +:10A5B0000C292DD03349364865E114271A26002C82 +:10A5C00069D04088A080FDF71EFC0090002804D1CF +:10A5D0002F482C49243810F0BEFD00980099C07D0A +:10A5E000A21D1831FDF7FCFD686808228089E08112 +:10A5F000696820461030091D10F023FC207E0121DF +:10A600000843F9210840207600984021807F50E0DF +:10A6100018270826002CD3D08088A080FDF7F3FBF4 +:10A62000050004D11A481749401F10F094FDA11DE0 +:10A630002846FFF7F3FA28E1002C01D0288BA080F0 +:10A64000287A01287ED0022805D0032838D0104867 +:10A650000C49853017E11C270726002CB0D0A088B4 +:10A66000FDF7D1FB0090002804D1094805491330BB +:10A6700010F071FD287B8007800F0128A0791CD085 +:10A68000400809E02C9E00001A030000440D002041 +:10A6900027040000E9E0E3E04000A071FD2108404C +:10A6A000297B4907C90F49000843A0710098802100 +:10A6B000807F084300998877E7E001210843ECE7B1 +:10A6C00013270B26002CA6D0A088FDF79CFB00903A +:10A6D000807F8007800F012807D00021A0880022FA +:10A6E00001F022FB050006D101E00121F6E7FB495C +:10A6F000FB4810F030FD0098807F8007800F012814 +:10A7000050D0E86A81788907890F0129A1794BD057 +:10A7100049084900A1718278FD255207D20F2940CE +:10A7200052001143A171E322114002785207D20E68 +:10A730001143A171DF2211404278D207920E1143DA +:10A74000A17100E033E00021E171C178217242790A +:10A750000179607AD30740084000DB0F1843930764 +:10A76000DB0F28405B0018435207FB23D20F184031 +:10A77000920010436072A07ACA0740084000D20FCE +:10A7800010438A07D20F2840520049071043C90FCF +:10A79000184089000843A07200980078232874D9D3 +:10A7A0002621C4E0A86AADE701221143B2E7297B64 +:10A7B000CC48022911D017270C26002C50D0012993 +:10A7C00012D003291FD0042920D005291ED09320A0 +:10A7D000C249C00010F0BFFC23E019270726002C57 +:10A7E00053D00121A17105E00121A171E17989080E +:10A7F0008900E171017CCA094906D201890E49002C +:10A800000A4302740DE00220A07106E0687B000795 +:10A81000000F8030A07105291DD0E07980088000EC +:10A82000E071A088FDF7EFFA0546007821282CD0CA +:10A83000232804D0AA48A949573010F08CFCA87FDF +:10A840008007800F01280ED00021A08801F093FA24 +:10A85000222128466CE0E07980088000401CDFE778 +:10A860000498068017E00121EFE7002C01D06888EA +:10A87000A080287A032832D004280FD005285AD087 +:10A8800097489649B03010F066FC0498002C06807A +:10A8900001D027806680002005B0F0BD15270C266A +:10A8A000002CDDD0A088FDF7AEFA807F8007800FF6 +:10A8B000012807D00021A088002201F035FA050008 +:10A8C00007D101E00121F6E785488449763010F090 +:10A8D00042FC0622A11DA86907F036FAD5E7162723 +:10A8E0000726002CBCD0A088FDF78DFA0090807F51 +:10A8F0008007800F012807D00021A088002201F0E6 +:10A9000013FA050007D101E00121F6E77448734905 +:10A91000843010F020FC2878C00601D5022000E029 +:10A920000120A071009800782328AED92721009833 +:10A93000FDF7A0FAA9E717270C26002C90D0A088D5 +:10A94000FDF761FA00906D7A002804D164486349EC +:10A95000973010F000FC0621A01D10F0CFFA002067 +:10A96000A071207A032108432072FB21084000993E +:10A97000C97FC907490F08432072680685D5E07969 +:10A9800004210843E071A07AE90740084000C90F9C +:10A990000843E17A2A0749084900D20F1143FD22F2 +:10A9A000AB07DB0F10405B001843A072E806C00F36 +:10A9B000114040000143E17267E710B50446807919 +:10A9C00090B08009012804D045484449C93010F0AE +:10A9D000C2FBFFF7BBF801206946087042480890A7 +:10A9E00042480190201D0290601C0B900AA9684605 +:10A9F000FDF71CF9002804D039483849D43010F04C +:10AA0000AAFB0322601C0B9910F01BFA10B010BDBA +:10AA100010B5364C002805D001461022204610F013 +:10AA200010FA0120207410BD10B50446FFF78EF80F +:10AA300010222E49204610F004FA10BD70B50025F2 +:10AA4000284C00281CD02A49884207D301218904B8 +:10AA5000884205D327490968884201D210250DE0B4 +:10AA6000062107F05BF9411C07D01E4940394865B3 +:10AA7000207C80210843207400E00725284670BD13 +:10AA8000207C4006400EF6E7F3B5002089B00D4665 +:10AA9000029000290AD0164885421CD30120800468 +:10AAA000854203D313480068854214D30998FDF703 +:10AAB000AAF9060003D03078222826D102E00E48F9 +:10AAC0000BB0F0BD002D19D1B07FC10903D08007B4 +:10AAD000800F022812D01020F2E700002C9E000008 +:10AAE0004D040000500E0020FFFF0000300D00203C +:10AAF00000C001002800002002300000B07FC10625 +:10AB000001D4010703D5002D01D00820D8E7FE4964 +:10AB1000097CC90717D1F17F490701D50D20CFE77F +:10AB20008007800F01280CD000210122099801F034 +:10AB3000FBF8070007D0B07F8007800F022804D001 +:10AB40000DE00121F1E71120BAE7002D07D02A46D8 +:10AB500039463046FEF764FF02900028B0D1EB483A +:10AB6000F8F7E6F9040003D1E949EA4810F0F3FAEE +:10AB70000A2020700998206238468830A060B07F93 +:10AB8000FB218007800F012829D0002D3DD0022015 +:10AB90002071381DE06038780007400F2074387845 +:10ABA000C006C00F6074A07C2A788008D20780009D +:10ABB000D20F1043A0740840F17F01AAC907490FC2 +:10ABC0000843A074A878E07469462846FEF769FF38 +:10ABD00068460079207568460078607519E00120A4 +:10ABE0002071207B2A788008D2078000D20F104382 +:10ABF0002073084029788907C90F8900084320730A +:10AC000024213046FDF736F90BE0032020710520A2 +:10AC1000207325213046FDF72DF9B07F4006400E08 +:10AC2000B07703A92046FDF701F8022806D00028D6 +:10AC300004D0B848B6492B3010F08DFA02983FE79F +:10AC4000FFB5B54A0E4607CA97B002AB07C3002747 +:10AC500001970C971798FDF7D6F8050005D02878CE +:10AC6000262804D008201BB0F0BDAC48FBE7A87F25 +:10AC70008007800F012807D000210022179801F0DB +:10AC800053F8040007D101E00121F6E7A148A049EB +:10AC9000623010F060FAA87F8007800F16900128BC +:10ACA00014D0022824D09B4899497B3010F053FAE5 +:10ACB00001210022852E31D01EDC002E26D0812ECF +:10ACC00026D0822E26D0832E1ED125E0002EEFD155 +:10ACD00021462846199AFEF7A3FE0028C3D11998E9 +:10ACE0008078019019980078C007C00F0C90DFE7BA +:10ACF0001998002808D1DBE7862E11D0882E11D0B4 +:10AD0000892E11D08A2E11D00720ACE710460EE014 +:10AD100008460CE002200AE0032008E0052006E0D7 +:10AD2000062004E0082002E0092000E00A200022BA +:10AD3000227101216A461176211D0791002801D058 +:10AD400020710BE1169801280CD0A66AE06A022255 +:10AD5000012111900020A0602846173002291AD046 +:10AD6000012119E0E66AA06A119003203070207872 +:10AD7000FB23C006C00F7070B07801221840019B01 +:10AD8000F37080080C9B800018430221B0700020F3 +:10AD900070713071DEE70021890009190861681CB3 +:10ADA000022A01D0012100E000218900091908616F +:10ADB000B0788007800F01285ED1119880788007D5 +:10ADC000800F012858D1119800790190119840798D +:10ADD0000090169801281DD0317908A80174717966 +:10ADE000017508A8027C01980099024008A8007D1E +:10ADF0000840149010433FD049491A98884207D31D +:10AE000001218904884215D346490968884211D234 +:10AE1000102028E70CAA0DA91998FEF742FE08A8F1 +:10AE2000007C01990840307108A8007D0099084015 +:10AE30007071D6E720463C3021460090F0311698DC +:10AE40000191022834D000211A9B20460C33FEF7D2 +:10AE500091FE0028DDD12046503021460090F4318B +:10AE600016980191012825D0002120461A9B149A9A +:10AE7000FEF780FE0028CCD111988078400702D4DC +:10AE8000E87FC0072BD0169902A8012914D0119988 +:10AE900009784900405A21780907490F4900C840FC +:10AEA0008707BF0F2AD0012F14D0022F0FD113E034 +:10AEB0000121C9E70121D8E721780907490F490095 +:10AEC000405A119909784900C8408707BF0F032FDE +:10AED00004D004E0022711E001270FE002271698B2 +:10AEE00001280BD1B078FB210840E97FC907490F41 +:10AEF0000843B07020780007400F30702078400879 +:10AF00004000207011990FE0500E0020440D0020E9 +:10AF10002C9E0000A90500001CB4010002300000B6 +:10AF200000C001002800002049781022C907C90E7E +:10AF3000D243114308402070C00622D4022F20D0F3 +:10AF4000012F20D00020A061E061206260622046D5 +:10AF50001830A060E87F40084000E877204606A946 +:10AF60008830FCF73FFE002805D0022803D0B44902 +:10AF7000B44810F0F0F825212846FCF77BFF0020AC +:10AF800071E6032008E020460D211B300FF0B6FFCC +:10AF900020461830A060042069460875E87F01212A +:10AFA0000843E87705AA29461798FEF7B7FDD5E7C5 +:10AFB000F0B587B015460F0004460DD0A248854273 +:10AFC00007D301208004854206D3A048006885424B +:10AFD00002D2102007B0F0BD2046FCF714FF060097 +:10AFE00004D03078272803D00820F3E79848F1E709 +:10AFF000B07F8007800F012807D000210022204663 +:10B0000000F092FE040007D101E00121F6E78D482F +:10B010008B491F3010F09FF80020002F05D0022F21 +:10B0200008D0012F11D00720D4E701216A46117101 +:10B03000A06018E0234618336946A3600871102207 +:10B04000294618460FF0FDFE0DE021461831A1609B +:10B0500069460871A061E0612062606206212846AD +:10B0600006F05CFEA0612078C10714D040084000C3 +:10B070002070022069460870204618300290703017 +:10B08000FCF7B0FD022806D0002804D06D486C49BA +:10B09000423010F060F825213046FCF7EBFE00202E +:10B0A00098E7F8B515460E460746FCF7ACFE0400D7 +:10B0B00004D02078222803D00820F8BD6448F8BDC9 +:10B0C000A07F8007800F022802D06148C01CF8BD15 +:10B0D0005D4886420ED3012189045C4A8E4202D328 +:10B0E00013689E4206D3854204D38D4204D3106870 +:10B0F000854201D21020F8BD00953288B31C21464C +:10B100003846FEF7B0FD112816D00028F3D1E17FB4 +:10B110002A7C4908D2074900D20F1143E1772A7CE3 +:10B1200049079206490FD20ED2001143E177A17F61 +:10B130004906490EA177F8BDA17F0907FBD4204637 +:10B140000822B11C34300FF07CFE30886086204627 +:10B150001022294622300FF074FEE07FFD210840C6 +:10B16000297CC907890F0843E077287C4108202003 +:10B170000155A07F08210843A0770020D7E770B5CC +:10B1800094B00D460646002B02D0072014B070BDC7 +:10B19000FCF739FE040007D02078222802D3A07FD4 +:10B1A000400603D40820F1E72948EFE7002D19D025 +:10B1B0002D216846017046801022294601A80FF013 +:10B1C00040FEE07F297C4008C9074000C90F0843C2 +:10B1D000E077297C40078906400FC90EC900084363 +:10B1E000E07703E02E2168460170468009A9684691 +:10B1F00000F0A3FCA17FBF221140A177C6E710B5E4 +:10B200000C46FCF700FE002805D0104909688C4266 +:10B2100003D2102010BD0E4810BD2146FEF7FEFCE3 +:10B22000002010BD05E00278401C002A01D000205B +:10B2300070470A46491E89B2002AF4D1012070479E +:10B240002C9E0000ED06000000C001002800002038 +:10B250000230000030B50346072903D00620DA7813 +:10B260001C7916E00320FAE707290BD05500ED18EA +:10B270006D79072D01D0401EC0B2521CD2B2092AEE +:10B2800007D105E05500ED186D79072DF3D0F4E7EF +:10B2900000222546641EE4B2002DE5D130BDFFB585 +:10B2A00081B00C461646114620460A9F0B9DFFF7BB +:10B2B000D1FF00280AD02079092803D3FEA1A020BD +:10B2C0000FF049FFA078C00907D019E0072E02D07F +:10B2D000112005B0F0BDFD48FBE701982880381D1E +:10B2E0006880002068712871EF80049828812846C2 +:10B2F00000F04BFC002803D1EFA1AD200FF02BFF95 +:10B30000E07821794018491CC0B22171092801D385 +:10B310000938C0B24000001946718179F12249080C +:10B320004900114081710020D3E7FFB583B0164674 +:10B330000F461C46002203210C9D039800F0F4FCEC +:10B34000010008D033463A46019500940398FFF770 +:10B35000A6FF07B0F0BDDD48801EFAE7F0B5054650 +:10B3600016460F4650888DB00022032100F0DCFC09 +:10B37000040003D1D0A1DF200FF0EDFE00206946CC +:10B380000871A078400603D1CBA1E3200FF0E3FEC3 +:10B39000042F5ED32A78D007C017401C06D16178ED +:10B3A0006B78994255D12178090752D00121142A8E +:10B3B00046DA012A42D0122A02D0132A40D128E0CC +:10B3C0000C2F3DD1A2785206520E012A38D0207897 +:10B3D00000090001401C20706878607068460171A7 +:10B3E00068792A790102114368460181E879AA79CE +:10B3F0000102114368464181687A2A7A01021143A9 +:10B4000068468181E87AAA7A010211436846C181BF +:10B410001AE0062F14D120780009000120707188ED +:10B42000012001F0EAF8022168460171C91E01817C +:10B4300068792A790102114368461FE0062F0AD075 +:10B440006A461279002A1BD07088324601A9FDF79E +:10B4500020FB0DB0F0BD207800090001207071883C +:10B46000012001F0CAF802216846017168792A7941 +:10B4700001021143684601810021C9434181E3E78C +:10B480000028E6D07488684681766978C176022102 +:10B4900081830021C18304A8052200900623114660 +:10B4A0002046FFF742FF0028D3D089A1D6200FF015 +:10B4B00052FECEE7F7B58CB015460C990D98FAF709 +:10B4C00041F9C0B2082850D10020694688856888B3 +:10B4D0000022032100F028FC040004D1FF2076A103 +:10B4E00063300FF038FE01230021E07822790BE071 +:10B4F0004600361976799E4201D1491CC9B2401CDA +:10B50000C0B2092800D100201646521ED2B2002E29 +:10B51000EED1002902D117206946888504AB023399 +:10B520000BAA00950C990D98F8F7B6FB0006000ED3 +:10B5300007D002281BD0032817D0FF205EA1893036 +:10B5400011E06846808D00280FD002A9019100907B +:10B550006888042301222146FFF7A1FE002804D0B9 +:10B56000FF2055A176300FF0F6FD0FB0F0BD6878E2 +:10B57000102108436870F8E700205A49024643004A +:10B58000401CCA520828FAD3704700218170017804 +:10B5900009090901017000214170C17001717047F2 +:10B5A00070B50D460022032100F0BEFB040004D15B +:10B5B000FF2041A1CF300FF0CEFDA0786906C00971 +:10B5C000C001490E0843A07070BD704710B5014618 +:10B5D000012001F012F810BD3EB58DB2002203210A +:10B5E000284600F0A1FB040004D1FF2032A1E43082 +:10B5F0000FF0B1FD2078694600090001207002209B +:10B60000087039488880C88000222846FDF741FA32 +:10B610003EBDF7B505460078002700090C463E46BA +:10B62000012804D0FF2024A1F3300FF094FD287AE4 +:10B6300003280CD0412020A1C0000FF08CFD0298FF +:10B64000002C068001D0278066800020FEBDEA899C +:10B65000702710460A3086B2002C0AD06888A08075 +:10B66000A8892081E28020460A3029690FF0E9FB91 +:10B67000E5E702980680E8E7F8B543680246D9791D +:10B680009C79090221435C7A1E7A25025C88981D08 +:10B690003543241FA14238D11B79022B35D1042D0B +:10B6A00034D0052D3DD0062D34D0402D2DD3061D90 +:10B6B0000F461446284619E07372635C6C3263616E +:10B6C000705F636F72652E6300000000043000003D +:10B6D0007372635C6C326361705F636F72652E635B +:10B6E00000000000680E0020FFFF000000F0E3F9FA +:10B6F00008280AD01120207003202072A581E7813C +:10B7000026616078082108436070F8BD001DFFF7CE +:10B71000D1FEF8BD031D50880A461946FEF771FE9A +:10B72000F8BD001DFFF71AFEF8BD70B50D468CB0D0 +:10B7300006460022032100F0F7FA040031D02078F9 +:10B740000007000F01282ED0122069468874607807 +:10B750000523801CC874082088822888C8826888CD +:10B760000883A8884883E888888302A90C2001916F +:10B7700000901A4621463046FFF791FD00280ED171 +:10B78000F02300223146012000F090FE20780009CD +:10B790000001401C20706078801C607000200CB09C +:10B7A00070BDCB48FBE71120F9E770B50D468CB0B2 +:10B7B00006460022032100F0B7FA040006D02078E4 +:10B7C0000007000F012803D00820E8E7C048E6E79B +:10B7D0001321684681746178C17402218182C58217 +:10B7E00002A906200523019100901A462146304601 +:10B7F000FFF755FD0028D2D1207800090001207004 +:10B800000020CCE7F3B581B00D460022032101985A +:10B8100000F08AFA00260446002803D1AD49AE485C +:10B820000FF099FC2079A8423BD2AB48A949401CB3 +:10B830000FF091FC35E0E07841000F19401C797958 +:10B84000C0B20091E070092801D10020E070207999 +:10B85000401E2071B879C00708D0009801990428CB +:10B8600015D09C49822018310FF075FCB87900077B +:10B87000410F08D0400F019904280CD095498F2022 +:10B8800018310FF068FC009807280AD107E0084635 +:10B89000FEF74CFEEAE70846FEF713FEF3E7761CD8 +:10B8A000F6B228466D1EEDB20028C4D13046FEBD6A +:10B8B00010B50022032100F037FA040004D1B520AE +:10B8C000844980000FF047FCE07821794018C0B22D +:10B8D000E070092801D30938E07000202071A078B9 +:10B8E00080210843A07010BDF8B517460D46002210 +:10B8F000032100F019FA040005D0002D0CD0002F10 +:10B9000007D0062006E0072D01D00620F8BD032051 +:10B91000F8BD0820A84204D86F486E4942300FF0A5 +:10B920001AFC29462046FFF795FC0646002F28D032 +:10B93000002E26D1E07821791CE0420012195379BB +:10B94000072B03D093791B075B0F04D0401CC0B2B8 +:10B9500009280CD00CE0400000198079F123184030 +:10B960006B071B0F1843907100290AD104E00020D7 +:10B97000491EC9B20029E0D1574856495A300FF044 +:10B98000EAFB3046F8BDF8B50D460022032100F071 +:10B99000CBF9040004D150484E4968300FF0DBFB6E +:10B9A000681E052804D34C484A4969300FF0D3FB80 +:10B9B0000921E2782079002310E0560036197779C2 +:10B9C000AF4206D1B17949084900B1715B1CDBB2C5 +:10B9D0001146521CD2B2092A00D100220646401E4E +:10B9E000C0B2002EE9D1092905D248000019817999 +:10B9F0000122114381711846F8BD10B50446402854 +:10BA000001D2072010BD00F056F8082802D03120DE +:10BA1000000210BD0021314802E0491C082903D270 +:10BA20004A00825A002AF8D1082903D0490044521A +:10BA3000002010BD042010BD10B5402801D2072001 +:10BA400010BD00F038F8082805D00021234A400036 +:10BA50001152084610BD052010BDF0B58BB016463A +:10BA60000C00074607D0002E05D06188402904D27B +:10BA700007200BB0F0BD1020FBE72088002801D084 +:10BA8000172801D90C20F4E7084600F014F808281C +:10BA90000FD0258803A82A46314602300FF0D1F98D +:10BAA00001A8009062882B4607213846FFF73DFC2D +:10BAB000DFE70520DDE701460020084A02E0401CE0 +:10BAC000082803D24300D35A8B42F8D170470000B4 +:10BAD00002300000B8B60000AD020000680E002081 +:10BAE00000B51E2827D00FDC0C2820D008DC03006E +:10BAF0000FF052FC0913211521211B1B17192100DE +:10BB0000122818D1072000BD302814DD3A38030070 +:10BB10000FF042FC030F11091100002000BD214865 +:10BB200000BD042000BD0D2000BD0F2000BD082079 +:10BB300000BD112000BD032000BD10B50C4604F06F +:10BB4000A0F800281ED0204602F013FE002816D0D0 +:10BB500022780E2A0DD00F2A0BD0022A09D0032AF0 +:10BB600007D0102A09D010A17E200FF0F4FA00208F +:10BB700010BDA078FFF7B4FF10BD112010BD0AA1C1 +:10BB80008420F2E708A18A20EFE710B502F0A2FCBA +:10BB900010BD10B502F0EDFD10BD10B502F01AFD9C +:10BBA00010BD0000023000007372635C686F737434 +:10BBB0005F6863692E630000F8B5054606ACC1CC2A +:10BBC000E44C21706270A370E070681C4208277119 +:10BBD0005200E14B66710021880000198446026220 +:10BBE000605C40008218002D0AD0002005E0664607 +:10BBF0004700366A401CF353C0B2665C8642F6D8F2 +:10BC0000491CC9B20629E7D30026D21C9708B00008 +:10BC1000BF0000198760304600F02AF9A15D761C4C +:10BC20004843C219F6B2062EEFD3501B80B2F8BDBE +:10BC3000F0B504468C46C7490020A500FF23024604 +:10BC40006D18C54E0C5D0BE02F6A5100795AB14258 +:10BC500004D1401CC0B2FF2B00D11346521CD2B2FB +:10BC60009442F1D8002801D061460B70F0BD70B548 +:10BC7000B84C0023655CA678B54200D10346890024 +:10BC800009199D420AD90C6A5E00A45B844202D164 +:10BC90001370012070BD5B1C9BB2F2E7002070BDE9 +:10BCA000FFB583B00C9C1F460D46060009D0002D41 +:10BCB00007D0F01C80088000B04204D0102007B0EC +:10BCC000F0BD0E20FBE70598A04201D8A74201D99C +:10BCD0000720F4E701460094019423463A460020E9 +:10BCE0000294FFF769FF2988814207D0814201D27F +:10BCF000042100E0092128800846E0E7009401942F +:10BD000023463A46029430460599FFF755FF2880AE +:10BD10000020D4E710B5044600F0B4F8002801D0A4 +:10BD2000E0B210BDFF2010BDF8B505468A481646A2 +:10BD30000C46854201D0062C01D30020F8BD002717 +:10BD400069460F7028466A462146FFF790FF002893 +:10BD50000DD068460178204600F09CF8002EEDD00A +:10BD60000028EBD12146284600F0A0F8F8BD38465F +:10BD7000002EF7D1F8BDF8B505460C460020764EEA +:10BD80006946764F0870B5423BD0062C01D3072098 +:10BD9000F8BD0A4621462846FFF769FF002830D043 +:10BDA00068460178204600F075F823000FF0F4FA99 +:10BDB000060404090C11161B01462846FEF742FA38 +:10BDC00015E0FDF735F812E001462846FFF7FDFBC8 +:10BDD0000DE001462846F7F7E4FE08E00146284654 +:10BDE000F9F73AFB03E05EA17C200FF0B4F9594A61 +:10BDF0006846A10000788918096A40000E520020A8 +:10BE0000F8BD3846F8BD5A4A1268914201D2102056 +:10BE10007047062801D30720704708720020487237 +:10BE20007047F8B5044652480068844201D2102099 +:10BE3000F8BD207A474A83009B18617A464D125C10 +:10BE400011E01E6A4F00F65BAE420AD04A1C6272D5 +:10BE50001A6A4B00D25A228000F01CF86060002061 +:10BE6000F8BD491CC9B28A42EBD861720520F8BD01 +:10BE70000EB5404B40000ECB0091029301926946F3 +:10BE8000085A0EBD33498978814201D90120704793 +:10BE90000020704770B50C460546FFF7E9FF2D4AB4 +:10BEA000A900891889686043401870BDF8B5044638 +:10BEB0000E4600206946087005462046FFF7E2FF5F +:10BEC000002803D126A1F3200FF045F92148214B8A +:10BED000815D8278B000C718914209D1E0B269460D +:10BEE0000870396A4000085A1B49884206D02EE083 +:10BEF00069463046FFF79CFE002828D06846007847 +:10BF0000396A40000C52684601783046FFF7C2FF9C +:10BF1000054633000FF040FA060404090C0F14170D +:10BF200029462046FEF760F911E0FCF75EFF0EE0BF +:10BF3000FFF72BFB0BE029462046F7F7F9FD06E05B +:10BF4000F9F783FA03E006A162200FF004F928460E +:10BF5000F8BD0000780E0020FFFF00000230000056 +:10BF60007372635C686F73745F636D2E63000000AF +:10BF70002800002028B401008107C90E002808DA33 +:10BF80000007000F08388008C24A80008018C06986 +:10BF900004E08008C04A800080180068C84000069D +:10BFA000800F7047BD4948788978884201D3401A8C +:10BFB00002E02122511A0818C0B27047B749233154 +:10BFC00048788978884201D3401A02E02122511A28 +:10BFD0000818C0B27047B14946314878897888421C +:10BFE00001D3401A02E02122511A0818C0B270474A +:10BFF000A94910B50C310868FF22120290430122B2 +:10C00000D20310430860A54900202331487088708E +:10C01000233948708870463148708870A04806F00F +:10C02000BCF89F48401C06F0B8F8F6F7A3FB00F0F8 +:10C0300028F910BD20207047B4E770B50C460546BE +:10C040000026FFF7AFFF9549A04214D30A46203AD5 +:10C0500000232046641EE4B200280BD08878105CD0 +:10C06000287088786D1C401CC0B288702128F0D1DF +:10C070008B70EEE7012600F004F9304670BD2020F9 +:10C0800070479BE770B50C4605460026FFF796FF04 +:10C0900082492331A04214D30A46203A0023204685 +:10C0A000641EE4B200280BD08878105C2870887871 +:10C0B0006D1C401CC0B288702128F0D18B70EEE757 +:10C0C000012600F0DEF8304670BD2021017000200E +:10C0D000704710B50446FFF77EFF2070002010BDAA +:10C0E00070B50C460546FFF776FF6C494631A04215 +:10C0F00015D30A46203A00232046641EE4B20028E5 +:10C100000BD08878105C287088786D1C401CC0B2F9 +:10C1100088702128F0D18B70EEE7002400E0614C9C +:10C1200000F0AFF8204670BD70B50C4605462129D9 +:10C1300004D9FF205CA147300FF00DF85548406846 +:10C14000103840B2FFF718FFC6B20D20FFF714FFFA +:10C15000C0B2864207D2FF2053A14D300EF0FBFF44 +:10C1600001E0F6F74AFB21462846FFF766FF002864 +:10C17000F7D070BDF8B507464948484C401E474EB9 +:10C180000078254646362335002806D1A9786878F8 +:10C19000212200F06BF800280ED0A17860782122CF +:10C1A00000F064F8002814D0B1787078212200F0F3 +:10C1B0005DF8002828D033E038496878C91C0F544E +:10C1C0006878401CC0B26870212829D100206870AE +:10C1D00026E03249607820390F546078401CC0B2A4 +:10C1E0006070212801D1002060702D4F7F1E3878AB +:10C1F000002815D0A1786078212200F037F80028B7 +:10C200000ED0002038700BE02449707826310F548E +:10C210007078401CC0B27070212801D1002070706D +:10C22000A9786878212200F021F800281DD0A17893 +:10C230006078212200F01AF8002816D0B1787078C2 +:10C24000212200F013F800280FD0F6F7B8FA1448AE +:10C2500005F0ABFF01214903884203D016A1C1209C +:10C260000EF079FF0E4805F0B8FFF8BD401C88427B +:10C2700005D0904201D1002901D000207047012053 +:10C28000704710B5064805F090FF002801D1F6F779 +:10C2900085FA10BD00ED00E000E400E0F00E0020A3 +:10C2A00069000020072000007372635C736F635F96 +:10C2B00072616E642E6300007372635C736F635F00 +:10C2C00072616E642E630000FEB5F54C074660682F +:10C2D000FF213E0181552178FF2913D00901083142 +:10C2E00041583246491E083209020192090A805813 +:10C2F00000F0CCF9002802D02478254615E06168CA +:10C30000207888552770FEBDE5484268019811588D +:10C31000280100900830105800F0B8F9002806D124 +:10C32000DF482C46416800980D5CFF2DECD1DC48BD +:10C330002101406885554754FEBD70B5D84A044672 +:10C340000020157A53680AE00201561C9E5DA64241 +:10C3500003D10C329A588A4204D0401CC0B28542A4 +:10C36000F2D8FF2070BDF8B5CD4F3E7801F00AFE3F +:10C370000146FF2E68D034012546786808354059BB +:10C3800000F084F9022802D9786840595AE0C4497B +:10C390004868025D0A70A11C425C002A0CD0521E43 +:10C3A000425441590122D20589180902090A415112 +:10C3B0003046FFF789FF30E0631CC25C0092221D0B +:10C3C00094468258002A10D001239B029A420FD92A +:10C3D0009205920D43595703DB191B021B0A435167 +:10C3E0006346C3589A1A920A09E0FF21C1540AE031 +:10C3F000435952039A181202120A4251002242541F +:10C400003046FFF761FFA6480C344168C2680098C7 +:10C4100009598000125800989047A14C2078FF28B5 +:10C4200012D001F0AFFD01462078626800010830AB +:10C43000105800F02BF9012896D920786168000186 +:10C440000830085801F091FDF8BDF8B51C461546B6 +:10C450000E460746FF2B03D392A1D3200EF07BFE9E +:10C460008F48FF21C7604560047206740170002286 +:10C470004270104604E00201521C401CA954C0B294 +:10C48000A042F8D3F8BD70B5854C06466578207C8F +:10C49000854203D383A1E6200EF05DFEE068A9008B +:10C4A00046506078401C6070284670BDFFB581B072 +:10C4B0001D46FF2401F066FD794F06467978019804 +:10C4C000814203D877A1F4200EF045FE7448002184 +:10C4D000037A406810E00A019446521C825CFF2AED +:10C4E00024D0019FBA4205D162460C328758029A85 +:10C4F00097421DD0491CC9B28B42ECD8FF2C17D0F3 +:10C5000021014B1C019AC2540B33029AC250039B67 +:10C51000634F0022012B0ED00B1DC25001239B0242 +:10C520009D4216D9AA05920D08D008E00C46E1E715 +:10C53000FF2005B0F0BD0B1DC550EFE71A465303B1 +:10C540009B190E461B0208361B0AAA1A8351920A2F +:10C5500009E0002D00D101256B039B191D022D0A56 +:10C560000B460833C550891C42543D463E78204650 +:10C57000FFF7AAFE2878B04217D001F003FD01466C +:10C5800028786A6800010830105800F07FF8012808 +:10C5900007D92878696800010830085801F0E5FCDF +:10C5A00003E001F010F9F5F7AFFE0198C1E770B5AF +:10C5B0000C46054601F0E6FC064621462846FFF7F4 +:10C5C000BCFEFF2817D0364D0401204669680830AC +:10C5D0000858314600F05AF80121090340186968EB +:10C5E000A41C095D400B002901D08902081800280D +:10C5F00000D1012070BD002070BDF3B581B00F46A1 +:10C600000198FFF79AFEFF282AD0254D2E786968F9 +:10C610003246344604E0844205D026462301CC5CF1 +:10C62000FF2CF8D11CE0FF2C1AD0A64221D110011A +:10C63000085C2870FF281AD001F0A4FC2A78014673 +:10C64000120168680832805800F020F8012809D9E2 +:10C650002878696800010830085801F086FC08E075 +:10C660000020FEBD01F0AFF8F5F74EFE01E001F04D +:10C6700084FC39460198FFF79AFF22016968FF237D +:10C68000541C0B558A5C3301CA54FEBD401A00028B +:10C690000121000AC905884200D900207047000026 +:10C6A0003C0F00207372635C736F635F74696D6528 +:10C6B000722E6300F0B500241C4A01211C4B0803B4 +:10C6C000546018601B4B1C601B4C20601B480469A5 +:10C6D000E443E406E617046910252C430461184C72 +:10C6E0006160184D2960761C00E020BF1F68002F94 +:10C6F000FBD0002E03D107691026B743076190686D +:10C700008005906801D5104A10436960A16000213E +:10C7100019600121084A09031160F0BD10B50446F3 +:10C72000FFF7C8FF2060002010BD000000C50040DA +:10C7300080E100E000C1004080E200E000ED00E0A8 +:10C7400000C3004000C0004000FCFFFF70B51F495F +:10C750000A68002A17D000231D4601244A68521C8B +:10C760004A60092A00D34D600E792246B2400E6815 +:10C7700016420AD072B60B6893430B6062B64968E2 +:10C780000160002070BD052070BD5B1C092BE5D346 +:10C790000FA136200EF0DFFCF5E7012010498005DF +:10C7A00008607047EFF31081CA07D20F72B60121FB +:10C7B00081400648036819430160002A00D162B62F +:10C7C000EBE70248002101604160704770000020E3 +:10C7D0007372635C736F635F6576742E6300000031 +:10C7E00000E200E001208107086070470120810716 +:10C7F000486070471048C068C00700D001207047EB +:10C800000D488068C00700D0012070470A48406981 +:10C81000C00700D0012070470748C069704706492B +:10C820008A69D20306D589698907890F814201D1B6 +:10C83000012070470020704700040040F8B5F74C15 +:10C84000207EE17D88421CD00126F54D0027E07D49 +:10C85000215C14200A4642435019037C052B11D059 +:10C86000037C062B1CD0037C072B28D0437C012B98 +:10C8700033D0ECA1EE480EF06EFC207EE17D8842C4 +:10C88000E5D1F8BD0674E07D162807D0E07D401C98 +:10C89000E075491CC8B2AA5802210CE00020F7E755 +:10C8A0000674E07D162808D0E07D401CE075491C28 +:10C8B000C8B2AA5803219047DFE70020F6E70674C4 +:10C8C000E07D162807D0E07D401CE075491CC8B209 +:10C8D000AA580821EFE70020F7E74774E07D162803 +:10C8E00007D0E07D401CE075491CC8B2AA5807215A +:10C8F000E1E70020F7E770B50024CE4E0C207072FF +:10C90000CD4825464473047328300476C475CB485B +:10C9100005F043FCCA480575F572CA49601E886077 +:10C920007571B570F57035717570C748E839057067 +:10C9300045701420604340180574641CE4B20B2C4D +:10C94000F7D30120F5F7E0FF0020F5F7DDFF012028 +:10C95000B071F5F7A3FCBD48F5F7B2FCBC4C2070F4 +:10C96000BC48F5F7ADFC6070F5F76EFF70BD10B513 +:10C97000F5F795FFB64C2078F5F7C0FC6078F5F731 +:10C98000BDFCAC4C207A002803D0F5F746FD002012 +:10C99000207210BD70B5A74CA079002804D0A1A1C9 +:10C9A000AD480EF0D8FB70BDE07A002803D19DA100 +:10C9B000AA480EF0D0FB0126A6710025E572607A28 +:10C9C000042114225043964A801801749D488168BE +:10C9D000491C04D0691E81600120F5F795FF0020F5 +:10C9E000F5F792FFF5F776FF05F018FDF6F777F803 +:10C9F0009B480560056001209A49C0030860F6F76E +:10CA0000EDF891480078022804D0032804D1E0789A +:10CA1000002801D0A67000E0A570F6F74CF870BDB4 +:10CA200003467F490B20142242435218203A127FBA +:10CA3000002A04D0401E0006000EF4D170471422D4 +:10CA4000424351180A46803AD366012220390A77B8 +:10CA50007047012805D0032805D1002903D1002003 +:10CA600070470029FBD010B4724C00236370764AE3 +:10CA7000002890700CD002280AD007291AD208008A +:10CA800078440079001887441505070D0F1113002D +:10CA9000D37003E01B2000E03A20D07001206070CA +:10CAA00010BC70475820F8E77720F6E79620F4E7A7 +:10CAB000B520F2E710BC0020704710B562484078FE +:10CAC000F6F714F880B210BD411E1422504310B581 +:10CAD000534A8418203C0A2902D8207F002803D119 +:10CAE00050A161480EF037FB207F012804D0B3200D +:10CAF0004CA180000EF02FFB0020207710BD70B5F8 +:10CB00004D4C607B217B884201D1012500E000254E +:10CB1000F5F785FFF5F7EAFF617B227B914201D1B2 +:10CB2000012100E00021A942EBD170BDF7B5064616 +:10CB3000481E84468EB0C0B2142205905043384A35 +:10CB400085180495287C2D1D07282AD1334C0027F1 +:10CB5000E07D227E824221D0235C059A934201D15E +:10CB6000012701E0002F04D0162811D0421CA25C3E +:10CB7000225416280ED0401C227EC0B28242EBD135 +:10CB8000002F0BD0207E002806D0207E401E04E01F +:10CB90000022ECE70020EFE716202076049801221F +:10CBA00002746046234C0A2813D8142041431C48C1 +:10CBB00008182038007F00280BD00498007C01283A +:10CBC0000BD00498007C012803D01098807A0128AB +:10CBD00007D014A125480EF0BEFA1098807A0128DB +:10CBE0006DD104980E4B007C022843D00B4C207E64 +:10CBF000162870D0207EE17D401C884203D109A117 +:10CC00001B480EF0A8FA049901204874217E05986B +:10CC10006054207E162862D063E0000038110020A6 +:10CC2000541100207372635C72656D2E6300000006 +:10CC3000D40500005C1200201011002068120020B2 +:10CC4000201100203C1200207A00002067C3000061 +:10CC5000780000203DC800007D0200005E02000058 +:10CC600000F5004080E200E0CB0200001503000068 +:10CC700022030000607A059A0146904206D00146E0 +:10CC800014277843C018807C9042F8D1627A82429F +:10CC900008D1617A14225143C918897C617201213B +:10CCA000A17207E014224243D21814277943927CE0 +:10CCB000C9188A7414220C215043C018817410982A +:10CCC000007A06281DD201007944097949188F4459 +:10CCD0000C161412100EE07D002890D093E700206F +:10CCE00001E0207E401C2076B5E000210FE0B42159 +:10CCF0000DE073210BE0322109E00A2107E0062153 +:10CD000005E0FF20FDA1E0300EF025FA002110988B +:10CD100002910068401A28601099097A002912D0FF +:10CD20000221401A0102090A29601098026840682D +:10CD300010180002000A68601098807A0228109883 +:10CD400003D0007B71E00421EBE7007A002812D0C9 +:10CD500002220298121810984368104610301818D2 +:10CD60000A90E948029B4078984202D9E378002B68 +:10CD700003D00A9805E00422EBE7029BC31A0A9845 +:10CD80001818637A10300C2B1CD0637A14277B435D +:10CD9000DE4FDB195B68994214D0DD4F617ABC46E7 +:10CDA00014235943D94BC9184B6889689B1B891BAD +:10CDB0001B0209021B0A090A984237D8634535D875 +:10CDC000614533D831180A980123081A0002000A75 +:10CDD000286010998018C9680002000A471ACD4AD5 +:10CDE0009B05BC469F4201D2384610E00F1A9F4275 +:10CDF00001D260460BE0944503D9511A0818401C33 +:10CE000005E0974206D9101A4018401C40420028FD +:10CE10005FDC03E0B9A1C0480EF09DF929680A98CB +:10CE200008180002000A686000202872686810274D +:10CE300010300002000A68601098407AA8721098BA +:10CE4000007A687203280ED200280CD0FFF7D2FCBB +:10CE5000002803D007E0002011B0F0BD0298422165 +:10CE60000F1A32200290A8490878012801D003281F +:10CE700009D148780299884205D9E178002902D180 +:10CE80000299401AC7196B6828689B1B801B9C4637 +:10CE900001021B029E4A090A1B0A8F4219D8174633 +:10CEA000914216D8BB4214D8617A0C2915D0677A02 +:10CEB00061460C22039200921422944B7A43D218BA +:10CEC00093689B1B834216D80397977C0C2FF3D152 +:10CED00073E0059801F04CF9BDE70498022205992A +:10CEE0000274627A0C2A00D0627A82746172012024 +:10CEF000A07211B0F0BD0C2F5FD0002238469446CE +:10CF00001422824B4243D21853689B1B8B4225D27A +:10CF1000907BAB7A98421BD804980521059D01743B +:10CF20007E4C207E16280FD0207EE17D401C88425A +:10CF300003D172A17A480EF00EF9207E2554207E8E +:10CF4000162800D0CDE6CAE6E07D0028F1D0F4E74F +:10CF500001208446907C0C28D2D102E06146002951 +:10CF60002AD03D46009014202A46424367480621B5 +:10CF7000161831741C38007E1628684816D0017EB9 +:10CF8000C07D491C814203D15CA166480EF0E3F8E4 +:10CF90006248017E4554017E16290BD0017E491C52 +:10CFA0000176B57C0098A842DDD106E0C07D00285E +:10CFB000EAD0EDE70021F3E7009704990220534DF2 +:10CFC0000874607AB84207D104990098887405986B +:10CFD00060720120A07221E003980C2F0FD00C2862 +:10CFE00003D146A150480EF0B6F8039814225043DE +:10CFF0004019059981740499009888740EE00C28F2 +:10D0000003D13EA149480EF0A6F8039814225043DC +:10D0100040190599817404990C208874012011B07D +:10D02000F0BD70B50D46424A441900210B46101A56 +:10D030008B4103D231A13F480EF08DF83E48854226 +:10D0400003DD2EA13D480EF086F83D48854203DA07 +:10D050002AA13C480EF07FF83B48844205DA002CB8 +:10D0600001DB204670BD384800E03848201870BD0C +:10D07000401E70B5C0B21421484324494418607B57 +:10D08000062813D201007944097949188F44020C0B +:10D090000A080604002067E0B42010E073200EE0C8 +:10D0A00032200CE00A200AE0062008E0FF2013A14D +:10D0B000E0300EF050F8617B0020002954D00221AE +:10D0C0004018616840180002000AF5F70FFD0C25B2 +:10D0D0006557174A441900210B46101A8B4103D299 +:10D0E00006A114480EF037F81348854203DD03A16A +:10D0F00012480EF030F81248854229E07372635CE2 +:10D1000072656D2E630000007A000020541100202B +:10D11000FFFF3F00FFFFFF00130700003811002052 +:10D1200007020000C5030000DD030000E303000068 +:10D13000FF7F841EF50300000020A107F603000016 +:10D1400000E05EF8F70300000080841E00807BE1B1 +:10D1500003DAF749F7480DF0FEFFF748844207DA93 +:10D16000002C03DB204670BD0421A9E7F24800E053 +:10D17000F248201870BDF0B5064683B0F048019023 +:10D18000457A029534687068001B0702ED483F0A33 +:10D19000001B00900C2D2DD0142029464143EA4855 +:10D1A0000122081884464168E64892058646081B15 +:10D1B000904210D3631A93420DD3024670467245D3 +:10D1C00003D900984018401C05E073450ED9411A58 +:10D1D0000819401C404200280CDA60460295857C04 +:10D1E0000198C0790028D5D003B0F0BDD049D74808 +:10D1F0000DF0B1FF0298854226D014214843D24950 +:10D200000123401802908068CE499B058C46011B83 +:10D210008646994210D3221A9A420DD3634661453D +:10D2200003D900997144491C06E0194662452DD97D +:10D23000091A0819401C4142002905DD0298B17AFB +:10D24000807B814200D374460C2D15D0BE4914203A +:10D25000454368184268121B1202120ABA420BD2E6 +:10D26000B37A827B934200D38468857C0198C0792D +:10D270000028B9D10C2DEAD13068A042B4D0E01911 +:10D280000002000A3460706003B0F0BDA849AF48E6 +:10D290000DF061FFD8E7F0B5AD490446486885B0A8 +:10D2A000C005C00D1CD0103840B200280CDA0207AF +:10D2B000120F083A920892005118C9698007C00EEF +:10D2C000C1400806800F09E08108A24A8900891838 +:10D2D00009688007C00EC1400806800F002808D0EA +:10D2E00000272078002806D0012804D0002005B0AF +:10D2F000F0BD0127F5E72079062813D20100794413 +:10D30000097949188F44020C0A080604002018E025 +:10D31000B42010E073200EE032200CE00A200AE076 +:10D32000062008E0FF208249E0300DF014FF21794B +:10D330000020002905D002214618814D002F02D07F +:10D3400003E00421F8E70020E871694602AAA0681A +:10D35000F5F7D6FB694608228A56E06801A98018CD +:10D360000122C01C1F2801DA019209E003AAF5F787 +:10D37000C7FB6846007B002802D00198401C019042 +:10D3800000990198401810300002000A0190881B93 +:10D390000002000A00906079694688720098039044 +:10D3A000F5F73DFB009A019B121A181A6A491202FE +:10D3B0000002120A000A8A4216D8884214D8684627 +:10D3C000FFF7D9FE00990398814205D08819000221 +:10D3D000000AF5F78BFBA0600120E979002986D0CF +:10D3E000002FB0D005B0F0BD0020F6E7F3B58FB048 +:10D3F0005A480C460B9004F0D8FE594A0F99504FEA +:10D400005618584D203E00280BD05748007D002864 +:10D4100003D056A158480DF09EFE207801287CD0FC +:10D420005AE1687B16280CD0687B297B401C884217 +:10D4300003D14EA151480DF08EFE2078012804D072 +:10D440000CE0287B0028F4D0F7E7F07F002803D019 +:10D4500046A14B480DF07FFE0120F077697B0F98C5 +:10D460001422484E5143891908742078022822D08A +:10D47000687B142148438619207930726079707274 +:10D4800032460C323146A068F5F73AFB0C20305694 +:10D490000F2804DD1F3830733068401C30600C21C9 +:10D4A0007156301DE26801905018C01C1F283EDAEA +:10D4B00001200199F7E026494868C005C00D21D038 +:10D4C000103840B200280CDA0207120F083A92080E +:10D4D00092005118C9698007C00EC1400806800F2C +:10D4E00009E081081B4A8900891809688007C00E75 +:10D4F000C1400806800F002804D105201BA10002AE +:10D500000DF029FE687B1421484386190021E0684C +:10D510006A460691117006A900E0D3E0F5F7F0FA2B +:10D520006A46002010560F282EDD01202DE0AEE0C7 +:10D53000FCD00000F70300000080841E00807BE127 +:10D540005C120020FFFFFF005411002013070000B1 +:10D5500000ED00E000E400E0FFFF3F006812002063 +:10D560003012002010110020201100207372635C23 +:10D5700072656D2E6300000011050000EF040000CD +:10D58000F4040000500F0020002006994018079076 +:10D590000220B0722079307260797072A068311DFB +:10D5A000C01C06911F2801DA012009E0F5F7A8FA4E +:10D5B00068460078002804D0069806990068401C48 +:10D5C0000860307A062813D2010079440979491895 +:10D5D0008F44020C0A08060400200FE0B4200DE07E +:10D5E00073200BE0322009E00A2007E0062005E066 +:10D5F000FF20FE49E0300DF0AEFD0020217900292A +:10D6000043D002214018069071681030081807991D +:10D61000089009180698081A0C900020F871F5F780 +:10D62000FEF904463060079820180002000AF060F6 +:10D63000787A0C2825D0797A14204143EC480818D0 +:10D6400040680899029040180002000A0390707A1E +:10D650006946887402A8FFF78EFD0299039A091B98 +:10D66000121B09021202E34B090A120A0C98994292 +:10D6700007D8824205D80299069808180002000AC5 +:10D680003060F8790028C8D110E00421BAE704AA74 +:10D690000199F5F735FA6846007C002804D0019816 +:10D6A00001990068401C08602078B072687B1628D9 +:10D6B00006D0687B401C68730B9804F08EFD47E031 +:10D6C0000020F8E7F07F002804D0A320CAA1C00002 +:10D6D0000DF041FD0120F077CA490F9808742078B9 +:10D6E000022803D1C4A1C8480DF035FDC54E2079EC +:10D6F00030726079707232460C323146A068F5F7AC +:10D70000FFF90C2030560F2804DD1F3830733068C5 +:10D71000401C30600C22B256301DE1680190881820 +:10D72000C01C1F2802DA012001990BE003AA01990D +:10D73000F5F7E6F96846007B002804D001980199C6 +:10D740000068401C08602078B072AE49012008755E +:10D75000687B297B884224D07C7A0C2C23D0F5F777 +:10D760005EF914214C43A24961180A7C042A18D09E +:10D770000A7C032A15D04B6889681B1A081A1B02F9 +:10D7800000029C4A1B0A000A102B0AD3114693423E +:10D7900007D8884205D8687B297B884201D0F5F7F5 +:10D7A0008AF911B0F0BD687B297B8842F7D111B0AE +:10D7B000F0BD10B50020F5F794F810BD10B50120AC +:10D7C000F5F78FF810BD914800787047F1B50098D3 +:10D7D00002281ED08E4C607A0C2803D186A18D4879 +:10D7E0000DF0B9FC0026A6710125E572607A0321CF +:10D7F00014227F4F5043C0190174F5F761F9009866 +:10D8000000280BD001282AD003287AD07AA1824898 +:10D8100045E07E480078F4F777FDF8BD7F48007F4B +:10D82000002804D02B2074A140010DF094FC6571F8 +:10D830007A4D00202E60F5F767F8A968481C04D0DF +:10D84000012300221846F5F795F8607A617A401CAA +:10D85000C0B2142251437A5801219047F8BD0120EB +:10D86000F5F752F8607900280DD06C488068401CAC +:10D8700009D0607A617A401CC0B2142251437A58B0 +:10D8800006219047F8BD6548007F01280AD002288C +:10D8900012D0032822D0042834D057A160480DF0BC +:10D8A0005AFCF8BD2079002803D02671F5F70DF950 +:10D8B000E5705A480677F8BD207A002802D1F4F7BF +:10D8C00083FD2572607A617A401CC0B214225143F4 +:10D8D0007A580021904751480677F8BD4F4F0123F1 +:10D8E000397B78680022411A1846F5F743F8207909 +:10D8F000002803D02671F5F7E8F8E57002203877A4 +:10D90000F8BD19E0454E217870680123411A0022C4 +:10D910001846F5F72FF8207A002802D1F4F754FDC5 +:10D920002572607A617A401CC0B2142251437A5841 +:10D93000002190473577F8BD607A617A401CC0B20B +:10D94000142251437A5805219047F8BD10B5304C48 +:10D95000607A0C2803D128A132480DF0FCFB607AD4 +:10D96000617A401CC0B214225143214A525804210A +:10D97000904710BDF0B583B00C200290F5F74FF83A +:10D98000234C0090617A284801900C2920D0617ABC +:10D990001420414316480918097C042918D0617ADB +:10D9A000142251430818007C032879D0019900986B +:10D9B0000B6849681B1A081A1B0200020D4A1B0A51 +:10D9C000000A102B6CD31146934269D8884267D85D +:10D9D00012488068401C03D007A114480DF0BBFB1F +:10D9E00000206071607A0C282AD121E0FCD0000070 +:10D9F00054110020FFFF3F007372635C72656D2E4F +:10DA000063000000201100201E05000078000020A7 +:10DA10005C12002054050000A70500003C12002005 +:10DA20009B050000AE0500004C120020EA05000036 +:10DA30006078002804D0FE48C17841708178017078 +:10DA4000607A0C2815D0607A1421FA4A484380186D +:10DA5000007C04280DD1607A0290607A01211423A1 +:10DA6000584380180174607A58438018807C607233 +:10DA7000A172F14D687B297BF04F884233D0F04E84 +:10DA8000287B142148438019007CC05D0128287B35 +:10DA900007D048438019007CC05D02282FD044E0A5 +:10DAA000FCE1142148438019807A01280AD0287BA0 +:10DAB0000221142250438019007CC155287B16286E +:10DAC00008D009E0287B0021142250438019007CF3 +:10DAD000C1552AE0002001E0287B401C2873687BA8 +:10DAE000297B8842CCD1D74D287D00284DD0287C79 +:10DAF000C15D012928D0C05D022830D03BE0287BE1 +:10DB0000142148438019807A012803D0CEA1D1483E +:10DB10000DF021FB297B00201422514389198872C2 +:10DB2000297B51438919097CC855287B1421484316 +:10DB30008219287B48438019017C0098FEF7F6FF84 +:10DB4000287B1628C8D1C5E7A97A012904D002216B +:10DB5000C155002028750EE00021C1550BE0A87AC0 +:10DB6000012804D0C520B8A1C0000DF0F4FA0020AF +:10DB7000A872297CC855287D002806D0297CB14A86 +:10DB80000098FEF7D3FF0020287502980C281ED0BD +:10DB900014214843A7494018017C012917D10721C6 +:10DBA0000174AD4D287E16283CD0287EE97D401CAE +:10DBB000884203D1A4A1A9480DF0CDFA297E02988C +:10DBC0006854287E162831D0287E401C2876607A3A +:10DBD0000C287DD0A07A00287BD00020A072617A2A +:10DBE0001420414393480E189D49B56873680A464E +:10DBF000F6687C32CB67966055609A4D697E002945 +:10DC000016D00226617A14228A4851430818407BB4 +:10DC100006281BD201007944097949188F440A1457 +:10DC200012100E0CE87D0028C4D0C7E70020CDE715 +:10DC30000426E7E700210FE0B4210DE073210BE09B +:10DC4000322109E00A2107E0062105E0FF2086498C +:10DC5000E0300DF080FA00212973687E022801D09F +:10DC6000012810D12869009A4018821A1202120A5B +:10DC7000422A08D93238032100026976000A286155 +:10DC80003220287308E0322906D2207A00280AD1EF +:10DC9000F4F79AFB012005E0207A002803D0F4F77E +:10DCA000BCFB00202072624910224878207009785D +:10DCB000012901D0032906D101212171297B884244 +:10DCC00001D9421A1032A378002B00D0921C01E037 +:10DCD0008DE09BE02179002901D1002B5DD0944695 +:10DCE000624A00990092019A176852687F1A511A85 +:10DCF0003F0209023F0A090ABC451BD85B4A97420A +:10DD000018D8009A914215D8297B884223D92B69CB +:10DD1000421A9A1A1202120A101880190002000AF6 +:10DD20002A616860002914D0032028770006000EBD +:10DD30003ED14CE000202071A070297B002925D025 +:10DD40002869401880190002000A686002202877BC +:10DD50002EE00120E9E781420BD92A69511889197F +:10DD60000902090A6960002801D00420DDE70220C9 +:10DD7000DBE7002B03D134A13D480DF0ECF9286915 +:10DD800080190002000A6860002004E029698919EE +:10DD90000902090A6960287719E0287B00280FD05A +:10DDA0002969081880190002000A68600220287793 +:10DDB00028690123811900221846F4F7DBFD09E0E8 +:10DDC000286980190002000A686000202877012075 +:10DDD000F4F79AFD607A1421484316490C22401842 +:10DDE0008256012300206968F4F7C4FD0EE001208B +:10DDF000F4F78AFD0020F4F787FDF4F76BFD207A35 +:10DE0000002803D0F4F709FB00202072A078002836 +:10DE100004D0F4F75AFE0020E070A070607800286B +:10DE200004D00348C178417081780170207921E0E5 +:10DE30007A00002054110020101100202F12002021 +:10DE4000500F0020201100207372635C72656D2EEC +:10DE5000630000000C060000381100203A060000A4 +:10DE6000D01100203C120020FCD00000FFFF3F003A +:10DE70008C060000002806D00020CF49E070097809 +:10DE8000002900D12071CD48017EC07D814203D0A0 +:10DE9000CB484078F4F738FA0120E07103B0F0BDC8 +:10DEA000F0B5C84C0746607A83B00C2803D1C6A1F0 +:10DEB000C8480DF050F9607A1421C74E48438019C4 +:10DEC000007C032804D06F20BFA100010DF043F9AE +:10DED000C24DA868401C03D0BBA1C1480DF03BF95E +:10DEE000607A1421484381190C20085600216A46A3 +:10DEF00000911171C01901AA6946F4F701FE6A4642 +:10DF0000042010560F2801DD012000E000200099B8 +:10DF10004018696840180102090AA9606079002860 +:10DF200004D0012300221846F4F724FD03B0F0BD0D +:10DF300070B5AD4CAB4A0B1AA34214D3451AA54297 +:10DF400011D3934203D9101A43185B1C0BE095427E +:10DF500004D9511A0818401C434204E0A349A448BC +:10DF60000DF0F9F80023184670BD10B501460123E5 +:10DF700000220220F4F7FEFC10BD10B50220F4F7D9 +:10DF8000C3FC10BD10B5F4F74AFD10BDF0B58D4DC2 +:10DF90000446E87A83B0002803D18BA195480DF0A0 +:10DFA000DAF8642C4DD3944900200246091B8241C3 +:10DFB00047D39248417B007B814242D19048007D0B +:10DFC00000283ED1687A1421834F4843834EC519F7 +:10DFD000306801AA00196946F4F792FD69460420E9 +:10DFE0000856002802DD0098401C0090A96800989F +:10DFF0006B680A18D21A1202824B120A9A4220D86F +:10E00000AA7C0C2A08D014235A43D2195268511AF8 +:10E010000902090A814214D3B068401C05D00120CE +:10E02000F4F772FC0020C043B06030680019306023 +:10E03000A868009940180002000A7061012003B02E +:10E04000F0BD002003B0F0BDF8B50646401EC5B2D5 +:10E050001420614968434418207C002803D15AA148 +:10E0600069480DF078F86548017B407B81420CD00F +:10E07000664A14234B439B181B7CB3420CD01629D1 +:10E080000CD0491CC9B28142F3D15D48017D002901 +:10E0900064D0007CB04261D10020F8BD0021F1E7DE +:10E0A000217C052905D0217C062902D0217C072965 +:10E0B00028D101212174C17D0023027E8A4221D012 +:10E0C0000246565CAE4201D1012301E0002B04D090 +:10E0D000162911D04E1C965D565416290ED0491C97 +:10E0E000167EC9B28E42ECD1002B0BD0117E0029D6 +:10E0F00006D0117E491E04E00026ECE70021EFE780 +:10E1000016211176617C00292AD06774C17D002315 +:10E11000027E8A4224D0425CAA4201D1012301E05E +:10E12000002B04D0162912D04A1C825C42541629B6 +:10E130000FD0491C027EC9B28A42ECD1002B0FD00D +:10E14000027E0146002A06D00A7E521E04E000220A +:10E15000EBE70021EEE716220A7601E017480027D8 +:10E16000217C01299CD1617C002999D10120F8BD35 +:10E1700070B505461420184A0521684380180174BB +:10E180000E4C207E162811D0207EE17D401C884256 +:10E1900003D116491E480CF0DEFF207E2554207E58 +:10E1A000162807D0207E401C207670BDE07D002818 +:10E1B000EFD0F2E70020F7E77A00002038110020C6 +:10E1C000780000205C1200207372635C72656D2E13 +:10E1D00063000000EF060000541100203C120020F4 +:10E1E000F1060000FF7F841E0020A107FCD0000084 +:10E1F0001307000032070000FF1FA10710110020C5 +:10E2000020110020FFFF3F006F070000500F00208B +:10E210000702000010B509F063FC042803D009F0E0 +:10E220005FFC052803D106F0D1FE00280BD104F0D5 +:10E2300007F9032803D004F009F9032805D109F0F0 +:10E24000B0FD002801D0012010BD002010BDF0B5A8 +:10E2500085B00746002668460D4606726946384670 +:10E2600005F05CFA00287DD16846007800280BD0C4 +:10E2700009F009FDB84275D00022294638460AF057 +:10E28000CCFE00283ED120E006F077FCB842F2D068 +:10E2900000222946384608F01DF900287DD1019C4E +:10E2A0009020005D2834002804D1607E002801D031 +:10E2B000012000E000200490204660300390807828 +:10E2C00006F08AFB002804D008E0019C2834607E18 +:10E2D000F1E7FF20FDA1DA300CF03DFF20462030B1 +:10E2E000417B00290FD0817B89070CD56E700121FD +:10E2F0002970AE70AF80C17BA971218E2981618E9A +:10E300006981467349E0039802A9807806F030FAE3 +:10E31000002804D1FF20EDA1EE300CF01CFF684670 +:10E32000007A002809D06E700D202870AF806846F2 +:10E33000007AE8800120A8702FE0049800282FD0F0 +:10E3400006F0B5FB00282BD068460078002806D1DF +:10E3500001988030406A4188B94200D10670039824 +:10E36000807800E01CE006F0CAF8002803D1D7A1AD +:10E37000DA480CF0F0FE6E700A202870AE70AF80A4 +:10E38000A07EA8716676684605F07EFA002804D063 +:10E39000D248CEA10E300CF0DEFE012005B0F0BD5B +:10E3A0000020FBE77CB5CEA103C9CF4D002401912D +:10E3B0000090AC7001F067FD2946EC7004204039F4 +:10E3C000088710204887C81DC84AF9304280047168 +:10E3D000C280E03844740C7084730475C0300477D4 +:10E3E0001D300522694604460CF02BFD28462146C7 +:10E3F000BC3008F0F7F97CBDF8B5BD4C0D46606047 +:10E40000217006F057F805F0D1F8FFF7CBFF207820 +:10E4100009F03AF9B4498431084681380F46064676 +:10E4200006F08CFC606808F0D8F8284604F06EFC12 +:10E430003946304609F057FC60680AF08AFE01F060 +:10E4400022FDA9480021C170F8BDFEB50E461D464B +:10E45000144601A905F062F9002839D102988030EC +:10E46000807A06F079F800280CD0684606F087F824 +:10E47000002806D0002C03D006F01DF8A04206D2DA +:10E480000020FEBD91A19B480CF065FEF8E70098C6 +:10E4900005F0AAFB3146009805F0ABFBE2B2294635 +:10E4A000009805F063FD06F08FF8002804D191482C +:10E4B00086A11E300CF04FFE68460079012807D176 +:10E4C00001A801F0E7FC8A48002180688030418281 +:10E4D0000120FEBD30B40179002904D0012907D004 +:10E4E00030BC00207047831D42880488022103E06D +:10E4F00042880488831D0121204630BCA5E7FFB572 +:10E50000794C85B00E460746C0346088694608805D +:10E51000154602A905F002F9002811D0002168462D +:10E5200005F059F9002823D1684602A9008805F0B2 +:10E53000F5F8002804D06F4864A13C300CF00BFEC5 +:10E5400068460088388068460088608066480021F8 +:10E55000C23005F040F9002802D00020C04360809E +:10E5600003988030807A06F037FA002803D007E05D +:10E57000002009B0F0BD5F4854A156300CF0EBFD0F +:10E5800004A806F03CFA0028F3D0049805F068FBD4 +:10E590003070022807D0012805D056484BA17230B0 +:10E5A0000CF0D9FDE4E70899049805F0F6FC288002 +:10E5B000002804D14F4845A165300CF0CCFD06F091 +:10E5C00045FA002804D1E92040A180000CF0C3FDE9 +:10E5D0000120CEE73EB50446831D02AA694601A884 +:10E5E000FFF78DFF002813D068468088208068469A +:10E5F000008960800020607168460078012808D09A +:10E60000022806D03B4831A192380CF0A4FD01202D +:10E610003EBD2071FBE7FEB5040004D135482BA1B7 +:10E620007E380CF098FD304D0026203D687C002897 +:10E6300008D0667010202070A87CA070E87CE07084 +:10E640006E7430E0284F403F3878002808D02C22E4 +:10E65000B91C20460CF0F5FB0E2020703E7022E025 +:10E66000A87B002809D00120E070E87BA070287CFE +:10E6700060700F202070AE7315E01B480221C63079 +:10E68000029005F0A8F8002871D1174FC037F8881C +:10E690000190F888042808D0052831D02146FFF7DA +:10E6A000D6FD002859D00120FEBD0021204606F0ED +:10E6B00019FA0028F7D1287D00284ED06670132063 +:10E6C00020701C21A01C0CF019FC15E07372635C17 +:10E6D0006C6C5F6374726C2E630000000D020000AE +:10E6E000FFFFFFFF1F000000AC120020FFFF000033 +:10E6F00080000020390300000220A0702E75D2E7B0 +:10E700000021204609F098FA002826D02078132806 +:10E71000C9D1A0783C28C6D1A088694604F07CFF06 +:10E72000002803D0FD49FE480CF015FD009880300C +:10E73000807A05F0E4FE002804D1F948F749001D6D +:10E740000CF009FD009804F09FFF0028ABD0F448BE +:10E75000F24908300CF0FFFCA5E70221029805F011 +:10E760003AF8002803D1F9880198814291D100201C +:10E77000FEBD50E710B508F011FF002804D0E848AE +:10E78000E649BE300CF0E7FC07F01FFF06F09AFAEE +:10E7900004F07AFA002804D07920E049C0000CF097 +:10E7A000DAFC0AF0CEFC002804D03D20DB49000151 +:10E7B0000CF0D1FC09F070FA002804D0F520D749FC +:10E7C00080000CF0C8FCFFF7EDFD04F0ABFE002864 +:10E7D00004D0F720D14980000CF0BDFC05F01CFEF0 +:10E7E00001F051FBCF480021C17040380171012177 +:10E7F00041710222C270017010BD10B5C94C403C7D +:10E800002078002804D00A210E2001F002FB10BD60 +:10E81000FFF700FD002801D00C2002E001F033FBDF +:10E8200000202071012060710A21E170207010BD6C +:10E8300070B5BC4C0646403C2078002804D03A21F4 +:10E840000E2001F0E6FA70BDFFF7E4FC002801D0CD +:10E850000C2010E0B34DE87808280BD20001001915 +:10E8600010223146443001F0DEFAE878401CE870AE +:10E87000002000E007202071012060713A21E17042 +:10E88000207070BD70B5A74C0646403C207800282B +:10E8900004D00B210E2001F0BCFA70BD30780028A6 +:10E8A00003D0012801D0122015E09E4D8035287933 +:10E8B000082817D2FFF7AEFC002801D00C200AE090 +:10E8C000984833782979721C883001F098FB2879B0 +:10E8D000401C287100202071012060710B21E17023 +:10E8E000207070BD0720F6E710B58E4C403C2078B4 +:10E8F000002804D039210E2001F08BFA10BDFFF75B +:10E9000089FC002801D00C2002E086490020C87054 +:10E910002071012060713921E170207010BD8148A3 +:10E9200010B540380178002904D00F210E2001F0E5 +:10E9300070FA10BD002101710E2181700F21C1708C +:10E94000FF2181710021C9430181774949680A7813 +:10E9500082728A8882814988C18101214171017056 +:10E9600010BD704910B540390A78002A04D03C2106 +:10E970000E2001F04EFA10BD6A4A0088C032508065 +:10E980000120107100220A7148713C22CA7008707F +:10E9900010BD10B5634C403C2078002804D02B21DA +:10E9A0000E2001F036FA10BD0821A01DFDF7BCFBBA +:10E9B00000202071012060712B21E170207010BDBA +:10E9C00010B5584C403C2078002804D005210E207A +:10E9D00001F01FFA10BD05F06EFDE08005F0C6FEE7 +:10E9E000207200202071012060710521E1702070EB +:10E9F00010BD10B54B4C403C2178002904D031218A +:10EA00000E2001F006FA10BD00214156042911D054 +:10EA100000290FD0081D0DD0001D0BD0001D09D0FE +:10EA2000001D07D0001D05D00A3003D00A3001D0E8 +:10EA3000122003E0084601F033FB00202071312052 +:10EA4000E07001206071207010BD30B5354D044676 +:10EA5000403D28788DB0002805D02A210E2001F0F5 +:10EA6000D8F90DB030BD10222146684601F0DBF91F +:10EA70001022A11804A801F0D6F9684603F00BFC97 +:10EA800010222C46A81D08A901F0CDF90020207104 +:10EA90000E20A0702A20E070012060712070E0E755 +:10EAA000F0B5204C85B0403C2078002804D03B21B4 +:10EAB0000E2001F0AEF971E40020A07119486946FA +:10EAC000C0304088888002A904F028FE002805D0C4 +:10EAD000002101A804F07FFE002865D16846114D91 +:10EAE00081880180283D684602A9008804F016FE4E +:10EAF000002803D009490D480CF02DFB039E04A902 +:10EB000037468837B878283605F04BFE002804D100 +:10EB100006480249401D0CF01EFB09E0CCE600004F +:10EB2000FF020000AC12002080000020140500004D +:10EB3000767EB87805F050FF002803D1FB49FC48E9 +:10EB40000CF009FB05F0B3FF0121484031460143B9 +:10EB50001FD06A461188A279FD2352001219118133 +:10EB6000A2794000515D4908490031435155A279CD +:10EB70001940014351556A46107C002802D00420F8 +:10EB8000014301E0FB200140A0794155A079401CE0 +:10EB9000A0710021684604F01EFE002804D16846DA +:10EBA0000188808881429ED10020207101206071FF +:10EBB0003B21E17020707EE770B5DE4C0546207881 +:10EBC000002804D034210E2001F023F970BD08F094 +:10EBD00087FF052804D0284608F03FFD002000E00C +:10EBE0000C202071012060713421E170207070BD13 +:10EBF00010B5D04C2078002804D00E21084601F032 +:10EC000008F910BD0622CC49A01D0CF01AF900200D +:10EC10002071012060710E21E170207010BD70B56F +:10EC2000C44C06462078251D002804D032210E2031 +:10EC300001F0EFF870BD3146002009F032F928707C +:10EC400000280CD100213246084606F080F92870D1 +:10EC5000002804D106223146B7480CF0F2F8012012 +:10EC600060713221E170207070BD70B5B14C054605 +:10EC70002078002804D030210E2001F0CAF870BDA1 +:10EC800008F073FD002803D104F0DEFA00280DD04F +:10EC9000287804F08AF8287806F0C0F9002020715E +:10ECA000012060713021E170207070BD0C20F6E70A +:10ECB000F8B5A04C06462078251D002804D0172161 +:10ECC0000E2001F0A6F8F8BD3146012009F0E9F860 +:10ECD0000127287000280FD13246012106F037F9AC +:10ECE0002870002808D19348062231463C300CF0A9 +:10ECF000A8F890484030877067711720E07027703F +:10ED0000F8BDFEB58B4C05462034A07B002804D00E +:10ED100028210F2001F07DF8FEBDA8781A2824D004 +:10ED20000EDC03000CF038FB16333333333321335E +:10ED300033333333333333333333333321212133D9 +:10ED40002A2824D00ADC1E3803000CF025FB0C20F6 +:10ED5000202020202020202020200E203A380300D0 +:10ED60000CF01AFB04150315031528887349884213 +:10ED70000DD81F21E173282121740120A073288858 +:10ED8000694604F0CBFC002803D0022014E01220D6 +:10ED900012E068460078019F00280FD0C637019E18 +:10EDA00000280DD0C736684601F05CF8002802D074 +:10EDB0003878002806D00C20E073FEBD9C37EEE7C3 +:10EDC0009D36F0E701203870A87830700020E0739D +:10EDD000684601F05FF8FEBDF0B5564C0746207856 +:10EDE00085B0002804D025210E2001F012F862E63B +:10EDF000388802A904F092FC4E4E00210836002803 +:10EE00000CD00220207131603171E1800E20A070A1 +:10EE10002520E0700120607120704CE6039D28469B +:10EE20000A30483501900020A87505223046019926 +:10EE30000CF007F8A87D0028F5D13888E080E5E7D8 +:10EE4000FEB53C4C06462034A07B002804D010219F +:10EE50000F2000F0DEFFFEBD1F20E07310202074A5 +:10EE60000127A7733088694604F058FC002810D1A8 +:10EE7000684600F0F7FF00280BD06846019D007837 +:10EE800028350028019806D0CA300178002909D118 +:10EE900004E0022007E08030406AF6E72035697B15 +:10EEA000002902D03A20E073FEBDA97B89070DD16D +:10EEB0000621017068460078002804D10198318845 +:10EEC0008030406A4180684600F0E4FF0020E07333 +:10EED0006F73FEBD70B5174D04462878002804D026 +:10EEE00038210E2000F095FF70BD1F2028710120F1 +:10EEF00068713821E97028702078002808D001282E +:10EF000006D0022804D0032802D01220287170BD38 +:10EF1000002606F051F8207807F061FC207808F010 +:10EF2000E6FF20780AF0ABFA2E7170BDCCE6000047 +:10EF30001F0500006C1200208C000020FF0E000056 +:10EF4000F8B5FE4D06462878002804D01D210E2075 +:10EF500000F05FFFF8BD1F202871012068711D219E +:10EF6000E970287008F0BCFD0C27042857D005284C +:10EF700055D0B0791224012801D000281DD1307855 +:10EF8000002801D0012818D1F079002801D00128EB +:10EF900013D17088EA49021F30248A420DD2B28808 +:10EFA000121F8A4209D22887B0886887B079002466 +:10EFB000012804D000280CD016E02C71F8BDDF48E1 +:10EFC0004030807800282AD0DC4A3C3201210846B3 +:10EFD00002E0DC4A0021012005F0B9FF040003D063 +:10EFE000D949DA480CF0B7F8F079012801D00028A7 +:10EFF00002D105F0C8FF0446002C01D01F2011E00B +:10F000003078012802D0002803D00AE00021022035 +:10F0100001E00021012005F0C6FF002801D02F717A +:10F02000F8BD00202871F8BD70B5C44C21780029C6 +:10F0300004D01E210E2000F0ECFE76E71F21217186 +:10F04000012161711E22E270217002781221012AD1 +:10F0500001D0002A04D14078002803D0012801D033 +:10F06000217162E700260C25012A09D008F038FD3D +:10F07000052803D008F042FA002806D0257154E78D +:10F08000618F208F08F083FBF6E726714DE7F0B51E +:10F09000AD490446143103C987B0A84D0591203508 +:10F0A0000490A87B002805D021210F2000F0B1FE9C +:10F0B00007B0F0BD1F20E873212028740126AE732D +:10F0C00022889F4B111F3020994243D261880F1F25 +:10F0D0009F42FAD291423DD8E2899D4B911F9942BD +:10F0E000F3D2218A8F1F9F42EFD28A42F3D8628ADD +:10F0F000FF23F4339A42EED8A28A954F13460A3B77 +:10F100003F1FBB42E1D2C9088A4223D9E18A228B40 +:10F110009142E0D821791220002902D0012919D189 +:10F1200002E061790029F9D1217B002901D0012970 +:10F13000F5D108F0D5FC05280BD008F0D1FC042847 +:10F1400007D0287D002804D105F017FD81498842A9 +:10F1500001D00C20BDE0684604F0AEFA002801D0D2 +:10F160000920B6E001220321009804F0E6FF009F89 +:10F17000042178880F3703903846FCF7D5FF3846CE +:10F18000039905F0C2F874A0009F0068069003215F +:10F1900006A81337FCF751FF002006A90A5C3A5471 +:10F1A000401CC0B20328F9D30098218A8180618A6B +:10F1B000C180A18A01810146002720318F73CF735E +:10F1C0006179002902D0012903D101E0C77600E06E +:10F1D000C6760622A11D1C300BF033FE00980522D6 +:10F1E00004A90A300BF02DFE0098A0300673694682 +:10F1F0000F71012101A8FCF720FF6946087941073A +:10F20000C206490F920F80068918C00F0818694678 +:10F210000871401D009B0928987601D20830987625 +:10F2200001220021184604F088FF00988A3005F07A +:10F2300044F9002804D145484349FC300BF08BFFCA +:10F24000207B002806D0012808D03F4943480BF016 +:10F2500082FF40E000213B4A012008E0374840306F +:10F26000807800280FD0354A01213C32084605F04D +:10F270006EFE00282FD000988030807A05F03FF98C +:10F28000002816D01AE000988030807A05F037F90F +:10F29000002804D131482C490D380BF05CFF009850 +:10F2A00004F0DAFA002800D153E72C48264909383F +:10F2B00041E02A482449C01D0BF04DFF009804F09E +:10F2C000CBFA002804D025481F490B300BF043FF30 +:10F2D0001F20E873ECE62079012801D0002803D133 +:10F2E00005F051FE00280CD10320009905F05BFECB +:10F2F000002806D162882188009808F0F5F90028D6 +:10F3000007D000988030807A05F0F9F8002805D001 +:10F3100009E00098A0300770EF73C9E60F480A496A +:10F3200031300BF018FF009804F096FA0028BBD09B +:10F330000A48054935300BF00EFF0AE76C12002031 +:10F34000FD3F00008C000020CCE600000607000016 +:10F350007B0C0000FFFF0000112233001C0800009E +:10F3600038B5F94C2078002804D022210E2000F076 +:10F3700050FD38BD1F202071012565712220E070ED +:10F38000257008F0ADFB052802D00C20207138BD97 +:10F3900000202071684608F059FA0028F7D100983B +:10F3A0008030807A05F0ABF8002803D1E749E848BF +:10F3B0000BF0D1FE009804F04FFA002804D0E44886 +:10F3C000E249001D0BF0C7FEDF4820300575E1481B +:10F3D0000078F2F799FF38BDF8B5DB4D04462035CB +:10F3E000A87B002804D023210F2000F012FDF8BDD7 +:10F3F0001F20E873232028740120A8736288D64B4D +:10F40000911F302099424CD2A1888E1F9E4248D233 +:10F410008A4246D8E288FF23F4339A4241D82289AF +:10F42000CD4E13460A3B361FB3423AD2C9088A4230 +:10F4300037D96189A289914233D80026208869464C +:10F4400004F05EF9022700280BD1009800F0F8FCC8 +:10F45000002806D000988030416A0A78002A06D138 +:10F4600001E0EF73F8BD826B1278002A01D03A20D8 +:10F4700017E005228A71416A0E81426AA188518192 +:10F48000426AE1889181426A2189D181406A018979 +:10F490004289914204D88179082901D8914202D346 +:10F4A0001220E873F8BD2188418000988030406ABE +:10F4B0000770EE73F8BDFEB5A34C06462078002811 +:10F4C00004D024210E2000F0A4FCFEBD01256571AE +:10F4D0002420E0702570304604F039FF002801D068 +:10F4E000002000E0122020710028EED1964F052266 +:10F4F000E03738463D7731461D300BF0A2FC002640 +:10F500003E77701E69460880684604F031F900288D +:10F5100019D168460788684601A9008804F0F0F808 +:10F52000002804D08A4889498F300BF014FE0198D6 +:10F53000A0300573684604F01BF9002803D1684623 +:10F5400000888742E7D12671FEBD38B57E4C05465E +:10F550002034A07B002804D026210F2000F059FC85 +:10F5600038BD1F20E073262020740120A073288856 +:10F57000694604F0C5F800280BD1009800F060FC43 +:10F58000002806D000988030416A0A78002A06D107 +:10F5900001E002200DE0806B0078002801D03A20C5 +:10F5A00007E007200870009829888030406A418071 +:10F5B0000020E07338BD10B5634C2078002804D0DB +:10F5C00006210E2000F025FC10BD002020710E2029 +:10F5D000A0700620E0700821A01D0BF08FFCA1791F +:10F5E00001200143A1716071207010BD38B5564CE7 +:10F5F00005462034A07B002804D02C210F2000F0E9 +:10F6000008FC38BD1F20E0732C2020740120A0735B +:10F610002888694604F074F800280CD1009800F09E +:10F620000FFC002807D00098014680314B6A1A78F9 +:10F63000002A06D101E0022025E0896B0978002923 +:10F6400001D03A201FE04030007F00281DD0082262 +:10F65000A91C181D0BF0F5FB00986A898030416ADF +:10F660008A81406A294610220C310E300BF0E9FBEA +:10F67000009803218030406A01700098298880300A +:10F68000406A41800020E07338BD0C20FBE770B574 +:10F690002D4E044630780C25002804D018210E2069 +:10F6A00000F0B7FB41E402F0CBFE032865D002F086 +:10F6B000CDFE032861D06079002801D001282DD12A +:10F6C000A079002801D0012828D1A07B002805D0EE +:10F6D000012803D0022801D003281FD1607B002815 +:10F6E0001CD0C0081AD1628801208003824202D84F +:10F6F0002188814203D9207901280FD119E020798E +:10F70000002806D0012814D0022805D0032805D1EE +:10F7100002E0202A0BD30CE0A0290AD22079042889 +:10F7200005D12088202802D36188884201D912257A +:10F7300023E00548217920308175607900280DD0BB +:10F7400001280FD019E000006C120020CCE6000068 +:10F750007F080000800000207B0C0000FA4A002196 +:10F76000204607E0F9488078002806D0F74A0121B2 +:10F77000121F204608F01BFB0546012035717071F1 +:10F780001821F170307058E410B5F04C403C2178ED +:10F79000002904D01A210E2000F03BFB10BD017897 +:10F7A0001F2902D91220207106E000212171027860 +:10F7B000411C104608F09EFB012060711A21E17087 +:10F7C000207010BD10B5E14C403C2178002904D0D8 +:10F7D00020210E2000F01DFB10BD01781F2902D949 +:10F7E0001220207106E0002121710278411C104690 +:10F7F00008F06FFB012060712021E170207010BDC6 +:10F80000F8B5D24C403C2178002904D01B210E20B1 +:10F8100000F0FFFAF8BD012666710C212171007815 +:10F820000025012804D000285CD01220207188E037 +:10F8300002F006FE002835D102F008FE002831D182 +:10F8400008F021FAC24988422CD108F07AFA00283F +:10F8500077D0684603F0C6FEBB4A00990C3A916027 +:10F86000002803D0BB49BC480BF075FC01220321E2 +:10F87000009804F008FC009808F0CDFB00988A304E +:10F8800004F01BFE002804D1B348B24908300BF045 +:10F8900062FC009803F08CFA002851D0AE48AD49C4 +:10F8A0000C301CE002F0CCFD02284AD102F0CEFD63 +:10F8B000002846D1A5482038807D002841D0012865 +:10F8C0003FD004283DD008F03CFA002839D0002071 +:10F8D00003F06EFA002833D09F489E4924300BF085 +:10F8E0003AFC2DE002F0ACFD032804D002F0AEFD9E +:10F8F000032820D025E002F0A6FD0090002003F0B0 +:10F900004FF900281DD1257100988030807A04F0CD +:10F91000F6FD002804D190488E493E300BF01BFCC8 +:10F92000009803F0B1FE00280BD08B488949423083 +:10F930000BF011FC05E0002003F032F9002800D1A3 +:10F9400025711B20E0702670F8BD38B57F4C054648 +:10F95000403C2078002804D02D210E2000F059FAD8 +:10F9600038BD2888694603F057FE002801D00220E0 +:10F970000FE00098CA21095C002909D13321095CF4 +:10F980000F2901D0102903D1FC21095C00290BD0DB +:10F990000C2020710E20A0702D20E0702888E080BF +:10F9A00001206071207038BD1022A91CD8300BF0E6 +:10F9B00048FA00980421C03081720020E9E738B588 +:10F9C000624C0546403C2078002804D02E210E20B1 +:10F9D00000F01FFA38BD2888694603F01DFE002894 +:10F9E00001D002200CE000980146C030827A002A43 +:10F9F00005D12031C97C0F290DD010290BD00C2046 +:10FA000020710E20A0702E20E0702888E080012058 +:10FA10006071207038BD052181720020F0E77CB54F +:10FA20004A4C0546403C2078002804D037210E205F +:10FA300000F0EFF97CBD2888694603F06FFE0028CE +:10FA400007D002202071012060713721E170207001 +:10FA50007CBD01987F22014628300272427200224A +:10FA60008272A87822318870E878C8702879087185 +:10FA70002271E8E71CB5354C403C2178002904D0C0 +:10FA800013210E2000F0C5F91CBD0088694603F063 +:10FA900045FE002801D0022006E001982421095CDF +:10FAA000801C012902D00C20207107E0002201995E +:10FAB00022712831097A21720088E080012060716A +:10FAC0001321E1700E21A17020701CBDF8B51F4CF0 +:10FAD0000546403C2078002804D035210E2000F057 +:10FAE00098F9F8BDA878002801D0012804D1A88889 +:10FAF000FF21F531884201D91220207128886946FA +:10FB000003F08AFD0126002806D0022020716671CC +:10FB10003520E0702670F8BD009800270246C030FE +:10FB20000770AB8801464380104680300677AA787C +:10FB3000012A00D000220A70407F002801D003F083 +:10FB400027FA2771E3E700008C000020AC120020A8 +:10FB5000FFFF0000CCE600002D0A0000F8B5D44EEF +:10FB600004463078002804D03D210E2000F051F9E1 +:10FB7000F8BD2088694603F04FFD002801D002201F +:10FB800027E0009F6488FD883A896800B988401C96 +:10FB9000844217D3C7484143800050430BF0BAF961 +:10FBA000401EFF2180B2F531884200D908468442C8 +:10FBB00000D22046691C401C0BF0ACF96D1C684358 +:10FBC000401E85B2E820C05D002800D17D84F5800C +:10FBD00000203071012070713D21F1703070F8BD4E +:10FBE00070B5B34C05462078002804D033210E2090 +:10FBF00000F00FF956E502F023FC002801D00C209C +:10FC000018E02978002911D00A290FD014290DD025 +:10FC10001E290BD0282909D0322907D04B2905D01D +:10FC2000642903D0FF2901D0122003E0284603F005 +:10FC30004BF900202071012060713321E1702070A8 +:10FC400030E570B59A4C05462078002804D03E2156 +:10FC50000E2000F0DEF825E502F0F2FB002803D1CB +:10FC600002F0F4FB002801D00C2003E0287808F013 +:10FC70004DF900202071012060713E21E17020705B +:10FC800010E510B5017801240B000BF085FB3FBF98 +:10FC9000BF21BFBF4C94BFBFBF2427BFBF464F612A +:10FCA000BFBF59BFBFBF2B97BF9B9FBF797DBFA36E +:10FCB0008185888C6590BF5DBF555275A7ABBF37F6 +:10FCC0002F33BB6DAFBF71423F3B4969B3B7C00033 +:10FCD000FEF750FD9BE0FEF790FD98E0801CFEF7DC +:10FCE000D1FD94E0801CFEF7E3FF90E0801CFEF75E +:10FCF00080FE8CE0801CFEF792FF88E0801CFEF7FF +:10FD0000B4FF84E0801CFEF793FD80E0FEF7ECFD7D +:10FD10007DE0801CFFF7DEF879E0FEF769FF76E012 +:10FD2000FEF7BEFE73E0FEF74BFE70E0FEF7F7FD58 +:10FD30006DE0FEF72EFE6AE0801CFEF786FE66E0B0 +:10FD4000801CFFF797FE62E0801CFEF7DAFF5EE0A2 +:10FD5000801CFFF775F85AE0801CFFF73DF856E06D +:10FD6000801CFEF7FEFD52E0801CFEF725FF4EE0F2 +:10FD7000801CFFF754FE4AE0801CFFF737FC46E08A +:10FD8000801CFFF7DDF842E0801CFFF74DF93EE0F4 +:10FD9000801CFFF77CF93AE0FFF7E2FA37E0801CBD +:10FDA000FFF71AFB33E0801CFFF785FB2FE0801C78 +:10FDB000FFF7CBFB2BE0FFF7FEFB28E0801CFFF7F3 +:10FDC00066FC24E0801CFFF7DFFC20E0801CFFF7CE +:10FDD00017FD1CE0801CFFF7F5FC18E0801CFFF706 +:10FDE000B4FD14E0801CFFF7EAFD10E0801CFFF773 +:10FDF0006DFE0CE0801CFFF7B1FE08E0801CFFF7F1 +:10FE000020FF04E0801CFFF7EBFE00E0002420460A +:10FE100010BD274A2032537C002B03D19074D1743B +:10FE200001205074704730B5134606E0CC18203CD2 +:10FE3000D51AE47F5B1E4455DBB2002BF6D130BDF2 +:10FE4000017800290CD14121095C002908D18030BA +:10FE5000017C002904D0007C042801D001207047D7 +:10FE60000020704701784068002903D001780029FC +:10FE700005D100E0E4E740304078002801D00020C0 +:10FE80007047012070470A4900208031886740315F +:10FE90000871704710B50178012908D14068803099 +:10FEA000417F002903D00021417703F071F810BD94 +:10FEB0006C120020C409000070B5FC4D00246C7069 +:10FEC0002C70AC616C72AC720120E872F84844701E +:10FED000C473AC62F7482C6302F05FF9002804D0C9 +:10FEE000FF20F5A14F300BF036F92C7770BDF8B537 +:10FEF000F54902250D60F5490026CE630127CF6341 +:10FF0000F349C96A09070DD4F24AD36AF2494B6230 +:10FF1000136B8B62536BCB62936B0B63D26BCB0512 +:10FF20001A434A63ED4C002823D0012825D0FF2036 +:10FF3000E1A1A2300BF00FF9E948A063FF200430E3 +:10FF40006063276303202061E64996204860D74913 +:10FF50001C2008560B22D243811A904237D011DC64 +:10FF60001C313AD00A2938D0142934D0182911D19B +:10FF70002FE0DD486061DD4802E0DD486061DD487A +:10FF8000A061D9E708301FD004281BD0082817D05B +:10FF90000C2812D0FF20D8A176300BF0DCF8DB491A +:10FFA000D9488860DB48DA494160DB490160DB48B9 +:10FFB0000560DB4910204860F8BD0420E060EEE7F2 +:10FFC000E660ECE7FC2000E0F820E060E7E7F420E2 +:10FFD000FBE7F020F9E7EC20F7E7D820F5E710B5CC +:10FFE0000C460146CF480BF0B2F9B048047210BD80 +:10FFF000AF4840787047AD4A517010707047F8B5FF +:020000040001F9 +:1000000004460D4650791179000208436900091928 +:100010000884501C01460E78012730464E7836027F +:1000200030438E78C9783604304309060843117886 +:1000300000020843A9006050284608303E4686402A +:10004000002B0CD0012B04D0FF209BA1E9300BF03A +:1000500082F8206B3043AF4038432063F8BD206BFB +:10006000B043F8E770B50D460446082904D9FF20CF +:1000700091A1FA300BF06FF80022002D0CD9AA489C +:100080009100635809180B6053001B191B8C0B62FD +:10009000521CD2B2AA42F3D3206BA449086070BDAF +:1000A00010B504460B22D2430C308C49944223D025 +:1000B00008DC1C3026D00A2824D0142820D0182888 +:1000C00009D11BE02046083014D0042810D008289D +:1000D0000BD00C2807D0FF2087A176300BF03BF81F +:1000E0007248047710BD042000E00020C860F7E7E4 +:1000F000FC20FBE7F820F9E7F420F7E7F020F5E72C +:10010000EC20F3E7D820F1E76948007B704773499A +:10011000C2784A6202461378184653781B02184385 +:100120009378D2781B041843120610430002C8616A +:100130007047252808D0262808D0272808D0410055 +:100140000A2807D8091D06E0022105E01A2103E06C +:10015000502101E0891DC9B2604A9160614948613E +:10016000704752498861704770B5002816D0022246 +:100170004E4C6F4BA27203201860644D6248686059 +:1001800000200126207500290AD001290FD002295C +:100190001DD049A167480AF0DEFF70BD0122E7E7E4 +:1001A0006548012A01D0466070BD066070BD3F48B9 +:1001B000012A006B05D001214905084320636960CD +:1001C00070BD0121090508432063696070BDA06905 +:1001D000002804D1492038A1C0000AF0BCFFA16961 +:1001E000A06A4018554988604A4855498160554978 +:1001F000C1600120216BC0030143216368602C486A +:10020000C67370BDF8B54A4801688F084449BF00FD +:100210004A68D206D60F10228A60002404603B4848 +:10022000394981600C2069460870474D2C6142496C +:10023000012008610BE000BF00BF00BF00BF00BF8E +:1002400000BF00BF00BF69460878401E08706846BE +:100250000078002802D028690028ECD06846007891 +:10026000002804D14D2024A1C0000AF074FF2C61A5 +:100270000E48012144728472C1722D480760002E1D +:1002800002D0274910204860F8BD01460A78104680 +:100290004A78120210438A78C9781204104309067A +:1002A000084300020D49000AC86370477413002018 +:1002B00094130020A81300207372635C68616C5F64 +:1002C0007263732E6300000080E100E0C01F0040F5 +:1002D00080000010C0000010001700400015004012 +:1002E0005B060000401500400601020025000302E5 +:1002F000050103001F0003027372635C68616C5F99 +:100300007263732E630000000040000400F501409A +:100310004080004080F501401011004080E200E084 +:1003200000130040761300200016004040160040E5 +:1003300000120040550200000010004040850040BF +:10034000488100401010004000110040FB4902208D +:100350000860FB4908607047FA490220086070474E +:10036000F9490870704710B5F84801F01EFF0028E1 +:1003700003D0F749F7480AF0EEFE10BD10B5F34878 +:1003800001F02BFF10BDF4494860704770B5F34C85 +:100390000546A06AA84203D3ED49F1480AF0DBFE06 +:1003A00001202073EF49002025614860EE48456038 +:1003B0000120216B800501432163EC49486070BD39 +:1003C000E64802210173C6210161E64A002151601D +:1003D000816AE54AC63151600121026B89050A43F1 +:1003E0000263E248416070470121E048890581606D +:1003F000DA48026B8A430021026301737047DC48CC +:1004000001214160C160D74900204860D649486059 +:10041000D24988627047D74940200862D6490A68A5 +:1004200002430A607047D44801684022914301604A +:10043000D049002008627047CF48016810229143DC +:100440000160CE49012088617047CD490020C86114 +:10045000C94801681022114301607047C849CA6940 +:10046000012A01D000207047C24A92685206520EFB +:10047000524202700020C8610120704770B50C0024 +:10048000054604D1D920B24980000AF064FEE00795 +:1004900005D0012C03D0AE49BA480AF05CFE002D0D +:1004A0000DD00221AD4801294172C472B24808D072 +:1004B00002290BD0A649B4480AF04DFE70BD0121B7 +:1004C000F0E7016804221143016070BD0168082251 +:1004D0001143016070BDF8B5A04C0025E27A910788 +:1004E00001D5410713D4D306A849002B05DA4B7B6D +:1004F000002B02D08B7B002B09D0130702D50B7881 +:10050000002B04D1520703D54978002900D10125D9 +:10051000677A002201239849002F1BD00226304021 +:10052000284348D0084601688E089949B6004D68AE +:10053000ED06ED0F10278F60002101608B4A954872 +:1005400090600C206A4610708D4F39618B490120F4 +:10055000086114E0854D8F48A86008688008800015 +:100560000860A272E372F8BD00BF00BF00BF00BF09 +:1005700000BF00BF00BF00BF1078401E1070107891 +:10058000002802D038690028EED01078002804D165 +:100590004D208149C0000AF0DEFD00203861607204 +:1005A000A0720120E07274480660002DDBD078480C +:1005B00010214160F8BD012F06D0022F0CD06449F4 +:1005C00076480AF0C8FDF8BD08680425A84308600D +:1005D0006272E372A372F8BD08680825A843086038 +:1005E0006272E372A672F8BD5C4908757047F8B58F +:1005F000664D5A49EC7B086B002C58D001245B4AAD +:10060000E4039460A04308635B480768604C1021D2 +:10061000A16000210160001490600C206A461070F7 +:10062000574C21615548012606610AE000BF00BF12 +:1006300000BF00BF00BF00BF00BF00BF1078401E5A +:1006400010701078002802D020690028EED01078B1 +:10065000002804D14D205049C0000AF07CFD002044 +:10066000E060206160606061A061434807603F49CD +:1006700000144860464910204860384CA07A012890 +:100680000FD0022810D0444945480AF064FD0020EC +:10069000E873207D022803D1424801688907FCD510 +:1006A000F8BD36480660F2E734484660EFE72F4A67 +:1006B000906000200863087B2A4E002802D07068F2 +:1006C000012809D000222E4C2069012806D00023E1 +:1006D000887A012804D006E00122F4E74023F7E7F6 +:1006E000E768012F04D000271F43012802D004E04F +:1006F0002027F9E76368012B05D000233B432A4FED +:10070000022802D007E01023F8E73968012902D156 +:10071000E168012904D000211943022802D007E032 +:100720000821F9E73B68002B02D1E368012B3DD09B +:1007300000230B4302283BD03EE0000080E100E0B4 +:1007400080E200E000E100E092000020A813002019 +:10075000B8020100A202000000150040741300203E +:10076000B3020000408100404085004000F5014098 +:100770000080004040150040001200400010004082 +:1007800000110040690300007E0300009413002064 +:100790000013004000400004F8020100CF030000F5 +:1007A0005E03000000E200E0001400400423C0E704 +:1007B000002A01D0022100E000211943022807D1BC +:1007C0006068012804D17068012801D0012700E089 +:1007D000002790480F4301680906090E02D061699D +:1007E000012900D00021297300680006000E02D004 +:1007F000A069012800D0002068738748006A00289B +:1008000003D000F0DCF9012800D00020A8730020FC +:10081000E060206160606061A06180494860804E56 +:100820008049307548683C4670620968B1620B4681 +:10083000B17A022909D17178002906D07A4A526822 +:1008400012780A40317891430ED000212970774FF9 +:10085000E10710D03978032908D0022906D002F028 +:10086000D1FC0121B06A20E00121EFE707F022F975 +:100870000121B06A27E0A0060ED53878032806D0FB +:10088000022804D00221184602F0CBFC0FE002211E +:10089000184607F010F90AE0A00708D538780328B1 +:1008A0000FD002280DD00021184602F0BAFC5E4895 +:1008B00041680622B01C09310AF096FA002805D0DA +:1008C0000DE00021184607F0F6F8F0E75648317AB7 +:1008D00040680078C009814201D1012000E0002079 +:1008E00068702046FFF7F7FD387800280DD0012802 +:1008F0001ED002282FD003284AD04D494D480AF077 +:100900002AFCB07A022856D075E0A00701D507F07E +:10091000C6FC200702D5012007F0FDFC600702D5C8 +:10092000002007F0F8FCA006EBD507F059FCE8E73B +:10093000A00701D508F0E8FF200702D5012008F044 +:100940004DFE600702D5002008F048FEA006D8D56D +:1009500008F098FDD5E7A007BF25002802DA2C4053 +:1009600004F022FF200703D52C40012004F05DFB9A +:10097000600703D52C40002004F057FBA00602D5E9 +:100980002C4004F061FE6006BBD504F04AFBB8E7DA +:10099000A00701D506F0F0F8200702D5012005F0E8 +:1009A000B1FF600702D5002005F0ACFFA006A8D576 +:1009B00005F01CFFA5E7307B00281CD0174900225A +:1009C0004A60022820D0012803D019491A480AF0A9 +:1009D000C2FBB16A3069884203D8154917480AF04A +:1009E000BAFB1048316941600120316B8005014339 +:1009F000316313494860307D012800D050E611482A +:100A000001688907FCD5F8BD3169B06A411805480D +:100A10004160E9E740160040401500404081004039 +:100A20007413002040850040001500409200002013 +:100A3000B8020100FD0400001205000013050000CB +:100A400000F5014000E200E02E48002101704170F5 +:100A5000704770B5064614460D460120F0F7A2FC1B +:100A600028490120284B08709E60DC601D6170BD24 +:100A7000F8B504460120F0F795FC224901200870E2 +:100A800021494C60214900264E600321204D090672 +:100A9000A960204F002C0AD0012C03D01EA14120B8 +:100AA0000AF059FB3E60032000066860F8BD38601C +:100AB00001200006F9E710B51248017800290ED090 +:100AC0000321134A0906916010494A680021002A4F +:100AD00003D0154A1268427000E041700170002096 +:100AE000F0F760FC10BD07480178002907D00748DF +:100AF0004068002802D00C480068C0B270474078B7 +:100B0000704700009300002000F5004000F1004015 +:100B100000F5014000F200407372635C68616C5F35 +:100B200063636D2E6300000000F400403B48002129 +:100B30000170417010218170704770B506461446EF +:100B40000D460220F0F72EFC01203449344A08708B +:100B5000E41E14619660556070BD10B50220F0F778 +:100B600021FC2E49012008702E48002101604160BF +:100B7000816001202C49C005486010BD10B5274890 +:100B80000178002917D00121274AC905916025491C +:100B90000B680022002B05D04B68002B02D089681F +:100BA000002902D04270102103E0012141701F4949 +:100BB0000968817002700020F0F7F4FB10BD17483F +:100BC0000178002912D01748016800290AD001686D +:100BD000002905D04168002902D08068002803D090 +:100BE000002070470220704701207047407870470E +:100BF0000A48017800290FD00A480168002905D069 +:100C00004168002902D08068002801D01020704778 +:100C100006480068C0B27047807870479500002091 +:100C200000F5004000F1004000F5014000F40040F4 +:100C3000FFB593B0044600201D9E049015981C9D9E +:100C40001027082806D0E06901F014F8002809D020 +:100C50003770CCE028880921384328801F98022764 +:100C6000017016E0E169012088710521E269C9027D +:100C70009180E1698872E169F9480881E1690020A1 +:100C80008873288820210843288011211F98042771 +:100C900001701F980225801C0390307810900A2064 +:100CA0003070204618301190F5F7A1FC00206FE05D +:100CB0001598102809D1022D07D06846828A049918 +:100CC0000398401A8270110AC1706846C08A16994A +:100CD000884203D9E349097A149106E0884204D195 +:100CE0001099002901D0317021E003990870000AA1 +:100CF00048701E980088401BC01B83B2FF20C01B99 +:100D0000984200D203460398149AC0190CA9009285 +:100D1000019002912020015D6846C08A0022F5F70B +:100D2000DBFC3070002806D0C0B2832862D0684651 +:100D3000C08A208345E00F98002805D0C948006884 +:100D400000790A2830D33CE06846008EC119C9B248 +:100D50000491022D0FD01F99049A4978914203D132 +:100D60006A46128C824209D0BE480491006801781C +:100D7000032909D027E008461F994870B948006840 +:100D80000178042906D008E000790A281BD2012046 +:100D90000F9009E06946C98A818003990498081870 +:100DA00003900498281885B205AA14991198F5F7AC +:100DB00021FC002805D11E980088401BB84200DBAA +:100DC00076E7022D0ED01598102807D1049A0399C2 +:100DD0006846808A891A8870000AC8701E98058043 +:100DE000002030709F4800680078032802D000205F +:100DF00017B0F0BD0220FBE7F8B50446406B0026B3 +:100E0000134600282BD0491F8DB2618F2A46083225 +:100E1000278F8A18BA4221D89A7840185F78110231 +:100E200039430170090A41701A79DF781102394398 +:100E30008170090AC1700571290A41712A46591D3C +:100E4000801D09F0FEFF608FAD1D401980B26087E4 +:100E5000626B002110180170417000E009263046D5 +:100E6000F8BD30B50B88048F9C4212D9446BE01852 +:100E70004478057824022C430BD044790579240268 +:100E80002C436404640CA41D1B190B80106000200B +:100E900030BD822030BDF7B588B000256846058298 +:100EA00005275DE00398417802780E0216434179E8 +:100EB000027908021043000452D40A9801230680E4 +:100EC00005A802905B02002200970195304609991F +:100ED000F5F702FC04004AD16846018A01830398B1 +:100EE0004179027909021143437802781C021443C4 +:100EF000B4421ED10A041CD44B0401215B0C8903AB +:100F000000950B4301970295C17880780A0202434D +:100F100020460999F5F7FCF9040011D103994879A5 +:100F20000A79000210430122D20310430871000A1B +:100F3000487103AA06A90898FFF793FF0400CED0D2 +:100F400003990095019702954878097800020843B3 +:100F500069468B8A00220999F5F7DAF9822C06D1C5 +:100F600003AA04A90898FFF77CFF04009AD06846FA +:100F7000058209E003984179027909021143490485 +:100F8000490C0171090A417103AA04A90898FFF7E5 +:100F900068FF0028EED0822C02D020460BB0F0BDB6 +:100FA0000020FBE730B50446406B002597B00028D1 +:100FB0000DD00B2268460270228F0281606B039174 +:100FC000019000216846F2F72AFB684605706563C8 +:100FD0006587258717B030BDF8B50F460546696BA4 +:100FE0000020069E144600290FD0012B0DD1324659 +:100FF00039462846FFF74FFF002806D1002C04D0C1 +:1010000032463946284600F044FEF8BD00220280F0 +:10101000C262831D0263C36142634287028720303C +:101020000170704710B50022D24302800420FBF704 +:10103000E4FA10BD10B596B00446FFF7B3FF208E5A +:10104000002808D0012069460870E06A019000215C +:101050006846F2F7E4FA0020E062206316B010BDA3 +:1010600001280000AC1300200146098800200A076F +:1010700000D501200A06120F01D002221043CA0532 +:1010800001D5042210438A0501D5102210434905D9 +:1010900001D5202108437047FFB5A9B00600329D55 +:1010A000359C2B981F46229016D0007841060FD40D +:1010B0008106890E1E2909D021884A05520E0BD1BE +:1010C0003A88172A08D3FE4A914205D0C10906D0B2 +:1010D0008006800E122802D003202DB0F0BD2046DD +:1010E0002C302690F7492A980872002018AA0390FD +:1010F00010726A46107404AA0A60339A4A6020AAE1 +:10110000908090812298007801908106681C1C9044 +:10111000701F1D902B98890EC21C249222462032EB +:101120001B92083A401C02920B000AF035F91FFD91 +:10113000FD11FD1FFD8EFDFCFDFBFDFAFDF9FDFC23 +:10114000FDF8FDFDFDF7FDF6FDFDFDFDFDF5FD00E6 +:10115000032E76D102E018A9087219E30320287043 +:101160001C9917220A7000224A70CFE2052EF0D196 +:101170004178027808021043208320A98880249AAD +:101180005178127809021143618300287ED0884289 +:101190007CD800202072E080401E60840298F5F721 +:1011A00026FA05202870A81C0190022000901BAA96 +:1011B0002A990298F5F71EFA002868D118A8807CB1 +:1011C000012803D002206870102002E0012068701E +:1011D00002202490002225A91CA8F1F7AAFD0028CE +:1011E0002BD120A8007D2499814226D13A880099EC +:1011F000801C511A814220DB10A8C18D019801701A +:10120000090A417001991CA8891C01910099019A51 +:10121000891C009125A9F1F78CFD20A8007D01997A +:101220001BAA091801910099081880B200902A9908 +:101230000298F5F7DFF90028CCD00098022826D0D4 +:1012400064E272E018A9087261E2072E6DD341785A +:101250000346027808021043208320A98880249A3C +:101260005178127809021143618300280ED0884218 +:101270000CD8012020725879197900020843E080C7 +:1012800000202073E06900F0F5FC01E098E0A9E09F +:1012900000280ED1E169012088710521E269C902A7 +:1012A0009180E1698872E16987480881E1690020DD +:1012B0008873F01F60842298C01D60620298F5F761 +:1012C00096F907202870681C0090012001900020EA +:1012D00010A9C8852FE00198012814D0E069807911 +:1012E000012830D000981E38417F007F0902014359 +:1012F00000980170090A41700098801C00900198C4 +:10130000801C80B2019010A8C18D00980170090A5C +:1013100041700098801C09E00AE296E13BE1DFE0C1 +:1013200004E29BE077E036E016E2AFE0009001983F +:10133000801C80B201901BAA2A990298F5F75AF9ED +:10134000002803D007E010A8818DD1E739880198E3 +:10135000081A0428BFDA0198012843D0E06980798F +:10136000012804D010A8818D5548814206D110A8CB +:10137000818D00980170090A417009E000981E38BB +:10138000417F027F0802009910430870000A4870EC +:101390000198801CBAE1072E01D0152E76D1417834 +:1013A000027808021043208320A98880249A51786B +:1013B0001278090211436183002801D0884201D9C3 +:1013C00001203FE7012020720020E0802073052EDD +:1013D0000AD01D982299E269C0B2491DF1F783FC39 +:1013E000002801D00A202DE70020C04360841AA8FD +:1013F000019023A922980297039500910078002379 +:101400008206920E20462A99FFF712FC0390208B49 +:1014100020A988807BE1032EC0D1402220A98A81A7 +:101420004178027808021043208320A988802A99F5 +:101430001EAB1C9A02930192009139880022491E2A +:101440008BB21B990978F5F747F918A9087200289B +:1014500033D10B20287010A8008F3FE0052E9DD1BE +:10146000802220A98A8141780278080210432083D3 +:10147000249984464A78097812020A43628420A992 +:1014800088801248824202D30720DBE6AFE03F208B +:101490008002024362842A981FAB1C990293019137 +:1014A00000903888401E83B21B9801786046F5F79B +:1014B00013F918A9087200280CD08328AAD107E0D4 +:1014C000FFFF0000AC130020012800000102000013 +:1014D0000220B8E00D20287010A8808F401C15E174 +:1014E00001990C22C9095143C91CB14204D9019880 +:1014F00040067CD5002009E14278037810021843A9 +:1015000020AA9080844622980078400609D50520BC +:101510006A46107422980078C00905D00020107423 +:101520001DE106206A46107424981F902A9A0090A4 +:101530000023701A029383B21E9001921B9800221E +:1015400001786046F4F7E4FE18A9087200226946A3 +:101550000A74832801D10220039022980078400663 +:101560000DD52088C00506D520A9208B8988884202 +:1015700001D100206062002018A90872C6E0FF2196 +:10158000013120A88181808820831E9860841F9863 +:1015900060621320B8E0052E29D341780278080252 +:1015A000104320A98880218F002902D0FE4A914251 +:1015B00006D10A216A4611740121C943218702E03C +:1015C00007216A46117422992A9A491D01920091B5 +:1015D00001221D990023D203029311438BB2249957 +:1015E0004A78097812020A431B99097800E0C9E099 +:1015F000F4F78EFE18A90872002269460A740122C7 +:10160000520220A98A81832808D0002809D0218F7E +:10161000E54881427ED10020208778E088882083B9 +:101620004DE7606B002808D031462046229AFFF72C +:10163000E3FB18A90872002869D12B463A463046C8 +:10164000229900F056FB039061E02298022E407828 +:1016500001907DD1002801D0012879D10820694668 +:1016600008740198087521A800901B980022017841 +:101670002046019BFFF7B0FC6946002248758A7539 +:10168000002802D10198012809D0208F002806D017 +:10169000002008740120800220A988810EE004A89F +:1016A0003399F1F7BCFF03900020694608740120CC +:1016B000800220A988810398022807D0BB480068CF +:1016C0008079002805D018A908722BE001982083A2 +:1016D0001DE00398002803D0812018A9087240E07B +:1016E00021A800901B98012201782046019BFFF75A +:1016F00073FC18A9087220463499FFF753FC18A907 +:10170000087A002803D11920287001203880684603 +:10171000007C00E03CE0002804D004A83399F1F7F5 +:101720007EFF0390039800282ED01AE0062012E5D1 +:101730002078000713D5012E11D1092168460174C4 +:10174000A188818204203499FAF757FF082100E02C +:1017500005E020A88181CDE60198400612D503203E +:10176000039020A9208889890843208020A988899E +:101770004005400E04D026992B9808602698868054 +:101780000398AAE40420E6E418A8007A00280ED002 +:101790000120287022980078687020A88088A8709E +:1017A000000AE87018A8007A28710520388020A95E +:1017B0002088898988432080E2E7FFB50746A1B0E9 +:1017C00000201C903A7801209040794A7C681040B3 +:1017D00010AA1087744B22885B1C9A4203D0002801 +:1017E00004D0100702D5012025B0F0BD249E0020B2 +:1017F000307023980025028810A8028518A8057566 +:101800006A4B68461972057404A8186020462C308B +:101810001B902A985860249E94463878721C0521A3 +:10182000039201282DD0022808D003287DD13078DA +:10183000800980011D303070B889A0803878022876 +:1018400004D13078800980011B303070F01C1FAA51 +:1018500001900292009110A8008D0022C01E83B258 +:101860002020015DB889F4F737FF0028DED1039806 +:10187000B9890170090A417010A9888FC01C0885B8 +:1018800028E1787B18AA10753A7B012A02D0022A37 +:10189000CCD1FCE022887F231B011A4010AB1A87B1 +:1018A000802A4AD006DC102A10D0202A0ED0402AE6 +:1018B0000AD124E0FF3A013A65D0FF3A013A79D0E3 +:1018C000FF3AFF3A022A76D00525A2E02078C0062A +:1018D00001D5082000E010201C9004206A461074F6 +:1018E000002090821AA81DAA1EAB039601920290B6 +:1018F00000933B8A20461C9AFFF79AF984E0228BDA +:101900003B8A9646934268D10A221C92002839D11C +:10191000039801906046401E1FAA83B202922020C5 +:101920000091015D0022704600E0BAE0F4F7D4FEB9 +:10193000014618A801750B201AE0228B3B8A9646B7 +:1019400093424AD10C221C92002862D10398019044 +:1019500060461FAA401E0292009183B22020015DC2 +:10196000628C7046F4F7B8FE014618A801750D2088 +:10197000307010A8818F491C0185042168460174CC +:10198000218B818245E0238B3A8A9C469A4224D15E +:1019900012221C9200283CD1606A002813D0002239 +:1019A0006B4607C3638C07E0FEFF0000AC1300200A +:1019B00009F800000DE04BE02020015D6046F4F7DF +:1019C000A7FC18A9087513203070012010A90885FC +:1019D0001FE0398A228B914201D00425B6E01621FE +:1019E0001C91002815D11B98818802682046FFF7BA +:1019F00003FA18A9087500280BD11B983346016813 +:101A000080881AAA00F075F9054602281BD0042D1B +:101A100019D01B988088002811D06846007C0028C7 +:101A200004D004A82A99F1F7FAFD05460120694679 +:101A300008741B981B990068059000208880002D71 +:101A400048D0052D2ED06846007C032878D07DE054 +:101A500018211C91002806D0388A20832046B968B6 +:101A6000FFF7A0FAD5E72046183000902020015D4E +:101A7000237E01222046FFF7AFFA18A90875002837 +:101A8000ECD119203070012010A90885E6E72088E4 +:101A900001214902084010A90887FF38FF380228B1 +:101AA00006D0052510A92088098F884320804DE0A5 +:101AB000208F9849884290D116201C9038690028C0 +:101AC00005D06063B88A20870020608702E000208C +:101AD000C043208710A8008F7F21090102468A4356 +:101AE0000DD0782300220420B968FAF7DFFC38789B +:101AF000A07010A92088098F0843208002E0218867 +:101B0000814321806846007C002805D082484168D6 +:101B100004A8F1F784FD054618A8007D002815D01B +:101B20001C98707001203070208BB070000AF0702B +:101B300018A8007D3071052110A8018506E0FFE797 +:101B40007548416804A8F1F76AFD05467248017AB4 +:101B500020884005400E22D11B98808800281ED086 +:101B6000239A0026138810AA1385249A2A9B6F466D +:101B70004CC71B9A039412681AABFFF78DFA0546FF +:101B800002280CD00120694608741B982A99006825 +:101B9000059004A8F1F743FD05461B98868010A820 +:101BA000018D2398018028461EE600B597B00428D1 +:101BB00007D102206A461070019100216846F1F7B2 +:101BC0002EFD17B000BD10B5534C037800222168DC +:101BD000012B02D0022B42D126E00B78002B01D042 +:101BE000042B03D10A7122680321117021688388B4 +:101BF0000A79D200921D8B5221680A79D2000832EC +:101C00008918C2880A80216803890A79D2000A32B9 +:101C10008B52428920680179C9000C3142522168F7 +:101C20000879401C08711EE00A7482888A80216845 +:101C3000C288CA8022680189118122684189518144 +:101C4000C1682068C1606168F1F7E9FC01460228BB +:101C500007D02068007C002802D1002903D0812011 +:101C600010BD832010BD002010BD406B002800D0A7 +:101C7000012070478178012909D100880521C90216 +:101C8000884202D0491C884201D1002070470520BB +:101C90007047F7B586B00024684615460F46848124 +:101CA00005261AE004984178027809021143298038 +:101CB000811D019602940091417902790B02134330 +:101CC000C178827809020A43417800780902084302 +:101CD0003946F4F71DFB002806D104AA03A906988B +:101CE000FFF7BFF80028DDD0822800D1002009B01E +:101CF000F0BD10B51488844201D2052010BD172410 +:101D00001C701080421E581C491C09F09AF80020D3 +:101D100010BD0000FEFF0000AC13002030B50346EC +:101D2000002002460DE09C5C2546303D0A2D02D382 +:101D30000020C04330BD0A25684330382018521CAB +:101D4000D2B28A42EFD330BD70B50D46144608E0DA +:101D50000A2109F0DFF82A193031203A641ED177C0 +:101D6000E4B2002CF4D170BD10B5002310E0040AD9 +:101D700000020443A0B2CC5C44402006000F604047 +:101D80000407240C44402006C00C60405B1C9BB23E +:101D90009342ECD310BD000010B572B600F0DCF831 +:101DA00000280BD0EFF77CFAFAF7E1FD08F097FB7B +:101DB0006E490020C86288626D49086062B60020E2 +:101DC00010BDF3B5002501200007C06A81B0C043F3 +:101DD0000006000E04D167480068401C00D10125B0 +:101DE00072B600F0B9F8002802D062B60820FEBD35 +:101DF000EFF7ACF9EFF758FA5F4B604E00211A6825 +:101E0000CA40D2071FD00246CA40D20718D14AB2F0 +:101E1000002A07DA1407240F083CA408A400A41918 +:101E2000E46904E09408564FA400E419246892077A +:101E3000D20ED4402206920F012A04D0032A02D0E7 +:101E400062B65048FEBD491C2029D8D30198030032 +:101E500009F0A2FA142123232323232323230B0D88 +:101E60000F11131F1517191B1D2E002416E0012436 +:101E700014E0022412E0032410E004240EE00824FD +:101E80000CE009240AE00A2408E00B2406E00C24F4 +:101E900004E0052402E0072400E00624F0690121A3 +:101EA0000002000AC9070843F061002D04D009E0D0 +:101EB00062B601200003FEBD2C4D3348E862EFF707 +:101EC000F3F9A8622A49314808603149029808604C +:101ED000EFF7EAF9214608F0E9FAFAF70CFD08F005 +:101EE000EFFC08F065FB0198EFF7A8F9040062B673 +:101EF00003D0FFF751FF2046FEBD0020FEBD10B508 +:101F0000044600F029F8002800D0012020700020AD +:101F100010BD204908600020704710B50C461028FD +:101F200008D011280BD012280CD013280ED0012075 +:101F3000086010BD03CC083CFFF743FF0AE0FFF741 +:101F40002BFF07E02068FFF7DAFF03E01149206864 +:101F500008600020206010BD05480C4900688842D8 +:101F600001D10120704700207047000000050040AB +:101F7000640000200010001000E100E000ED00E02F +:101F800000E400E00110000000220000BEBAFECA1A +:101F9000980000200400002010B520380C460300F3 +:101FA00009F0FAF933A6AAAEB2B8BCC0C5E0DBE4CA +:101FB0001B1F23272C31373C41474D5054585C6040 +:101FC0006D71656974787C8084888C9094989C9FEE +:101FD000A2CACFE9F0F3D3D7F800206800F0DDF80B +:101FE000D6E0206800F0E1F8D2E0206800F0F5F8D3 +:101FF000CEE0207840B208F0C9F8C9E0207840B2BD +:1020000008F0E7F8C4E02078616840B208F0FAF818 +:10201000BEE0207840B208F00AF9B9E0207840B27A +:1020200008F015F9B4E02078217940B208F020F9E1 +:10203000AEE02078616840B208F04AF9A8E008F004 +:1020400056F9A5E0206808F05AF9A1E0207808F0D8 +:102050006FF99DE02068FAF738F899E02068FAF700 +:1020600038F895E021792068FAF73AF890E020688E +:1020700007F0D8FF8CE0206807F0D9FF88E02078CF +:1020800007F0D9FF84E007F0E3FF81E0207807F054 +:10209000E5FF7DE0207807F0F7FF79E0206808F0A1 +:1020A00010F875E0206808F012F871E0206808F078 +:1020B00014F86DE0206808F015F869E0206808F071 +:1020C00017F865E0206808F019F861E0206808F06A +:1020D0001AF85DE00846EFF751F859E0F0F787F994 +:1020E00056E0F0F7B4F953E02068F0F7BCF94FE0A0 +:1020F000206800F0E1F84BE0206800F0E9F847E0E4 +:10210000206800F0F0F843E02078A268616800F0F1 +:10211000F5F83DE0207800F006F939E0207800F08D +:1021200017F935E02078616800F027F930E0207871 +:10213000616800F03AF92BE02179207808F008FA7C +:1021400026E0206800F06BF822E02068FAF7FEFA3B +:102150001EE02068FAF7E2FA1AE007CC0C3C08F01F +:10216000F1FA15E0206808F044FB11E003CC083CCC +:1021700008F06FFB0CE0206808F065FD08E009E05E +:1021800003E0FFE708F077FD02E0206808F0AEFD0D +:10219000206010BD0120086010BD002101700846BC +:1021A00070470146002008707047EFF31081C9079F +:1021B000C90F72B60278012A01D0012200E0002284 +:1021C00001230370002900D162B6002A01D000204B +:1021D0007047012040037047E7E7EFF31081C9071C +:1021E000C90F72B600220270002900D162B6002029 +:1021F0007047F2E710B52848FFF7CFFF002803D05B +:1022000026A11D2008F0A7FF2348401CFFF7C5FFAB +:10221000002803D021A1212008F09DFF10BDF1B5B9 +:10222000224D6F6801261C48FFF7BFFF1A4C00289B +:1022300003D10026601CFFF7D0FF1D4A1D49012075 +:10224000506000BF00BF00BF00BF00BF00230B6095 +:102250004B60009B6B60106000BF00BF00BF00BF01 +:1022600000BF0868002802D148680028F9D04868F3 +:102270000028E4D1002E04D06F60601CFFF795FFAA +:1022800007E0601CFFF791FF0028D3D10248FFF759 +:10229000A4FF0020F8BDC2E79C0000207372635CBD +:1022A000736F635F6563622E6300000000E50040AA +:1022B00000E0004000E100405A495B4B0A685B497E +:1022C0009A42096801D18904890C01600020704795 +:1022D0005449554B0A6855499A4201D18004800CF3 +:1022E0004860002070474F494F4B0A684F499A4257 +:1022F00001D18004800C88600020704730B5494BC4 +:10230000494D1C684A4BAC4202D0102802D203E06F +:102310000E2801D3184630BDC30044481818016187 +:102320004261002030BD3F493F4B0A684049491C8B +:102330009A4202D0042802D203E0022801D30846C0 +:1023400070473C4A0121C00080180160002070479E +:102350003449354B0A683649491C9A4202D0042850 +:1023600002D203E0022801D308467047314A012116 +:10237000C000801841600020704770B5294A2C4B7E +:1023800014682D4E284D82005B1C9219AC4203D07C +:10239000042803D2116006E0022801D3184670BD5C +:1023A0008804800C1060002070BD70B51D4A204B61 +:1023B0001468214E1C4D82005B1C9219AC4203D064 +:1023C000042803D2106806E0022801D3184670BD25 +:1023D00010688004800C0860002070BD10B5134A9E +:1023E000164890600E200021C3009B1819615961A6 +:1023F000401C1028F8D300200F4A05E0022803D320 +:1024000083009B18196005E083009B181C68A404D6 +:10241000A40C1C60401C0428F0D310BD03490748DD +:102420008860704764000020BEBAFECA00F5014013 +:102430000820000000F0014000F8014000C0FFFF4C +:10244000FE48C07E7047FE4840687047FD48C07E29 +:102450007047FFB5F94E85B0706A346805686068EA +:102460000190306A0390298D0798401A80B202903B +:102470000898002804D0274638372046483002E024 +:10248000371D2846A0300090032038710598002899 +:102490001FD001287ED0022863D003287BD0EAA178 +:1024A000ED4808F058FE0898002806D0387903282F +:1024B00003D0E5A1E94808F04EFEA16A7069FAF779 +:1024C000B0FDB860216A606A814265D900990860F0 +:1024D00034E1306A002803D1DBA1E14808F03BFE7B +:1024E000288BE0494843421806980021002804D070 +:1024F0005043DD4908F00EFD411CA1610191AA88FD +:10250000D848002142430698002804D05043D649B9 +:1025100008F000FD411CE161306AD24A801CA062D3 +:10252000298BD04B5143019A891AD04A891809182E +:10253000A162AA7D01985A4340008018FF301930EB +:1025400020626062306A081AC949FF38153888422B +:10255000A9D2C84988427DD2BBA1C74808F0FBFD7B +:102560008BE0288BBF4AE16850430A180698002187 +:10257000002804D05043BC4908F0CCFC411CA161A8 +:10258000AA88B848002142430698002808D0504342 +:10259000B54902E03EE073E0CEE008F0BBFC411C30 +:1025A000E161306A002803D1A7A1B44808F0D3FD47 +:1025B000A620405BAB4A0028288BE16821D050431D +:1025C0000818A169401AA0622169A068A54A484379 +:1025D000A1694018A97D400051434018FF301730D1 +:1025E0002062A888E1695043411AA5480818606232 +:1025F000A06A316A401A9E49FF38553888423CD358 +:1026000051E750430818A169401A3168D638496823 +:102610004018D8E7284680300190C08C002802D0AE +:10262000306A002803D188A1964808F094FDA88854 +:102630008C49E3694843C01AA06201999C46CA8C40 +:102640002169A368521A4B43A16959186346534341 +:10265000C91800E011E0AA7D824B49005A4389184D +:10266000FF3117312162864941186162316A401A8F +:102670007F49FF3855388842C2D20120387112E7AD +:102680000898002803D03420005D00287ED1A88857 +:1026900074494843E169401A02994843A0622846B8 +:1026A00080300490C08C0028019825D0002803D0E9 +:1026B00065A1754808F04FFD04986A4AC18C0298DC +:1026C0000818E16948434000FF3017302062A888AD +:1026D0005043411A6A48081860626C4840680028F4 +:1026E00019D0A26A03990120511A614AFF3955395C +:1026F000914285D23871D6E6002802D0039800288E +:1027000003D151A1624808F026FD0198A16AD6388C +:102710000818A062D0E7FAF7F2F97269014610468C +:10272000FBF706FCA16A081A5149FF385038884265 +:10273000A5D2012009B0F0BD00980160009855496C +:1027400000684018F86028468030028A0799511ABC +:1027500009B2002904DD0599022901D0032100E016 +:10276000002179710E99002915D0028F002A1ED000 +:10277000418F4187A0352B7F491C4B4393420AD29E +:102780007979491E002906DD012100E00CE079710C +:10279000418F491C4187089838700898002808D054 +:1027A0003420005D002804D0022009B0F0BD0021D3 +:1027B000DFE708980121484020346075307FF27EC1 +:1027C0003946B37E9A4202D0FAF710FE04E00020A8 +:1027D000F076B07630607062002009B0F0BDF0B5E0 +:1027E0002A4F83B038680568416A2E460C68203647 +:1027F000717D00290AD0698E228D914206D1407ADE +:10280000002803D110A1244808F0A5FCFAF777F9B5 +:102810001E4F39684A6901461046FBF789FB3F683D +:102820000028796A096807D089880E4A51433A68B6 +:10283000D269891A08F06EFB698E2FE0B813002068 +:10284000B8000020E01300207372635C6C6C5F6C56 +:102850006D2E73302E630000310500003A05000034 +:10286000B7040000E204000040420F0033040000FF +:102870005C0800001D030000D4040000DC0400001C +:1028800094FBFFFFF50400001B050000A8000020DA +:1028900014050000FF0B000021060000228D131814 +:1028A000994202DB491C698602E0401C10186886C8 +:1028B000B07D002806D19421688E095B884201D141 +:1028C000401C6886388BFB4E401C388320464030C5 +:1028D0000190C1888088081A218D401E401887B257 +:1028E000C03418E03068F449406A002300794000A1 +:1028F000085A009323795B00C95A081881B2287DD1 +:102900000023FFF7A6FD00280FD001280FD0EB49C8 +:10291000EB4808F020FC6A8EB81A00B20028E1DA11 +:1029200001980821817005F0BDFF03B0F0BD688EED +:10293000401C6886EFE770B5DE4D09292B686A6890 +:102940007BD20C007C4424792419A7440463869626 +:1029500083A5A575A20000201062D17E042956D25D +:102960000B007B441B79DB189F4451510147516A8E +:102970000C68116808701168486010682030407D4C +:10298000002808D1FAF7BBF869680968096CFBF7F9 +:10299000CFFA002817DC6868228D0168498E9142C1 +:1029A00005D123468033998A8A1ADA8204E0891A8B +:1029B000962211530168498E21850268C16811640D +:1029C000C168416111E068680168098E228D8B1A27 +:1029D00022468032D3820168098E218501680B6C02 +:1029E000C3600B6C4361886C1062204606F0C8FB24 +:1029F000002821D0B3A1B74829E0D068506105F084 +:102A000088FA002818D0EF20AEA180001FE0ADA109 +:102A1000B1481CE0D07E042817D20100794409791E +:102A200049188F441212010B06F0E6FC002803D06F +:102A3000A4A1AA4808F08FFB70BD2DE005F09FFB14 +:102A40000028F9D09FA1A64801E09EA1A54808F062 +:102A500082FB70BDFDF7CBFD70BDD87E022806D08D +:102A6000D87E032806D0FF2096A1AB300EE0FFF7FA +:102A7000B6FE70BD00F013FC70BDD87E0228F6D003 +:102A8000D87E0328F6D0FF208EA1B83008F063FB73 +:102A9000F0E7FAF719F870BDFF208AA1C630D6E733 +:102AA000F3B50126834C904D81B00F46092945D2DC +:102AB00008007844007900188744042D38382D40E8 +:102AC000403838000121884800F0D0FB3946019891 +:102AD000FFF731FFE87E022826D160680468406A6B +:102AE0000768F9F7EAFFB988804A5143E269891A11 +:102AF000D639E162B72803D283200001081A02E028 +:102B0000081A7B494018E0627A48E16A814200D89D +:102B10000846E06205E00198FFF70DFFE87E022815 +:102B200002D128682030067503B0F0BD25600198F9 +:102B3000FFF701FF0020206003B0F0BDFF2061A17E +:102B4000623008F008FB03B0F0BD70B506460C46D5 +:102B500009291FD208007844007900188744040D21 +:102B600011110D1A1A1111000121634800F07EFBAA +:102B700021463046FFF7DFFE70BD3046FFF7DBFE33 +:102B800070BD4C4D5C4828603046FFF7D4FE0020F5 +:102B9000286070BDFF204BA1883008F0DCFA70BDC2 +:102BA000F0B5514985B0CA7E0026424C032A03D0B5 +:102BB0002831CA7E032A64D100252160002824D050 +:102BC00001280ED03FA14D4808F0C5FA2068002E1C +:102BD00005604562256054D049484560002005B035 +:102BE000F0BD0320887600E020BF2068C17E002968 +:102BF00003D0C17E827E9142F6D0C17E002902D0F0 +:102C000000268576E2E70126FBE700260327084633 +:102C10008F76C97E032903D0C07E00282DD02DE0F9 +:102C2000007F002803D127A1364808F094FA2068D5 +:102C3000067F684607714771F9F761FF0290FF2030 +:102C4000F530039001216846017069463046FAF775 +:102C5000CDFB2068007FFBF7F7F900280BD0206838 +:102C6000007FF9F731FF20680577C5768576056026 +:102C70000126456202E020BFEBE701262068857649 +:102C8000A4E70C2005B0F0BD10B5174800F04DFBCF +:102C9000194800F04AFB1C49002008751849487083 +:102CA00011494861144A506188769076014948601C +:102CB000086010BDA800002034B4010048280100BD +:102CC0005B0600007372635C6C6C5F6C6D2E73301E +:102CD0002E630000B6030000C3030000D60300000B +:102CE000DB030000E2030000B8130020E204000050 +:102CF00087F8FFFFEC060000E01300201E03000031 +:102D0000B80000207E02000008140020F8B5FF4E35 +:102D100005463068002401270004810FFC48006844 +:102D2000800F814204D0FF20FA49D03008F013FA16 +:102D30003068F94E0004810F30680006800F814230 +:102D400004D0FF20F349D13008F005FAF348C069F8 +:102D50003168800F0904890F884204D0FF20ED49B3 +:102D6000D23008F0F8F9EE480570EE4DEC76AC760E +:102D7000ED4EF476B476ED48077104606C627462CF +:102D80002C60EB4F346028467C6000F0CEFA304671 +:102D900000F0CBFAE74804757C706C617461AC7626 +:102DA000B476E54844600460F8BDE04908717047B6 +:102DB000F8B5DC490546CA7EDB48DF4C002A02D163 +:102DC000C27E002A03D0C97E022907D009E0DB4871 +:102DD0002160F9F725FE216808770AE0C17E002905 +:102DE00001D00C20F8BD2060D548F9F719FE216804 +:102DF0000877CF48456021680860D2484862284675 +:102E00000121BC30F9F790F9A035287F8007800FA9 +:102E1000401C28772068007F002803D1BD49CA489C +:102E200008F099F9F9F749FEC849884200D20846E6 +:102E3000C749401886B221680320C87604F084FF91 +:102E40002168086104F0A8FF01270025002826D08A +:102E500004F0A2FF21684A6A106008680121077027 +:102E60006846F9F7EAF868460078BA49000208F0BF +:102E700051F80F46F9F743FEF119FAF7D2F8216835 +:102E8000C86022680320107250721571107FD37EC3 +:102E9000111D967EB3420ED0FAF7A8FA0FE0F9F7AB +:102EA0002EFE3146FAF7BDF82168C8600868057043 +:102EB00008684770E5E7D576957615605562206815 +:102EC000058300202560F8BD7047F8B5954EF17E6A +:102ED000002903D19449C97E002901D00C20F8BDF6 +:102EE0000221F176914F934D77623560002438606E +:102EF0002C7500943979C0304A00974900798A5A74 +:102F00004000085A2346101881B222462046FFF797 +:102F1000A0FA002803D07F49904808F01CF92C61E2 +:102F20000120AC6028756C862C868D4884753968C4 +:102F3000088D401E088534830020F8BD10B57E48FA +:102F400001244068817E03290CD00168497800295A +:102F500006D0006A8349884202D9002405F03CF972 +:102F6000204610BD0024FBE77348406802681178D2 +:102F7000491C1170016A0068C26A914204D8007D40 +:102F8000012801D0012070470020704700207047C1 +:102F9000F8B5694D63482860416A00270C680068ED +:102FA000342126460F548036B17F002927D1007D79 +:102FB000032824D1F9F7A3FD29684A690146104680 +:102FC000FAF7B6FF00281ADD2D68674B6A6A296890 +:102FD000126892880091C9695A43511A07F09AFF02 +:102FE000218D401C4218009953480A862968B28AEC +:102FF0000B8ED21A12B2002A03DC0760F8BD2F60D4 +:10300000F8BD012220318A7521464031CA8889885D +:10301000514F511A228D491E89188EB20546C0346F +:1030200019E0496A09794900795A00220092028E12 +:103030002379007D5B00FB5A591889B20123FFF701 +:1030400008FA00280ED001280FD002280AD03149F2 +:10305000464808F080F829680868028EB21A12B251 +:10306000002ADEDA00202860F8BD28680068018E9A +:10307000491C0186EFE770B52F4900244D680628EA +:1030800076D202007A441279921897441820020EE0 +:10309000240D002000F08FF9EC76AC762C60002136 +:1030A00008466C6200F0E2F870BD1D480D680078BB +:1030B000EFF72AF9EC76AC762C606C6270BD0120DB +:1030C00000F079F90021084600F0D0F870BD2968B9 +:1030D0000320087570BD686A29680068CA698A603B +:1030E0008188214A51432A68D1600146C0310A8A49 +:1030F00002838A7B82754A8A82808A8AC280C98AD0 +:10310000018129680220087570BD31E000E400E00B +:1031100008E400E0C42C010018E400E000ED00E049 +:10312000A0000020B8130020E0130020B000002011 +:10313000B800002008140020A8000020A12A0100E7 +:103140004B2B0100A4000020C9020000F60500007E +:10315000BB0200001027000034B40100520300003D +:1031600028140020D9821300E204000007060000A2 +:10317000DD49DE4807F0EFFF70BD70B500280BD0C9 +:103180000024DB4D01280ED002282FD0EF20D64995 +:10319000C00007F0E0FF70BD00F06BF900210846A9 +:1031A00000F064F870BD686801684C70C47684767D +:1031B0000460D04E446201220021706800F063FF79 +:1031C00071680846C0318C72CC72FFF77EFE002811 +:1031D00003D0C549C84807F0BEFFF9F7DBFBC74875 +:1031E0006C600078EFF790F86C6070BD00F041F90A +:1031F0006868C4768476046000214462084600F062 +:1032000035F870BDBA494968CA7E022A08D10A68F1 +:103210001378002B04D150600968CA6A1018C8627C +:10322000704710B5B24A002952680BD0012906D068 +:10323000022906D0AC49B24807F08DFF10BD801EB0 +:1032400000E0401F106210BD08B50020C043694671 +:103250000880AC48C07E002801D0002008BD084688 +:1032600000F0F6F90028F9D0012008BD70B5A04C97 +:1032700005466268002908D0002A04D0FF209A4938 +:103280000D3007F068FF656070BD002A04D1FF2093 +:103290009549133007F05FFF0020606070BD38B5BE +:1032A000934C20680168497801291FD001216846A4 +:1032B000F8F7C3FE684600789349000207F02AFE3B +:1032C0002068426AC06812685118F9F7AAFE21689E +:1032D000C8608C4822680321824202D0108B0A28E1 +:1032E00010D2108B401C108351720DE07D21C068FC +:1032F000C900F9F796FE2168C86004F025FD216831 +:103300000861E6E702205072117200231371107FEA +:10331000D47E111D957EAC4202D0FAF767F838BD15 +:10332000D37693761360536238BDF8B5704C05467A +:103330001F27EE7E042E2DD230007844007900182D +:103340008744312801237148854203D0664970487B +:1033500007F001FF02202560A87600E020BF216869 +:10336000C87E002803D0CA7E887E8242F6D0CA7EFC +:10337000002A04D000228A760C27226010E0002266 +:103380008A760A604A6222600DE00120FFF708FC9D +:10339000074603E054495F4807F0DDFE002F02D0E6 +:1033A000E87EB042C5D1E87E002803D04E495A4895 +:1033B00007F0D1FEF8BDF8B54D4D01286A68516A95 +:1033C0000C6846D10879554940000B5A1068077DB2 +:1033D0000126032F06D0027D022A13D0007D01288A +:1033E00024D036E00027076110688760942000969B +:1033F000025BC420005D4000085AC01881B23B4601 +:1034000003201EE022468032D78C07610096C4203C +:10341000005D928A4000085AC01881B20023022041 +:10342000FFF717F8696809680E750CE0942000969C +:10343000025BC420005D4000085AC01881B200231E +:103440000120FFF706F8002803D02749344807F089 +:1034500082FEF9F79FFA29480078EEF755FF696870 +:10346000002008830B68228D5A86096820318875F0 +:10347000F8BDF8B51E4D002168680C46006842781A +:10348000002A01D0447027E00078002809D00121EB +:103490006846F8F7F7FD684600781B49000207F018 +:1034A00039FD6868426AC06812685118F9F7B9FDB9 +:1034B0006A68D060147103205072107FD37E111D92 +:1034C000967EB34202D0F9F791FF03E0D47694766A +:1034D0001460546268680483F9F75CFA074800785E +:1034E000EEF712FFF8BD0000C42C010056070000E3 +:1034F000A8000020B800002003070000A000002062 +:103500009D070000E013002010270000B8130020E2 +:1035100007020000130200001902000034B4010089 +:10352000BC060000F8B50024E948FEF73EFE00287E +:1035300025D1E84FC02026464643F51901462846C6 +:1035400007F0DEFC0120B8556C80E34900200870CC +:10355000E24A4A8080356962E149641C0870A962C8 +:10356000E049E4B208704A80A963032CE2D3D8484A +:10357000FEF733FED648FEF718FE002801D00C20D7 +:10358000F8BDFF211931D84807F0BAFCD64801210F +:1035900001704480D5490020087208750877D44925 +:1035A0008872CB48FEF719FE0020F8BD10B5C84858 +:1035B000FEF7F3FD002803D0CEA1282007F0CBFDB5 +:1035C000C348FEF7EAFD002803D0CAA12D2007F06A +:1035D000C2FDFFF7A7FF002803D0C6A1332007F0E4 +:1035E000BAFD10BD10B50446B948FEF7DEFD00284F +:1035F00001D00C2010BDBC490878002807D000205D +:103600000870B3482160FEF7E8FD002010BDB04807 +:10361000FEF7E3FD1F2010BD70B505460C46AC4813 +:10362000FEF7C3FD002801D00C2070BDAE4A5088C3 +:10363000A84202D11078002804D0A548FEF7CDFD9D +:10364000122070BDA2482260FEF7C7FD002070BDA9 +:1036500010B504469E48FEF7A8FD002801D00C20B6 +:1036600010BDA1480178002907D00020C043208068 +:103670009748FEF7B2FD122010BD40882080944884 +:10368000FEF7ABFD002010BD10B504469048FEF7D4 +:103690008CFD002801D00C2010BD2078002804D01B +:1036A0008B48FEF79AFD0C2010BD01202070884841 +:1036B000FEF793FD002010BD10B504468448FEF7C8 +:1036C00074FD002801D00C2010BD824A0021C020CA +:1036D0004843105C00280AD0C023002059435054AE +:1036E000881820607A48FEF778FD002010BD491C3C +:1036F000C9B20329EBD37648FEF76FFD1F2010BD3A +:10370000032805D2C0225043724A135C002B01D01B +:1037100012207047801808600020704710B5002202 +:103720000C46032809D2C02148436A490B5C002B90 +:1037300014D122704018606018E003280ED164484C +:10374000FEF733FD002809D167484188032902D1DB +:103750000178002904D05E48FEF73FFD122010BD1D +:1037600060605B48FEF739FD01202070002010BD2D +:1037700010B504465648FEF718FD002801D00C206D +:1037800010BD2088534A032804D2C0214843105C4E +:10379000002801D00020208000202188491C89B207 +:1037A0002180032900D300212180C0235943515C8B +:1037B00000290BD0401CC0B20328EED30020C04328 +:1037C00020804348FEF709FD122010BD4048FEF757 +:1037D00004FD002010BD70B505460E463C48FEF7BE +:1037E000E4FC002801D00C2070BD2888341D03287B +:1037F00004D303D0A04201D3002028800020361D2E +:103800001DD0394B33492A88521C92B22A80A242D9 +:1038100000D300222A80042A02D3A24217D301E057 +:10382000032A05D0C02672438A5C002A0FD002E02A +:103830001A78002A0BD0401CC0B2A042E3D300206B +:10384000C04328802248FEF7C8FC122070BD2048E3 +:10385000FEF7C3FC002070BD10B504461C48FEF7FF +:10386000A4FC002801D00C2010BD2078002804D032 +:103870001748FEF7B2FC0C2010BD01202070144840 +:10388000FEF7ABFC002010BD10B504461048FEF753 +:103890008CFC002801D00C2010BD217801200029CB +:1038A00002D0012905D008E061680A78002A09D011 +:1038B00003E061680A78002A04D00548FEF78DFC11 +:1038C0000C2010BD08700248FEF787FC002010BDD8 +:1038D000C00000205814002098160020FFFF0000B0 +:1038E000C1000020C6160020D8160020B8170020FE +:1038F000D81700207372635C6C6C5F64622E630087 +:1039000010B5282107F0FAFA10BD70B50546007809 +:103910000A0700090001120F1043287007290ED270 +:10392000080078440079001887440305030503075D +:103930000300062408E00C2406E0222404E000240E +:10394000F8A1572007F007FC687880098001204320 +:10395000687070BD00780007000F704710B5C01C7C +:1039600007F0F5FC10BD0A4610B5C11C104607F063 +:10397000EEFC10BD10B5093007F0E9FC10BD02786F +:10398000BF23C9071A40490E0A43027070470078E6 +:103990004006C00F704702785206520EC9010A4312 +:1039A0000270704770B50C460546C11C20460930B0 +:1039B00007F0CDFC20784006400E2070297849069B +:1039C000C90FC9010843207070BD70B515460E4679 +:1039D00004461F2A03D9D3A1A82007F0BCFB204628 +:1039E0002A463146093007F02CFA6078AD1D80096F +:1039F0008001A906890E0843607070BD70B5054648 +:103A000040780E468406A40E062C03D2C5A1B82029 +:103A100007F0A1FBA41FE4B21F2C00D91F242946E4 +:103A200022460931304607F00CFA204670BD70B5C9 +:103A300015460E4604461F2A03D9BAA1CC2007F02A +:103A40008AFB20462A463146093007F0FAF96078A9 +:103A5000AD1D80098001A906890E0843607070BD04 +:103A600070B5044640780E468506AD0E062D03D28D +:103A7000ACA1DD2007F06FFBAD1FEDB21F2D03D908 +:103A8000A8A1E12007F067FB21462A46093130460C +:103A900007F0D7F9284670BD0A78C2734A780274D5 +:103AA0008A784274C978817470470A78C2744A78F7 +:103AB00002758978417570474176090A81767047A9 +:103AC000C176090A017770474177090A8177704703 +:103AD000C175090A017670478175704720300279F7 +:103AE000C90652095201C90E0A43027170472030BB +:103AF0000279D206D20E49010A430271704710B50D +:103B00001F3007F019FC10BD417800788906890E36 +:103B10000007000F06D0012808D0022809D0062887 +:103B200010D10AE0891F1F290AD90BE00C2907D000 +:103B300008E0891F1F2903D904E0891F1F2901D824 +:103B400001207047002070474178007889060007FF +:103B5000890E000F042805D1062903D3252901D891 +:103B6000012070470020704770B401780907090FE1 +:103B700003292ED0052931D1411C827E0C46437E7B +:103B800011021943037FC27D1D02037EC67E1B0204 +:103B90001343827D407835438006800E22281DD154 +:103BA00006291BD31920C001814217D8FF26F436FD +:103BB000B54213D8002A11D0082A0FD88A420DD254 +:103BC0008B420BD8617F227F09021143814208D9C1 +:103BD00004E040788006800E0C2802D070BC0020E3 +:103BE000704770BC0120704710B5222107F086F99C +:103BF00010BD10B502788B07920892009B0F1A43F4 +:103C000002704278520952014270012908D00229FB +:103C100006D0032905D0FF2042A1E83007F09BFA27 +:103C200010BD01210A43427010BD10B502788B0708 +:103C3000920892009B0F1A43027042785209520177 +:103C40004270012907D0022905D0032904D035A1EB +:103C5000384807F080FA10BD01210A43427010BDB8 +:103C600000788007800F70470278EF23C9071A4059 +:103C7000C90E0A43027070474178C078C906C90E60 +:103C80000E2835D202007A44127992189744060918 +:103C90000C0F1215181B1E2124272A2D0C2929D0A0 +:103CA0002AE0082926D027E0022923D024E017297A +:103CB00020D021E00D291DD01EE001291AD01BE0E3 +:103CC000012917D018E0022914D015E0092911D0D4 +:103CD00012E009290ED00FE001290BD00CE00129D8 +:103CE00008D009E0062905D006E0022902D003E049 +:103CF0001B2901D8012070470020704770B5054688 +:103D0000C1700E2926D20800784400790018874433 +:103D100006131517191B1B151D1D1B1B1F150C2426 +:103D20001DE000007372635C756C5F7064752E63D8 +:103D30000000000001020000082410E002240EE050 +:103D400017240CE00D240AE0012408E0092406E011 +:103D5000062404E000249A499A4807F0FCF96878A0 +:103D6000400940012043687070BDC0787047C17140 +:103D7000090A01727047017AC2790802104370473C +:103D80004172090A81727047817A427A08021043AF +:103D90007047C172090A01737047017BC27A080239 +:103DA000104370474171090A8171704781794279E6 +:103DB00008021043704701717047007970474173E2 +:103DC000090A81737047817B427B08021043704768 +:103DD00070B4017AC37909021943431C857A1C46E1 +:103DE000467A2B023343657926792C023443C21C70 +:103DF000754E00798D1FB54215D8FF25F435AB42BD +:103E000011D800280FD008280DD888420BD28C4238 +:103E100009D8507A117A00020843B11D884202D8AD +:103E200070BC0120704770BC0020704710B5001DA9 +:103E300007F082FA10BD0A4610B5011D104607F0C2 +:103E40007BFA10BD4172090A81727047817A427A09 +:103E5000080210437047017170470079704710B530 +:103E6000001D07F081FA10BD0A4610B5011D10466D +:103E700007F07AFA10BD0A780273497841737047E7 +:103E8000027B0A70407B4870704710B50E3007F017 +:103E90006BFA10BD0A46014610B50E31104607F008 +:103EA00063FA10BD0A7882754A78C2758A780276FC +:103EB000C97841767047827D0A70C27D4A70027E61 +:103EC0008A70407EC870704710B5001D07F04CFA2C +:103ED00010BD0A4610B5011D104607F045FA10BD89 +:103EE0000A7802734A7842738A788273C978C173F8 +:103EF0007047027B0A70427B4A70827B8A70C07B6B +:103F0000C8707047017170474171090A817170472B +:103F1000C171090A0172704700797047817942794D +:103F2000080210437047017AC279080210437047B3 +:103F300001717047007970470171704710B5001D1D +:103F400007F012FA10BD0A4610B5011D104607F021 +:103F50000BFA10BD10B5001D07F006FA10BD0A4699 +:103F600010B5011D104607F0FFF910BD70B51546DC +:103F70000E4604461B2A03D91149144807F0EBF8F2 +:103F80002A463146E01C06F05CFF6078E9064009ED +:103F90004001C90E0843607070BD70B50546407899 +:103FA0000E46C406E40E1B2C03D90549084807F049 +:103FB000D2F82246E91C304606F043FF204670BD89 +:103FC000243D0100A10200007A0C0000F103000072 +:103FD000FD03000070B504460020A083208C1E461F +:103FE00048431546114606F0A3FF2084F0002946F9 +:103FF00006F090FF401C80B20146192269439202EC +:10400000E083914201DD401EE0837D2029460002CD +:1040100006F080FF401CA08470BD70B50A7BD206FC +:10402000D20E0A73002282758B181B7ADC075B089C +:10403000DD07E40FED0F2C195B08DD07ED0F2C19E0 +:104040005B08DD07ED0F2C195B08DD07ED0F2D195F +:104050005C08E307DB0F5B196508EC07E40FE41865 +:104060006B081B1984186374847D521CE318D2B248 +:104070008375052AD8D3D8B2252803D9E1A18A208F +:1040800007F069F870BD70B504460B462546264614 +:10409000214600202835C0368031032B0AD0002B62 +:1040A0003AD0012B41D0022B03D1A11C2846FFF7A7 +:1040B000B4FF70BD2880A871E871E8722873687336 +:1040C000A873A870E870287168716876A8832B4679 +:1040D00068842033987128859872E8752876E8738B +:1040E0002874D872187398731A752884FF22603563 +:1040F000AA709875088248828882C882088348839B +:104100004877C884A4221055088748872421085579 +:1041100060843070B07170BDC8848877A1882389AD +:104120000A462846FFF756FFBFE7C884F38A728A1B +:10413000A1882846FFF74EFF70BD70B504460346C0 +:1041400028348033054603290AD0002933D00129B9 +:1041500038D0022903D1A91C2046FFF75EFF70BDAD +:1041600000202080A071E071E07220736073A07362 +:10417000A070E070207160716076A0832146608439 +:104180002031887120858872E0752076E073207474 +:10419000C872087388730A752084FF226034A27085 +:1041A00088751883987618742421586148551877B3 +:1041B000A035287370BDA9882B890A462046FFF7D1 +:1041C00009FFC8E7586AA988C38942892046FFF7D2 +:1041D00001FF70BD70B5867D0D460446002E01D0EE +:1041E000252E01D9122070BD002A18D0287EE17D2D +:1041F00050430818252106F08DFEE1750846CA08CF +:104200004907490F834BAA18595C127A914308D089 +:10421000314606F07FFE491CCAB200200AE00020A9 +:1042200070BD2076002070BD002803D02118097CC5 +:10423000511ACAB22118497C91423AD32918097AF5 +:10424000C943CB07DB17D21A521E1206120E35D005 +:104250008B07DB17D21A521E1206120E32D04B07F2 +:10426000DB17D21A521E1206120E30D00B07DB17C4 +:10427000D21A521E1206120E2ED0CB06DB17D21AFD +:10428000521E1206120E2CD08B06DB17D21A521EAB +:104290001206120E2AD04B06DB17D21A521E120635 +:1042A000120E28D00906C917511A491E0A06120E05 +:1042B00026D0401C0528B7DB1F2070BDC00020762B +:1042C000002070BDC000401C2076002070BDC000E2 +:1042D000801C2076002070BDC000C01C207600200D +:1042E00070BDC000001D2076002070BDC000401DC4 +:1042F0002076002070BDC000801D2076002070BD9B +:10430000C000C01D2076002070BD70B50D4604466B +:10431000072904D9FF203BA15D3006F01CFFE0789F +:10432000502108406907490F88300843E070A078A1 +:10433000A72108401830A07060785E210840203026 +:1043400060702078BC2108404030207070BD017939 +:10435000490901D000207047002230B41146445C66 +:10436000491CE3076408E507DB0FED0FEB18640851 +:10437000E507ED0FEB186408E507ED0FEB1864088F +:10438000E507ED0FEB186408E507ED0FEB1864087F +:10439000E507ED0FA407EB18E40FE318D218D2B22B +:1043A0000529DCDB002A02D030BC0120704730BC7C +:1043B0000020704738B505460C466846FCF74EF8B5 +:1043C00000281ED069460020085620720921615637 +:1043D0000022411A00D549422035EB788B420FDC90 +:1043E000FF2B0DD0A17A491CC9B2A1722B79994239 +:1043F00002D8617A7F2903D160720020A072012265 +:10440000104638BD7372635C6C6C5F7574696C2E9A +:104410006300000044B40100F8B50024F74EFF200B +:10442000B470F0702546F64F06E0042D04D3FF204B +:10443000F4A1AB3006F08FFEFF212846A03148439F +:10444000FF213331C0194A1C0C540146FF3114546A +:1044500021310C754C75F178A94202D1B470FF215D +:10446000F170FF219D314A1C6D1C0C54EDB21454A7 +:10447000042DDAD30020FF21A0314143C919FF31B7 +:1044800081318C77401CC0B20428F4D3E048FFF798 +:10449000ABFB0021DE48FFF7E7FB0121DC48FFF71B +:1044A000A8FBDC49FF20087048708870C87008714C +:1044B0004871F8BDB0E71B20704710B4D04A002106 +:1044C000FF23A0334B439B18FF3381339B7F002B8B +:1044D00004D0491CC9B20429F2D30DE004290BD23F +:1044E000FF23A0334B439A180124FF328132947783 +:1044F0000170204610BC704710BC0020704730B4DB +:104500000025042825D2FF220146A0325143BC4A8F +:1045100089180B46FF3381339A7F002A19D0FF2474 +:104520003334621C655455541A46603A15755575F6 +:10453000B24AD478844202D19570FF20D070FF2017 +:104540009D304554FF319E310D709D7730BC012068 +:10455000704730BC0020704704280ED2FF2201466D +:10456000A0325143A64A8918FF318131897F002941 +:1045700003D0A8494871012070470020704710B44B +:10458000A449FF224979A03251439D4A82B089183B +:104590000A46FF322132937C6C462370D27C227112 +:1045A000237822795A40802A0AD022782223520680 +:1045B000520E5A435118016002B010BC01207047DE +:1045C00002B010BC002070479248FF214079A03112 +:1045D00048438B4981B041180846FF303330FF31E2 +:1045E0002131CA7C69460A7003780922097859404A +:1045F00080290ED0037869460B7009784906490E68 +:10460000491C914208D26A461178491CC9B21170FE +:1046100009E0002001B0704769460978090601D514 +:10462000002100E080210170012001B070470428C2 +:104630000ED2FF220146A0325143714A8918FF3140 +:104640008131897F002903D07249087101207047A8 +:104650000020704710B46F49FF220979A0325143FE +:10466000674A82B089180A46FF322132947C6B4631 +:104670001C71D27C1A701C781A7994420AD01A786C +:1046800022235206520E5A435118016002B010BC48 +:104690000120704702B010BC0020704738B55D485B +:1046A0000179FF20A0304143554808180146FF31E9 +:1046B00021318A7C6C4622700922FF303430037825 +:1046C0002478A34223D004786B461C701B785B06C9 +:1046D0005B0E5B1C934205D26B461A78521CD2B219 +:1046E0001A7006E06A461278120601D5002200E030 +:1046F00080220270087D401C0875087D497D884233 +:1047000003D140A1444806F026FD012038BD002019 +:1047100038BD4048FF210079A0314843384940184E +:10472000FF302130C17C807C814201D10120704763 +:10473000002070473748FF210079A03148433049B5 +:104740004018FF302130817CC27C092013464B4049 +:10475000802B0AD049065206490E520E914201D3CF +:10476000881A01E0511A401AC0B2704709207047F8 +:104770000022042813D2FF23A0335843204BC01833 +:10478000FF239F331B5C002B09D0FF300A702130C0 +:10479000027D437DD31A0B704275012070470020C3 +:1047A0007047042811D2FF22A0325043144A8018C7 +:1047B000FF229F32125C002A07D0FF302130027D99 +:1047C000407D101A08700120704700207047104982 +:1047D0000160704704280ED2FF220146A0325143E7 +:1047E000074A8918FF318131897F002903D009499F +:1047F000087001207047002070470000101800204A +:10480000141800207372635C646D5F712E63000086 +:10481000901E0020C70000205A020000AC49CA7850 +:10482000FF2A03D000210160084670478A78A94911 +:10483000012A02D001600120704700207047A6487D +:104840000178012907D001210170A4480178A0480E +:10485000C170012070470020704704280ED2FF224B +:104860000146A03251439E4A8918FF318131897F28 +:10487000002903D0994948700120704700207047F3 +:104880009349964BCA785B789A4206D18A78203948 +:10489000002A02D0016001207047002070478C4838 +:1048A0008E4AC1785278914209D1FF21C170801C93 +:1048B0000178002903D000210170012070470020F9 +:1048C00070478348854AC1785278914204D18078F4 +:1048D000002801D0002070470120704704280ED224 +:1048E000FF220146A03251437D4A8918FF318131B0 +:1048F000897F002903D07949C870012070470020C2 +:10490000704710B47549FF22C978A0325143744AE8 +:1049100082B089180A46FF328132147F6B461C70C0 +:10492000527F1A711C781A79FF3162403731802A20 +:104930000AD01A7822235206520E5A4351180160A7 +:1049400002B010BC0120704702B010BC00207047BC +:104950006248FF21C078A0314843614981B04118C5 +:104960000846FF309D30FF3181314A7F69460A7029 +:10497000037803220978594080290ED003786946CC +:104980000B7009784906490E491C914208D26A46C3 +:104990001178491CC9B2117009E0002001B07047BC +:1049A00069460978090601D5002100E080210170DF +:1049B000012001B070474948FF21C078A031484329 +:1049C00047494018FF308130417F007F814201D14B +:1049D000012070470020704704280ED2FF220146B4 +:1049E000A03251433E4A8918FF318131897F002925 +:1049F00003D03A498870012070470020704710B4F6 +:104A00003649FF228978A0325143354A82B089184D +:104A10000A46FF328132147F6B461C71527F1A7036 +:104A20001A781B79FF3137319A420BD06A461278D7 +:104A300022235206520E5A435118016002B010BC94 +:104A40000120704702B010BC002070472348FF21AE +:104A50008078A0314843224981B04018FF219D3120 +:104A6000095C6B4619700321FF309E3002781B7879 +:104A70009A4219D003786A46137012785206520E81 +:104A8000521C8A4205D26A461178491CC9B211707B +:104A900006E069460978090601D5002100E0802179 +:104AA0000170012001B07047002001B070470B4831 +:104AB000FF218078A031484309494018FF308130F8 +:104AC000417F007F814201D1012070470020704763 +:104AD00010180020F017002012180020C700002036 +:104AE00014180020F8B5FD4F0A46044600207978D6 +:104AF000FB4D0646002902D0012909D00FE0F949F3 +:104B0000497A00290BD0002A08D10120787005E0ED +:104B1000A97F002903D0002A00D17E700120797876 +:104B20002B23594349198B7F034311D0002A22D1EB +:104B30002A22A01C1F3106F084F966700420207020 +:104B40000120A07078782B2148434019867712E025 +:104B50002878012801D00020F8BD002A0BD166700A +:104B6000132020701C22A91CA01C06F06AF9A67153 +:104B70002E70DD48C6770120F8BDD948017800299C +:104B800001D080887047D9487047F8B5D44E0746A1 +:104B9000B07F00282DD13846FEF7DCFE002101252C +:104BA000D34C072824D202007A44127992189744F1 +:104BB0000305081F1F1F0A00217006E025702172DF +:104BC00008E0032000E002202070CA493846FEF7C2 +:104BD00015FF20723846FEF7DAFE6070C649384687 +:104BE000FEF7C1FEBD4CC54F20787F2807D101E0FC +:104BF0002172F8BDFF20C2A1543006F0ACFA207833 +:104C000038707F202070B577032002F0E7FEF8BDF2 +:104C100010B5002002F072FE002812D0FBF79CFBBA +:104C200000210120FBF7A0FABA48FBF7ACFBAE4C21 +:104C3000A06AFBF7ABFB2079032805D0022803D03C +:104C400006E000F0F3FD10BD01210020FBF716FC8B +:104C5000FBF7FBFBB04C6078002803D0FBF77DFF2F +:104C6000FBF7D9FB0320E07010BD70B59E4900280A +:104C7000CA8D08D0FF2A0DD25004000CC885FF2829 +:104C800008D9FF2005E0012A04D95008C88501D1C0 +:104C90000120C88591484268012A01D0002A01D12B +:104CA0000D224260D24317239B4C5A43637B3B2522 +:104CB000DB436B43D2184260C98D900C06F02AF991 +:104CC000617370BDF8B5944CE078022804D0E078A8 +:104CD000012801D00C20F8BD0020814A05462B2177 +:104CE000414389188D77401CC0B20228F7D3157054 +:104CF0006078002804D0FBF796FBFBF73FFF657058 +:104D0000794845778577C5778449257001228A7768 +:104D10000571A570CA760A774A77714E0146324608 +:104D2000736F7432B46FF66FD7688B60CC600E61AE +:104D30004F6112698A6105770020F8BD10B5764A87 +:104D40000023D3701371684B596318630120D0702E +:104D5000FFF7B8FF002803D069A1714806F0FBF9FE +:104D600010BDF1B582B00C2001906B480090C07866 +:104D7000012806D00098C078022802D00C2003B089 +:104D8000F0BDFBF7F0FA0020FBF7B1F8564C207F9E +:104D9000002837D0524920460F4682687437C368CE +:104DA000056946694A678B67CD67FE60806938612F +:104DB00000266677A677594DE87E002805D1287F22 +:104DC000002802D1687F00281AD0009800780028B7 +:104DD00016D02079032802D0022805D008E005214A +:104DE000504800F040FD03E003214E4800F03BFD39 +:104DF000A97E3846FBF7F3F80020019026770CE0F7 +:104E0000267703E00098C078022804D00098C07884 +:104E1000022828D00AE0002001900098C0780128DC +:104E200004D10099087300980221C170606B017869 +:104E3000002903D00178001DFBF714F9206B0178DD +:104E4000002906D0384A401CFBF777FE0099012064 +:104E500048700298A0623548FBF717FAFBF78EFA04 +:104E6000019803B0F0BD00990120C8700C2003B078 +:104E7000F0BD70B5FBF777FA274CE078022803D035 +:104E8000FBF77CFA0C2070BD012017496073C885C0 +:104E90000220FBF765FA2648FBF739F9254E002575 +:104EA000A0780321401C06F035F8A170885D012828 +:104EB00044D06D1CEDB2032DF2D3FFF7A9FE20798B +:104EC000002809D0012807D002283DD003283BD074 +:104ED0000BA1194806F03FF9002070BDD00000205A +:104EE000B41E0020F41E0020341F0020FFFF00002D +:104EF000D41E0020DD1E0020D61E0020FC1E002037 +:104F00007372635C6C6C5F64645F7363616E2E6369 +:104F1000000000006C1F0020541F0020141F002000 +:104F200051030000941F00206F1F00204CB40100AB +:104F300052B401002F1F0020EA030000C8B2FC4950 +:104F4000085CFBF7F6F8B8E7EEF762F8C4E770B56F +:104F5000F84C0125A577E37F002B01D03A2070BDE6 +:104F60000026002802D1A07B884209D1A173667770 +:104F70001146F14806F0EBF96577F04805702577A2 +:104F8000A677002070BD024600200123E949002ACF +:104F900003D0012A03D0122070478B7400E088747C +:104FA0000B774A767047E34A032800D151611076A7 +:104FB0000120107700207047E049012803D0032822 +:104FC00001D0002000E0012008717047D948017F1E +:104FD000002903D0407E002803D170474079002883 +:104FE000FBD00120704710B5FBF709FAFBF7FCF97D +:104FF000FBF708F9FBF7AAF9D04C6078002805D038 +:10500000FBF711FAFBF7BAFD002060700120207356 +:105010000220E070FBF7B2F9002010BDC7494871CB +:10502000704710B500F002FC10BDF0B5C44EC34D82 +:1050300083B0002810D0C348FEF766FD002804D1D5 +:10504000C048FEF781FD002806D0BA4C207903281D +:105050000DD1A07F00280AD0E87805286BD2010086 +:105060007944097949188F44666666F7F600E8784E +:1050700005287AD201007944097949188F44757559 +:105080007502EE00AF48FEF765FCAD498870AE488A +:105090000190807F002803D1FBF736F8002800D06C +:1050A000012000906878002813D00526761EF6B2FD +:1050B000FBF785FD0746022805D1002EF6D1A3494E +:1050C000A34806F048F80098002810D1012F0ED010 +:1050D00000909B4F9F4EB878072871D20100794409 +:1050E000097949188F446DFE056C6C6C280001200D +:1050F000EEE76878002803D0FBF795F9FBF73EFD53 +:105100008F48FBF7ABF9002801D17F203870FBF7FF +:1051100093F9009800280AD02079012801D00228AC +:1051200005D1FBF76FF88748FFF72FFD37E2FBF754 +:1051300069F8FFF76DFD34E26878002803D0FBF7CB +:1051400072F9FBF71BFD7E48FBF788F9002801D1B7 +:105150007F203870FBF770F90098002879D020790B +:10516000022803D001287AD047E221E27548FFF7F0 +:105170000CFD012002F0C2FB00286ED07649714878 +:10518000FEF710FC7448FBF7FEF8607F00280ED095 +:105190006848019902898A824289CA828089088383 +:1051A00031466D48FEF7DAFB00206077A0770121D9 +:1051B0000846FBF763F9FBF703F90520E870F0E117 +:1051C0005BE16878002803D0FBF72DF9FBF7D6FCEC +:1051D0005B48FBF743F9002801D17F203870FBF7CB +:1051E0002BF90098002834D02079022808D0012813 +:1051F00035D0032837D05549584805F0ACFFD0E1E9 +:105200005048FFF7C2FC012002F078FB002824D0B0 +:1052100051494C48FEF7C6FB4F48FBF7B4F8607F96 +:1052200000280ED04348019902898A824289CA82A5 +:105230008089088331464848FEF790FB002060775C +:10524000A07701210846FBF719F9FBF7B9F805200B +:1052500001E10EE103E0BFE1ADE1B3E022E1394855 +:10526000FFF793FC9BE137482168C2780B7F9A4295 +:105270001DD102794B7F9A4219D142798B7F9A4294 +:1052800015D18279CB7F9A4211D10A462032C37957 +:105290001778BB420BD1037A5278934207D100783A +:1052A000CA7E4006C00F904201D1012000E00020DC +:1052B0006279012A30D0002800D138E7022002F0BC +:1052C0001DFB00287ED0012002F088FB22491D48EA +:1052D000FEF768FB2068018B1F48FEF7F9FB20688A +:1052E000817D00E03CE01C48FEF7F6FB1A48FBF726 +:1052F0004AF8607F002866D00E48019902898A82A8 +:105300004289CA828089088331461348FEF726FB0A +:1053100000206077A0779BE00028CFD109481C319E +:10532000FEF721FB0748FEF732FB2168C876C5E788 +:105330004FB40100341F00203C1F0020541F0020E8 +:10534000D00000206C1F0020141F0020004F01001F +:10535000D4040000281F0020941F0020CC0500006A +:105360006878002803D0FBF75EF8FBF707FCF948E4 +:10537000FBF774F8002801D17F203870FBF75CF848 +:105380000098002875D0FAF733FE002871D02079F4 +:105390000328F14804D0FFF7F8FBFAF733FFFEE0EB +:1053A0002168C2780B7F9A4220D102794B7F9A42C2 +:1053B0001CD142798B7F9A4218D18279CB7F9A4255 +:1053C00014D101E056E043E00A462032C379177851 +:1053D000BB420BD1037A5278934207D10078CA7E40 +:1053E0004006C00F904201D1012000E00020627908 +:1053F000012A32D0002800D199E6022002F07EFA7C +:10540000002837D0012002F0E9FAD449D248FEF74B +:10541000C9FA2068018BD148FEF75AFB2068817DCC +:10542000CE48FEF759FBCD48FAF7ADFF607F002864 +:105430000ED0CB4901980A8982824A89C282898921 +:1054400001833146C548FEF789FA00206077A077CE +:105450000120E0770620E870A3E00028CDD1BE4807 +:105460001C31FEF780FABC48FEF791FA2168C87635 +:10547000C3E7C2E000F0DAF993E06878002803D0CF +:10548000FAF7D1FFFBF77AFBB248FAF7E7FF0028FB +:1054900001D17F203870FAF7CFFFFAF7B3FEFFF79C +:1054A000B7FB7EE0AC48FEF755FAB070AA48AB49AE +:1054B000C3784A7A93421CD103798A7A934218D1ED +:1054C0004379CA7A934214D183790A7B934210D1EB +:1054D000C3794A7B93420CD1037A8A7B934208D1E9 +:1054E000007809784006C00FC909884201D101241B +:1054F00000E00024FAF786FEB07804283ED1002CA4 +:105500003CD09448FAF7AAFF002801D17F203070E0 +:10551000FAF792FF287B002802D00020FFF7A5FBB6 +:105520000120904C28738C4F607A002837D10420DA +:10553000E0723846FEF72BFA002801D0012800D18E +:10554000207389493846FEF70EFA88493846FEF737 +:1055500087FAE0741F2801D91F20E0743078844F47 +:105560007F2804D1FF208349543005F0F4FD3078C2 +:1055700038707F2030700120607210E07548FAF7B3 +:105580006DFF002801D17F203070FAF755FF287B8E +:10559000002802D10120FFF768FB00202873FFF7E5 +:1055A00037FBE87802283DD0E87804282DD127E0A1 +:1055B0007049714821E66878002803D0FAF733FF74 +:1055C000FBF7DCFA6348FAF749FF002801D17F2096 +:1055D0003070FAF731FF10E05E48FAF73FFF00281D +:1055E00001D17F203070FAF727FF287B002802D1F5 +:1055F0000120FFF73AFB00202873FAF703FECEE7FD +:1056000037205C49400105F0A6FD2879002809D023 +:1056100001280ED0022807D0032810D0554957483A +:1056200005F099FD03B0F0BDE878032807D003B07A +:10563000F0BDE878062802D0E8780528F7D10120E7 +:10564000FAF7D2FF03B0F0BD70B54D4CE0780728F3 +:105650005FD201007944097949188F445A5A5A5A3D +:105660005A030B003C48FAF78EFEFAF7EEFE0420D0 +:10567000E07053E0FAF7C3FEFAF7B6FEFAF7C2FDA0 +:10568000FAF764FE012626730220E070FAF776FE30 +:105690003C4D2878002803D036493B4805F05BFD97 +:1056A0000020A8702E4800684188A980C17EE97159 +:1056B000818B2981C18B6981018CA9818188E982D3 +:1056C000C188298300896883607928772F48304909 +:1056D000807EA8732F4805F03AFE6078002803D03A +:1056E000FBF76DFA012808D0687F40084000687712 +:1056F0002E70022002F072F910E0687F3043687764 +:10570000FBF776FA697F4000C907C90F0143697743 +:10571000EEE775201749000105F01DFDE07802282D +:1057200016D0E078032806D0E078042803D0114989 +:10573000194805F010FD2079002809D0012807D06C +:1057400002282DD003282BD00A49144805F003FD68 +:1057500070BD0000D00000206C1F0020941F0020AE +:10576000341F0020F41E0020011F0020081F00200D +:10577000271F0020004F01009E060000F5060000D4 +:10578000541F0020B41E002029070000141F002011 +:10579000281F0020C31E00205607000062070000DB +:1057A0000120FAF721FF70BD10B55C4CE0780528A8 +:1057B00020D201007944097949188F441B1B1B1919 +:1057C00002005748FAF74AFE002802D154497F20C8 +:1057D0000870FAF731FE207B002802D10120FFF784 +:1057E00044FA00202073FAF70DFDFFF711FA01E0EB +:1057F00000F01CF8E078022813D0E078032803D0EA +:105800004849494805F0A7FC2079002809D001281B +:1058100007D0022806D0032804D04249434805F0A7 +:105820009AFC10BD0120FAF7DFFE10BD10B5FAF7A3 +:10583000E6FDFAF7D9FDFAF7E5FCFAF787FD374CF4 +:105840006078002805D0FAF7EEFDFBF797F9002005 +:105850006070012020730220E070FAF78FFD0020B5 +:1058600002F0BCF810BD70B5314C054626466036D6 +:105870007434032943D0052940D1FEF741F80521AE +:105880002846FEF742F8B17E2846FEF778F8214612 +:105890002846FEF763F8274C284621680F31FEF7AB +:1058A000FBF8216828461331FEF7FFF82068817D58 +:1058B0002846FEF711F92068018B2846FEF708F903 +:1058C000206881882846FEF7F7F82068C1882846B6 +:1058D000FEF7F6F8206801892846FEF7F5F82168FA +:1058E00028460A31FEF70BF92068817E2846FEF72C +:1058F000F5F80A4841792846FEF7F9F870BDFDF73A +:10590000FFFF03212846FEF700F8B17E2846FEF788 +:1059100036F821462846FEF721F870BD541F0020B6 +:10592000D0000020004F010099070000A5070000EB +:10593000B41E0020341F0020F8B5FEF7FBFE04461D +:10594000FEF7BFFFF74E0546F0682030407B002889 +:1059500026D0012867D0022869D0032871D0FF2003 +:10596000F1A1793005F0F7FB3069F7220178114099 +:105970000170F2682032937BDB071B0F1943FB2376 +:1059800019400170D37BDB075B0F19430170577B14 +:10599000EF23022F60D0012F63D0032F65D06AE080 +:1059A000E548FEF76DFF002827D030690090F168C8 +:1059B000088DC9884018801D87B20098FEF7D5F978 +:1059C000012805D00098FEF7D0F9002808D00FE094 +:1059D000F06839468030C7850098FEF733FA07E053 +:1059E000F06839468030406A87800098FEF7E7F912 +:1059F000F168032020314873B6E7CF48FEF72AFE4E +:105A0000002804D0F0685321095C002907D0CA4857 +:105A1000FEF7DDFEF168012020314873A4E7022182 +:105A200020304173A0E7C448FEF7D1FE9CE7C2488E +:105A3000FEF710FE002897D1FF20BBA16B3008E0D5 +:105A4000FFE7BD48FEF71CFF00288DD1FF20B6A15F +:105A5000733005F080FB87E7012C08D8002D06D0B5 +:105A600009E06D1E2C4302D105E0002C03D0194043 +:105A70001023194300E019400170D17D002915D091 +:105A8000517B012912D0AD48FAF77DFCAC480121C9 +:105A90000176F268116E526E42610161A749326966 +:105AA000FAF7D7FF0020FAF7E3FF03E0FAF76BFC01 +:105AB000FBF701F801210846FAF7E0FC03203070FB +:105AC000F8BD08282FD203007B441B79DB189F44C4 +:105AD00003060B0E11152528002926D023E00229E4 +:105AE00023D0032921D01EE007291ED01BE008295E +:105AF0001BD018E00A390B2917D914E00D2914D04E +:105B00000C2912D0002A04D00D290CD315290CD948 +:105B100009E0112907D3152907D904E0092904D080 +:105B200001E0012901D0002070470120704730B505 +:105B3000054683B08048FEF771FE002803D17AA1A4 +:105B4000804805F008FB774C2069FEF74DF80321EB +:105B50002069FEF76AF82069EF2201781140017090 +:105B60002946FEF7CBF80D2D76D22800784400792F +:105B7000001887441F1606448080840E7280848437 +:105B800060006848C16800698031497FFEF763F9A9 +:105B900075E06448C16800698031497AFEF7CCF944 +:105BA0006DE06048C16800698031896A491CFEF770 +:105BB0003DF964E05B4CE0688030406A817920699F +:105BC000FEF7F9F8E0688030406A01892069FEF745 +:105BD000E9F8E0688030406A41892069FEF7C7F83B +:105BE000E0688030406A81892069FEF7C9F8E06882 +:105BF0008030406AC1892069FEF7CBF83FE0494C0C +:105C0000E0688030416A2069091DFEF728F9E068E4 +:105C10008030416A20690C31FEF72DF9E068803050 +:105C2000416A20691E31FEF730F9E1682069803150 +:105C3000FEF738F923E03B4CA06901782069FEF7B4 +:105C400061F9A06981882069FEF75EF9A069418841 +:105C50002069FEF75DF912E00DE000200090694632 +:105C60000190087801210843694608702D480069B1 +:105C7000FEF764F903E02CA1334805F06CFAFEF757 +:105C8000DEFD002803D128A1304805F064FA0C2D70 +:105C90000ED0072D0ED0012D0AD0002D08D0022DD8 +:105CA00006D020480021C068403041810121817325 +:105CB00003B030BD1B480021C0684030018203B0F2 +:105CC00030BDF0B5174C8DB02079C0077ED060791B +:105CD00000287BD16069C0780E2878D20100794411 +:105CE000097949188F44737306733D5DE25C73FD57 +:105CF0007334FCA5E06854210A5C2030417D01200A +:105D0000FFF7DFFE00284BD16069FEF7A6F8E168D7 +:105D10009E22505402223520425400204031887483 +:105D20008873EFE1D80000207372635C6C6C5F6D68 +:105D300061737465722E6300E8000020E21F00208A +:105D40000820002083060000C7060000CD060000E2 +:105D5000E0682030C17C0A297ED10021C1750D2167 +:105D60001DE0E0683321095C0E2975D1A421095892 +:105D700040884988814203D0FAA1FE4805F0EBF93A +:105D8000E0688030416A60692631FEF7A2F8E16878 +:105D900060698431FEF7ADF8E06811212030C174EC +:105DA000B0E1E1683320405C112855D180318C4648 +:105DB0004B6AF14810260022082168440E33B51AB8 +:105DC000ED18203DEF7F4770AD7F01E0A2E17AE161 +:105DD0008570801C491E921C0029F0D161464B6AD7 +:105DE00003A810260022082103301E33B51AED182F +:105DF000203DEF7F4770AD7F8570801C491E921C4F +:105E00000029F3D16846FCF746FA08AD8DCDE1686C +:105E100000260E664E660D4670318DC10126203576 +:105E2000EE75D64E8DC6D64805F09EFA1320E8745E +:105E300068E1E0683321095C112901D00E293AD1CB +:105E40004030007D002836D16069FEF773F8E168C4 +:105E50000B460A46803300E02DE0187200254031E1 +:105E6000CD748D73586A51884088884203D0BDA193 +:105E7000C44805F070F9E06801468030426A157048 +:105E8000826B1378002B03D0D920B6A1800033E0B9 +:105E90004B88D380836B027A1A71826B1572836B85 +:105EA0000B221A70806B4988418008E1E068332139 +:105EB000095C152902D00220607123E1014600250A +:105EC0004031CD748D73A42109584088498881429E +:105ED00003D0A4A1AC4805F03EF9E068014601E01A +:105EE0002CE094E080314A6A15708A6B1378002B9D +:105EF00005D071209BA1C00005F02DF9DFE003461D +:105F000040331E7D002E0BD01D754388D3808A6BD5 +:105F100015718B6B0C221A70896B40884880CEE01B +:105F20004388D3808A6B15718B6B01221A728B6B3D +:105F30000B221A70896B40884880C0E0E0685421C9 +:105F40000A5C2030017D0020FFF7BBFD00280DD149 +:105F5000E06854210A5C2030C17C0720FFF7B1FDC6 +:105F6000002803D16079012108436071607900281D +:105F70004CD1E0684030807D800715D46069FDF722 +:105F8000CBFFE1684031C8756069FDF7C7FFE16884 +:105F9000403108836069FDF7C6FFE16802224031A5 +:105FA0004883887D10438875E068014640318A7DCA +:105FB000D20716D10A7D2030017D0020FFF781FD38 +:105FC000002803D167A1714805F0C5F8E0680121F8 +:105FD000342211540623A02213544030817400212E +:105FE0000182E06801462031CA7C012A03D10022E7 +:105FF000CA744E210A54A421095840884A88824212 +:1060000004D1087806287DD1002008707AE0E06885 +:1060100054210A5C2030C17C0620FFF752FD002885 +:1060200003D160790121084360716079002869D14A +:1060300069466069FDF793FF68460078C107C90F9C +:106040006846017004D0E06801214030017703E028 +:10605000E068002140300177E06800254E210D54B2 +:10606000A421095840884988814203D03DA148486D +:1060700005F071F8E06802468030416A0D70816B6E +:106080000B78002B04D037A1424805F064F816E0E5 +:106090005388CB80816B6B460D71816B1B880B81A4 +:1060A0006B465B884B816B469B888B816B46DB889C +:1060B000CB81836B06211970806B51884180E06829 +:1060C0002030C5741EE0E06854210A5C2030017D58 +:1060D0000020FFF7F6FC002803D160790121084376 +:1060E0006071607900280DD16069FDF73EFEE168BE +:1060F0008922505405223420425400204031088225 +:1061000001208874E2680023916ED06E491C5841CA +:106110009166D0660DB0F0BDF8B5FAF770F9FAF7F0 +:1061200063F9FAF76FF8FAF711F9FAF7C4FCFAF71E +:1061300025F9194CE06820300079012801D1FAF7DF +:106140007BF9E068012502462032917D002908D1C3 +:10615000E178CB0701D1890703D59575012101F0BD +:10616000F9FB1BE07372635C6C6C5F6D617374654B +:10617000722E630021030000FFFFFFFF08200020B4 +:10618000212000205F03000083030000C303000000 +:10619000F1030000F6030000D8000020E07900269B +:1061A00000284FD100F06DFDF848FEF737FB0028BE +:1061B00048D06079002845D1E06854210A5C20303D +:1061C000417D0120FFF77DFC00283BD1E0680246BD +:1061D0008032117F002901D0022051E00346203394 +:1061E000D97C05292AD0E927FF000C292DD00D29BB +:1061F00029D0132943D01B7D012B4BD0052B42D036 +:10620000526A1378002B61D0528843889A425DD13C +:106210004030027D0020FFF754FC00287FD0E0686A +:10622000A42109580978891E062978D20A007A44DF +:106230001279921897443A3C7373658CD449D548C7 +:1062400004F089FFB6E00B201AE0F5F71AFF0C28DE +:106250007DD3E06808218030406A1E30F5F712FFD8 +:10626000002806D0E06804218030F5F70BFF0028F5 +:1062700003D1C749384604F06EFF032000E0062032 +:10628000FFF755FC96E00720FFF751FCE06820304F +:1062900006758FE00C20FFF74AFCE06801464030AD +:1062A000827D2A43827520310E7583E000200BE049 +:1062B0002030C17D00290AD0007E002803D1B449D6 +:1062C000B54804F048FF0A20FFF731FC27E0F5F756 +:1062D000D8FE0C2823D3E06808218030406A1E30A5 +:1062E000F5F7D0FE002806D0E06804218030F5F7ED +:1062F000C9FE002803D1A649384604F02CFF03202C +:10630000E2E74030807D800709D10C20FFF70FFCC9 +:10631000E068403046818573817D294381759B48C3 +:10632000FEF77CFA002845D0E06854210A5C203052 +:10633000C17C0020FFF7C5FB00283BD0E168AC2002 +:10634000405C002836D0E0690078002802D031E0B7 +:106350000820B9E7088D0A282CD905220A31206ABD +:1063600004F042FD002822D0E0688030816A08787D +:1063700000280CD00522491C206A04F035FD0028B5 +:1063800018D1E0688030806A0078002806D1E06883 +:10639000216A8030806A401C04F0CEFFE0688030C3 +:1063A000806A0178491C01700120FFF7C0FBE0689A +:1063B000A0300673E078C007E06802D040308680E5 +:1063C00003E040308188491C8180E0689C21095CA1 +:1063D000002908D154210A5C2030417D0120FFF7BB +:1063E00070FB002804D0E06840300189491C01811D +:1063F000E0793D21002804D0E0684030817045708C +:106400005AE0207A02280AD001280AD060790028B0 +:106410001AD0420701D4C2060AD51E21ECE7162184 +:10642000EAE7E0689E21095C40308170457043E0F6 +:106430000207E1D4C10705D1800703D45449574866 +:1064400004F089FE2A21D7E7E06802464032917BBA +:10645000002905D05389591C518191898B4213D24F +:10646000917C002905D0118A4B1C13829389994293 +:106470000AD21789D3889F4203D39C21095C002943 +:1064800002D191898F4203D322209070557013E07E +:106490003621095C0029918805D0994209D308204A +:1064A0009070557008E0062903D33E209070557017 +:1064B00002E05178002908D0E06801462031CE740E +:1064C0000E758E752570022101E02570002101F006 +:1064D00041FAF8BDF8B50C4616466946FDF710F9C5 +:1064E000002801D00020F8BD009800250246803029 +:1064F000816B0B78072B1CD0A71C0C2B29D00B2BE6 +:1065000034D0062B4CD01146A031087C0028EAD0AC +:10651000657012202070087C002808D0A2320D740B +:10652000108A6080508AA080087C0028F7D1012062 +:10653000F8BD002EFBD1657007212170816B0A2206 +:10654000A01C091D04F07DFC00988030806B057054 +:10655000EDE7002EEBD165700C212170816B8A88EC +:106560006280C988A180806B0570E0E7002EDED1D3 +:1065700065700B212170816B8A883A80CA887A8085 +:106580000989B980806B0570D1E70000E800002020 +:1065900064610100BE0500007905000032020000C0 +:1065A000002EC4D1657006212170816B8A883A80E3 +:1065B000CA887A800A89BA804A89FA808A893A81A7 +:1065C000CA897A81806B0570B1E7FE48007801289E +:1065D00001D00C2070470020704770B5F94C05467B +:1065E0002078002803D0F849F84804F0B4FD0020D2 +:1065F000A5616072012020702078012803D0F24943 +:10660000F34804F0A8FD70BDF8B5EE4C21780129DF +:1066100001D00C20F8BDE0608030807AFEF707F8EA +:1066200000283AD0E0688030807AFEF757F90028D9 +:1066300033D0E0688030807AFEF7CCF800282CD088 +:10664000E0688030807AFEF708F9002825D0F9F755 +:106650008AFE0026E6710120F9F749FCE068014650 +:1066600040318A7B002A03D04A898B899A4211D211 +:106670008A7C002A03D00A8A8B899A420AD20B8923 +:10668000CA88934206D236231B5C8988002B06D029 +:10669000914206D30120A0703BE01220F8BD0629EC +:1066A000F8D2A6701330F9F7F0FDE0680F30F9F773 +:1066B0002EFD0320F9F754FEE06805462030017EE8 +:1066C000002902D1C07D002809D0294670318EC929 +:1066D000C0488EC02946C048803104F045FE98204D +:1066E000405BA91C401C82B228462830FDF772FD91 +:1066F000002803D0B449B94804F02DFDE0684030CB +:106700000078F9F716FDF9F727FE01210020F9F7C7 +:106710002BFDE67026716671A6712672022020702C +:10672000E06880300683F9F729FE0020F8BD10B537 +:10673000F9F719FEA34C2078022803D0F9F71EFEC2 +:106740000C2010BDA078002802D0FFF7E5FC17E070 +:10675000F9F736FEFFF7F0F8E068203000790128FD +:1067600001D1F9F772FE607A002809D0012809D01A +:10677000022805D0032805D09349994804F0EBFC82 +:10678000002010BDECF744FCFAE770B505468030F8 +:10679000018B2C46491C01834034A188491CA180EF +:1067A000A17B002902D06189491C6181A17C00295B +:1067B00002D0218A491C2182007F002807D1352080 +:1067C000415D227D0120FFF77CF9002802D020895D +:1067D000401C2081284600F0EBF9002070BD79496B +:1067E00048727047774A1162D0617047F8B5754CAE +:1067F0002078032803D074497A4804F0ACFCE1689F +:1068000004272031887A0025002803D08D72207952 +:1068100038432071206901260278D2439207002A6A +:106820001FD1CA7A002A1CD1CE72217902221143CB +:106830002171FDF79AFA062802D00B2811D10AE03F +:10684000E06801462030C27C132A0AD100228A6601 +:10685000CA66067605E0E0682030C17C0D2900D1CB +:1068600005762079400704D5E0682030407D022875 +:1068700005D06079002802D1A079002802D0FFF766 +:106880004BFC2AE05848FEF73CF8002801D0657020 +:1068900002E0667055486061E0682030007E0028A4 +:1068A00011D05348F9F76FFD4A480576E268916EBA +:1068B000D26E426101614E4A6169FAF7CAF801205D +:1068C000FAF7D6F804E06069F9F75DFDFAF7F3F836 +:1068D00002210020F9F7D2FD2770207801280CD082 +:1068E000607A002809D0012807D0022806D00328A2 +:1068F00004D035493F4804F02EFCF8BD0120F9F7DB +:1069000073FEF8BDF8B52F4C05462078042803D057 +:106910002D49394804F01FFC002D71D0FAF7E3F837 +:106920000125002812D1E0682030017E00290DD019 +:1069300061694A78D20609D00978C07B0907C90F76 +:10694000814203D1E571FFF7E7FBACE0E06820305E +:106950000079012811D1F9F76FFDE168881C283111 +:10696000FDF728FD002808D0E068B22142880A52CD +:106970003121095CA030017505746069002600783A +:106980004007C10FE0682030827B914255D0407BA8 +:10699000002852D002280FD1FDF780FE002803D135 +:1069A0000949164804F0D7FBE2680023106E516EC7 +:1069B000401C594151661066E06820304673C17A28 +:1069C00001291EE0D800002064610100EF070000EB +:1069D000FB07000008200020212000203A080000CA +:1069E0007A080000AF080000EC000020C01F002063 +:1069F000E21F0020F3080000FB080000FD05000076 +:106A0000B1E014D1C6722079082108432071FDF746 +:106A100046FF002803D1FE49FE4804F09CFBE268D3 +:106A20000023106E516E401C594151661066E0689B +:106A30002030817B012948D08573606901788C46BC +:106A40000907CF0FE1680A462031CB7B9F420CD16A +:106A50006746BF07BF0F012F4FD0022F4DD0032F26 +:106A600035D06079042108436071E0782843E070F4 +:106A700020690078C00604D460690078C00600D49C +:106A800061E720790028FBD160780028F8D100F078 +:106A900056FF0028F4D060790028F1D1A0790028B1 +:106AA000EED1FEF749FF207801280DD0607A00284A +:106AB0000AD001285CD0022806D0032858D095209F +:106AC000D349000104F047FBF8BD8673B5E7FDF735 +:106AD000D3F800280CD0E068203085722179294352 +:106AE0002171C17B012901D1C673BEE7C573BCE723 +:106AF0006079102108436071B7E74078C7062CD051 +:106B00006378002BB1D1C006C00E1B28F0D84032EC +:106B1000127DC97C0520FEF7D4FF002804D0A0799F +:106B200008210843A071A0E7E07804210843E07041 +:106B3000FDF70EFF002803D1B549B74804F00BFB61 +:106B4000E0680023816EC26E491C5A41C2668166AC +:106B50002030C17B0129C9D1C6E7012B01D0CD73FB +:106B600083E7CE7381E7E07802210843E070EAE62C +:106B70000120F9F739FDF8BD10B5A84800780428C0 +:106B800003D0A349A64804F0E6FAFFF7C5FA10BD02 +:106B900036210A5C40308188091D002A04D0C08853 +:106BA000814203D3012070470629FBD200207047A1 +:106BB000F8B5054606462036F07C2C460027803482 +:106BC000072820D1288DE18D401C884258D1A16A28 +:106BD00028460A30491C04F0AFFB01220221284656 +:106BE000FDF7ABFAF77401215E204155A06A0078E9 +:106BF000002804D1A1208649800004F0ACFAA16AE3 +:106C00000878401E0870F07C082839D1616A288D08 +:106C10008988401C884233D1A06B0178002904D0B8 +:106C20007B49804804F097FA15E06988C180606A62 +:106C3000A16B40890881606AA16B80894881606A84 +:106C4000A16BC0898881A06B0771A16B07200870B8 +:106C5000A16B68884880012211462846FDF76DFA2D +:106C60000321284600F076FE606A698840888842E1 +:106C700003D067496C4804F06EFA606A0770F774D5 +:106C8000F8BDF8B5654C6079002875D120790126EA +:106C900040070025002815DAE0682030C07C022873 +:106CA00002D0052807D102E05949604801E058495F +:106CB0005F4804F050FAE0682030417D022901D19C +:106CC00026724575207908278007002840DA607908 +:106CD00000283DD12069C0780D2875D20100794483 +:106CE000097949188F4449350681FCFCBB1722FC01 +:106CF0005B71CA00E06854210A5C2030417D0120AC +:106D0000FEF7DFFE002823D1E0680321352211546D +:106D100040308573E2E0E06854210A5C2030017D58 +:106D20000020FEF7CEFE002870D1DDE0E06854219F +:106D30000A5C2030C17C0020FEF7C3FE002803D18E +:106D400033493C4804F007FAE06809212030C17457 +:106D5000CAE0E06854210A5C2030C17C0020FEF7C4 +:106D6000B0FE002803D12A49334804F0F4F9E06862 +:106D700007212030C174B7E0FBE0E06854210A5CD1 +:106D80002030C17C0020FEF79CFE002803D1204962 +:106D90002A4804F0E0F9E0682030C774A4E0E06815 +:106DA00054210A5C2030C17C0020FEF78AFE0028B6 +:106DB00003D11749224804F0CEF9E06853210E545C +:106DC0000A212030C1748FE08AE0E0682030C07C66 +:106DD0000D2803D00E491B4804F0BDF9E06854218A +:106DE0000E540C212030C1747EE0E06854210A5C0E +:106DF0002030C17C0020FEF764FE002828D1E06826 +:106E00004030007D002823D101491DE064E00000EE +:106E1000646101000E06000057060000D800002043 +:106E20005809000091020000A50200006A04000059 +:106E30006E040000AC040000B1040000B6040000C1 +:106E4000BB040000C20400009920C00004F083F9D4 +:106E5000E06853210E540E212030C17444E0E068F4 +:106E60002030C07C132804D04D204349000104F099 +:106E700072F9E06815212030C17435E0E068A42182 +:106E8000095843884A889A421CD10978062919D1A1 +:106E900054210A5C2030C17C0020FEF712FE00283D +:106EA00003D13549354804F056F9E06801464031D0 +:106EB0008A7D920702D42030C67403E08D7380303F +:106EC000406A0570E06854210A5C2030017D002092 +:106ED000FEF7F7FD002807D0E0684030857403E036 +:106EE0002549274804F037F9207900070AD5607949 +:106EF000002807D1E0682030417D032902D102211A +:106F000021724575FEF7DDFEA07900072ED5E068F9 +:106F100054210A5C2030C17C0520FEF7D2FD0028F8 +:106F20000BD0607938436071E0688030816B0878FD +:106F30000B2800D10020087018E0E07804210843F5 +:106F4000E070FDF705FD002803D10B490D4804F062 +:106F500002F9E0680023816EC26E491C5A41C26684 +:106F600081662030C17B012904D0C673E068FFF739 +:106F70001FFEF8BDC573F9E764610100DC04000081 +:106F8000F6040000EA020000F7B582B00646039856 +:106F900017468188FE48FE4A41430398039D008BB3 +:106FA00000245043009080352A7C002A0CD0F948F8 +:106FB000012A40683CD0022A1FD0032A38D0F6A10B +:106FC000F94804F0C8F84BE0002F04D17D20F2A16D +:106FD000C00004F0C0F8EF4C6068002803D1EEA1B7 +:106FE000F24804F0B8F86068A168001D0918F04A7A +:106FF000009880180C18012018E0791E084303D16E +:10700000E5A1EC4804F0A7F8EB48016800980C18DB +:10701000002F0AD0DF484168E8480818A04204D988 +:107020008120DDA1C00004F096F80320287415E04B +:107030000C46002F12D0D74F002806D178780028B0 +:1070400003D0D5A1DE4804F086F8DC48796808183A +:10705000A04203D9D0A1DB4804F07DF8002C03D175 +:10706000CDA1D94804F077F821466869F5F7D9FF32 +:10707000686100203070012434716869B060039841 +:10708000FFF786FD002801D0747104E0287C0128F8 +:1070900005D003207071CD48F06005B0F0BD02202E +:1070A000F8E7F0B5054687B00F46012000F01BFD5C +:1070B000C4B20B2000F017FDC0B2844204D0FF2000 +:1070C000B5A14D3004F047F8012000F00CFDC4B22A +:1070D000182000F008FDC0B2844204D0FF20AEA109 +:1070E0004E3004F038F83846B94F6C1E6900CD199F +:1070F0000026403D09287DD20100794409794918CC +:107100008F44044150504CE9E9E9A0000B2C04DB0A +:10711000FF20B0A1213004F01EF8E88F6946FCF78B +:10712000EFFA002804D0FF209BA1563004F013F89A +:107130000B2C04DBFF20A7A1213004F00CF80099F0 +:10714000E88F4988884204D0FF2093A1583004F08A +:1071500002F800988030007C002804D1FF208EA126 +:10716000593003F0F8FF8B484660467086600098FF +:10717000FFF74AFA002804D0FF2087A1603003F00F +:10718000EAFF07B0F0BDFFF7D2FA0028F9D0FF20E0 +:1071900081A1663003F0DFFF07B0F0BDF9F727FAF1 +:1071A00007B0F0BD0420C04300F09DFCC6B219201A +:1071B00000F099FCC0B2864204D0FF2076A1723064 +:1071C00003F0C9FF0B2C04DBFF2082A1213003F068 +:1071D000C2FFE88F6946FCF793FA002804D0FF202D +:1071E0006DA1763003F0B7FF0B2C06DBFF2079A1F1 +:1071F000213000E06FE003F0AEFF0099E88F49888E +:10720000884204D0FF2064A1783003F0A4FF0098E6 +:10721000FFF7BBFA002804D0FF205FA17B3003F00A +:107220009AFF009C0022214602A8FFF7ADFE8034A1 +:10723000A07E02A9F6F7DAF80099088D401C0885AF +:1072400007B0F0BD0B2C04DBFF2062A1213003F05E +:1072500082FFE88F6946FCF753FA002804D0FF202C +:107260004DA1863003F077FF0B2C04DBFF2059A1E2 +:10727000213003F070FF0099E88F4988884204D0DC +:10728000FF2045A1883003F066FF00988030007C25 +:10729000042804D0FF2040A1893003F05CFF009C4B +:1072A00080342674A57E4F4F681E0B2804DBFF2018 +:1072B00048A1273003F04FFF4548690008184038BF +:1072C000C787A07EF5F700FC4748A6760078EBF765 +:1072D0001BF807B0F0BDFF202FA193304FE770B52A +:1072E000424C0646E08B0025401C80B2E0832378A8 +:1072F0000A46002B09D021464968042B0BD0052BE8 +:1073000017D03D2024A1000102E0ED2022A1800041 +:1073100003F021FF14E00A2801D3022000E003203B +:107320007071002A0BD00320226900F0F5FB05469E +:1073300006E002207071002A01D02D4D00E00D46BC +:1073400029462069F5F76DFE002120613170012189 +:107350003171B060A068FF303130F06070BDF0B5C1 +:10736000074685B00E46012000F0BDFBC4B20B20DD +:1073700000F0B9FBC0B2844204D0FF2006A19E30C9 +:1073800003F0E9FE012000F0AEFBC4B2182031E0AA +:10739000E2040000302000207372635C6C6C5F6C50 +:1073A0006D2E6D302E6300001C040000E903000008 +:1073B0005504000003040000000100205F040000E9 +:1073C00016040000170400001F040000F60400006B +:1073D0005C2000207372635C6C6C5F6C6D2E6D3092 +:1073E0002E630000FFFF0000FC0000203C20002076 +:1073F000B80B000000F077FBC0B2844204D0FF203D +:10740000FD499F3003F0A7FE00250120FB4C092E0B +:1074100070D231007944097949188F44041A3737FA +:10742000336B6B18520060732073607800280ED1A4 +:10743000F348456085602573A068C338FDF791FC6B +:10744000002804D0FF20EC49B33003F084FE05B0DF +:10745000F0BD6178002909D0207B002801D1FDF71B +:10746000C2FD6573F5F796FA05B0F0BDA073FDF7A0 +:1074700000FD0028F8D0FF20DF49C73003F06BFE85 +:1074800005B0F0BDF9F7B3F805B0F0BD0420C04376 +:1074900000F029FBC4B2192000F025FBC0B28442E1 +:1074A00004D0FF20D449D53003F055FE012200213D +:1074B0006846FFF714FF69463846F5F797FF05B0B1 +:1074C000F0BD2078052804D0FF20CB49E13003F03F +:1074D00042FE207F002804D1FF20C749E23003F09C +:1074E0003AFE25772570207DF5F7EEFA257505B073 +:1074F000F0BDFFE7FF20C049ED30A6E7F0B5BF4C77 +:1075000087B020780026042805D02078052802D0EE +:107510000C2007B0F0BD01276770607B00250028B4 +:1075200027D072B6607B002808D0A07B002805D049 +:10753000FDF759FD6573A573F5F72CFA62B6207D4A +:10754000F6F782FD002827D0207F002808D0257775 +:107550002078052803D0A849AA4803F0FCFD0C2692 +:1075600065702570207DF5F7AFFA2575304607B0B8 +:10757000F0BD207D00900320694608734873F5F73D +:10758000BEFA04900020C043694605900F7202A91C +:107590000098F5F72BFFD2E720BFD0E7F0B597486A +:1075A00083B00078002801D0FFF7A8FF944F012096 +:1075B0003870FF26944D2D36002405E00B2C03D3A4 +:1075C0009249304603F0C7FD204601A9FCF798F820 +:1075D000002838D101988030007C002833D00B2C53 +:1075E00003D38A49304603F0B6FD2046AC422ED084 +:1075F0006946FCF785F8002803D08449844803F0E5 +:10760000AAFD00988030807EF6F71EFD002822D06B +:107610000098002180300174847E0C2C04D3FF205C +:107620007A49273003F097FD7A48610008184038FE +:10763000C58700988030807EF5F746FA00990020D3 +:1076400080318876B8E7641CE4B2032CB6D30020FE +:10765000387003B0F0BD20BFD3E710B500786E4C92 +:1076600000280FD001280CD068496C4803F073FD46 +:10767000A0686B49884203D364496A4803F06BFDF4 +:1076800010BD6948A060F3E710B55D4900220A709B +:10769000614C207059480270427002770273427345 +:1076A0008273826102752030574B0380052143802D +:1076B0008380001D491EFAD1100004D0002A04D096 +:1076C0005948A06005E0A26003E05049534803F028 +:1076D00042FDA0685249884203D34C49514803F007 +:1076E0003AFDFFF75BFF10BD70B5444C0E462178A4 +:1076F00084B01546002902D00C2004B070BDA061F2 +:107700008030007C002803D03B49484803F023FD2B +:107710004748464345434748ED1C30186660A5601E +:10772000854200D82846A0603549002088600521A0 +:10773000217060702077E0833F48F5F771F920757C +:10774000002803D12C493D4803F005FDF5F7D7F992 +:107750002061002201216846FFF7C1FD207D6946B6 +:10776000F5F744FE002004B070BD08B50020C0430A +:107770006946088021480078002801D0002008BD13 +:107780000846FBF7F5FF0028F9D0012008BD10B529 +:107790001A4C84B02278002A02D00C2004B010BD0C +:1077A000234A51435043C91C224AA160606080189B +:1077B000814200D80846A06000206070042121703A +:1077C000E0831D48F5F72CF92075002803D10A49FC +:1077D0001B4803F0C0FCF5F792F91A49F5F721FCB4 +:1077E0002061002201216846FFF779FD207D69466E +:1077F000F5F7FCFD002027E0987301003C200020F5 +:107800003020002076020000FFFF0000D47301004A +:10781000190300005C200020FC000020510500003E +:107820006A1800005A050000C40900008B0200001D +:1078300071020000B3FBFFFF5F73010097020000BD +:10784000C6020000B80B000004B010BD10B5E14C3A +:10785000A1690160FFF752FE0021A16110BD70B562 +:10786000DC4C84B02078052802D00C2004B070BD18 +:10787000A069002803D1D849D84803F06CFCA0695E +:107880008030007C002803D0D349D54803F063FC46 +:10789000A0698030807E002803D0CF49D14803F012 +:1078A0005AFCD148F5F7BCF8A1699A225054054614 +:1078B0004E88401E0B2804DBFF20C749273003F009 +:1078C0004AFCCA49680040184038C687A069803021 +:1078D000807E002803D1C049C54803F03CFC01224A +:1078E0006846A169FFF750FBA06969468030807E39 +:1078F000F5F77CFD0020A06104B070BD10B5BD4956 +:107900004C68983400280ED001280FD0022811D0DE +:107910003520B949000103F01EFCAE488068A04242 +:107920000BD9012010BDFF347934F6E7B120800077 +:107930002418F2E7FF346134EFE7002010BDAD48B2 +:107940004178002902D10078002801D0002070473A +:107950000120704770B504460422A84E803484B0DC +:1079600000290DD0012923D0022907D0032921D0D5 +:10797000A149A34803F0EFFB04B070BD227410E0EE +:1079800005469C4800780028F8D12946012268461F +:10799000FFF7FAFAA07E6946F5F728FD288D401C0E +:1079A0002885F4F7F7FF3078EAF7AEFC04B070BD35 +:1079B000032010E08188934A5143934A1160616A21 +:1079C0000A8902838A7982754A8982808A89C2807B +:1079D000C98901810220207404B070BDF0B5874EC2 +:1079E0000146307800257B4C85B0002908D001295C +:1079F00016D0022942D0032958D07F49834839E064 +:107A0000E583EAF781FC6078002849D1002211461D +:107A10006846FFF764FC207D6946F5F7E7FC3FE028 +:107A2000744F20697968774B401879494218A069EA +:107A300081884088594300F06FF8B1680546884254 +:107A400005D2A1696F4A88884243551903E06D4900 +:107A500003F060FAA1690883A06905218175008B94 +:107A600068494843281A6B49B860884204D32520E6 +:107A70005949400103F06FFB05B0F0BDE583EAF71B +:107A800043FC01202077A0692169803041610574A1 +:107A9000FFF7E5FE002803D04F495F4803F05BFB8A +:107AA000F4F778FF6573A57305B0F0BDEAF72CFC19 +:107AB00005B0F0BD704710B54E4A00290ED001291F +:107AC00006D0022906D04C49544803F044FB10BDAF +:107AD000401E03E05178491C5170001F506010BDDA +:107AE0003C48007870478107C90E00280BDA000770 +:107AF000000F083880084A4A80008018C069C840D2 +:107B00000006800F70478008464A80008018006891 +:107B1000C8400006800F7047F7B582B00D46064694 +:107B2000414F002406E00B2C04D3FF202A492D30BE +:107B300003F011FB204601A9FBF7E2FD00280ED15E +:107B400001988030007C002809D00B2C04D3FF2042 +:107B500021492D3003F0FFFABC4204D006E0641C3A +:107B6000E4B2032CDFD3002005B0F0BD6946204607 +:107B7000FBF7C6FD002803D017492C4803F0EBFAA9 +:107B8000A64204D1DD201449800003F0E4FA28481D +:107B9000341B44430098803041690498F6F7C8F9D3 +:107BA000041908D5281B66422946401E03F0C0F977 +:107BB0006843841B05E02946204603F0B9F9684371 +:107BC000241AAC4203D904491A4803F0C4FA2046E7 +:107BD00005B0F0BD3C200020D4730100E702000096 +:107BE000E9020000EB020000A37001005C2000200D +:107BF000EE0200003020002098730100FC000020FD +:107C0000ED040000E204000000010020190500005E +:107C10004E0600006A180000B3040000360500009C +:107C200000ED00E000E400E0FFFF00007103000051 +:107C3000770800008903000070B5F84E0446B0795B +:107C40000025012805D0F64E307A01280CD00020FE +:107C500070BD002915D1657014202070F149A01C59 +:107C600003F082FBB5710CE000290AD16570132086 +:107C700020701C22EC49A01C03F0E3F80120A07145 +:107C80003572012070BDE648007A002802D0E7482E +:107C9000808D7047E6487047F8B5E64801780029BE +:107CA00002D00C263046F8BD0026E04D34462E7535 +:107CB0006E75EE752E76AE75DF496E734E73D84FC6 +:107CC0007F217E718170687E002804D0F8F7ABFBBD +:107CD000F8F754FF6C763C72D848FBF711FED84891 +:107CE000FBF70EFEDEE770B5D24A00251570CC4ECC +:107CF000D44B35711966D8651078002805D0FF205F +:107D0000D1A17A3003F027FA70BDC84C257565758E +:107D1000E5752576A575C8486573457375717F202F +:107D20009070607E002804D0F8F77DFBF8F726FFFE +:107D300065763572C148FBF7E3FDC148FBF7E0FD0E +:107D400070BDBA48007D704710B5B849C87B897BC3 +:107D500042078307D20FDB0FC007D218C00F1018DD +:107D60004000052911D20A007A44127992189744EA +:107D7000090509020700B849085A10BDB74810BDE7 +:107D8000B74900E0B749085A10BDFF20AEA19A30AC +:107D900003F0E1F9002010BDA448B349008A48432C +:107DA00070479F488079002800D001207047F8B5BF +:107DB00006469E4C407BE07330790027A073012873 +:107DC00025D0308820829648B37B83719D4DA7488B +:107DD0002970114603F0BBFAB0796873F11DA4480D +:107DE00003F0B5FA607B0126002800D06675924842 +:107DF000407B002800D0A675A07B05284DD201004D +:107E00007944097949188F440409262B09002782EF +:107E1000D9E700218948FBF778FD25E00121874853 +:107E2000FBF773FDE91D8548FBF7A4FD687B00287F +:107E300007D001280AD0FF2083A1E83003F08BF996 +:107E400012E000217D48FBF7A6FD0DE001217B48F3 +:107E5000FBF7A1FD08E006217848FBF756FD03E09B +:107E600002217648FBF751FDE7752776691C7348B8 +:107E7000FBF774FD29787148FBF781FD04217048F8 +:107E8000FBF743FD691C6E48FBF768FD29786C48D9 +:107E9000FBF775FD26750020F8BDFF206AA1F230C2 +:107EA000CCE770B5614C012525765D4A127A002A2F +:107EB00001D03A2070BD634A13780022834205D175 +:107EC000E2756A4803F043FAE57500E02276002087 +:107ED00070BD70B50446554D0020A8752246654812 +:107EE00002F0AFFF544844730120A87570BD4C499F +:107EF0000871704710B54D4C0022627560730246E0 +:107F00005D4802F09EFF0120607510BD4449487134 +:107F10007047F8B5474D287800282CD1434C207D78 +:107F2000002828D0F8F71FFA0026A674E6746E70B1 +:107F30003046F8F715FA0020F7F7D9FF4F48F8F761 +:107F4000E6F84F48F8F7A1F9F8F73AFAE07B01278D +:107F5000C107002902D0A17CC9070ED0810712D524 +:107F6000A17C89070FD42620F8F7E3F8A07C022132 +:107F70000843A07413E00C20F8BD2520F8F7D9F8C9 +:107F8000A07C38430AE0400709D5A07C400706D40E +:107F90002720F8F7CEF8A07C04210843A074F8F756 +:107FA000DBF901210020F8F7DFF80F210520F8F7B1 +:107FB00022F8244D2978681CF8F711F8A07B0128D5 +:107FC0000AD0042808D0607D002805D0627B2A49A9 +:107FD0001A48FBF7FAFC6675A07D002806D0164803 +:107FE0002449427B9830FBF722FDA675286E017864 +:107FF000002903D00178001DF8F734F8E86D017806 +:10800000002904D01F4A401CF8F797FD6776F8F75F +:10801000B5F90020F8BD074948607047F4200020FA +:10802000D4200020FB200020DE200020B4200020EF +:10803000FFFF000008010020942000200421002000 +:108040002C210020742000207372635C6C6C5F61D3 +:1080500064762E630000000066B401009A89130064 +:108060006EB401005EB401007102000075200020B2 +:108070007B20002082200020A220002059B4010093 +:1080800056B4010057210020F8B50126FE4C0546E4 +:10809000002824D0E07B2146C207897C002A01D039 +:1080A000CA070BD082070FD58A070DD42620F8F710 +:1080B00040F8A07C02210843A07410E02520F8F7C6 +:1080C00038F8A07C3043F7E7400708D5480706D4C6 +:1080D0002720F8F72EF8A07C04210843A074E07C48 +:1080E00000280AD0A07B012804D14B20E7490001D9 +:1080F00003F031F800F0BDFAF8BD002D0CD00221DC +:108100000020F8F731F8E2480079032801D001286F +:1081100002D10220F8F768FAE07D002700280AD093 +:10812000DC4DDD48691CFBF719FC691CDB48FBF7DB +:1081300015FCE7752776D848F8F725F9A07B0528C0 +:108140000CD201007944097949188F440202020BCC +:10815000020001210846F8F791F903E0CB49D04825 +:1081600002F0F9FFE07BA17C884303D1A07B0128CA +:1081700003D0E674CB480670F8BDA774FAE710B5D3 +:10818000F8F7F1F8C7480078002816D1BE48007DFE +:10819000002812D00020FFF777FFBD4800790028A3 +:1081A00009D0012815D0022805D0032811D0B749DD +:1081B000BD4802F0D0FF002010BDF8F720F9F8F715 +:1081C00013F9F8F71FF8F8F7C1F8F8F7D7F80C200B +:1081D00010BDEAF71DFFEEE7B24901204870704775 +:1081E000F8B50024FAF7AAFE002822D0FF202D308F +:1081F000F7F7B7FFAB4D2878A54F01281CD0022810 +:1082000001D0032831D0CF20A049800002F0A3FF85 +:10821000287800280CD03879002809D0012807D008 +:10822000022835D0032833D09849A04802F093FFA4 +:10823000F8BD00F01EFAF8BD934EB07B032814D0B1 +:10824000707E002803D0F8F788FCF8F7E4F8984827 +:10825000F8F799F8B07B012812D0042810D0B8792B +:10826000012806D0032804D004E00120FFF70CFF0A +:10827000CEE7102421460E2001430020F8F7FEF837 +:108280007879012801D1F8F7E0F802202870BFE7DB +:1082900028780228CFD10120F8F7A6F9F8BD70B5EB +:1082A0007B48804C4079012808D18248F8F7D6F8FD +:1082B000002801D17F20A070F8F7BEF8724D687ECB +:1082C000002803D0F8F7AFF8F8F758FCFAF736FEB5 +:1082D00000280BD02078022804D0DD206B498000D4 +:1082E00002F039FFA87B012803D006E000F0C1F9B5 +:1082F00070BD99208000F7F734FF0120FFF7C4FE1E +:1083000020780028F4D020780128F1D05F496A480D +:1083100002F021FF70BDF0B5044689B00020069040 +:108320000190F7F7F1FE03905E480078022803D031 +:108330005649624802F00FFF554D6879012809D16E +:108340005C48F8F78BF8002802D156497F208870E6 +:10835000F8F772F85648FBF7FDFA4B4E0746002C2B +:108360006FD05348FBF700FC00286AD0F7F740FEB7 +:10837000002866D0707E00280AD00524641EE4B26E +:10838000F8F71DFC022811D0012800D00020019030 +:10839000474A4B4CD01C0290062F52D238007844EA +:1083A000007900188744B4B4B409B44E002CE5D168 +:1083B00044A1484802F0CFFEE8E7B07B012840D056 +:1083C00004283ED001990398084304D1A8790028D5 +:1083D00001D0022835D1687901281AD1A079002866 +:1083E00017D10120A07110784006C00FE0713A4803 +:1083F000029902F0ACFF2B4C384FA0787F2804D1B3 +:10840000532030A1000102F0A6FEA07838707F2032 +:10841000A0702248F7F7B7FF22480321017028799E +:10842000002877D0012808D0022873D0032804D070 +:1084300024A12B4802F08FFE6CE00120F8F7D4F85D +:1084400068E065E01348D178C07981424AD111488B +:108450001179037A994245D15179437A994241D1B0 +:108460009179837A99423DD1D179C37A994239D1B0 +:10847000117A037B994235D11178407B4906C90FA7 +:1084800081422FD101212EE0B4200020488001003C +:10849000D420002074200020042100202C21002062 +:1084A000DE04000008010020D1020000510300009A +:1084B000542100200A01002083030000C1030000B2 +:1084C000F42000207372635C6C6C5F6164762E63D1 +:1084D00000000000AB030000FC200020022100206F +:1084E000090400000021B07B012801D0042801D13B +:1084F00000290AD100280BD101990398084304D11F +:10850000A879002801D0012802D1307E00281FD090 +:1085100001200690707E002803D0F7F784FFF8F75B +:108520002DFB0698002802D00120FFF7ADFD73480F +:10853000017800290AD00178012907D000780328A2 +:1085400004D049206E49000102F005FE09B0F0BDDB +:108550006A486C4F4068397BC173797B0174B97B81 +:108560004174F97B8174684909784906C90FC1765D +:108570001C30029902F0EBFE6048397C4068C174FF +:10858000797C0175B97C4175F91E897D81750299E7 +:108590004A7D0B7D110219430183F91E8A7E4B7EB1 +:1085A00012021A438280029A537E177E1A023A43BD +:1085B000C2808A7F4B7F11021943018153490A30DF +:1085C00002F0BAFE52480179CA064C49D20E4968F7 +:1085D0008A7600794009C0310871287A002803D0D2 +:1085E00047494C4802F0B7FD0020A87243484B4968 +:1085F00047687888B085F87EE873B88B2882F88B56 +:108600006882388CA88244480078A875444802F0F3 +:108610009EFEB888F087F888208038896080C0374F +:10862000387920710198002860790BD00121084326 +:108630006071F8F7DDFA61794000C907C90F01439D +:10864000617102E0400840006071012028722B4CEB +:1086500000202070F7F7D3FEF7F7C6FEF7F7D2FD3C +:10866000F7F774FEF7F78AFE01206168FAF785FDD7 +:1086700050E7F8B5F7F7C3FEF7F7B6FEF7F7C2FD18 +:10868000F7F764FE274E0027707E002804D0F7F726 +:10869000CAFEF8F773FA7776184D2F70F7F76EFE6B +:1086A000B07B012804D000210846FAF766FDF8BD2A +:1086B00000210220FAF761FD1B4C207A002803D02C +:1086C0000F491A4802F047FD68780028EFD0124899 +:1086D000417BE1730078A0751549164802F037FE1A +:1086E0000E490F4802F033FE3C20A07268684088B3 +:1086F000B085012020726F70F8BD000008010020D5 +:10870000C48401005721002054210020732100203F +:10871000742100203D0400007420002075200020FA +:10872000EB200020B4200020D42000204F020000C5 +:108730007B200020E4200020F8B5FBF7FBFF044677 +:10874000FCF7BFF8FE4E054670692030407B0028DC +:1087500026D0012844D0022846D003284DD0FF203F +:10876000F8A19C3002F0F7FCB069F72201781140C3 +:10877000017072692032937BDB071B0F1943FB23C7 +:1087800019400170D37BDB075B0F19430170577BE6 +:10879000EF23022F3CD0012F3FD0032F41D046E0E2 +:1087A000EC48FCF76DF8002804D0716903202031F3 +:1087B0004873D9E7E748FBF74DFF002804D07069FC +:1087C0005321095C002907D0E248FCF700F87169E1 +:1087D000012020314873C7E7022120304173C3E7ED +:1087E000DC48FBF7F4FFBFE7DA48FBF733FF00286C +:1087F000BAD1FF20D3A18E3007E0D648FCF740F86D +:108800000028B1D1FF20CFA1963002F0A4FCABE745 +:10881000012C08D8002D06D009E06D1E2C4302D192 +:1088200005E0002C03D019401023194300E0194043 +:108830000170D17D002915D0517B012912D0C64885 +:10884000F7F7A1FDC548002101767269116E526EDD +:1088500042610161C049B269F8F7FBF80020F8F7FE +:1088600007F903E0F7F78FFDF8F725F9B06900780D +:10887000C00606D4F0690078C00602D4F07900285A +:1088800006D0B079002803D101210846F7F7F6FD9C +:10889000032030703079002803D1F7F791FD0120D3 +:1088A0003071F8BD10B5A649002348690246203052 +:1088B000C37483750120412398548032927F002A2B +:1088C00003D008700021022001E000210320FAF704 +:1088D000D2FB10BD06281AD202007A4412799218EF +:1088E00097440205090D101000290ED00FE0891ED3 +:1088F00002290AD90BE0891F012906D907E00829B6 +:1089000003D004E00B390B2901D801207047002067 +:10891000704730B5044683B08E48FBF77FFF0028D0 +:1089200004D1F52087A1C00002F015FC844DA86990 +:10893000FBF75AF90321A869FBF777F9A869EF2239 +:108940000178114001702146FBF7D8F90E2C5BD25B +:1089500020007844007900188744565606561F5A5E +:108960005A175642565A312B75485D224169525C5E +:10897000002A04D006218069FBF76DFA48E0C03177 +:10898000C9798069FBF767FA42E06D4841698069FF +:108990008031497AFBF7D0FA3AE0694D6969A869F4 +:1089A000B031FBF791FA6969A8698431FBF798FA4D +:1089B0002EE0634806218069FBF7BAFA28E0604D93 +:1089C00028690178A869FBF79DFA28698188A86958 +:1089D000FBF79AFA28694188A869FBF799FA17E02A +:1089E000002000900190564841694031097F0029DC +:1089F00005D06A461178012211436A461170694612 +:108A00008069FBF7A7FA03E04EA1554802F0A3FBEB +:108A1000FBF715FF002804D17F204AA1000102F0D6 +:108A20009AFB0C2C0AD0072C06D04548002140693F +:108A3000403041810121817303B030BD40480021A5 +:108A400040694030018203B030BDF0B53C4D064670 +:108A500068698DB020300079012801D1F7F7ECFC6E +:108A60000024012E1ED168692030017E002902D128 +:108A7000C07D002801D0F8F71EF8F7F7C0FCF7F723 +:108A8000B3FCF7F7BFFBF7F761FCF7F777FC687902 +:108A9000C006686902D58030048703E08030018F0A +:108AA000491C018768790226C107002901D1800786 +:108AB00013D568692030817D002902D0032907D0B1 +:108AC0000BE00121817500210120FAF7D4FA04E0BE +:108AD000867500210120FAF7CEFA68692030817D81 +:108AE000012903D16979090700D586751448807A70 +:108AF000002861D100F015FF1648FBF78FFE002813 +:108B00005AD00F4D287A002856D16869C621095CD1 +:108B100000290ED02030C17C0120FFF7DBFE0028A9 +:108B200007D168692030C17C0420FFF7D3FE0028FC +:108B300018D06869CB21095C062919D01FE0000014 +:108B4000100100207372635C6C6C5F736C617665FE +:108B50002E6300002801002080210020A821002091 +:108B6000EA070000686940300481447702204DE044 +:108B70002030C17C0420FFF7ADFE002815D06869C5 +:108B80002030C07C801E15287ED2010079440979EE +:108B900049188F449B9B9B1C9B9B9B979B1E9B9B5D +:108BA0009B243E9B9B9B9B9B900068695621095C84 +:108BB000C90702D0C030C472AEE00C20FFF7A9FE96 +:108BC000686901224030817D11438175A4E007204E +:108BD0001CE0FBF7F0FE00286CD00B2016E0F3F74A +:108BE00050FA0C2866D368690821B030F3F74AFAC6 +:108BF000002806D0686904218430F3F743FA00287E +:108C000003D1F4A1F74802F0A6FA0420FFF781FE91 +:108C100082E068698446C030807A042802D0052842 +:108C200039D079E06046E030007D002874D1EE490B +:108C30006046102600230822D8306944F51A2D1802 +:108C4000203DEF7F4F70AD7F8D70891C521E9B1CA5 +:108C5000002AF3D103A86346102608210330A83365 +:108C6000B51AED18203DEF7F4770AD7F8570801CF1 +:108C7000491E921C0029F3D16846F9F70CFB08AF96 +:108C80004ECFDA4D686900E020E070304EC005201C +:108C9000FFF73FFE0BE060464030017D002903D026 +:108CA00001214177022000E00D20FFF732FE6869C4 +:108CB000C030847230E00620FFF72BFE6869403038 +:108CC000847329E00920FFF724FE25E06869CA21A2 +:108CD000095C002920D0062906D02030C17C002064 +:108CE000FFF7F8FD002817D068690146C0318A7A7D +:108CF000072A11D213007B441B79DB189F440C0C0C +:108D00000C0C0C0C03004030807DC20700D154E7EE +:108D1000C043800700D18C72B44D2879002868695F +:108D200002D08030048303E08030018B491C018332 +:108D30006879C007686904D0A4210C54403084804D +:108D400003E040308188491C8180E879002806D002 +:108D50006969A0310879022806D8401C0871686941 +:108D6000A0300079022806D9686901468030048362 +:108D70004483A0310C7168692030C17C0020FFF76A +:108D8000A9FD002804D168692030C07C07284CD197 +:108D900068690146C0318A7A062A46D0C97A06290E +:108DA00043D03621095C02293FD1A0300079002848 +:108DB0003BD1FBF7AEFC002837D0FBF782FD002843 +:108DC00033D06869014680314A8A012A2DD90122AF +:108DD0004A77024640329688D288931E9E4201DB33 +:108DE000012302E0921B521E93B20A8BAE89B2425B +:108DF00001D3012202E0B21A521C92B2934200D96E +:108E00001346012B00D14C77C0300278002A10D0D5 +:108E1000498B4088814201D3012102E0401A401C65 +:108E200081B28B4205D90B4603E06869012380308B +:108E300044776A69118D1646C81883B2104680308F +:108E400083822036B77D002F25D0012F23D0022F1B +:108E50000CD0032F0AD05FA1654802F07CF9687935 +:108E6000C006686919D58030C4841BE0F67C032EE7 +:108E700009D0082E0FD04032D1889288891A891ED5 +:108E800059180182EBE740329688032E03D3D2882B +:108E90008918491CF5E70382E1E78030C18CC28A5A +:108EA0008918C18468690246C0329179002906D0C8 +:108EB0000146403196230E891B5AF3180B81A97A7B +:108EC0000426002913D002463D214032917001460C +:108ED0002031CC748C75012151708030807F002846 +:108EE00070D0297000210220FAF7C5F85EE0014633 +:108EF0002031CB7C042B48D02B7A002B1ED05A0774 +:108F000001D4DA0604D51E2240308270CE743CE0D3 +:108F10001A0704D53D2240308270CE7435E0D80760 +:108F200005D1980703D42BA1324802F014F96869DF +:108F30002A21422211542030C67426E04030837B1F +:108F4000002B05D047897B1C438183899F420FD228 +:108F5000D37A062B02D0927A062A05D1038A5A1CAC +:108F600002828289934203D20389C288934203D347 +:108F700022228270CE7408E08B7D002B23D0838860 +:108F800093423CD308228270CE7468694122014624 +:108F90002031CC748C75012111548030807F0028E1 +:108FA0002AD0297000210220FAF765F8F9F7EEFFC0 +:108FB00000282DD068690146FF300130827A002AEE +:108FC00022D025E018E08288062A18D33E2282703B +:108FD000CE74DAE77372635C6C6C5F736C61766598 +:108FE0002E63000039060000FFFFFFFF1001002084 +:108FF000790800004502000000210320D4E7012089 +:10900000287000210846CFE74988818101218172BB +:109010006869803084770DB0F0BDF8B50C4617460E +:109020006946FAF7F9FA002801D00020F8BD009847 +:109030000146E030027AF74E0025002A17D0002FB3 +:109040007DD1657007212170007A00280DD07169EB +:10905000E8204D8445540A22A01CEA3101F0F1FEBB +:109060000098E030007A0028F1D1A57067E0027D19 +:10907000002A2AD0002F62D1017D0D2920D20A00BA +:109080007A441279921897441B1B1B1B1B1B1B1B3A +:109090001B1B1B0F060065700C212170817DA170C8 +:1090A00071694988A18009E065700B212170817D7B +:1090B000A17071694988A180817EA17105753EE02A +:1090C000D549D64802F047F839E0027F002A15D08A +:1090D000002F34D16570082222707269FF315288E6 +:1090E000628001310A88A2804A88E2808A882281CF +:1090F000CA8862810989A181057720E0FF310131A9 +:10910000887A002808D0002F19D1657011202070AE +:10911000888960808D7212E0887B002886D0002FBD +:109120000DD1657012202070887B002807D08D73C8 +:10913000088A6080488AA080887B0028F7D10120B7 +:10914000F8BDB4480078012801D00C2070470020F9 +:10915000704770B5AF4C05462078002803D0AE4963 +:10916000AF4801F0F8FF00202561E0720120207077 +:109170002078012803D0A849AA4801F0ECFF70BD6F +:10918000F8B5A44D2978012901D00C20F8BD01269D +:10919000686180308677807AFBF749FA00282ED004 +:1091A00068698030807AFBF799FB002827D06869CE +:1091B0008030807AFBF70EFB002820D06869803071 +:1091C000807AFBF74AFB002819D0F7F7CCF86869DA +:1091D00000248030408A002825D09348FBF71EFBEE +:1091E000002820D06869C621095C00291BD02030E6 +:1091F000C17C0120FFF76EFB002802D013E0122093 +:10920000F8BD68692030C17C0420FFF763FB0028AB +:1092100009D168694030048144770220FFF779FB67 +:109220006869803044776869E821095C002905D1C4 +:10923000418CC288914201D9A98101E0C188A981EC +:1092400001468031CA8A521E93B20A8BD21892B25A +:109250000A830F7F002F02D04C830C7702E04F8BE4 +:10926000FF184F8305464035AF88FF18AF804D8A01 +:10927000012D01D86D1C4D82002B01D0A4231C545C +:109280002030C07C634D042817D0487F002816D0BA +:10929000A889824213D2FBF73CFA00280FD06869F4 +:1092A0000146C0310A78002A09D08030408B4988B5 +:1092B000884204D3AC70EE7003E0AE7001E0AC7095 +:1092C000EC7068699D210C543321095C062901D09A +:1092D000072917D1CC21028D095A511A09B2002948 +:1092E00010DB0146CE310A3002F04FF80122022194 +:1092F0006869FAF7C8FE6869CB210C5433210C5415 +:1093000040308677434D962168690A5A01462830D5 +:10931000891CFAF75FFFA87800284DD16869C02141 +:10932000095C002901D0803044830120F6F7DFFD7D +:10933000384D68691330F6F7A8FF68690F30F6F703 +:10934000E6FE0120F7F70CF8686901462030027E3E +:10935000002A02D1C07D002806D07031ACC9334844 +:10936000ACC0334802F000F8F6F7F6FF01210846DA +:10937000F6F7FAFE274D68698030006AF7F706F8BD +:109380002C48FBF7BEFA002801D06C7002E06E702A +:109390002948E86168692030007E002802D068789A +:1093A000002817D0E869F6F7EEFFF7F784FB686945 +:1093B00040300078F6F7BDFE164802214471C471B2 +:1093C000847104724472847204710170F6F7D6FFDE +:1093D0000020F8BD1848F6F7D6FF144806766A69EB +:1093E000916ED26E42610161134AE969F7F731FB70 +:1093F0000120F7F73DFBDAE710B5064C207802288C +:1094000001D00C2010BDA078002817D00020FFF755 +:109410001CFB2FE010010020D48F0100DD080000AC +:109420002D0900003809000028010020A821002093 +:10943000C12100202C01002080210020F6F793FF9D +:1094400001210020F7F71AF804202070606920300D +:109450000079012801D1F6F7F8FFE07A002809D059 +:10946000012807D0022807D0032805D0F949FA4877 +:1094700001F071FE002010BDE9F7CAFDFAE7F749D7 +:10948000C8727047F8B5F54C2078032803D0F1492D +:10949000F34801F060FE616901252031887A0028D7 +:1094A00006D0002088720D73A07904221043A071A9 +:1094B000A0690278D24392072BD1C97A002928D11A +:1094C000FAF753FC04281DD0052802D00B2819D127 +:1094D00011E0606901462030C27C102A12D10022BE +:1094E0008A66CA6605767031CCC9DE48CCC0DE48D3 +:1094F00001F03AFF06E060692030C17C0B2901D100 +:1095000000210176606902212030C572A0790843EC +:10951000A071A0690078C00606D4E0690078C00692 +:1095200002D4E07900280FD0607800280CD1A0790F +:10953000002809D1F9F718FD002805D0207A002865 +:1095400002D1607A002803D00120FFF77EFA1DE0E7 +:10955000C648FBF7D6F9002802D00020607002E070 +:109560006570C348E06160692030007E002802D049 +:10957000607800281CD0E069F6F705FFF7F79BFA42 +:1095800001210020F6F77AFF0420207020780128BE +:109590000DD0E07A00280AD0012808D0022819D07E +:1095A000032817D0A920AB49000101F0D4FDF8BD74 +:1095B000AF48F6F7E8FEAB4805766269916ED26E69 +:1095C00042610161AA4AE169F7F743FA0120F7F71E +:1095D0004FFAD5E70120F7F707F8F8BDF8B59F4C2B +:1095E00005462078042803D09A49A24801F0B3FD2B +:1095F0009A481027417939434171002D7ED0F7F701 +:1096000072FA0125002814D1944842692032117E53 +:1096100000290ED0C1694B78DB060AD00978D27BCD +:109620000907C90F914204D185720120FFF70DFA95 +:1096300054E18A4CE07800281ED0E0694178C906E0 +:109640001AD10078C00617D460692030007901284B +:109650007ED1F6F7F1FE6169881C2831FAF7AAFE7F +:10966000002875D06069C21D4388F932138220300A +:10967000007C907495732BE160692030007901289B +:1096800011D1F6F7D9FE6169881C2831FAF792FEEC +:10969000002808D06069C21D4388F9321382203047 +:1096A000007C90749573E069002600784007C10F34 +:1096B00060692030827B914242D0407B00283BD0C1 +:1096C00002280FD1FAF7EAFF002803D161496A485E +:1096D00001F041FD62690023106E516E401C59413A +:1096E00051661066606920304673017B012903D101 +:1096F0000673A1793943A171C17A00E0D1E0012953 +:1097000014D1C672A07908210843A071FBF7C7F8ED +:10971000002803D14F49594801F01DFD626900231B +:10972000106E516E401C59415166106660692030C0 +:10973000817B01292ED085736079082108436071EF +:109740004649C869496903781A07D40F203100E0F7 +:109750007FE0CA7B94420CD19B07404C9B0F012BAE +:1097600048D0022B46D0032B16D0207A0421084380 +:1097700020723A48417929434171C67181790907BC +:1097800004D541692031C97C032962D0017A0029BE +:109790005FD182E08673CFE76378002BE9D18D72C9 +:1097A000A3792B43A371012A10D0CD73FAF7DDFA08 +:1097B00006280DD00B28DCD1606901462030C27C20 +:1097C0000C2AD6D1C67540310D75D2E7CE73EDE7C0 +:1097D000606901462030C27C122ACAD100220A6682 +:1097E0004A66C57570319CC91E489CC0093001F09D +:1097F000BBFDBEE74078C30649D06278002AB8D1E5 +:10980000C006C00E1B283FD8C97C0520FFF762F8B0 +:10981000002804D0607A082108436072A9E76079C3 +:10982000042108436071FBF793F8002803D109492C +:10983000134801F090FC60690023816EC26E491CE0 +:109840005A41C26681662030C17B01291AD0C57396 +:109850008FE73DE0D48F01000D0A000010010020C9 +:10986000360A0000A8210020C12100202C01002080 +:1098700080210020A80A00000A070000220700003B +:109880007C070000C67374E7207A384370E7012A2A +:1098900001D0CD736DE7CE736BE7407A002817D106 +:1098A0001AE0F948022211434171C179491CC9B239 +:1098B000C17101290CD840692030007E00280BD0EE +:1098C000F2484078C106C90E052905D2C00603D06A +:1098D0000120FFF7BAF801E0FEF72EFFEA48017811 +:1098E00001290CD0C07A002809D0012808D002280C +:1098F00005D0032804D0E649E64801F02CFCF8BD69 +:109900000120F6F771FEF8BD10B5DF480078042895 +:1099100003D0DF49E04801F01EFC0120FFF795F875 +:1099200010BDF8B5D84C0427A07900250007002801 +:109930002FDA207A00282CD160692030C07C801E6C +:10994000132826D201007944097949188F44210946 +:1099500021212121212121212121212121212121F7 +:109960001A006069014640318D734A7F002A04D095 +:1099700006228A702030C7740BE016228A702030CD +:10998000C77406E0606901464031CD748D732030A4 +:10999000C57400F063F9BC4801268279500700289D +:1099A00022DAB948017A00291ED1406901462031E6 +:1099B0000B46C97C891E072916D20C007C442479E9 +:1099C0002419A744031111110B110E000146403157 +:1099D0008D73C030007A8870DF7405E0C030C672C5 +:1099E00002E00221C030C172A74C90074AD5207A0C +:1099F000002847D160692030C17C0120FEF76AFF52 +:109A000000283FD1A069C0780E287DD2010079449A +:109A1000097949188F44A7A706A73747630BA718EA +:109A2000A7279755616903202031C8749FE06069BA +:109A30002030C07C052803D09549984801F08BFB65 +:109A400060692030C57492E060692030C07C0928CC +:109A500003D08F49924801F07EFB60694E210D547E +:109A60002030C57483E060692030C07C0B2803D0AF +:109A700087498C4801F06FFB606953210E540C211B +:109A80002030C17473E060692030C07C0F2803D09F +:109A90007F49854801F05FFB606953210E54102116 +:109AA0002030C17463E060692030C07C102803D08E +:109AB00077497E4801F04FFB606912212030C17464 +:109AC00055E060692030C07C102803D07049784888 +:109AD00001F041FB606914212030C17447E06069E6 +:109AE0002030C07C162803D06949724801F033FB4E +:109AF000606901464030C5748573E031087D0028F7 +:109B000006D063492B2000E02DE0400101F023FB4B +:109B10006069014640310A7D002A08D00D754288EF +:109B2000F8210A520146E0318D750C2207E0418888 +:109B3000F82211520146E0318D758E760B220A759E +:109B40002030C57413E060690146C030827A062A6D +:109B500004D14031897D890700D58572C17A0629F3 +:109B600005D1C57203E04A49534801F0F4FAA079DF +:109B7000C00612D5207A00280FD160692030C17C40 +:109B800007290AD20A007A441279921897440505E7 +:109B90000505050503000721C174607A000727D574 +:109BA00060692030C17C0520FEF794FE002807D0B4 +:109BB000207A0821084320726069E030057517E0BB +:109BC000607938436071FAF7C3FE002803D1304949 +:109BD0003A4801F0C0FA60690023816EC26E491CE8 +:109BE0005A41C26681662030C17B012934D0C673D8 +:109BF00060693321095C08292DD10146028DC031ED +:109C00008B89521C9A4226D1227A002A23D14A8A71 +:109C100083889A4207D18B8AC788BB4203D1CB8AFB +:109C20000789BB4208D043888B85CA858A8A0A8601 +:109C3000CA8A4A86E8210E5401221146FAF723FA0D +:109C400000210420F9F717FA6069CB210D54203068 +:109C5000C57403218175F8BDC573C9E730B50A4CD9 +:109C600083B0A079C0077DD0207A00287AD16069BE +:109C70002030C17C0120FEF72DFE00284AD1E0698A +:109C8000C0780D286FD21BE0100100208021002039 +:109C9000D48F01000E0B0000160B000027050000FA +:109CA0002D050000340500003C05000043050000C0 +:109CB000490500005B050000BD0500009E03000093 +:109CC00001007944097949188F443B1506C14D4D6F +:109CD000FE24FD4D98B2FC00E069FAF7BEF8616918 +:109CE000C82250540222332042540020403148817F +:109CF0000120887385E160692030C17C0020FEF777 +:109D0000E9FD0028207A02D0002803D103E00121D8 +:109D10000843207275E1E069FAF798F86169CC228E +:109D200050520A8D801ABC4A00B290425FDC002873 +:109D30005DDDCE31E069FAF77EF8606906212030FA +:109D400083E060692030C17C0020FEF7C3FD00285D +:109D500003D1207A012108432072207A00284CD1B7 +:109D6000E06901E055E134E1FAF732F800282ED03D +:109D7000E069FAF728F86169CC2250520A8D801AFE +:109D8000A54A00B2904232DC002830DDE069FAF7E3 +:109D900014F86169C0318873E069FAF707F86169FE +:109DA000C0310882E069F9F7E6FF6169C031488295 +:109DB000E069F9F7E9FF6169C0318882E069F9F784 +:109DC000ECFF6169D62250520820203196E060698C +:109DD0002030C17C0020FEF77DFD002803D1207AD1 +:109DE000012108432072207A002806D100E12820B2 +:109DF0004222505404202031C87402E160692030AE +:109E0000C17C0020FEF766FD002803D1207A0121E5 +:109E100008432072207A00285FD160690022014641 +:109E200040304281012282730B202031C874E8E067 +:109E300060692030C17C0C2903D0217A02221143B1 +:109E40002172217A002948D10D21C174D9E06069BD +:109E50002030C17C0020FEF73DFD002808D160695C +:109E60004030007D002803D1207A01210843207270 +:109E7000207A002831D160690022014640304281B9 +:109E800001258573A831E069FAF704F86169E06992 +:109E90008031FAF710F86069E030007F002803D0C5 +:109EA0005E495F4801F057F96169FE204A884252D5 +:109EB000FF310131E069F9F7D7FF6169E069FF31EE +:109EC000093102E01CE056E008E0F9F7D9FF6069CB +:109ED000FC210D540F212030C17492E060690146CD +:109EE0002031CA7C122A03D0227A02231A4322721A +:109EF000227A002A6CD1403082731620C87480E028 +:109F000060690146C031CA7A002A06D0897A0629DA +:109F100003D0217A012211432172217A002970D1C4 +:109F20004030807D800715D4E069F9F7F5FF61695D +:109F30004031C875E069F9F7F1FF61694031088384 +:109F4000E069F9F7F0FF6169022240314883887DBA +:109F50001043887560690146C0318A7A062A01D1AA +:109F600000228A724030827DD2074AD10622CA720C +:109F70000021018245E060692030C17C0020FEF7AD +:109F8000A9FC002803D1207A012108432072207AFD +:109F9000002836D16946E069F9F7D5FF68460078B0 +:109FA000C107C90F6846017004D0606901214030C3 +:109FB000017703E060690021403001776069002289 +:109FC0000146403042810122827309202031C87449 +:109FD00017E060692030C17C0020FEF77BFC002880 +:109FE00003D1207A012108432072207A002808D169 +:109FF000E069F9F7BAFE61698922505405202031E1 +:10A00000C87461690023886ECA6E401C5A41CA66D2 +:10A01000886603B030BD0000FE7F0000D48F0100D1 +:10A020002104000047490968016000207047454944 +:10A030000860002070470121434A002803D001280E +:10A0400003D042487047916300E0D163002070471D +:10A050003F49012008603D48801C704704223D4B69 +:10A060003B49002805D05A60086901221043086165 +:10A0700008E008694008400008619A603249002001 +:10A08000C03188600020704731490622002808D07E +:10A09000012809D002280DD003280FD02B48401CDE +:10A0A00070470869904302E008699043801C08618A +:10A0B0000020704708699043001DF8E708691043C5 +:10A0C000F5E723494A6A02434A6200207047204963 +:10A0D0004A6A82434A62002070471D49496A01600A +:10A0E000002070471A49CA690243CA6100207047BC +:10A0F0001749CA698243CA61002070471449C96977 +:10A100000160002070471249024600204031002AB9 +:10A1100003D0012A01D0072070478A6370470D4998 +:10A120000420886008490020C03188600A4801681E +:10A130008022090A090211430160084901200860D0 +:10A140007047000000040040400000400420000070 +:10A15000000500400003004000E400E000E100E0F2 +:10A160008107C90E002808DA0007000F08388008A8 +:10A17000814A80008018C06904E080087F4A80001E +:10A1800080180068C8400006800F704710B504466C +:10A1900000F0DBF8002813D02046FFF7E1FFC0B243 +:10A1A00000F0E1F800280DD07549E2060B78D20ED8 +:10A1B00001209040002B08D04A681043486006E018 +:10A1C000704810BD6F48401C10BD6F4908600020EA +:10A1D00010BD10B5044600F0B8F800280BD068494F +:10A1E000E2060B78D20E01209040002B05D04A6881 +:10A1F00082434A6004E0634810BD634980310860CF +:10A20000002010BD70B50D46044600F09EF80028F1 +:10A210000BD05E480068E206D20E01219140084052 +:10A2200000D001202860002070BD564870BD10B5D8 +:10A23000044600F08AF8002807D0E106C90E012084 +:10A24000884052490860002010BD4E4810BD10B52E +:10A25000044600F07AF8002808D0E106C90E012073 +:10A2600088404A4980310860002010BD454810BD33 +:10A2700070B50D46044600F068F8002819D028464D +:10A2800000F071F8002816D0A007C10EFF228A4006 +:10A29000A807000E8840002C10DA2107090F0839A2 +:10A2A0008B0835499B005B18D96991430143D961FB +:10A2B0000CE0344870BD3348401C70BDA3082F49E2 +:10A2C0009B005B181968914301431960002070BD21 +:10A2D00070B50C46054600F038F8002805D0284631 +:10A2E000FFF73EFF2070002070BD264870BDBFF311 +:10A2F0004F8F21492648C860BFF34F8FFEE770B5E6 +:10A300001F4C05462178012000290ED1207072B61D +:10A3100000F0F4F81C4E803631688143616000F033 +:10A32000EDF8C043306062B600202870002070BD98 +:10A3300013490A78002A06D0002804D1124A486836 +:10A340001060002008700020704710B504462028D7 +:10A3500007DA00F0D3F80121A140084201D1012021 +:10A3600010BD002010BD012803D0032801D000201B +:10A37000704701207047000000ED00E000E400E0BD +:10A38000300100200120000000E100E000E200E0D8 +:10A390000400FA05F8B504468007002501260028C8 +:10A3A00004DA5848C563C66302208443E00404D538 +:10A3B0005548C563C66380148443600003D5534881 +:10A3C000456080058443E00504D55148C563C663F4 +:10A3D00080158443A00404D54E48C563C663401469 +:10A3E000844360042704C00FF90F884203D04AA1B8 +:10A3F000612000F0B0FEB80F0AD04C49CD634C4844 +:10A40000C563C563CE63C663C6630320800384430C +:10A4100020050AD5474FFD632F20E6F7C5FEFE63F2 +:10A420002F20E6F7C1FEF8148443F7F7D7FF424820 +:10A43000044203D038A18D2000F08DFEF8BDF0B5A8 +:10A4400000210A46FF230446CC40E4072AD04CB240 +:10A45000E606F60E0125B540384E3560384E3560BB +:10A46000002C11DA25072D0F083DAE08354DB6003A +:10A470007719FD69A407E60E1C46B440A5431446AF +:10A48000B4402543FD610DE0A6082F4DB6007619B6 +:10A490003568A407E70E1C46BC40A5431446BC40E3 +:10A4A00025433560491C2029CDD3F0BD70B5274C1C +:10A4B0000D462060FFF76EFF2068FFF7C0FF2846BB +:10A4C000E8F766F8F7F796FEF1F792FDF7F786FFE3 +:10A4D000FFF725FEE7F7E2FE00F06AF870BD10B561 +:10A4E0001A4C2068FFF756FF2068FFF7A8FFF7F720 +:10A4F00075FFE8F7C7F80020206010BD134800681A +:10A5000070470000C01F0040C0CF004000E5014080 +:10A51000C08F0040C0DF00407372635C736F635F85 +:10A52000636F6E6669672E6300000000C0EF004035 +:10A53000C0FF0040C0BF0040FEFF0FFC80E100E014 +:10A5400080E200E000ED00E000E400E038010020DF +:10A5500070B5002402460D4620462146002A1ED032 +:10A56000012A04D0022A04D0032A1ED103E00120CC +:10A5700002E0022013E003202B0000F00DFF07167D +:10A580000507090B0D0F1600012108E0022106E066 +:10A59000032104E0042102E0052100E00621F2F796 +:10A5A00058FA002801D0204670BD0724FBE70000C0 +:10A5B000B348002101708170704770B5B14D01231F +:10A5C0006B60B14B1C68002CFCD0002407E00E68C7 +:10A5D00006601E68002EFCD0001D091D641C9442FC +:10A5E000F5D30020686018680028FCD070BD70B5F5 +:10A5F000A34C0E466178884203D0A4A16F2000F0DE +:10A60000AAFD0325330000F0C7FE09520624245298 +:10A610005252524952002078022803D09BA1732045 +:10A6200000F099FD2570A078022802D0012804D0FE +:10A6300008E0A068E8F7C6FC04E02046083007C838 +:10A64000FFF7BBFF0020A070F2F7A4F904202070F0 +:10A6500070BDF2F754FA01466068F3F769FC0646EC +:10A660002078022803D089A1872000F074FD8B4A4E +:10A670008B498C48964205D86269032A02D2521C43 +:10A68000626102E0864207D84D71801BC860844930 +:10A690006078F2F7ABFE70BD032003E0A0780028DD +:10A6A000FAD10220F2F77EF800F0E1F870BD77A150 +:10A6B000B12000F050FD70BD70B50546F2F71FFAED +:10A6C0006F4C60602078012803D070A1B82000F0A2 +:10A6D00042FD73490220087000220A718D60042235 +:10A6E0004A71704ACA6020706078F2F77FFE70BDD0 +:10A6F00010B5634CA078002802D12078002801D042 +:10A70000112010BD6848F2F78BF96070607800285E +:10A7100004D0012020700020606110BD032010BD16 +:10A7200010B50124020B64040121604BA04202D247 +:10A730009140186802E0203A58689140084000D0E3 +:10A74000012010BDF8B50E46910005464F1914467C +:10A750003F1F0091E8F747FC009980028919091F03 +:10A76000B14201D2012200E00022002C03D0FF21DF +:10A7700001318C4201D90920F8BD4D498D4219D3D0 +:10A78000AF4217D3854205D2874203D228463043D1 +:10A79000800701D01020F8BD8E420BD3002A09D1CA +:10A7A0002846FFF7BDFF002804D13846FFF7B8FF61 +:10A7B000002801D00F20F8BD3E483F49006888427C +:10A7C00005D0224631462846FFF7F7FE0FE0FFF797 +:10A7D0008FFF0028EFD12A480121C66085600461FF +:10A7E00081702046302148431830FFF765FF002074 +:10A7F000F8BD10B504462E48800A84420BD3E8F712 +:10A80000F2FBA04201D8102010BDA0020446FFF7C1 +:10A8100087FF002801D00F2010BD26482649006878 +:10A82000884203D02046E8F7CDFB0AE0FFF760FF3F +:10A830000028F1D112480221846081701F48FFF77F +:10A840003BFF002010BD1A48010B01208840401E2C +:10A85000704700B50B460246FFF7F5FF104201D0E6 +:10A860000F2000BD114802604360002000BD10B5FC +:10A87000034C6078F2F728F900202070A07010BD1A +:10A880003C01002000E5014000E401407372635C7C +:10A89000736F635F666C6173682E630030750000D0 +:10A8A000D0210020D0FB0100EFA5010000060040F0 +:10A8B00000C0010064000020BEBAFECA3A56000083 +:10A8C000F94805218170002101704170C1708160DB +:10A8D000704710B5F5490A78022A07D0CA681018DF +:10A8E000C860C8689638F3F7DBFA10BD8A6810189C +:10A8F00088608868F6E70378ED49EE4A002B02D0BD +:10A90000012B10D014E00379002B01D0012B0FD1C3 +:10A910004379002B01D0012B0AD18368643B8B4221 +:10A9200006D2C06810E00379002B03D0012B01D0C0 +:10A93000002070474379002B01D0012BF8D1C36868 +:10A94000643B8B42F4D280689042F1D8012070477A +:10A95000F8B504460226F2F731FF0068002803D05C +:10A96000D5A1BD2000F0F7FB0127CF4D002C08D06A +:10A970002078002817D0012805D0022811D00328FC +:10A9800013D02F710DE06068C82808D3F3F7FEFAE2 +:10A99000002804D06068FFF79CFF012603E0002632 +:10A9A00001E000F0FDF93046F8BD28780028F8D124 +:10A9B0006068FFF7A0FF0028E3D0606800780028F7 +:10A9C00026D0A878042803D0BBA1F72000F0C3FB51 +:10A9D000B64F0020387060680079012800D0002050 +:10A9E000387160684079002837D004207871606839 +:10A9F0008168E868F2F715FBB8606068C068963057 +:10AA0000F8600320A870A949E878F2F7EFFCC8E7DE +:10AA1000A6480221017061680979012919D0002135 +:10AA2000017161684979002915D00421417161687B +:10AA30008968963181606168C968C160C0689A4C54 +:10AA400014346060F2F75BF820606F700220A87029 +:10AA5000A7E70321E4E70321E8E70320C6E7F8B509 +:10AA6000914C0D46E178884204D0FF2092A11A3023 +:10AA700000F071FB2846002501268C4F030000F0F2 +:10AA80008BFC0906123C5E82939DCAA6CA00A07880 +:10AA9000032807D0A078022804D0FF2086A11E300A +:10AAA00000F059FBF8BDA078032807D0A078022851 +:10AAB00004D0FF2080A1223000F04DFB0420A070C4 +:10AAC00025712078002815D1FFF703FF3878022878 +:10AAD0000CD0B868E0607F49886A7F4A02402261F2 +:10AAE0007D4AD24310408862002055E0E078F2F7BA +:10AAF000BFFAEFE700F054F9F8BDA078032807D0BB +:10AB0000A078022804D0FF206BA14B3000F023FB7B +:10AB10002078002802D000F04FF9F8BDA078032873 +:10AB20001ED104202BE0081AF8606049E078F2F7A3 +:10AB30005DFCF8BD0420F1F735FEA570F8BDA078E6 +:10AB4000032807D0A078022804D0FF205AA16C3037 +:10AB500000F001FB20780028DDD1A07803280DD07B +:10AB6000F1F7CDFF504E014614363068F3F7E0F9A7 +:10AB70000028DFDB71688142DCDBD4E70520F1F7D8 +:10AB800011FEA670F8BDA078042804D0FF204AA1C9 +:10AB90008D3000F0E0FA0220A1688847FFF7D8FE68 +:10ABA000FF260546C63642E0A078042804D0FF20E0 +:10ABB00041A1923000F0CFFA0120EDE7A0780428FF +:10ABC00098D0FF203CA1973000F0C5FA92E7A0781A +:10ABD00004280AD06078002802D0A078022804D087 +:10ABE000FF2035A19C3000F0B6FA2078002892D1E1 +:10ABF0002079002804D00620F1F7D4FD2571C0E7A4 +:10AC00006078002805D02949E078F2F7EFFB6570FD +:10AC1000F8BD0720B3E7FF2027A1B73040E7002D9C +:10AC20000AD0012D06D024A1304600F094FA022D5E +:10AC3000F5D1F8BD042000E00320A1688847FFF7A4 +:10AC400087FE0546F3E770B5050005D0164CA078E1 +:10AC5000052803D0112070BD102070BD1F48F1F7EA +:10AC6000DFFEE070E078002803D0A5600020A0702F +:10AC700070BD032070BD10B50B480178002901D0CC +:10AC8000112010BD817805292AD08178012929D089 +:10AC90008178002926D0012101708178012921D0F5 +:10ACA000807800281ED01FE054010020E021002001 +:10ACB0003D860100FF1FA1077372635C736F635FC2 +:10ACC000726164696F5F74696D65736C6F742E6314 +:10ACD0000000000000050040028100005FAA0100A2 +:10ACE0000F2010BD00F068F8002010BDF8B5394EF7 +:10ACF0000446B078002801D001280DD1002C0DD0D9 +:10AD00002046FFF7F8FD00280AD02078324D0028B1 +:10AD100008D0B078012823D00F20F8BD1020F8BD4E +:10AD20000720F8BD02272F702079012814D00020B9 +:10AD300028716079002811D004206871A0689630CD +:10AD4000A860E068E860E868224C14346060F1F7BD +:10AD5000D6FE2060B77019E00320E9E70320ECE796 +:10AD6000002028702079012816D0002028716079F1 +:10AD7000002813D004206871A168F068F2F751F937 +:10AD8000A860E0689630E8600320B0701249F0785F +:10AD9000F2F72CFB0020F8BD0320E7E70320EAE7E9 +:10ADA00010B50E48816A0E4A11400A4A12691143D1 +:10ADB0008162F1F7EFFD10BD10B5064CE078F1F7B8 +:10ADC00083FE0820F1F7EEFC0520A0700020207023 +:10ADD000607010BD54010020E021002000050040FB +:10ADE000FD7EFFFF70477047034610B50B439B077E +:10ADF0000FD1042A0DD308C810C9121FA342F8D0DE +:10AE000018BA21BA884201D9012010BD0020C043E0 +:10AE100010BD002A03D0D30703D0521C07E0002046 +:10AE200010BD03780C78401C491C1B1B07D103780C +:10AE30000C78401C491C1B1B01D1921EF1D11846F5 +:10AE400010BDF8B5042A2CD3830712D00B78491C07 +:10AE50000370401C521E83070BD00B78491C0370F3 +:10AE6000401C521E830704D00B78491C0370401C01 +:10AE7000521E8B079B0F05D0C91ADF002023DE1B53 +:10AE800008C90AE0E6F7A0F9F8BD1D4608C9FD406B +:10AE90001C46B4402C4310C0121F042AF5D2F308FC +:10AEA000C91A521EF0D40B78491C0370401C521E64 +:10AEB000EAD40B78491C0370401C012AE4D40978B9 +:10AEC0000170F8BD01E004C0091F0429FBD28B0703 +:10AED00001D50280801CC90700D00270704700298C +:10AEE0000BD0C30702D00270401C491E022904D3B4 +:10AEF000830702D50280801C891EE3E70022EEE76B +:10AF00000022DFE7020A08704A70020C8A70020E03 +:10AF1000CA707047002203098B4273D3030A8B4225 +:10AF200058D3030B8B423CD3030C8B4221D312E04A +:10AF300003460B437FD4002243088B4274D303099A +:10AF40008B425FD3030A8B4244D3030B8B4228D33B +:10AF5000030C8B420DD3FF22090212BA030C8B4261 +:10AF600002D31212090265D0030B8B4219D300E001 +:10AF7000090AC30B8B4201D3CB03C01A5241830B86 +:10AF80008B4201D38B03C01A5241430B8B4201D336 +:10AF90004B03C01A5241030B8B4201D30B03C01A5F +:10AFA0005241C30A8B4201D3CB02C01A5241830AD9 +:10AFB0008B4201D38B02C01A5241430A8B4201D308 +:10AFC0004B02C01A5241030A8B4201D30B02C01A32 +:10AFD0005241CDD2C3098B4201D3CB01C01A524199 +:10AFE00083098B4201D38B01C01A524143098B4222 +:10AFF00001D34B01C01A524103098B4201D30B010B +:10B00000C01A5241C3088B4201D3CB00C01A52412F +:10B0100083088B4201D38B00C01A524143088B42F4 +:10B0200001D34B00C01A5241411A00D2014652418D +:10B03000104670475DE0CA0F00D04942031000D3AC +:10B040004042534000229C4603098B422DD3030A01 +:10B050008B4212D3FC22890112BA030A8B420CD311 +:10B06000890192118B4208D3890192118B4204D33A +:10B0700089013AD0921100E08909C3098B4201D3BA +:10B08000CB01C01A524183098B4201D38B01C01AF4 +:10B09000524143098B4201D34B01C01A524103096B +:10B0A0008B4201D30B01C01A5241C3088B4201D31A +:10B0B000CB00C01A524183088B4201D38B00C01AC7 +:10B0C0005241D9D243088B4201D34B00C01A52419E +:10B0D000411A00D20146634652415B10104601D32B +:10B0E0004042002B00D54942704763465B1000D3B5 +:10B0F000404201B50020C046C04602BD70477047BF +:10B10000704710B500F058F810BD30B58C180278B3 +:10B11000401C13071B0F01D10378401C120906D1F4 +:10B120000278401C03E00578401C0D70491C5B1E32 +:10B13000F9D101E00B70491C521EFBD1A142E6D3AC +:10B14000002030BD012308CB134B1860134B19604E +:10B15000134B1A607047134A134B13607246053A3B +:10B16000F0E7114A0F4B1B689A420ED10D4B00209D +:10B17000186001980D4B04B598470CBC9E460246DA +:10B18000029800990A4B1B68184706980599094BC5 +:10B190001B68DB6818470000780100207C01002054 +:10B1A0008001002070010020EFBEADDE4D2F0000B9 +:10B1B00098000020040000201D481E497047FFF73A +:10B1C000FBFFE5F7BBFF00BD01200007C06AC0B26E +:10B1D000FF2804D1184819490968884202D0184844 +:10B1E00018490160184819490968884203D1184A6A +:10B1F00013605B68184700BD20BFFDE71248134984 +:10B20000096888420ED1134B18680B498842F3D065 +:10B2100080F308881049884204DD10480268022142 +:10B220000A4302600E4880470E4880470E48004798 +:10B23000F0210020F0210020FFFFFFFF0010001090 +:10B240002C05004008000000001000000000002055 +:10B250000400002000C00100002000202405004060 +:10B26000632F0000C9B1010045B1010013487045CA +:10B2700002D1EFF3098101E0EFF308818869023818 +:10B280000078102814DB202810DB2B280BDB0C4A5D +:10B2900012680C4B9A4203D1602804DB0A4A10471B +:10B2A000022008607047094A10470000084A10470A +:10B2B000084A12682C32126810470000FDFFFFFF99 +:10B2C00064000020BEBAFECAAD120000991F010042 +:10B2D0001B1F0100040000200D4B0E4908470E4BB8 +:10B2E0000C4908470D4B0B4908470D4B09490847C6 +:10B2F0000C4B084908470C4B064908470B4B0549BE +:10B3000008470B4B034908470A4B0249084700000E +:10B31000B125000051220000D52B0000772A000043 +:10B32000252A0000D7270000B912000017140000DA +:10B33000392B0000472300000A7802704B784370D5 +:10B340008A788270CA78C2700B79037170470A7864 +:10B3500002704B7843708A788270CA78C2700B7919 +:10B3600003714A79427170470A7802704B784370D2 +:10B370008A788270CA78C2700B7903714A794271F7 +:10B380008A798271CB79C37170470A8802804A88B2 +:10B3900042800A790271704730B47446641E257881 +:10B3A000641CAB4200D21D46635D5B00E31830BCF9 +:10B3B00018470000FFFFFFFF0000FFFF0100030030 +:10B3C000000001000000000000000000000000007C +:10B3D00000000000870000000000000000000000E6 +:10B3E0000000000000000001020304000D0E0F1019 +:10B3F000000000000F6900002D6B0000F56B0000DD +:10B400004F6C0000A36C00000B6D00006969000028 +:10B41000216A0000AD6D0000BB7900001001100131 +:10B420003A0200001A020000040104013C00170067 +:10B4300044000E00F401FA00960064004B00320054 +:10B440001E001400010204081020408055555525A7 +:10B450002627D6BE898E555555D6BE898E0000004A +:10B460007006120DB413000014035A06A009000060 +:10B470006004F208840D0000A8B401000800002058 +:10B480001000000004110000B8B4010018000020F2 +:10B490006C0100000AB10100D8B401008401002051 +:10B4A0006C20000020110000024801688907FCD5CB +:10B4B0007047000000E200E0013536010001005451 +:10B4C0003720FB349B5F80B4800010026801337F1B +:08B4D0000102A029E449B101C9 +:00000001FF From b8c6aba46a781da7aaa9034cf5b88a0ffce0178b Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Wed, 29 Apr 2015 10:36:38 +0100 Subject: [PATCH 16/24] Update to v1.0 of Nordic's S130 production release. This brings in BLE4.1 functionality. It will take some time for BLE_API to expand to cover available functionality. --- .../s110_nrf51822_8.0.0_softdevice.hex | 5649 ----------------- workspace_tools/targets.py | 4 + 2 files changed, 4 insertions(+), 5649 deletions(-) delete mode 100644 libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_8_0_0/s110_nrf51822_8.0.0_softdevice.hex diff --git a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_8_0_0/s110_nrf51822_8.0.0_softdevice.hex b/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_8_0_0/s110_nrf51822_8.0.0_softdevice.hex deleted file mode 100644 index eeaf2212fa4..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_8_0_0/s110_nrf51822_8.0.0_softdevice.hex +++ /dev/null @@ -1,5649 +0,0 @@ -:020000040000FA -:10000000C0070000D1060000D1000000B1060000CA -:1000100000000000000000000000000000000000E0 -:100020000000000000000000000000005107000078 -:100030000000000000000000DB000000E500000000 -:10004000EF000000F9000000030100000D010000B6 -:1000500017010000210100002B0100003501000004 -:100060003F01000049010000530100005D01000054 -:1000700067010000710100007B01000085010000A4 -:100080008F01000099010000A3010000AD010000F4 -:10009000B7010000C1010000CB010000D501000044 -:1000A000DF010000E9010000F3010000FD01000094 -:1000B00007020000110200001B02000025020000E0 -:1000C0001FB5C046C04600F0EFFA04B00FB41FBD24 -:1000D00008205A49096809580847382057490968CB -:1000E000095808473C2055490968095808474020E5 -:1000F0005249096809580847442050490968095875 -:10010000084748204D490968095808474C204B4981 -:10011000096809580847502048490968095808479C -:100120005420464909680958084758204349096836 -:10013000095808475C204149096809580847602068 -:100140003E4909680958084764203C49096809582C -:100150000847682039490968095808476C20374919 -:100160000968095808477020344909680958084740 -:100170007420324909680958084778202F490968CE -:10018000095808477C202D490968095808478020EC -:100190002A490968095808478420284909680958E4 -:1001A0000847882025490968095808478C202349B1 -:1001B00009680958084790202049096809580847E4 -:1001C00094201E4909680958084798201B49096866 -:1001D000095808479C201949096809580847A02070 -:1001E0001649096809580847A4201449096809589C -:1001F0000847A8201149096809580847AC200F4949 -:10020000096809580847B0200C4909680958084787 -:10021000B4200A49096809580847B82007490968FD -:1002200009580847BC2005490968095808470000D3 -:1002300003480449024A034B7047000000000020B5 -:10024000C0070000C00700000122D84B5A6000BF61 -:10025000D74A1268002AFBD0016000BFD44A126856 -:10026000002AFBD00022D14B5A6000BFD04A12684E -:10027000002AFBD07047F0B505460E46174600240D -:1002800006E0A200B158A2005019FFF7DDFF641C80 -:10029000BC42F6D30020F0BD0120C043C549086030 -:1002A000401048607047014601229204086890425D -:1002B00001D9102070470020FCE7F0B505460C4638 -:1002C0001646002706E028462168FFF7BDFF2D1DD2 -:1002D000241D7F1CB742F6D3F0BD70B505460C4611 -:1002E0002E460BE0304600F075F9FF2C01D80024B3 -:1002F00001E0FF3C013C012080023618002CF1D1C6 -:1003000070BD0146012292044868904201D909203B -:100310007047A9484069401C01D10F20F8E7002030 -:10032000F6E7FEB504462068030000F037FA05043E -:100330002B4249598B00201DFFF7E3FF0546002D96 -:1003400001D02846FEBDFFF7A7FF0120C00200F044 -:1003500041F9042221469948FFF78DFF002801D07A -:100360000320EFE708222146944800F06DF90028A9 -:1003700006D1002192480068FFF766FF00F00CF9F3 -:100380000320DFE7A768E6686068019031463846D9 -:10039000FFF7A3FF324638460199FFF78EFFB20000 -:1003A0003846019900F050F9002800D1CAE703202F -:1003B000C8E700F0E3F9834800688349086041E03A -:1003C00060680190E668A0680090B200009901980A -:1003D00000F03AF90746002F00D1B3E70E20B1E74D -:1003E000201DFFF760FF0546002D01D02846A9E734 -:1003F0006068002807D1FFF74FFF0320800200F05C -:10040000E9F800F0C9F8FFF747FF0120C00200F04B -:10041000E1F8042221466948FFF72DFF002801D0AA -:1004200003208FE708222146644800F00DF90028D8 -:1004300006D1002162480068FFF706FF00F0ACF823 -:1004400003207FE700BF00207CE770B505460C461F -:10045000182D04D12068FFF764FF206002E001201E -:10046000206000BF00BF70BDF0B589B05248406940 -:1004700003905248806881000398081802900398FE -:10048000000B01900121090302984018401E000B47 -:1004900000900124002520462946019A00F0C4F866 -:1004A0000022401E91410791069001260027304608 -:1004B0003946009A00F0B8F80022401E914105919B -:1004C0000490049BDB43059AD2430698184307998E -:1004D00011430791069037490698086007984860CD -:1004E00009B0F0BD70B53448446934488568466841 -:1004F000AA003146204600F0A7F8002801D00020CD -:1005000070BD0120FCE72D484068002801D0012083 -:1005100000E000200546FFF7E5FF002807D0FFF7C1 -:10052000BBFE0320800200F055F800F035F8FFF71D -:100530009BFF002D0ED020484669204884684768FC -:1005400021463046FFF7C9FE224639463046FFF7BE -:10055000B4FE00BF00F020F810B5184844681A48EF -:100560000460204600F0DCF810BD15480068006803 -:10057000401C01D100BFFEE710480068002802D0EF -:10058000042806D101E0FFF7BEFFFFF7E5FF00BF3B -:10059000FEE700BF00BFFEE7BFF34F8F0B480C49DB -:1005A000C860BFF34F8F00BFFEE7000000E50140C9 -:1005B00000E40140000600400010001000080000A8 -:1005C000B8070000BC070000000000200400FA0586 -:1005D00000ED00E010B50146104B1A6808460223F2 -:1005E0000F4C636000BF0F4B1B68002BFBD0531CEC -:1005F00004D0904202D20A4B186101E0084B986087 -:1006000000BF084B1B68002BFBD00023044C636029 -:1006100000BF044B1B68002BFBD010BD0010001066 -:1006200000E5014000E4014010B5202A04DB01464A -:10063000203A9140002010BD914020239C1A03468F -:10064000E3401943904010BD034610B50B439B0790 -:100650000FD1042A0DD308C810C9121FA342F8D025 -:1006600018BA21BA884201D9012010BD0020C04328 -:1006700010BD002A03D0D30703D0521C07E000208E -:1006800010BD03780C78401C491C1B1B07D1037854 -:100690000C78401C491C1B1B01D1921EF1D118463D -:1006A00010BD70477047704710B500F007F810BDD7 -:1006B000014B1B68DB6818470000002019481A49E5 -:1006C0007047FFF7FBFFFFF7FBFC00BD20BFFDE716 -:1006D0001649174C24688C420BD1164B1B68994263 -:1006E0000CD1154B154A1360186810498842EDD09B -:1006F0000AE0134880F30888124B18470F4A13602A -:1007000018680A498842E1D080F308880E49884277 -:1007100004DD0E48026802210A4302605B68184744 -:100720000346DFE7C0070000C0070000FFFFFFFF30 -:10073000000C000014100010001000000000002049 -:10074000000400206B05000000200020240500406C -:100750000D48704502D1EFF3098101E0EFF3088104 -:10076000886902380078182802D1C046074A104725 -:10077000074A12682C3212681047000000B5054B7A -:10078000054A9B58984700BDFDFFFFFF4B04000042 -:1007900000000020001000000400000030B4744687 -:1007A000641E2578641CAB4204D3635D5B00E318D0 -:1007B00030BC18471D46F8E7000C00000010000090 -:1010000000150020CD64010025220000336401009A -:1010100000000000000000000000000000000000D0 -:101020000000000000000000000000003D6501001D -:101030000000000000000000252200002522000022 -:10104000A9650100AF6501002522000025220000EE -:101050002522000025220000252200002522000074 -:10106000B56501002522000025220000BB650100B6 -:1010700025220000C1650100C7650100CD650100A2 -:101080002522000025220000252200002522000044 -:101090002522000025220000252200002522000034 -:1010A000D3650100D965010025220000252200003A -:1010B0002522000025220000252200002522000014 -:1010C00000F002F815F0E3F90CA030C80838241835 -:1010D0002D18A246671EAB4654465D46AC4201D170 -:1010E00015F0D5F97E460F3E0FCCB64601263342A9 -:1010F00000D0FB1AA246AB4633431847B456010052 -:10110000E4560100103A02D378C878C1FAD85207E1 -:1011100001D330C830C101D504680C6070470000AD -:101120000023002400250026103A01D378C1FBD803 -:10113000520700D330C100D50B6070471FB5C046C1 -:10114000C04615F063F904B00FB41FBDF0B44046BB -:10115000494652465B460FB402A0013001B506482D -:10116000004700BF01BC86460FBC804689469246B8 -:101170009B46F0BC70470000C11000008269024924 -:101180008161024810447047911100000100000085 -:1011900001B41EB400B50BF0E6FF01B40198864619 -:1011A00001BC01B01EBD0000401E00BF00BF00BF5B -:1011B00000BF00BF00BF00BF00BF00BF00BF00BF37 -:1011C00000BFF1D17047000070B505460C461646C9 -:1011D00002E00FCC0FC5103E102EFAD2082E02D31B -:1011E00003CC03C5083E042E07D301CC01C5361F2E -:1011F00003E021782970641C6D1C761EF9D270BD45 -:101200008307FF22DB0E9A408907090E99400028C8 -:101210000BDA0007000F0838830828489B001818CD -:10122000C36993430B43C3617047830824489B0001 -:101230001B181868904308431860704710B504469F -:1012400000210120FFF7DCFF00211820FFF7D8FF65 -:1012500000210B20FFF7D4FF02211920FFF7D0FF58 -:1012600002210D20FFF7CCFF02210E20FFF7C8FF5F -:1012700002210F20FFF7C4FF0221C81FFFF7C0FFA4 -:1012800003211620FFF7BCFF03211520FFF7B8FF4D -:10129000204600F019F8002010BD6421018070473D -:1012A00010B500F020F810BD0648704710B500F0EA -:1012B00022F810BD704770477047000000ED00E055 -:1012C00000E400E003F9004370B505462D4C07200B -:1012D0002070A01CFFF7E1FF5920A080294620467E -:1012E00000F099FB70BD10B500F09EFB2549002071 -:1012F000891E087010BDF8B5224E0446B61E30781F -:1013000001270D46002807D0204660380B2808D852 -:10131000204600F03DFF2BE0602CF9D01A48086011 -:10132000F8BD20466C38032803D8204600F071FF32 -:101330001EE0204670381F2803D8204600F045F9EB -:1013400016E0204690380F2803D8204600F0E8F831 -:101350000EE02046A0380F2803D8204600F074F88D -:1013600006E02046B0380F2804D8204600F0CAF91D -:10137000286000E02F60602CD2D128680028CFD1EF -:101380003770F8BD1A000020013000000120244908 -:10139000C003086023490020087007202249C005C7 -:1013A0008860704770B51F4D04462878A04207D06A -:1013B000002C05D0002803D01CA14D2015F033F8D7 -:1013C0002878A0420ED000211D4A17482C70002C0E -:1013D00019D01C4B012C06D0022C0BD013A1682075 -:1013E00015F021F870BD11600221116053610321D5 -:1013F000090605E011600321116053610121C9054F -:101400008160416070BD116011600721C905816074 -:1014100070BD10B505A1712015F005F810BD0000D4 -:1014200080E100E02000002000F501407372635C61 -:1014300068616C5F63636D5F6161722E63000000C1 -:1014400000F500404001002010B5A038030015F061 -:10145000DBF80B070E172028313A414B525C650030 -:101460004B6808788A68194603F0E6F910BD888849 -:101470008A6883B20888194680B203F0ECF910BD7F -:1014800008884C68CB688A6880B2214603F0E7F987 -:1014900010BD08884B688A6880B2194603F0FBF9D2 -:1014A00010BD88888A6883B20888194680B203F024 -:1014B00007FA10BD88888A6883B20888194680B206 -:1014C00003F041FA10BD08884A6880B2114603F063 -:1014D00080FA10BD088982B2888883B208881946CC -:1014E00080B203F081FA10BD08884A6880B21146C4 -:1014F00003F09EFA10BD08894C6882B20888CB6858 -:1015000080B2214603F018FB10BD08884C68CB68F8 -:101510008A6880B2214603F02AFC10BD012010BD6C -:1015200010B59038030015F06FF809060F161D244A -:101530002C363F464E0088888A6883B20888194650 -:1015400080B204F031F910BD08884A6880B21146B3 -:1015500004F065F910BD08884A6880B2114604F0AD -:101560006AF910BD08884A6880B2114604F070F923 -:1015700010BD08884B688A6880B2194604F07BF970 -:1015800010BD088982B2888883B20888194680B263 -:1015900004F07AF910BD08894B6882B208881946B0 -:1015A00080B204F090F910BD08884A6880B21146F4 -:1015B00004F09BF910BD888882B20888114680B279 -:1015C00004F0EFF910BD012010BD10B57038030014 -:1015D00015F01AF81B0F15192125282F363B40440A -:1015E000484C53585F688D707980888D8D8D8D8FB4 -:1015F00096004A680878114608F0FDFD10BD08689D -:1016000008F04AFE10BD0C790B7B8A6808682146F9 -:1016100008F053FE10BD086808F011FF10BD08F077 -:1016200065FB10BD08884A6880B2114609F043F88E -:1016300010BD0A790888114680B209F0D3F810BDB0 -:10164000087840B209F0DCF810BD088880B209F0D3 -:10165000F0F810BD086809F0FEF810BD086801F048 -:10166000D2FB10BD086801F0FCFB10BD088982B2F6 -:1016700009C9194609F007F910BD05C9114609F055 -:1016800051F910BD08884A6880B211460AF0A6F9DF -:1016900010BD0C790888CB688A6880B221460AF0B0 -:1016A000C5FA10BD0B7908888A6880B219460AF01D -:1016B0006DFC10BD08884C68CB688A6880B22146F2 -:1016C0000AF0D5FC10BD08884A6880B211460AF0BD -:1016D00018FD10BD0B7908880A7A80B2194609F006 -:1016E00044F910BD088880B209F044F910BD062005 -:1016F00010BD08884A6880B2114609F042F910BD51 -:10170000012010BD10B5B02805D0B12808D0B228EE -:101710000BD0012010BD088880B20BF0FBF810BD83 -:10172000088880B20BF015F910BD08884B688A68EC -:1017300080B219460BF01EF910BD000010B5030071 -:1017400014F062FF0A0609060C0C0F0F06060612BB -:1017500008F0F4FA10BD0AF0C5FE10BD01F03EFA23 -:1017600010BD06F09FFA10BDFAA1FE4814F05BFE12 -:1017700010BD3EB5FC49054603C900900191FF200C -:10178000C33069460881F94A092310460A212838DE -:101790000BF0BFFD0024F6480BF0D9FD641CE4B249 -:1017A0000A2CF8D3F14801231A4602A990300BF015 -:1017B000A0F9002804D0FF20E6A13D3014F033FE4C -:1017C000686800F024FC00211E22084604F06CF931 -:1017D00008F0C3FC02222421E64801F07DFBE54825 -:1017E00001222C214C3001F077FBE2490B20B0396B -:1017F00001F0FEF9002804D0FF20D6A1513014F0EA -:1018000012FE0AF03EFE02F097F96B460022082114 -:10181000D9A008F07DFB002804D0FF20CDA15730CF -:1018200014F001FE284602F0E7FC002804D0FF2057 -:10183000C8A1593014F0F7FDF3218900D14814F004 -:10184000D3FCD04801214171022181710721C1716E -:101850003EBD10B5CB4CA0780A2804D3FF20BDA113 -:10186000903014F0E0FD20786021484300190021F9 -:101870000173417BF722C908C900C91C1140EF223E -:10188000114041730121E1700C3010BD70B50E465E -:1018900000211C4619801546030014F0B5FE0723ED -:1018A000050B1711231D23002246294630460AF056 -:1018B00037FE70BD22462946304608F095F870BDC7 -:1018C00022462946304601F0E2FF70BD22462946F5 -:1018D000304603F0EAFD70BD22462946304600F04E -:1018E00010FC70BDFF209BA1EF3014F09CFD032085 -:1018F00070BD70B5A34CE078002818D02078602126 -:1019000048430019407B00254007400F0119087922 -:10191000401E08712078401CC0B220700A2800D1F7 -:101920002570A078401CA0700BF097FEE57070BD8C -:101930009448C079002800D08BE7704770B5914D6E -:10194000A86800280CD0FFF7F3FF002862D06022BF -:10195000A968FFF739FCFFF7CCFF0020A860EFE78C -:101960006879002856D0FFF774FF044681484C3050 -:1019700001F0C2FA6060002804D17A4875A14A30AB -:1019800014F051FD606801F01AFB00280DD02046CC -:1019900007F00BFF6078010703D5C008C000401CAA -:1019A0002BE0744861684C302DE0724861684C301F -:1019B00001F0ABFA00F05AFB00282BD1FFF749FFEA -:1019C00004466C4801F098FA6060002804D1332086 -:1019D00060A1000114F027FD606801F0F4FA00280E -:1019E00014D060680088608020460AF0CCFD6078E2 -:1019F000010706D5C008C000801C6070FFF779FFA2 -:101A00009EE75C48616801F080FA99E7594861688F -:101A100001F07BFA70BD10B55B4CE160A0605B48E3 -:101A200000F032FC607010BD57490020087070470C -:101A300070B5574E0546706A94B00C46401C04D1F0 -:101A4000B06AC0430004000C0BD0306AC007C00F5E -:101A50002870706A14F0DBFBB06A2071000A6071B4 -:101A600014E02B206946087009A9684601F07BFA4A -:101A7000002804D03B4837A17E3814F0D4FC012064 -:101A8000287006220AA9204614F04FFB2878002867 -:101A900003D06079C0210843607114B070BDF0B507 -:101AA0003B4C0646206895B00D4637460837401C2B -:101AB00008D16068401C05D1A068401C02D1E068D4 -:101AC000401C11D02068314614F0A1FB6068311D24 -:101AD00014F09DFBA068394614F099FBE06831468C -:101AE0000C3114F094FB25E02B206946087009A9FD -:101AF000684601F038FA002804D01A4815A1553874 -:101B000014F091FC08220AA9304614F00EFB2B2099 -:101B10006946087009A9684601F025FA002804D032 -:101B200010480CA14E3814F07EFC08220AA9384651 -:101B300014F0FBFA20692E460836401C08D1606973 -:101B4000401C05D1A069401C02D1E069401C33D083 -:101B500020691FE07372635C686F73745F636F72F8 -:101B6000652E6300C3020000F866010094010020A6 -:101B70003D170000640800206E524635313832327D -:101B800000000000E8030020240000203D190000B0 -:101B900080000010294614F03AFB6069291D14F0FA -:101BA00036FBA069314614F032FBE06929460C315E -:101BB00014F02DFB15B0F0BD2B246846047009A964 -:101BC00001F0D1F9002803D0F649F74814F02BFCB6 -:101BD000082209AF28460AA914F0A7FA684604703B -:101BE00009A901F0C0F9002804D0EF48ED49C01D53 -:101BF00014F019FC0822391D304614F096FAD9E782 -:101C000070B5EA4C0546A068002804D0E648E549CE -:101C1000563014F008FCA56070BD10B50146E448CC -:101C200001F073F9E1498879401CC0B2887101283C -:101C300003D1E048407800F04BFB10BD70B504467E -:101C4000DD4816460D46814204D1D748D549CB30F0 -:101C500014F0E9FB012E05D0D348D249DA3014F054 -:101C6000E2FB70BD6620207000202072A58101205B -:101C7000A07370BD70B515460C460646FFF758FEBA -:101C800000280CD066210170468001210172216874 -:101C90000161A18881820573FFF72BFE70BD1321BE -:101CA000304608F09FFD70BDC2494968884201D2A4 -:101CB00010207047072101700020704770B5BD4C9F -:101CC00005462078002694B0002801D00820E4E6DC -:101CD000BA4A6260954201D21020DEE668680028A8 -:101CE00009D00921D82804D3C31C9B089B00834238 -:101CF00005D00846D1E60720000268600EE0012109 -:101D000009074B6B896B4B43AD49511A0122591A94 -:101D1000D202891A814201D20421EAE700F050FF81 -:101D20006178A06806F052F8E068401E07280BD8DA -:101D3000302269460A708870684607F007F9002863 -:101D400002D009A806F07CFA2846FFF712FD012010 -:101D500020703046A1E6F8B5044696480F46406824 -:101D6000814208D3002C01D0844204D3E01C8008B7 -:101D70008000A04201D01020F8BD8C488178002955 -:101D800011D0398800914178602251430D18287B89 -:101D90000C350007000F3B4600222946FFF776FD71 -:101DA000060004D015E0002038800520F8BD002C86 -:101DB00013D039880098814201D90C260DE028788B -:101DC0003B460007000F22462946FFF75FFD06004D -:101DD00005D00C2E01D0002038803046F8BD734C61 -:101DE0006078401CC0B260700A2801D10020607089 -:101DF000A078401EA07068784107490F01290ED0D5 -:101E0000022906D003291AD066496E4814F00BFB4C -:101E1000E3E7C006E1D46868FFF7FFFEDDE764484A -:101E200069684C3001F071F86079401CC0B2607193 -:101E30000128D2D15F48407800F04AFACDE7E07936 -:101E4000401CE071C9E7604A10B5904209D3594A75 -:101E50000124A4045268A04201D3904201D39142CC -:101E600001D2102010BD00F0FCFE10BD564B10B585 -:101E7000994209D34F4B0124A4045B68A14201D3CA -:101E8000994201D39A4201D2102010BD022803D0FA -:101E9000102801D0092010BD00F009FF0028FAD059 -:101EA000052010BD484B10B598420DD3414B01247D -:101EB000A4045B68A04201D3984205D3994203D39E -:101EC000002A03D09A4201D2102010BD00F015FF65 -:101ED0000028FAD0072010BD10B50446354894B04C -:101EE0004068844202D2102014B010BD0F2008A90F -:101EF000087369460BA801F036F80028F4D168464B -:101F0000007A207068464089608068468089A08099 -:101F10000020E9E710B500290BD0264A526891420B -:101F200002D30B68934201D2102010BD8A88002A88 -:101F300002D001F05AFE10BD092010BD10B5224A92 -:101F400094B091420ED31B4A01239B0452689942DC -:101F500001D3914206D3441E1E2C41D8994203D38B -:101F6000914201D21020BFE7012837D10878002420 -:101F7000C007C00F002803D003206946887001E025 -:101F80006846847038206946087009A9684600F0E0 -:101F9000EAFF002804D041200CA1C00014F043FA4D -:101FA0002046A1E7541B000093020000E803002034 -:101FB0006408002024000020FFFF0000001900201A -:101FC000000000200A040000008001007372635CBE -:101FD000686F73745F636F72652E6300072083E719 -:101FE0000246203A1F2AF9D807F0F9FF7CE710B51E -:101FF0005F4A5268914201D2102010BD0246203A39 -:102000001F2A02D808F065F810BD072010BD70B572 -:102010000546584C0020207020464619544846601A -:10202000E01C80088000A04204D0FF2052491330F9 -:1020300014F0F9F901200007C06AC0430006000E41 -:1020400003D14E480068401C03D04D484D49301A1A -:10205000C862A8B20122214604F039F9002804D050 -:10206000FF204549233014F0DEF970BDF0B595B07E -:102070003B2008A9087369460BA800F074FF0028EC -:1020800004D0FF203C496B3014F0CDF93E4E0024C3 -:102090006D4630E02F19B87DC10706D0400704D443 -:1020A00060004019C0880AF08DFB3848807900280C -:1020B0001FD0B87D80071CD560004019C088002261 -:1020C00006210AF09CFB002813D03C2108A80173CC -:1020D00060004019C1886846C18569460BA800F0B8 -:1020E00042FF06000BD0FF2023497F3014F09BF9FC -:1020F00005E0641CE4B268460079A042CAD83046C4 -:1021000058E5F7B505460078002700090C463E461D -:10211000062804D0FF201849A83014F084F9287A42 -:1021200000280ED0012814D0FF201349C93014F024 -:102130007AF90298002C068001D027806680002062 -:10214000FEBD02270926002C0ED0A889A080A87BFE -:1021500008E003271426002C06D02869E060A88A2E -:102160002082287B2072E4E702980680E7E70000DF -:102170002400002000190020CC1F000000100010D7 -:10218000000000200005004004300000E8030020AB -:1021900010B56038030014F037FA0A060A0F131856 -:1021A0001F252930353A0868FFF788FD10BD05C99D -:1021B0001146FFF7D0FD10BD0868FFF775FD10BD93 -:1021C00005C91146FFF73FFE10BD4B6808788A68C5 -:1021D0001946FFF74BFE10BD8A6809C91946FFF77B -:1021E00061FE10BD0868FFF777FE10BD08884A68D9 -:1021F00080B21146FFF78EFE10BD05C91146FFF7EC -:102200009DFE10BD05C91146FFF7F1FE10BD01206E -:1022100010BD0120704700000E4A12680C498A4226 -:102220000AD118470B4A1268094B9A4204D101B5EA -:102230000AF090FF03BC8E46074909680958084711 -:1022400006480749054A064B704700000000000099 -:10225000BEBAFECA7800002004000020001500204D -:102260000015002001203F49400608603E490860F3 -:102270003E490A68FF231B029A4383121A430A60ED -:10228000384980390860704710B502460420384943 -:1022900004E0C3005B181B79002B0AD00346401EE4 -:1022A000C0B2002BF5D133A1432014F0BCF8FF20BD -:1022B00010BDC300CA50002259184A718A71012208 -:1022C0000A7110BD2A4A0021C000801801717047B0 -:1022D00010B50446042803D326A1522014F0A3F815 -:1022E0002348E1000C182079012803D021A15320B4 -:1022F00014F099F86079A179401CC0B2814200D0F5 -:1023000060710120174940068031086010BD70B52A -:10231000164804250068164E0004800F1B4C022846 -:102320001AD014A1692014F07EF815E02078C100BD -:1023300088190279012A07D1427983799A4203D018 -:1023400042798271705880472078401CC0B220705A -:10235000042801D30020207028466D1EEDB200280D -:10236000E4D170BD80E100E080E200E018E400E02C -:10237000E00800207372635C736F635F7369676E5C -:10238000616C6C696E672E630000000034000020F1 -:1023900010B5EFF31080C407E40F72B6D24841784D -:1023A000491C41704078012801D10BF07BF9002CC9 -:1023B00000D162B610BD70B5CB4CE07800280AD1D0 -:1023C0000125E570FFF7E4FF0BF074F9002804D055 -:1023D00000200BF047F9002070BDC44865714560CE -:1023E000F9E770B5EFF31080C507ED0F72B6BE4C7C -:1023F0006078002803D1BEA18F2014F014F8607813 -:10240000401E60706078002801D10BF04FF9002D5C -:1024100000D162B670BD10B5B348C178002904D0B0 -:1024200000214171C170FFF7DCFF002010BD10B525 -:1024300004460BF03FF9AC49C978084000D00120B0 -:102440002060002010BDF8B50246A74C0026A671FA -:102450000820042101251027130014F0D5F80D08D9 -:102460000A0C0E101214161E262123252800257191 -:1024700022E0022001E021711EE020711CE02771A2 -:102480001AE02020F9E7012616E0FFF781FF0BF0A4 -:1024900011F90028FBD002260EE02171A5710BE096 -:1024A0002771FBE7202000E040202071F6E7FF20A5 -:1024B0008FA1763013F0B7FF0BF008F9002809D090 -:1024C0000BF00AF9B04205D130460BF008F90028AC -:1024D000FAD02CE001208007C560894900224A60BB -:1024E000884A9661814B02225A608560864802695B -:1024F000D243D206D517026910231A4302610F4650 -:102500006D1C00E020BF78680028FBD030460BF03F -:10251000E6F80028FAD0002D04D17B48026910218A -:102520008A43026171490220886000207860A079A6 -:1025300000280CD00BF0BEF805460BF01BF8734AD0 -:10254000002D02D0A260E06001E0E260A060002EF9 -:1025500001D100F0A5F8F8BD10B504460BF0B0F8B5 -:10256000002805D060490120C8704A78521C4A7082 -:102570002046FFF768FF10BDF8B5614DA86800263A -:10258000012802D1AE600BF06DF86868012800D117 -:102590006E6028680127544C012812D12E606079A2 -:1025A000002803D000200BF05DF866712078002829 -:1025B00007D00BF07FF8002803D0012080070761C7 -:1025C000A770286901282AD12E6100F05FF8012048 -:1025D00080074761A079002815D00BF06BF80090B8 -:1025E0000AF0C8FF0099002901D0E16800E0A16865 -:1025F000411A022901DA8A1C11DC0099002901D054 -:10260000E06000E0A060FFF7C3FE0BF053F8002885 -:1026100004D0012080070761A77000E02770E868F8 -:10262000012812D100F032F800F030F800F02EF856 -:10263000A078002804D1FF202DA1033013F0F3FE71 -:10264000EE60A6702670FFF7CCFEF8BD10B5264CE4 -:10265000E078002801D10BF029F80120810788617A -:1026600000F014F8A07800280BD0254CE068002872 -:1026700003D10BF034F80028F8D10020E06000F01E -:1026800005F800201949C043886010BD08B55020E6 -:10269000694608806A461088411E1180FAD208BD3A -:1026A000F8B5124819278760154900200860C860EE -:1026B0000BF000F8BE0701240B4D002802D0346156 -:1026C000AC7000E02C70FFF763FE084847600D49CE -:1026D00028798863FFF7DAFFB461FFF7D7FF08496D -:1026E000002008617461F8BD38000020000300403C -:1026F0007372635C736F635F636C6F636B2E6300F5 -:10270000000100400005004000ED00E0FFFFFF7FFA -:102710008107C90E002808DA0007000F0838800872 -:102720002E4A80008018C06904E080082C4A80008E -:1027300080180068C8400006800F704710B50D2053 -:10274000FFF7E6FFC4B20420C043FFF7E1FFC0B2C9 -:10275000844203D023A11A2013F065FE26490120EC -:10276000486010BD0121254A48031060244B002217 -:102770001A60244A5160244A1060244A11601F499B -:1027800080390860704701211C4A480310601F4AC5 -:1027900051601B4A002111601B490860704710B549 -:1027A00017490868012804D00EA1572013F03BFEFA -:1027B00010BD114880680022C0B20A600AF020FCF7 -:1027C00010BD10B50E4801680029FCD0FFF7E7FFE7 -:1027D00001200D494003086010BD000000ED00E03D -:1027E00000E400E07372635C736F635F68616C5F49 -:1027F000726E672E6300000000D5004080E100E0AB -:1028000000D1004000D3004080E200E000D0004052 -:1028100030B40121BC48C9020160CD1005604A03F3 -:102820000260BA4803681B021B0A036004680023A5 -:10283000240A24020460B6480468240A24020460BE -:10284000B448012444608460B34C23606360A36097 -:10285000B24B19601D601A60B14B19601A600121FA -:10286000016030BC704710B40121A748CA02026061 -:102870000B0203600C060460A64841608160A94811 -:1028800041680029FCD1A4490020086048608860A4 -:10289000A24802600360046010BC704701219F4899 -:1028A000C9020160C91001607047002805D00128E5 -:1028B00005D0022805D19C4870479C4870479C4829 -:1028C000704710B59BA18B2013F0ADFD002010BD0B -:1028D00070B500219E4C9F4D9F4A8F4B002808D019 -:1028E00001281DD0022822D092A1B32013F09BFD15 -:1028F00070BD01200004A060A86011601960974BB2 -:10290000C2039A60964A90607F4A00121060954810 -:10291000016086480160944801609448017070BD70 -:1029200001204004A060A8605160596070BD012082 -:102930008004A060A8609160996070BDF8B594466D -:10294000834A8B4F834D00240126002808D001289C -:1029500032D0022840D077A1E82013F064FDF8BD02 -:10296000891E0902090A0120000490603C64686025 -:102970006C4A1164012B1DD000217C4A7D4B5170A3 -:102980006146DC63DE637C4B5C6002249C60042453 -:102990001C61744B3D31196073490E605F4B8915A2 -:1029A00019606F4B58605E4801606C49C005486013 -:1029B0001670F8BD0121E0E70120704E4004704F11 -:1029C000012B04D13464506068603964F8BD9060B4 -:1029D000346468603964F8BD01206A4E80046A4F2F -:1029E000012BF4D1EEE74F484068704770B54A4D6F -:1029F00028680026564C012806D1A068C00303D5DC -:102A000001200004A0602E606868012809D1A06838 -:102A1000800306D501204004A0606E6001200BF009 -:102A200041FEA868012809D1A068400306D501200D -:102A30008004A060AE6002200BF034FE70BD10B5C3 -:102A40004A490878002818D00120444AC0079060FD -:102A5000434AC00B90602C4A00121060414A00208B -:102A60001060324A1060404A106008704A78002AAC -:102A700002D048700BF016FE10BD0320FAE70120CB -:102A8000424900060860704701202449000608609A -:102A9000704701203D4940050860704701201F49EB -:102AA00040050860704733490020C86388151B49FA -:102AB00008607047410A364AC005C00D5043801C6B -:102AC0005143400A0818704710B4324C430B63431B -:102AD0001B0C5C020C602E4C6343C31A2E485C0234 -:102AE00058432B4B400D4343E31A0124DB032404DA -:102AF0001B191B1613700A681018086010BC704769 -:102B000010B50BF0A2FE10BD80E100E008E400E08B -:102B100018E400E000B0004040B1004080E200E076 -:102B200000E100E000B5004048B1004040810040B5 -:102B300044B100407372635C72656D5F68616C5F85 -:102B40006576656E745F74696D65722E6300000052 -:102B500000B3004040B3004040B5004000F50140E4 -:102B60000083004040850040008200404800002073 -:102B700000B10040C08F00400085004004B100401B -:102B800004B5004008B1004008B5004000E200E094 -:102B9000093D0000378600006F0C010010B50BF0F6 -:102BA00040FE10BD00200449C8630120012181407E -:102BB000024A116000BF7047C01F004080E200E081 -:102BC00010B50CF097FA0AF059F9FEF7DFFB12F096 -:102BD00063FA0CF0F5FF0CF081FF10BD70B50C46E8 -:102BE000054603F0D5FA214628460EF026F870BDBA -:102BF00070B50D46040012D0002D10D021012846DA -:102C000013F0F0FA10225449284613F08EFA524875 -:102C100001210838018044804560002070BD0120FA -:102C200070BD70B54C4E00240546083E11E0716839 -:102C300020014018817BAA7B914209D1C17BEA7BAC -:102C4000914205D10C22294613F042FA002806D001 -:102C5000641C30888442EADB0020C04370BD2046FB -:102C600070BD70B50D4606000AD0002D08D03A4C54 -:102C7000083C20886188401C884203D9042070BD2C -:102C8000102070BD3046FFF7CCFF002801DB401C50 -:102C90000AE020886168000140181022314613F0D4 -:102CA00044FA2088401C20802870002070BD70B538 -:102CB00014460D001FD0002C1DD00021A170022849 -:102CC00002D0102817D108E068782978000208435C -:102CD00011D00121A17010800BE02846FFF7A1FF61 -:102CE000002808DB401CA070687B297B0002084399 -:102CF0002080002070BD012070BD70B505461446CF -:102D00000E000AD000203070A878012807D004D91E -:102D1000114908390A8890420BD9012070BD002C56 -:102D200004D0287820702888000A5070022008708B -:102D300010E0002C0CD049680001411810222046F8 -:102D4000103913F0F2F9287820732888000A60738C -:102D500010203070002070BD540000205A4910B57A -:102D6000884207D301218904884205D3574909685D -:102D7000884201D2102010BD0146012006F0E4FA7D -:102D800010BD30B5044693B000200D4607901421C5 -:102D90000BA813F029FA1C21684613F025FA6A469D -:102DA000112010770020507710780221084310700E -:102DB00007A80C90012008AA907245486A46108521 -:102DC0000AA80B902088108460885084A088908482 -:102DD000E088D084907FF9210840801C40084000A2 -:102DE000907708209086108708A80F9010AA0BA94A -:102DF000684600F083FF002803D110A800882880CF -:102E0000002013B030BD3EB5044608206946088056 -:102E10002D48844207D301208004844205D32B48E7 -:102E20000068844201D210203EBD2146012006F0F8 -:102E30008BFA0028F8D12088694688806088C8808D -:102E4000A0880881E088488107F05FF801AB6A46F6 -:102E5000002101F0E1FB694609880829E4D003203C -:102E60003EBD1FB504460020029008206946088137 -:102E700015480391844207D301208004844206D37D -:102E800012480068844202D2102004B010BD07F03E -:102E90003CF8014602AA0F4801F055FD0028F4D184 -:102EA00069460989082901D00320EEE769460988A7 -:102EB000218069464988618069468988A180694680 -:102EC000C988E180E1E700000080010028000020BF -:102ED000042A0000FFFF000010B5031D036000205E -:102EE000521E04E05C181C60401C2346C0B2904295 -:102EF000F8DB0020186010BD01460A680020002A97 -:102F000002D0104612680A60704702680A600160C9 -:102F10007047000000B51E2823D00BDC0C281CD005 -:102F20001FDC030013F070FB090F1D111D1D171787 -:102F300013151D00302814DD3A38030013F064FB2C -:102F4000030F11091100002000BD214800BD04201D -:102F500000BD0D2000BD0F2000BD082000BD1120C8 -:102F600000BD032000BD10B50C4605F0EFFF0028A2 -:102F70001ED0204605F064F9002816D022780E2ACB -:102F80000DD00F2A0BD0022A09D0032A07D0102A0D -:102F900009D010A17C2013F046FA002010BDA078C3 -:102FA000FFF7B8FF10BD112010BD0AA18220F2E783 -:102FB00008A18820EFE710B504F083FF10BD10B51D -:102FC00005F03EF910BD10B504F0D9FF10BD0000AA -:102FD000023000007372635C686F73745F686369CA -:102FE0002E63000070477047704770477047704706 -:102FF00070477047704770477047704770470000D0 -:1030000010FFFFFFDBE5B151008001006400FFFF0E -:1030100003B40148019001BD09000020002803D03D -:103020008178012939D101E0102070470188FE4ADA -:10303000881A914233D01BDCFC4A881A91422ED068 -:103040000BDC00292BD00320C002081A27D001284E -:1030500025D001210903401A07E001281FD00228CA -:103060001DD0FF281BD0FF380138002815D116E0ED -:10307000FF220132811A904211D008DC01280ED0C3 -:1030800002280CD0FE280AD0FF2806D107E001292B -:1030900005D0022903D0032901D0002070470F205A -:1030A000704700B50B2826D009DC030013F0ACFAFA -:1030B0000B1D2125251B25292325271F1B00112832 -:1030C0001BD008DC0C2816D00D281CD00F2814D0DB -:1030D000102808D10FE0822809D084280FD0852835 -:1030E0000FD0872811D0032000BD002000BD05208F -:1030F00000BDCF4800BD072000BD0F2000BD04204B -:1031000000BD062000BD0C2000BD0D20800200BDCA -:1031100070B500290BD0CB1FFA3B81241E46CDB2DF -:10312000112B1BD2012805D0022806D009E000206F -:1031300010701DE0FF20043001E0FF2003308142C9 -:1031400018D0330013F060FA111613131613161665 -:103150001316161613131313161316000846FF380A -:1031600081381F2803D9FF39FE39022902D815708A -:10317000002070BD1470072070BD00B5030013F06F -:1031800043FA060406040C080A0C002000BD1120B6 -:1031900000BD072000BD082000BD032000BD007851 -:1031A0000207120F04D0012A05D0022A0AD10EE02C -:1031B000000907D108E00009012805D0022803D042 -:1031C000032801D0072070470870002070470620B0 -:1031D0007047002807D0012807D0022807D003280D -:1031E00007D007207047002004E0112002E02120D2 -:1031F00000E0312008700020704738B50C4605000B -:103200004FD06946FFF7CBFF002822D12088032149 -:1032100089028843694609788907090D0843208097 -:103220006946681CFFF7BBFF002812D121880320E4 -:1032300000038143684600788007800C01432180A9 -:10324000A8784007820F2020012A03D0022A03D049 -:10325000072038BD814300E00143218088B2010589 -:10326000890F08D0012189038843A9780907C90F6C -:1032700089030843208080B28104890F0AD0A9788D -:103280004004C906C90F400CC903084320808004CC -:10329000800F02D12088400403D5208840210843B4 -:1032A0002080002038BD70B50446002008801546F7 -:1032B0006068FFF7A2FF002815D12189A08981420B -:1032C00010D861688978C90708D00121490288426D -:1032D00008D8491C12F0A3FF298009E0FF21FF3123 -:1032E000884201D90C2070BDFF30FF3003302880A8 -:1032F000002070BD10B5137804785B08E4075B000C -:10330000E40F23431370FD2423400478A407E40F43 -:10331000640023431370FB24234004786407E40F04 -:10332000A40023431370F724234004782407E40FF8 -:10333000E40023431370EF2423400478E406E40FF1 -:10334000240123431370DF2423400478A406E40FF0 -:103350006401234313700078BF244006C00F23404C -:10336000800103431370002906D00878C10701D1FA -:10337000800701D5012000E00020C0015906490E58 -:103380000843107010BD30B50A8803239B020488DF -:103390009A4323059D0F02D1A3049C0F01D09B0FDC -:1033A00000E001239B021A4303230A801B039A4374 -:1033B00003889804840F02D11805830F01D0800F71 -:1033C00000E00120000302430A8030BDF3B593B052 -:1033D0000D000FD0139800280FD01221284612F0AC -:1033E00001FF03AAFF21012003F0E7F8002426468D -:1033F00037467AE0102015B0F0BD0720FBE768469D -:10340000807D01280BD16846818A0520C002081AF8 -:1034100010D0012810D0022812D0032812D0042C7A -:1034200014D0052C15D113E002290000012800005A -:1034300003300000012400E002246846468A08E0C8 -:10344000032406E068460424478A02E0052400E0DD -:1034500006246846418A1398814246D12C74002E76 -:1034600041D00DAA0EA905200292019100901023CF -:103470000022FF21304603F041F9002823D168469D -:10348000808E2A46C0B20EA9FFF711FC00281AD17F -:10349000AE81002F27D00DA9052008AE0291009023 -:1034A000132300220196FF21384603F027F9002854 -:1034B00009D16846808EF11CC01EC0B22A1DFFF7DC -:1034C000F6FB002801D0032095E708A88178427810 -:1034D00008021043E881062C05D16846807DA87259 -:1034E0006846808A2881002085E703A803F06EF8EB -:1034F000002884D0FFF7D5FD7DE7002805D0F94AE4 -:10350000012903D0022903D003207047518800E02D -:103510009188814201D1002070470720704770B523 -:103520000C4605461C21204612F05CFE002020803F -:10353000002D08D0012D04D0EBA1F04812F073FF4C -:1035400070BD062000E00520A07070BD70B592B07F -:103550001546064601206A461071107453740846D9 -:1035600008300395029048889082FEF7E1F9040044 -:1035700019D06580172069468883203600940AABED -:103580007178023307AA01A80DF05FF9064660784A -:10359000000701D5FEF7ADF9002E0AD03046FFF73F -:1035A000ECFD12B070BD1321284607F01BF9032073 -:1035B000F7E708A800906846838B0422012128467B -:1035C00008F035FEEDE770B506468AB000200D46DE -:1035D00007900590069003A90490052402460291E5 -:1035E0000190102300942946304603F087F8002804 -:1035F0000DD108A804A9009102900194684683891E -:1036000000222946304602F095FE002801D0FFF73F -:1036100048FD0AB070BD10B50DF01DFB10BDF0B532 -:1036200089B000260546059600780C460827030059 -:1036300012F0EAFF0CFD070C3A0B77779EC2FCD81C -:10364000E8FD68680A38FEF7E8FA0DE1A88800236B -:1036500080B201220321009009F08CFA0290002C24 -:1036600004D0A648A0A16E3012F0DDFE029800281A -:1036700004D1A2489CA16F3012F0D5FE02980099A7 -:1036800008300CF017FDFEF753F9040007D06078FE -:103690003843607000986080FEF72BF9E6E0132154 -:1036A000009807F09FF8EFE0002C04D1BD208EA118 -:1036B000800012F0B8FE608800230122032109F087 -:1036C00059FA0090002804D18C4887A1883012F064 -:1036D000AAFE0099002008802A7994461EE0C300C3 -:1036E0005B199B6807936B469B8B1A0708D5DA0614 -:1036F00006D56046C20050194038C08F088006E0E9 -:103700005B0409D50871C2005019C08848806078F0 -:10371000384360700226A7E0401CC0B28445DED862 -:10372000A2E0E888694608800090002C04D1734824 -:103730006DA1983012F077FE2878062814D10098F1 -:10374000C00B11D0608800230122032109F012FA76 -:10375000060004D1694864A1A23012F064FE002082 -:103760003071A88870803BE06078384360707BE0FF -:10377000002C04D161485CA1B43012F054FE608882 -:1037800000230122032109F0F5F90090002804D15B -:103790005A4855A1B73012F046FE009808300DF097 -:1037A000ACFA0121484002D1E888C00B5CD00098F7 -:1037B00061880226C180D7E7002C04D14F484AA176 -:1037C000D03012F030FE608800230122032109F07E -:1037D000D1F9002804D1494843A1D33012F023FE87 -:1037E0000226C1E7002C04D144483FA1DC3012F08E -:1037F0001AFE0226618801222046FEF71FFA0120E8 -:103800000590B1E7A889002380B20122032100902E -:1038100009F0B0F90746002C04D0384832A1EE3048 -:1038200012F001FE002F07D12FA101E00FE016E0FA -:103830003248EF3012F0F7FD686802902889694637 -:103840008881012202A90098FEF714FA0CE0002CEE -:103850008AD16D2024A1C00012F0E5FD84E727483D -:1038600021A1FE3012F0DFFD002C0DD060780007A2 -:103870000AD50598002807D18420207020465822B8 -:1038800029460830FDF7A0FC304609B0F0BDF7B579 -:103890000C460546007A224688B00A320292921CF3 -:1038A00004920027811E16323E4601920B0012F050 -:1038B000ABFE08F605F548488DD1F4F5688800237D -:1038C0000122032109F056F90190002803D106A135 -:1038D0000B4812F0A8FD01980088002812D052274A -:1038E000072601E1000900207372635C676174744C -:1038F000735F636F72652E63000000006F0200004B -:103900008603000051271E26002C7DD06888A080E9 -:103910000120A071019802990079C0004019C08966 -:10392000FFF754FD002870D101980079C0004019BC -:10393000C089208101980079C0004019408AA08385 -:10394000F2E0698A0091062820D1E889C00B1DD0D9 -:1039500008462230512786B2002CD6D0A889049977 -:10396000FFF734FD002873D16888A0800220A07181 -:10397000A88920810120A072288AE08300982084F1 -:103980006969009A019812F0D0FBCDE0084620301A -:10399000502786B2002CB8D0A8890299FFF716FDEF -:1039A000002855D16888A080A889E080287A062858 -:1039B0000AD002202072288AA0830098E083204643 -:1039C00069692030009ADEE70120F3E76888002368 -:1039D0000122032109F0CEF80690688A009006982B -:1039E000002803D1FD49FE4812F01DFD069808305D -:1039F0000DF083F90121484002D1E889C00B26D09F -:103A00000098223086B201E073E021E05127002CBB -:103A100079D06888A080A8890499FFF7D7FC00288E -:103A200016D10220A071A88920810420A072288AC2 -:103A3000E083009820846969009A019812F075FB70 -:103A40000699002008710698A98941806CE003203E -:103A50000BB0F0BD688805F0D2FB019068880023A8 -:103A60000122032109F086F800900198002804D172 -:103A7000DB48DA492C3012F0D6FC0098002804D13B -:103A8000D748D6492D3012F0CEFC0098D549C088D1 -:103A9000884205D05127222604E01EE03FE035E0B1 -:103AA00050272026002C2ED06888A080502F07D0C9 -:103AB0000220A0712146287B0831FFF730FD33E05A -:103AC000287BA11DFFF72BFD6A8800230099019830 -:103AD000FFF73CFD0028BBD126E0C349A889C9886F -:103AE000814207D154270626002C0CD06888A0807C -:103AF0001AE008E053270826002C04D06888A0802C -:103B0000A889E08010E00A98068013E05527072670 -:103B1000002CF8D0A889A0800020A07104E08D209E -:103B2000AE49C00012F07FFC0A98002C068001D03C -:103B30002780668000208BE7AB4900200870704723 -:103B400030B585B00C4601F0E0F90546FF2804D1F8 -:103B5000A348A249953012F066FC00202080207115 -:103B60006080401EE0802046294608300CF096FA1E -:103B70006A462946012002F020FD102412E0684622 -:103B8000808800070ED56846C0882946FFF71BFDD0 -:103B900068468188FF2321438180C0882946019A95 -:103BA00002F036FE684602F011FD0028E7D005B0AD -:103BB00030BD0A46014610B5104608300CF082FAB6 -:103BC00010BD70B5002305461A46032108F0D2FF48 -:103BD000040004D182488149B73012F024FC204609 -:103BE000294608300CF066FA70BDF0B591B00C466D -:103BF000074605F004FB050005D02878222804D2EA -:103C0000082011B0F0BD7948FBE700231A460321D4 -:103C1000384608F0AFFF0646002C02D0A0880028E6 -:103C20000CD00120694608710220087400204874F5 -:103C3000002C05D0A0880883206802E00920E0E776 -:103C4000088305903046083003970290FDF770FE18 -:103C5000040018D0678017206946888320350094B7 -:103C60000AAB6978023307AA01A80CF0EEFD0546FD -:103C70006078000701D5FDF73CFE002D09D02846ED -:103C8000FFF77BFABDE71321384606F0ABFD0320B2 -:103C9000B7E708A800906846838B042201213846C4 -:103CA00008F0C5FA0021C943F180AAE7FFB585B045 -:103CB0000E9E7788384605F0A2FA054600231A467C -:103CC0000321384608F056FF0446002D03D143492E -:103CD000474812F0A8FB002C04D145483F49401C3E -:103CE00012F0A1FB0834089869460394C1C105A8E5 -:103CF0000DC8203569780CF017FAC6E5F0B5044612 -:103D0000002099B00D4601460D9010A881811646FD -:103D100001818180344A68469180018510A8018024 -:103D200068460187818581841078012808D002289F -:103D300006D0032804D0042802D0082019B0F0BD12 -:103D40002C4A944273D32C4F0121890438688C4249 -:103D500001D3844278D3274A954275D3012189043F -:103D60008D4201D385426FD36168002913D0214A67 -:103D7000914269D301229204914201D3814263D3DB -:103D800060892189884203D801225202914201D9D7 -:103D90000C20D3E70D9016AA0EA92846FFF783FA48 -:103DA0000028CBD1686880784007800F02280AD1AC -:103DB0006846008F8004800F05D02869002802D053 -:103DC0003968884240D30AA92069FFF716FA00280B -:103DD000B4D1206900281CD060780FE0E8380000DA -:103DE000EE030000FFFF0000000900200230000089 -:103DF0000C050000008001002800002080076846B4 -:103E0000008D03D58004800F68D002E08004800F0D -:103E100064D16846008D810618D58004800F6068E3 -:103E200006D0002812D0396888420DD302E00BE09A -:103E300000280BD0FE49884206D30121890488421C -:103E400004D33968884201D2102077E709A9606954 -:103E5000FFF7D3F900289CD16069002808D0684694 -:103E6000808C0105890F012938D18004800F35D05D -:103E70000BA9A069FFF7C1F900288AD16846808C98 -:103E800080062BD46846808D810627D4A16900293D -:103E900006D00105890F012920D18004800F1DD093 -:103EA000E068002804D00078002817D01C2815D21C -:103EB00004AA611C2046FFF71DFA0121890210A8FF -:103EC0000180012768468773DA49818104AA033299 -:103ED00017A92868FEF711FF002801D007202DE759 -:103EE00010A8007F15A9C01CC2B200200C9201903E -:103EF000FF32009003460291FF3203A8033210996B -:103F000002F0B3FA002826D110A9888A0F902A89D6 -:103F10002969C94801910092029010A90A8B6B8906 -:103F200028680E9902F0A1FA01007DD1C24800254F -:103F3000001F818868464174090A8174052104A81C -:103F40006A4623C210A82A46FF21808A0C9B02F0F1 -:103F5000F1F9002802D0FFF7A4F8EFE66846007CEC -:103F60000322C1090020920290430122920280188C -:103F70001490002928D0014610A801806846292104 -:103F8000877309028181058608A8007C0023410807 -:103F900060784900C007C00F014308A80174FD20E4 -:103FA00001406078A54A8007C00F4000014308A87F -:103FB00001740CA9022001910090029503A81099A8 -:103FC00002F053FA01002FD16068002828D0206940 -:103FD00000280DD10AA90EA8FFF7D5F9607880074F -:103FE00006D46946088D032109038843694608857C -:103FF000904968468773FE31818190492089891EE6 -:1040000012F00DF962680D9811AB019200900293C5 -:104010000A46002303A80A9902F027FA010003D1F7 -:104020002078C10603D400E086E080062AD56846E1 -:104030000586606900280DD109A90EA8FFF7A3F92C -:104040006846818C03208002814301208002091888 -:10405000684681846946888CC821084369468884FB -:1040600074488F73FF30888112AA0CA90220029233 -:10407000019100900023714A03A8099902F0F5F913 -:10408000010059D12078C00729D068460586A0696B -:1040900000280DD10BA90EA8FFF775F96846818D90 -:1040A000032080028143012080020918684681852F -:1040B0006846818D40200143684681858773604949 -:1040C000818113AA0CA90220029201910090002381 -:1040D0005A4A03A80B9902F0C8F901002CD1E068F4 -:1040E00000282DD010A8149901805549684687737F -:1040F000491C8181E16808A80A78027449784174F2 -:10410000E0684122418868464186E06800230179E1 -:1041100008A80175E068D200C18808A84175090A9D -:1041200081750CA8072101900091029503A81099B0 -:1041300002F09BF9010003D00F9800F0EAFEFDE5C4 -:104140003D480321001F0170002E0AD08088308076 -:1041500010A88088708010A80089B08010A880897D -:10416000F0800020EAE530B501248BB015460B46FF -:10417000012802D002281CD104E06846052184737E -:10418000C90203E02B4968468473891E8181002B94 -:1041900012D003210020890288430121890240189E -:1041A0006946888405AA04A91846FEF7A6FD0028DA -:1041B00004D007200BB030BD1020FBE76A46127C0C -:1041C0001D480092801E05A9FF3201910290FF3226 -:1041D000002303A80332099902F047F9002802D00E -:1041E000FEF75FFFE6E71448001F002D01D041886D -:1041F000298004700020DDE770B592B004460126E6 -:1042000008A886700F496846018410AA08A930469C -:10421000FFF7A9FF00284DD12078074DC0070024E3 -:104220002D1F002848D01C21684611F0DDFF0BE04F -:1042300000800100032800000409002003020000A0 -:10424000032900000118000068460178202001437E -:104250006846017008A88670F9496846018411947F -:104260000794817FF92001406846891C81770020EE -:1042700001466846017700200146684641770421DF -:104280008185C485018607A80A9011A80D9008A809 -:1042900009900EAA09A96846FFF730FD002809D148 -:1042A0006846008FE8806846808F2881401C6881BE -:1042B0002C70002012B070BDEC802C8110A80088FA -:1042C000F4E7F7B5DF4900260A789EB0012A04D04A -:1042D000022A02D0082021B0F0BD4A88824201D0D3 -:1042E0000620F8E71F98824201D10720F3E7012258 -:1042F00010A98A75D4488882002003239B020146B6 -:1043000099439302CB1810A90B8669468A81CF4A3C -:10431000CA8118A9887110A9888419A904916946CD -:10432000CA820690FF20087503A802F072F90024E3 -:104330002546274608AA052103A802F06DF90028A2 -:1043400010D082286FD1002C6FD0002D6DD010A816 -:104350008480C5800021017418A8807B11AC0128DD -:1043600065D06DE008A88079002F21D0012857D1B1 -:104370006846818CB44881421CD113AA0DA905203E -:104380006B4607C36846408C10230022FF2102F0D1 -:10439000B5F9002868D110A88089042801D0062822 -:1043A0004CD16846818E1F98814239D10F2092E707 -:1043B000012835D16846808C0521C902884202D087 -:1043C000491C88422CD19F4841886846408C8142D4 -:1043D00001D1012700E00027002C01D0002D10D0D2 -:1043E0001F9988421CD113AB0DAA05216E460EC63B -:1043F000044610230022FF2102F080F9002833D167 -:1044000001E035460CE010A88089022801D0102870 -:1044100014D1C0B21BAA0DA9FEF749FC00280DD18A -:104420006846468C86E71FE0FFE7052053E714A99E -:104430001BA8221DFEF761FC002801D003204AE7DB -:1044400010A8007C0023001DC2B210A8027420989E -:1044500002900194009215A81C9902F006F8002819 -:1044600002D1784902220A70FEF71BFE33E710B52D -:104470000B46401E86B084B203AA00211846FEF700 -:1044800039FF04AA052103A802920191009001239B -:104490000022FF21204601F04DFF04466846008AB5 -:1044A000012804D06D206A49000111F0BCFF2046AC -:1044B000FEF7F7FD06B010BDF0B5624F0446387840 -:1044C00087B00E46032804D0042802D0082007B085 -:1044D000F0BD04AA03A92046FEF7E5FE0500F6D1CB -:1044E000606880784007800F02280DD16846808977 -:1044F0008004800F08D02069002805D0554909683C -:10450000884201D21020E2E7208905AA6B46216982 -:1045100007C369460A8A63892068039901F0A5FFE9 -:10452000002802D0FEF7BDFDD1E7002E02D068467C -:10453000808A3080042038702846C8E738B50C00DF -:10454000054609D000236A46FF2102F039F9002808 -:1045500004D0FEF7A6FD38BD102038BD69462046C0 -:10456000FEF74BFE0028F8D1A078FF21C307DB0F30 -:104570002846009A02F04CF9EBE73EB50C0009D052 -:1045800002AB6A46FF2102F01BF9002804D0FEF7B7 -:1045900088FD3EBD10203EBD0321204611F022FEC5 -:1045A0006846008801A90005800FFEF712FE00286A -:1045B0000BD16846007920706846008801A9800404 -:1045C000800FFEF706FE002801D003203EBD68469E -:1045D00000796070A278EF20024068460088C10B25 -:1045E00009010A43F7210A404104C90FC9000A43DF -:1045F000A270F9210A40800601D5022000E00120C6 -:10460000400069460243097A50084000C907C90FB3 -:104610000843A07000203EBD7FB5144605220192DC -:1046200003AD029500930A462388FF2101F082FE24 -:10463000694689892180FEF734FD04B070BD000011 -:10464000052A00000009002002280000FFFF0000EA -:10465000E838000028000020F3B5002799B068462C -:104660000C4607873D4600291ED0E068002806D08A -:10467000A068002818D001886A4611870780199819 -:1046800004F0BDFD002812D0007822287ED31998AE -:1046900000F03BFC002300901A460321199808F013 -:1046A00069FA060009D104E010201BB0F0BDFD48F6 -:1046B000FBE7FD49FD4811F0B6FEA078012803D0C4 -:1046C000022801D00720F0E72088002808D0401EEB -:1046D00080B203AA009901F070FF002859D11DE0B3 -:1046E000F048401CE1E76946498A228891420BD292 -:1046F0006846807D0025012810D16846808AEC49F3 -:1047000088420BD1012509E0914203D1002D2AD026 -:104710006D1C01E0022D0BD0032D04D203A801F083 -:1047200055FF0028DFD082281BD0002831D11DE0A2 -:104730006946897D0129F1D16946DD4B8A8A5B1E74 -:10474000D11A9A420FD005DCDA48101A0BD0012892 -:10475000E4D108E0012906D0FF390129DED1032583 -:10476000E1E7022D15D10D2080029EE7E0680028C8 -:1047700016D00EA9052202910192009069460B8F76 -:10478000A2882088FF2101F0D5FD00E01EE000286E -:1047900002D0FEF786FC88E76846A168008F088093 -:1047A0006846008AC00601D5C3487EE707980028FE -:1047B00003D06846008B022801D0032075E70798D4 -:1047C000A1780078012903D0800710D408206CE775 -:1047D000C007FBD000220721199808F010F8002824 -:1047E00002D00725022004E0AE48801C5DE70225C8 -:1047F000032008A908702188684681851998083621 -:104800000A90099617216846818712AB02330FAAD6 -:10481000052108A800970CF018F8002802D0FEF730 -:10482000ACFC42E710A800906846838F042229461A -:10483000199807F0FCFC38E770B5064615460C469B -:104840000846FEF7EBFB002804D12A4621463046F5 -:10485000FFF789FCF2E610B5FFF733FD10BD70B528 -:104860001E4614460D0014D0002C12D06168002999 -:104870000FD00121FEF741FE002809D12068FEF784 -:10488000CDFB002804D1324621462846FFF736FAF0 -:10489000D4E61020D2E670B515460C000ED00221E9 -:1048A000FEF72BFE002808D12068FEF7B7FB002892 -:1048B00003D129462046FFF7FFFDBFE61020BDE6E5 -:1048C000F8B506467D480D46016814468A4231D344 -:1048D0006068002808D07A4A90422BD301229204C3 -:1048E000904201D3884225D37648864204D0304690 -:1048F00004F085FC00280CD0304600F006FB06468C -:10490000284600F0BFFA002804D16068002802D0D1 -:1049100012E06448F8BD00236A463146284601F09B -:104920004FFF002802D0FEF7BCFBF8BD68460088A8 -:10493000800601D41020F8BD6188224628466368AD -:10494000FFF76AFEF8BDF7B55C4E0746306886B0E3 -:104950001446824202D2102009B0F0BD384600F061 -:10496000D4FA05465748874201D0FF2D08D00023CE -:1049700004AA2946079801F023FF002826D101E068 -:104980004848E9E76846008AC00601D54A48E3E797 -:1049900003A9002002910527019000976288494BE6 -:1049A0002946079801F0AAFE00280FD161683268F5 -:1049B000914208D30191029000972388628829468A -:1049C000079801F09BFE694689892180FEF769FB03 -:1049D000C2E7002907D03C4B0A881B899A4202D8BB -:1049E0003048401C704737E610B586B004236C464B -:1049F000A382354BDC88002C07D01B898B4201D267 -:104A0000914204D92748401C54E5062052E56B46E4 -:104A100019825A820021009101911C800221997013 -:104A200005A9029104A903916946FFF715FE41E526 -:104A3000F3B50C4685B0812069460873002C1BD065 -:104A4000059804F0DCFB070018D03878222869D3D9 -:104A5000059800F05AFA049000220121059807F009 -:104A6000CEFE00280CD000231A460321059808F03A -:104A700081F805000AD105E0102028E5094826E55F -:104A8000112024E50849114811F0CDFC28460830D2 -:104A90000BF032FB06462078012819D0022838D0C6 -:104AA000072014E502300000E8380000E1080000AB -:104AB0000328000000280000013400002800002026 -:104AC00000800100FFFF000000090020840A0000B0 -:104AD000A18803AAFEF71CFB0028CED1B00721D580 -:104AE0006846007B00281FD1A079C0071CD0E06871 -:104AF000002205216B4607C36389228968880499CF -:104B000001F018FC6946087300280DD0FEF7C9FAB9 -:104B1000DDE4A18803AAFEF7FBFA0028ADD134201A -:104B2000064201D10820D2E46846037B2946384674 -:104B3000059AFEF70BFDCAE4FFB597B0002001907F -:104B40001F4615460C460E46179804F058FB0028E1 -:104B500004D00078222803D20820A6E5F448A4E572 -:104B6000B80801D00720A0E5032F00D1002717982F -:104B700000F0CBF90890002C1BD0022D77D3ED4824 -:104B8000006884427CD361190091012902D0491E3A -:104B9000814275D3AD1EAAB22146E74810F036F81F -:104BA00000991E394A7F0B7F11021943884267D151 -:104BB000ADB2E248B90702D50189491C00E00121E4 -:104BC00089B20091F90701D0078900E0DA4F03AA02 -:104BD0000899009801F0F1FC0DE0F078B17800023E -:104BE000084310284CD80199091D401880B2019043 -:104BF000A84245D82618002E60D07078317800027F -:104C0000084300998842E8D358E06946098A0A07B0 -:104C100054D5002C3FD0019AA618121D92B20992C9 -:104C2000F278B37812021A439446102A28D8099AC7 -:104C30006244AA4224D87278337812021A4390420E -:104C40001ED1C8061ED509980AAA052120186B4650 -:104C500007C3707831780002084363460022089940 -:104C600001F068FB002803D0FEF71BFA1DE507E002 -:104C7000F078B178000208436946098D884201D076 -:104C80000B2012E5F078B17800020843099940182A -:104C900080B2019006E0C90604D50899FEF793FC9E -:104CA0000028E3D16946088A1021884369460882B2 -:104CB000488AFF23049A089901F0AAFD03A801F08D -:104CC00085FC002803D16846408AB8429DD900235C -:104CD0001A460321179807F04DFF040003D19849A5 -:104CE000984811F0A0FB20880028BFD0012108A817 -:104CF00001700173002646732188684601862046AC -:104D00000830099017980A90FCF712FE05001BD096 -:104D10001798688017206946888010AB023301AA73 -:104D2000052108A800950BF090FD0746687800075C -:104D300004D584488249223011F075FB002F09D038 -:104D40003846FEF71AFAB0E41321179805F04AFD29 -:104D50000320AAE40EA8009068468388042201215B -:104D6000179807F064FA00288BD126809DE4F0B5EF -:104D700000248DB01F4615460E46002A04D0B908FF -:104D800004D007200DB0F0BD1020FBE7032F00D1A9 -:104D9000002700F0BAF80390FF2804D06749B8074D -:104DA00003D5488902E06248ECE70120FA0702D007 -:104DB0004989491E00E0604906AA8FB2039901F0B3 -:104DC000FCFB38E06946898B090734D504AB052123 -:104DD0000022029300910192574B039901F08EFC3F -:104DE000002821D1002E21D06A46128A2988A218D3 -:104DF0003019121D914234D36946CA8B0270120ACF -:104E000042700A8A8270120AC27004A90522001D2B -:104E10000092029101906946C88B0B8A0022039987 -:104E200001F06CFC002801D00320ABE76846008A43 -:104E30002018001D84B206A801F0C8FB002804D089 -:104E4000822806D0FEF72DF99CE76846C08BB84251 -:104E5000B8D9002C07D0002E10D02988A01C814280 -:104E600003D20C208EE705208CE7224631463248DB -:104E70000FF0CCFE31190870000A4870A41C2C8079 -:104E800000207FE700B585B06946FEF79FFA00284D -:104E90000AD16846007C030011F0B6FB08052F2FED -:104EA0002F2F08080531032005B000BD6846807823 -:104EB000012807D1684600880321C902401A1CD086 -:104EC00001281AD068468079012806D16846808872 -:104ED00015214902401A05280FD96846807A012811 -:104EE00011D16846018929200002081A05D002283C -:104EF00003D0032801D0042805D10F20D4E712A144 -:104F0000164811F090FA0020CEE710B507F028FE01 -:104F100010BD10B50C4601F023FB002803D00AA1F8 -:104F20000F4811F080FA2046FEF7BBF810BD0000D4 -:104F30000230000028000020FFFF000000090020D0 -:104F4000E83800003F0B00007372635C67617474A3 -:104F5000735F636F72652E63000000002202000021 -:104F6000BB060000F8B500780C46164610340E3625 -:104F7000069F022809D0032836D005287ED0FF20BE -:104F8000F6A1E53011F04FFAF8BDCD890A2068434B -:104F90000E30188031203880002AF5D0087B9581AA -:104FA000801FC7B21AE020886168308048780A788C -:104FB00000021043F080C8788A78000210433081E4 -:104FC000B21C3846091DFDF772FE002F01D00028E3 -:104FD00002D000203071708008340A3628466D1ED9 -:104FE000ADB20028DFD1F8BDCD890A2068430E306C -:104FF000188032203880002AF5D0087B9581401F28 -:10500000C7B243E0616822880878F2803279C3072A -:1050100052085200DB0F1A43FD231A408307DB0FAF -:105020005B001A43FB231A404307DB0F9B001A4324 -:10503000F7231A400307DB0FDB001A43EF231A4064 -:10504000C306DB0F1B011A43DF231A408306DB0F65 -:105050005B011A43BF231A404306DB0F9B011A432F -:105060003271C00970718A784B7810021843308110 -:1050700032463846C91CFDF71AFE00E00CE0002855 -:1050800002D00020B070308008340A3628466D1EE9 -:10509000ADB20028B6D1F8BD087BCD89801E86B29E -:1050A0003046083068431030188034203880002A99 -:1050B000F1D0174695811037E800D681C0190090CD -:1050C0000DE020883880009878603246616800984A -:1050D00011F02BF800980834801908370090284602 -:1050E0006D1EADB20028ECD1F8BDFFB581B00A9DB0 -:1050F0001E460C46002A05D0607AFF300130D08071 -:10510000E089108101980E270078030011F07CFAE5 -:105110000B7E0719293541536C7878787E00009210 -:10512000087B082805D0032803D091A1954811F0E9 -:105130007AF9378030200FE000990020888105B08F -:10514000F0BD0092087B042804D08E4888A114305A -:1051500011F069F937803120288000980028EBD1C0 -:10516000EDE70092087B042804D0932080A1800002 -:1051700011F059F937803220EEE70092087B0228BF -:1051800004D080487AA13A3011F04DF937803320AD -:10519000E2E7087B1746042804D07A4874A14C3013 -:1051A00011F041F91020308034202880002FC6D023 -:1051B0000020B88116E0207B1746052806D0062877 -:1051C00004D070486AA1603011F02DF912203080AF -:1051D00035202880002FB2D0E089B88100203882A5 -:1051E00001984088F881AAE70092087B072804D03C -:1051F00064485FA1713011F016F937803620ABE7B3 -:1052000033460095019800F00EFC98E72F2053A13B -:10521000000111F008F992E770B50C46054603F05D -:10522000EEFF002804D00078222803D2082070BDA9 -:10523000554870BD00231A460421284607F09AFC01 -:105240002060002801D0002070BD032070BDFFB594 -:105250008BB00D4607461720694608850E98032631 -:105260001446002805D10EA93846FFF7D5FF0028BF -:1052700034D1002D0BD000220321384607F0BFFAAD -:10528000002834D00E980078002830D108E020782B -:10529000092819D00F2823D030A13C4811F0C3F8B9 -:1052A0000E98A760801D03AA606002320AA92046FA -:1052B00000F00FFC002827D0030011F0A5F9071A11 -:1052C000182323211C1E23000726002231463846BE -:1052D00007F095FA0028E3D12B48801C0FB0F0BDF1 -:1052E00000220321384607F08AFA0028D8D111207D -:1052F000F4E70020F2E70820F0E72348401CEDE740 -:105300000720EBE70320E9E701A800906846038D3A -:1053100004223146384606F08AFF0028DED1002DEF -:10532000DCD00E990D70D9E730B587B01D460C461C -:10533000002A11D0042369460B7013888B81528890 -:10534000CA81A2788A7422880A8200236A46294682 -:10535000FFF77DFF07B030BD1020FBE77372635C81 -:1053600067617474635F636F72652E630000000091 -:105370007372635C67617474635F636F72652E63DD -:105380000000000025020000023000004F03000072 -:10539000F3B581B001980C4600780826030011F09F -:1053A00033F9125F47471B134B0A0A0A0A0A0A0A13 -:1053B0000A0A0A0A0A5F002C02D1F849F84808E0F4 -:1053C0006078304360703CE0002CF9D1F448F34938 -:1053D000083011F028F8F3E70198002380880122B3 -:1053E00087B20421384607F0C5FB0546002C04D0DF -:1053F0007520EA49C00011F016F8002D04D1E848E4 -:10540000E649143011F00FF83946A81D00F058FB9A -:10541000FCF78EFA040006D0607830436070678035 -:10542000FCF767FA0FE01321384605F0DBF915E0C9 -:10543000DB48DA49283002E0D948D8492D3010F04D -:10544000F2FF002C0AD06078000707D59320207067 -:105450002046582208300199FBF7B6FE0020FEBD19 -:10546000CF48CE493130EAE710B500210170801DE8 -:1054700000F023FB10BD0A4610B50146901D00F058 -:1054800027FB10BD70B5002305461A46042107F01E -:1054900071FB040004D1F920C049800010F0C3FF63 -:1054A0002946A01D00F00CFB70BDF7B5054684B081 -:1054B0000C4600206946088188806F8803460122D7 -:1054C0000421384607F056FB060004D1FD20B349FD -:1054D000800010F0A8FF002C03D0A7800020E080FF -:1054E0002081297A20461230C91E142700900B0013 -:1054F00011F08AF80FFEFDFC3809A95E657A2FB21B -:10550000C9E99191FC003078012804D0A3497020AA -:10551000143110F088FFA9896A46C8000E309080C7 -:1055200030201081002C13D0A18100200DE0C1009B -:10553000327909190A747288CA8182005319DA898A -:105540004A821A8A401C8A8280B2A1898142EED89E -:10555000F1E002A8009001AB22462946304600F057 -:105560002BFAE8E03078042804D08C49BD201431AF -:1055700010F059FFA8890622014650436A460E30B2 -:10558000908033201081002CE2D0A18100200BE01C -:10559000062141434F190919FA89CA81BA7C8A74D4 -:1055A0003A8A401C0A8280B2A1898142F0D8C2E0C6 -:1055B000307806280BD079491431D72005E03078AF -:1055C000062804D07549EB20143110F02CFFE8892F -:1055D00069461230888035200881002CB8D0A9890E -:1055E000A1817188E18126E03078072804D06B49D9 -:1055F000FF20143110F017FFA8896A4601460E30CB -:10560000908036201081002CA2D0A1812046AA894A -:105610000E30296954E0E8896946123080B2382298 -:1056200088800A81002C7ED0A989A181287A10283F -:1056300007D00221A173E9892182EA8929690098AA -:105640003EE00121F6E702A8009001AB2246294680 -:105650003046FFF787FC6EE03078082805D04F49C8 -:10566000FF201431EE3010F0DEFE684637218780CF -:105670000181002C5FD0A989A18100206082208255 -:105680000120A07357E03078092805D04349FF2056 -:105690001431FF3010F0C7FE288A69461430888024 -:1056A00037200881002C46D00421A173A989A1814B -:1056B000E9892182298A618220462A8A143069690F -:1056C00010F033FD37E030780A2804D033493548EC -:1056D000143110F0A8FE6846372187800181002C24 -:1056E00029D00521A1730020A08102E01EE003E083 -:1056F0000CE0208260821EE002A8009001AB2246EE -:1057000029463046FFF7F1FC15E00CE00D20694614 -:10571000392288800A81002C05D00120E0800020F9 -:105720002081207307E00699088019E01C481B4976 -:10573000A43010F078FE6846069980880880002C16 -:105740000ED0684600892080684680886080287A6C -:10575000032805D0102803D0112801D00020307074 -:10576000002007B0F0BDF7B5568815460F46002358 -:1057700082B01A460421304607F0FCF9040004D137 -:1057800007480649C43010F04EFEA41D33462A4691 -:1057900039460094029800F022FBD0E45C530000EC -:1057A0009503000013020000F7B58CB00D461446B7 -:1057B00007A90C98FFF730FD002812D1B64E01273B -:1057C000002C0FD00321684601701021818208A8A7 -:1057D00002460690204605A9FDF78FFA00280BD057 -:1057E00007207BE50821684601708581C681052177 -:1057F0008774C90201820BE00798A17801712188A2 -:105800004180684605218774C90201828581C6816D -:1058100002460121079B0C98FFF719FD5EE508B5CC -:1058200001236A4693709D4B13800A460223694602 -:10583000FFF77AFD08BD08B501236A469370974BC0 -:105840005B1C13800A4603236946FFF76DFD08BD04 -:1058500000B587B000290CD002236A4613700B886C -:1058600093814988D18100230421FFF7F0FC07B020 -:1058700000BD1020FBE710B5002903D00523FFF77A -:1058800053FD10BD072010BD70B588B00D461446FD -:10589000064607A9FFF7C0FC00280DD1002C0DD04B -:1058A0000621684601708581C481079B02465C80A1 -:1058B00006213046FFF7CBFC08B070BD05216846D5 -:1058C00001708581F1E710B588B000290BD007245D -:1058D0006B461C709A81049100236A462146FFF7AB -:1058E000B6FC08B010BD1020FBE770B500241722ED -:1058F00088B0002914D00D782B0010F085FE062307 -:10590000050519041B231522D21E93B2CA88002A4A -:1059100002D08E68002E03D09A4203D90C20CBE728 -:105920001020C9E7042D05D08A88002A0AD101E099 -:105930000620C1E7012D11D0022D05D0042D18D06D -:10594000052D23D00720B7E709236A4613704B883B -:105950009381CB88D381896804911DE00C236A462A -:1059600013704B889381CB88D38189680824049174 -:1059700012E00D236A4613704B8893818B88D38184 -:10598000CB88138289680924059105E00E236A46B5 -:105990001370497811730A2400232146FFF757FC3E -:1059A0008AE700B587B00F236A4613709181002300 -:1059B0001946FFF74CFC5AE7FEB50078089D1C46D7 -:1059C00016460F46012803D03549912010F02BFDD3 -:1059D000F889C0000E30208030202880387B001FDE -:1059E000C0B20190002E1DD0F889B081002516E0CC -:1059F000E8008419C0190090224641690E320198CE -:105A0000FDF755F9002802D000202074E0810098AD -:105A10006D1C008A60820098ADB2408AA082B08975 -:105A2000A842E5D8FEBD70B514461425049A1D8021 -:105A300037231380002C0ED0CA89A28100226282F3 -:105A40000078082808D0092810D00A2819D014494D -:105A5000144810F0E8FC70BD087B0C2804D01148F5 -:105A60000F490C3810F0DFFC012008E0087B0D28FE -:105A700004D00C480A49083810F0D5FC0420A07363 -:105A800070BD087B0E2804D006480549001F10F0A1 -:105A9000CAFC0520F3E70000FFFF00000228000019 -:105AA00070530000BB02000010B5FE4B5860197225 -:105AB0001A80C90010F098FB10BD002101807047CA -:105AC00010B50022D2430280032007F0F8FC10BD7D -:105AD0007047F0B50E460446017801208840F2492F -:105AE00099B008400090616815460888EF4A9042D6 -:105AF00006D0009A002A06D0EB4A521E104202D06D -:105B0000012019B0F0BD009A10430880002D12D07A -:105B1000002028702178EA1C0027681C01920B00E5 -:105B200010F072FD10F30E16233A59616F3CB4B0B9 -:105B30008AB8F2F1F0F320780B28EBD00420E0E7EC -:105B400002212970A1890170090A4170032097E0A0 -:105B500004212970A1890170090A41700198E18925 -:105B60000170090A417005208AE006212970A18987 -:105B70000170090A41700199E2890A70120A4A709B -:105B8000218A0171090A4171A28AE81DA16910F0F8 -:105B9000CCFAA08AC01D73E0082129702178082959 -:105BA00001D110212970A1890170090A4170019861 -:105BB000E1890170090A41700520308020466A1D84 -:105BC00002A91030FDF799F800287DD16946308888 -:105BD000097A401854E00A212970A1890170090A44 -:105BE000417003200BE00C212970A1890170090A82 -:105BF00041700198E1890170090A417005203080E7 -:105C00009CE0A08984464000401C81B230888842D4 -:105C10005AD3052958D30E202870002008E02369A4 -:105C200042009B5A521953701B0A401C937080B259 -:105C30006045F4D33180B9E09A48417A002973D0A5 -:105C4000491E4172217B4068C9004518A98828680F -:105C5000082240180838216910F067FA02216846C6 -:105C600001710021417128680390A988684601816B -:105C7000002101A8FFF78CFB0020A880002E00D097 -:105C8000308093E0297880221143297029784022BE -:105C90001143297029788909890112312970A18954 -:105CA0000170090A4170E289E81C216910F03DFA8F -:105CB000E089C01C3080287841063FD5C00975D0E6 -:105CC00001216846017200E02CE000214172318818 -:105CD000091D81810495E189019808180590001D2E -:105CE00006907048017A68460177002102A8FFF704 -:105CF0004FFB074630880C303080022F06D0002F33 -:105D000054D065E03DE033E01CE05EE06548694664 -:105D1000097F4268CB00D218037A994202D2918857 -:105D2000002902D0042753E02FE0417A491C417238 -:105D30001560308890800020308049E06168A0893B -:105D4000888033E029788909890116312970A18971 -:105D50000170090A41700198E1890170090A4170D6 -:105D6000228A681D616910F0E0F9208A401D46E72B -:105D700028788009800118302870207B6870022004 -:105D80007EE760680188090401D4052720E0C08807 -:105D9000A189884201D006271AE01E202870012020 -:105DA0003080606801884904490C0180009800280F -:105DB0000ED03C4800220088A1688300032007F031 -:105DC000D9FA61682078887007E0002030800327C6 -:105DD0006068009902888A430280384691E6FFB5E0 -:105DE0009FB0289D0E46002805D0172803D82A8882 -:105DF0002E4B9A4202D1072023B0F0BD32785306D1 -:105E000001D4D20901D00820F6E700226B461A71AE -:105E10005A7114463278431E1D939BB2189303ABFC -:105E20001A939706CB1CBF0E1B93821E711C3B005E -:105E300010F0EAFB209011EE66EE74EEB0EED4EEB8 -:105E4000EDEEECEEEBEEEAEEE9EEEEEEE8EEE7EE8E -:105E5000E6EEE5EE90EE05287CD10421684601715E -:105E6000A9780172F078B278010211436846418145 -:105E70003179417170788006800E0C282ED009DCB3 -:105E8000801E030010F0C0FB0919661C6621662401 -:105E90006627660012282AD00ADC0E2821D0102896 -:105EA000DAD121E00C090020FF710000FFFF0000A3 -:105EB00016281FD01828CFD11FE02878800701E0CE -:105EC00028784007002845DA45E128780007F9E7F7 -:105ED0002878C006F6E728788006F3E72878400699 -:105EE000F0E728780006EDE72888C005EAE728886B -:105EF000C004E7E728888004E4E728884004E1E755 -:105F00002A78920726D50328A6D105206A46107163 -:105F1000487809780002084310811CE12978490774 -:105F2000F0D5062816D3717890B2012902D0022943 -:105F300092D101E0022100E01021189106216A4669 -:105F400011710021118102AF189AB11C0237921C05 -:105F50001B921AE0B3E04A780B7812021A433A8097 -:105F6000801E891C1790BA1C1A911898FCF79FFE86 -:105F70001A991898189A091817986B46801A1A894E -:105F800080B2521C1A811B9ABF1D8242E3D900289D -:105F900086D1E0E028780007B4D51D98694682B222 -:105FA0000720087100200881701C0A3111E0437835 -:105FB00007781B023B430B80C37887781B023B4367 -:105FC0004B806F463B89121F5B1C001D92B23B81C8 -:105FD000091D042AEBD2002A71D1BCE02978C90638 -:105FE0006DD502286BD308206946087100204881CE -:105FF00070780872844692B2B01C1A9919E089E050 -:1060000090E07EE067E05BE030E025E019E013E03F -:10601000BCE0437807781B023B430B80831C4B603A -:106020006346D21A6F467B8960445B1C92B27B81C7 -:1060300008319445EDD9CEE7287880063FD509226E -:1060400003E0287840063AD50A2268460271AA88F9 -:106050000281189A428107E0287800062FD50B208C -:106060006A46107118981081039174E02988C90557 -:1060700025D5022823D30C206946087100204881C9 -:1060800070780872844692B2B01C1A9914E0437872 -:1060900007781B023B430B80C37887781B023B4386 -:1060A0004B80031D4B606346D21A6F467B89604468 -:1060B0005B1C92B27B8108319445E8D98BE763E0A1 -:1060C0002988C90460D501285ED10D216846017177 -:1060D000A98801813FE02988890455D5052853D333 -:1060E0000E2269460A71AA880A811B99401F4A78C4 -:1060F000097812020A4369464A818881701D04901A -:1061000029E0298849043FD501283DD10F2069465F -:10611000087120E02A88120436D44A780B781202DB -:106120001A43EA8003282FD332789206920E1B2A54 -:1061300026D011226B461A712A880123DB031A43E9 -:106140002A804A78097812020A4369460A81C01EE9 -:1061500048811B98039030788006800E1B2809D058 -:106160001D2807D00320229907F0A9F92888C00B21 -:10617000C003288001A82199FFF70AF920463BE6D1 -:1061800010226B461A71DCE70724F7E70824F5E7CD -:1061900000B597B0032806D16A461070019100211E -:1061A0006846FFF7F5F817B000BD000010B58B7812 -:1061B000002B11D082789A4207D10B88002B0BD08C -:1061C00003E08B79091D002B08D08B789A42F8D117 -:1061D00003880C88A342F4D1002010BD812010BD9B -:1061E000052826D0002A02D0012A0DD102E0098814 -:1061F000090501E009888904890F07D0012918D011 -:10620000022909D003290ED081207047002A01D02D -:10621000032070470220704703280AD0042808D0C2 -:10622000002804D007E0042803D0022803D005206A -:106230007047002070470F20704770B513880546DF -:1062400014460B8018061DD5FE481022807AA842FD -:1062500003D813430B80002070BDA06893430078DF -:10626000E840C007C00E03430B802078A178800768 -:10627000800D0843F4490FF0D2FFA0686943081865 -:10628000401C70BD906870BD37B569468B8813801F -:1062900019061BD5EB4C0125A47A9168844209D8D4 -:1062A000FE280FD1D80602D5A5406D1E00E00025BE -:1062B0000D7007E085400C78DB06DB0FAC438340B4 -:1062C0001C430C7010881021884310803EBDF8B527 -:1062D0000746C81C80080E468000B04201D08620C8 -:1062E000F8BD082A01D90E20F8BDD64D00202E6039 -:1062F000AF802881AA723446E88016E0E988491CFC -:10630000E980810610D48007A178800D0843CE492A -:106310000FF085FF206800F0BAFA2989401880B292 -:106320002881381A8019A0600C3420884107E5D4F0 -:106330000020F8BDFFB589B09F041646139DBF0C21 -:106340000193099800F095FA04000AD0207800061D -:1063500009D5BC48817A0A98814204D887200DB0BB -:10636000F0BD0120FBE7224669460A98FFF765FF6A -:106370000690002069460872052D14D0012221469E -:106380002846FFF72DFF0028E9D1207840060AD5DE -:10639000022168460172099981810188C1810682C2 -:1063A0004782129805900198000404D500273E46C4 -:1063B0000125079709E02078A1788007800D084320 -:1063C000A14907900FF02BFF0D46019840040AD514 -:1063D0000798A84207D12088E1788005800F000245 -:1063E0000843B04201D3AE4201D90720B7E7B8193C -:1063F00080B20190A84201D90D20B0E76846007A2A -:10640000002804D002A8FDF706F90028A7D10798B4 -:10641000A8420BD1208803210902884301998905EC -:10642000890F0902084320800198E0701498002821 -:1064300000D007801298002815D006983A46801997 -:1064400012990FF072FE224669460A98FFF7F5FE90 -:1064500069460888102188436946088022460099C9 -:106460000A98FFF711FF002079E7FFB5754D0C2260 -:10647000E8882968504383B00C180D9F724905982D -:106480000FF0CDFE0091049800F001FA29682A89E6 -:106490008E46611A0C310918944651188AB2A9889F -:1064A000914202D8842007B0F0BD6A46168A3206AF -:1064B00003D5B20601D58520F5E7EA88521C92B2D1 -:1064C000EA800E9B002B00D01A80B20601D5A7608F -:1064D00006E0604480B22881091A70460818A0605E -:1064E0002246FE200499FFF7CFFE0598A070009881 -:1064F000E07020880599800889058000890F08438D -:1065000003210902884300998905890F090208437C -:1065100004210843208003988078A07103980088A4 -:10652000A08000202073310601D5AC7A00E0012460 -:10653000B10600D5002700260EE0052100200191BC -:1065400002900097E88831460C9B069AFFF7F2FE0E -:106550000028A8D1761CF6B2A642EED30020A2E70E -:10656000F1B5009800F085F9060002D00025009CE6 -:1065700014E00120F8BD204600F07BF907460078C2 -:1065800031498007820DB87810430FF048FE386813 -:1065900000F07DF94019641C85B2A4B22948C18875 -:1065A000601E8142E7DC00992648491EC1800189AE -:1065B000491B018100203070F8BD002804D0401E26 -:1065C00010809170002070470120704710B504467C -:1065D00001881C48C288914201D3822010BD006806 -:1065E0000C22514342189079A07290882081108823 -:1065F000D1788005800F00020843A081A078211D7A -:10660000FFF71BFE20612088401C2080E0800020D6 -:1066100010BD012101827047F7B50546002084B006 -:10662000C043108068681746817868468170686842 -:1066300001886846018000218171288A2C88A04247 -:1066400005D303E0180900200102000004462C8253 -:1066500035E0288A401C2882301D6968FFF7A6FDB6 -:1066600000282AD139889248814201D1601E3880A1 -:106670006888A04228D33088F1788005800F000216 -:10668000084302906946301DFFF790FD002814D1A1 -:106690006989874881421BD0002231460598FFF75F -:1066A0009FFD002809D16A890298824205D1E968D4 -:1066B000B0680FF00DFD00280AD0641CA4B220467B -:1066C00000F0D7F80600C4D1641E2C828220EAE6CE -:1066D0007C80B079B871B088B8803078B1788007A4 -:1066E000800D084378810298B8813946287A32466D -:1066F0000831FFF7A2FD38610020D4E6FFB585B070 -:106700001C460F46059800F0B4F8050009D028781B -:10671000000608D56748807AB84204D8872009B0B7 -:10672000F0BD0120FBE707982A468605B60D6946AD -:106730003846FFF782FD07460E98052816D000223E -:106740002946FFF74DFD0028E9D1287840060DD5F0 -:106750000121684601710599018101884181868185 -:10676000C48101A8FCF757FF0028D8D12888AA784F -:106770008107890D11438005800FEA7800021043DC -:10678000079A964207D04C4A914204D3611E814237 -:1067900001DD0B20C3E7864201D90720BFE7801B3C -:1067A00082B2A24200D922461098002800D002806E -:1067B0000F98002802D0B9190FF0B7FC0020AEE7FF -:1067C000F8B51D4617460E4600F053F8040008D0F1 -:1067D0002078000607D53748807AB04203D8872052 -:1067E000F8BD0120F8BD224639463046FFF725FDA9 -:1067F000002D0BD02078A1788007800D08432E490A -:10680000884201D2012000E0002028700020F8BD5D -:10681000F8B51E4617460D4600F02BF8040008D0C8 -:106820002078000607D52348807AA84203D887201D -:10683000F8BD0120F8BD224639462846FFF724FD61 -:10684000FF2E14D02588A178A807800D08431A4987 -:106850000FF0E5FC002E03D1FF31FF31033189B287 -:10686000A170A80880008905890F084320800020B6 -:10687000F8BD1049CA88824207D3002805D00C22EF -:10688000096850430C38081870470020704703B55A -:106890000846694609888A0607D4090604D50549C9 -:1068A000897A4143491C88B20CBD00200CBD000010 -:1068B000FFFF00001809002001020000F8B507786A -:1068C0000D460446012F19D0072F02D00C2F19D1E5 -:1068D00014E0A068216906780B2E0BD0052006F085 -:1068E000EEFD052E0ED0782300220520216906F04A -:1068F00041FD07E0782300220620F8E70520216902 -:1069000006F0DDFD002D0ED000202870294620461F -:1069100004F0AEF9FE482978C05D884201D1032019 -:10692000F8BD0220F8BD0021204604F0A1F90020A6 -:10693000F8BD70B50E460C462036317901208AB07C -:106940001546002909D0012905D12978042902D149 -:106950000520107000200AB070BD6068019005A885 -:1069600002900D21C01C0FF03DFC032205A8A16878 -:106970000FF0DBFB01203071062069460870206AA9 -:10698000049029466846FFF799FFE4E770B50C4686 -:10699000154620310A790120062686B0002A2CD01F -:1069A000012A28D12978042925D169681022A068F4 -:1069B00001F0B4F96868C07B000606D5D44AA06827 -:1069C0001023103A014601F09EF91022A168E068F8 -:1069D00001F0A4F9A068C07B000606D5CC4AE068A7 -:1069E0001023103A014601F08EF92E70A0686860FD -:1069F000E068A860002006B070BD60680190C448DF -:106A0000203802900120087168460670206A0490C0 -:106A100029466846FFF752FFEDE7027B032A06D0BE -:106A2000002224235A540B78092B02D003E00420BF -:106A300070470A76CA61027B9300521C0273C150F0 -:106A400003207047F0B50E4615460C462036024628 -:106A500031790120072393B000290CD0012924D0DB -:106A600002292ED0032904D12978042901D12B70C1 -:106A7000002013B0F0BD01203071606800280DD0F7 -:106A8000A1690B7060684860206988606069C860AF -:106A9000206A08621046FFF7C0FFEAE70620287068 -:106AA000206968606069A86009E029780629E0D15A -:106AB0000220307104202870954820386860032037 -:106AC000D7E729780429D4D1A08910280AD9103809 -:106AD00080B2A081A1681023091805A86A6801F096 -:106AE00012F923E010282FD0C2B21020801AA1681A -:106AF0000DAF1190C0190FF018FB11980006000E91 -:106B000006D0401EC1B28020785438460FF06AFB90 -:106B1000626910230DA909A801F0F5F8102309A94D -:106B200005A86A6801F0EFF80320307160680190F1 -:106B300005A80290062069460870206A049029463C -:106B40006846FFF7BBFE94E710232269A168E2E7DD -:106B5000F0B50E460C4620363179012006278FB05D -:106B6000154600290BD0012932D0022905D12978F8 -:106B7000042902D10820107000200FB0F0BD217D43 -:106B800008A8CA07D20F02718807C10F08A80171AF -:106B90006846027041700722801CE1680FF0C5FA58 -:106BA00002A80722013021690FF0BFFA6068059042 -:106BB0000AA8069010236A46A16801F0A4F80120F3 -:106BC000307168460774206A0890294604A820E0BE -:106BD00029780429D1D1062205A8E1690FF0A5FA88 -:106BE00006A806220230A1690FF09FFA0020089043 -:106BF0006068019009A80290102305AA696801F055 -:106C000082F80220307168460770206A0490294695 -:106C10006846FFF753FEB0E770B50D460C462035C9 -:106C2000297901208CB01646002909D0012905D107 -:106C30003178042902D10920107000200CB070BDF9 -:106C40006068019006A802900822E1680FF06DFAD2 -:106C5000082208A8A1680FF068FA01202871062010 -:106C600069460870206A049031466846FFF726FEA0 -:106C7000E4E770B50D460C462035297901208CB02B -:106C80001646002908D00129D8D131780429D5D158 -:106C90000A2010700020D1E76068019006A80290D9 -:106CA0000822A1680FF041FA002008900990012005 -:106CB0002871062069460870206A049031466846AB -:106CC000FFF7FCFDBAE730B50B4620331C790120F5 -:106CD0008BB0002C09D0012C05D11178042902D1E8 -:106CE0000B20107000200BB030BD4868019005A843 -:106CF00002908C6868462578057564784475CC6880 -:106D0000257885756478C47500200690079001E0A9 -:106D10002867010008900120187106236846037057 -:106D2000086A049011466846FFF7C8FDDBE770B5B6 -:106D30000C462034034625790120002D0AD0012D70 -:106D400014D0022D05D111780A2902D10C2010701F -:106D5000002070BD01202071C868052202704A68B9 -:106D60004260F84A8260921CC2600BE015780B2DDD -:106D7000EFD102202071C868042404705268426078 -:106D80008A688260096A016201461846FFF745FE7B -:106D900070BD30B5011D02463132947803258379E8 -:106DA000ED432C4323408371DB070DD04B7954799D -:106DB00023404B710B79127913400B718278C9789B -:106DC0008A4200D9817030BD00224A710A71F5E70C -:106DD000F7B50C4686B00020694626460870203676 -:106DE000317901271E2015461F2977D24B007B449D -:106DF0009B885B009F441E0017023E0256026902F8 -:106E000088029A02D102F5022E03590371037F030F -:106E1000AE03C303CC03F7031A0464049A04AB045F -:106E2000DF04FE0410052A0565059B05C6058305DC -:106E300087058B056069002802D0007813287DD073 -:106E4000A0680590002849D0012168460170206A99 -:106E500004900321684601710A214171E0690290A2 -:106E600020790028EFD0059909780029E7D00C296E -:106E700064D20B000FF0C8FB0CFD1A4B90B5E8FC78 -:106E8000FBFAF9F807FD022828D16069002802D032 -:106E90000078082852D1022168460170206A0490C7 -:106EA00005984178684601710021B9E20620216AFF -:106EB00006F005FB20790728E6D1606900F050FF55 -:106EC00002280CD0606900F04BFF042807D06069ED -:106ED0000028B8D000780128D6D103E01BE2616910 -:106EE0000120087005980079C11F0A2901D30A20E2 -:106EF00050E06169072288706069059930300FF0B1 -:106F000014F90120307161690320087034E007280A -:106F1000BAD16069002896D001780929B4D10599C1 -:106F2000C978890707D1059949790029DFD10599E1 -:106F300089790029DBD105994A7900E04EE20146C2 -:106F400020314B7D9A43D2D1059A8B7D92799A4319 -:106F5000CDD1059A1279D31F0A2BC8D20979914253 -:106F600036D80722C01C05990FF0DFF801203071D8 -:106F700061690A200870032069460870206A04903D -:106F80006069313001906069001D029060691C30B9 -:106F90000390A1E22076F2E311288DD1606900F020 -:106FA000DFFE042804D0606900F0DAFE0B2893D1DC -:106FB0006069059910223730491C0FF0B6F86069F6 -:106FC000017804297CD12421095C8278914201D97D -:106FD0000620DFE70521017003203071684601704B -:106FE000E2E3112894D1606900F0BAFE062804D0CB -:106FF000606900F0B5FE0C288AD1E068002813D043 -:107000002069002810D060690178062910D00D2170 -:1070100001706069059910225730491C0FF085F8FE -:107020006069573009218CE100206946087072E1DF -:10703000072101706069059910224730491C0FF043 -:1070400074F860694730EDE70228F0D1606900F01C -:1070500087FE0028EBD0606900F082FE0128E6D0B0 -:10706000606900F07DFE05E0B1E08DE06CE02AE0B3 -:107070000AE0D6E00828DAD00521684601710598B3 -:1070800041786846417146E11128D0D160690028F5 -:10709000CDD001780E29CAD1C16A4078022810D01B -:1070A0000020142250431430085805991022491C1E -:1070B0000FF03BF80520216A00F040FE0F205EE053 -:1070C000F1E10120EDE70B28B1D160690028AED0D5 -:1070D00001780F29ABD1C16A4078022826D0002060 -:1070E000142250430C300958059842780A70807871 -:1070F00048706069C16A4078022819D000201422C3 -:1071000050431030085805990822C91C0FF00DF89B -:107110000520216A00F012FE60694178022909D039 -:1071200000220832825C5208520073E00120D7E747 -:107130000120E4E70122F4E7012100E00021083109 -:107140004254BCE30267010011289CD16069002809 -:1071500099D00178102996D1C16A4078022811D0BF -:107160000020142250431830085805991022491C59 -:107170000EF0DBFF0520216A00F0E0FD11206169BF -:107180000870B4E30120ECE7082884D16069002886 -:107190009DD00178112997D10599C06A497801706D -:1071A00060690599C06A0622401C891C0EF0BDFF6B -:1071B0000520216A00F0C2FD60694178022904D0EF -:1071C00000220832825CFD2323E00122F9E7112826 -:1071D000BBD160690028BBD001781229B5D1C16A42 -:1071E0004078022819D00020142250431C3008583F -:1071F00005991022491C0EF098FF0520216A00F025 -:107200009DFD60694178022909D000220832825C24 -:10721000FB231A40022991D18EE70120E4E70122E5 -:10722000F4E70720B6E6287801288ED160696968FE -:1072300014221C30F9F7C8FF6069017F002901D0D2 -:107240002176ACE30178032901D0032037E002273F -:10725000C77081794907490F8171017A4907490F40 -:107260000172417A4907490F41726069FFF791FD48 -:10727000377196E228780F28E3D107206946087015 -:10728000216A049191680291694608716169072237 -:10729000C91C02980EF049FF6169042008700020A3 -:1072A0003071BBE028780328CBD1606901780529CB -:1072B000696807D0082247300EF037FF042030718C -:1072C00005206FE208225730F6E728780328B8D166 -:1072D000606901780529696811D008224F300EF0E5 -:1072E00024FF052030716069006A00280AD002205E -:1072F0002870002028716069006AA860F9E00822FF -:107300005F30ECE704204DE22878022899D12879F3 -:10731000002801D0207642E36069A96801626069B3 -:10732000002901D1F949016206200BE228780F28D3 -:1073300087D1A868E0616069017805292BD04730C2 -:1073400007213171E16802220A706269126A4A609B -:10735000886060693030C8606069C01C086162691B -:10736000087D926A400812784000D207D20F10437D -:1073700008756269926A521C8A61FD221040626936 -:10738000D26A1278D207920F104308756069C06AFA -:10739000401CC86153E25730D2E728780828BAD198 -:1073A0006069017805291AD00B2101700720694610 -:1073B0000870206A0490E069029011200871029818 -:1073C0000321017051681022401C0EF0AEFE002116 -:1073D0006846FFF773FA00203071E06187E206210A -:1073E000E3E728780F2896D1072069460870206ABD -:1073F0000490A8680290112008710298042101707D -:1074000061690A78072A0ED0002232710C220A70B4 -:1074100061691022401C47310EF087FE002168464A -:10742000FFF74CFA63E21022401C57310EF07DFE4C -:1074300000216846FFF742FA0A203071E168032014 -:1074400008706069006A48606069573088606069E8 -:107450004730F3E128780828A1D1606969681022D3 -:1074600037300EF035FE002801D0042092E5606927 -:107470000078072817D00A203071E16803200870CF -:107480006069006A486060695730886060694730A9 -:10749000C860206A08620698FFF7BFFA074660696D -:1074A000FFF777FC6BE208207AE1287809289AD167 -:1074B0000B20307161696868897810224018511A70 -:1074C0000EF090FE082069460870206A04906868F3 -:1074D000019060698078087268E129780D29BBD134 -:1074E00061698979C90703D00C20307109203EE019 -:1074F0003071032770E228780E28ADD1606914221C -:10750000291D1C30F9F760FE6069018DC06A417267 -:10751000090A817260698178C06AC1716169CA6A49 -:10752000081D117AC909C9011172437962691943A9 -:107530008378D26A9B079B0F012B00D00023007930 -:107540009B01C00003431943117260694078012810 -:1075500076D0B4E160694178022901D0012100E0D0 -:1075600000210831405CC00707D00E20EAE06946E0 -:107570000870206A1146049019E11320B8E72878B2 -:107580000F2894D1A868E0610F2030710520EEE744 -:10759000287803288BD16069C16A4078022801D01D -:1075A000012000E000201422504310300858082227 -:1075B00069680EF0BAFD10203071E168062022697A -:1075C00008706069406A48606069C36A4078022850 -:1075D00001D0012000E00020142778431030185813 -:1075E000CA6088602BE128780C2886D16069C26A5D -:1075F0004078022801D0012000E0002014214843F7 -:107600000C30105802230932696800F07CFB11200D -:107610003071E168052008706069006A486060693F -:10762000C06A093088603948001F07E128780B28B4 -:10763000A7D161694878CA6A022802D0012001E016 -:1076400059E1002014235843143010588A7869688F -:107650000EF06BFD60694178C26A022901D00121F8 -:1076600000E00021142359431431525881785018F6 -:107670001022511A0EF0B6FD072069460870206AE4 -:107680000490E069029011200871029806210170AF -:107690006169CA6A4978022901D0012100E000210C -:1076A00014235943143151581022401C0EF03DFD53 -:1076B00000216846FFF702F90020E06112206FE028 -:1076C00028780F2891D1072168460170206A04901C -:1076D000906802900B2268460271029801706169FD -:1076E000CA6A4978022901D0012100E0002114234F -:1076F00059430C3151580A78427049788170616958 -:10770000CA6A4978022903D0012102E00867010012 -:10771000002114235943103151580822C01C0EF087 -:1077200004FD00216846FFF7C9F826E76069417843 -:10773000022901D0012100E000210831405C8007CE -:1077400003D5142030710A2011E71620D0E62878DE -:107750000F287AD1A868E061072069460870206A7E -:107760000490E069029011200871029808210170CC -:107770006169CA6A4978022902D0012101E011E158 -:10778000002114235943183151581022401C0EF087 -:10779000CCFC00216846FFF791F80020E06115203D -:1077A00030710A2069460870206A049029466846AC -:1077B000FFF784F82BE028780F2846D10720694688 -:1077C0000870206A0490906802900820087102985E -:1077D0000921017061690622C969097841706169EE -:1077E000801CC969491C0EF0A0FC00216846FFF707 -:1077F00065F8AAE760694178022901D0012200E01A -:1078000000220832805C400703D51720C8E70746EE -:10781000B5E0012953D070E028780F2815D1A86869 -:10782000E06118203071E168052008706069006A25 -:1078300048606069C06A09308860F848C860206A9A -:1078400008620698FFF7E9F8E1E76FE028780B286F -:107850006CD16069C16A4078022801D0012000E043 -:107860000020142250431C300858102269680EF082 -:107870005CFC072069460870206A0490E069029069 -:107880001120087102980A2101706169CA6A497859 -:10789000022901D0012100E00021142359431C31A9 -:1078A00051581022401C0EF040FC00216846FFF7A2 -:1078B00005F80020E0616069407801281DD1192099 -:1078C00016E660694278022A09D000210831411881 -:1078D000097800290DD0CA0703D00E2106E0012146 -:1078E000F4E7890701D5102100E01221017000277B -:1078F00072E0012A01D00D20FAE51C20F8E51D20D8 -:1079000030710B2033E62978102948D1F0E5606901 -:107910000178012943D0082941D00021317100F0BC -:1079200019FA0C2069460870206A049037E028781C -:107930000F2805D01020107003271B2030714BE05A -:10794000072168460170206A0490A868029002210D -:1079500068460171029805210170217E4170002165 -:107960006846FEF7ABFF0B2168460170206A049061 -:1079700029466846FEF7A2FF07461B203071012FFB -:107980000DD029E0012168460170206A049004218D -:1079900068460171217E41710020207612E0207E30 -:1079A00000280FD06169132008701A2030710A2056 -:1079B00069460870206A049029466846FEF77EFFF3 -:1079C000074609E06069002801D01421017068466B -:1079D0000078002800D021E5384609B0F0BDF7B5A1 -:1079E0000F4620373879012686B00C46002804D08F -:1079F000012828D002281CD197E02079012804D042 -:107A0000022811D0032814D10AE0A0684078012888 -:107A10000ED10620216A05F02CFD00287FD10CE054 -:107A2000A1681320087008E0A0684178022901D0FD -:107A3000052674E00078082871D1012038710A20E9 -:107A40006946087033E0089800780F2867D107214D -:107A500068460170206A049008988568029522792A -:107A60000220012A04D0022A29D0032A57D10FE08C -:107A70000646684606710B202870207B00214007CF -:107A8000400F68706846FEF719FFA068067045E071 -:107A900006466846067105202870207B6870002124 -:107AA0006846FEF70BFF3E710B2168460170206AA5 -:107AB000049068460899FEF701FF06462FE06846E5 -:107AC000017101202870207C6870607CC007C00FA5 -:107AD000A870A07C4007400FE870E17C2971C007C6 -:107AE0001FD0207D4007400F6871607D4007400F28 -:107AF000A87100216846FEF7E1FEA068072229462A -:107B000030300EF012FBE068017AA068203001717D -:107B1000A16828798870A16809200870002630467D -:107B20005BE70020A8716871E3E7A1681420087082 -:107B3000012168460170206A0490042168460171A1 -:107B4000217B41710021FEF7B9FEE7E7F0B585B072 -:107B50000F4605460124287B800040198038C66FF7 -:107B60003078411E0A290AD22C498000323140184F -:107B70008038C36F3A463146284698470446002C61 -:107B800001D0012C11D1287B401E0006000E287365 -:107B900001D00324DFE70D2069460870306A0490A5 -:107BA000002101966846FEF789FE032CD3D02046BB -:107BB00005B0F0BD70B515460A4604462946104684 -:107BC000FFF7C4FF0646002C0FD0207814280CD1F4 -:107BD000207E002806D000202870204629460C3040 -:107BE000FFF7B4FF204600F0B5F8304670BD70478F -:107BF00010B5012903D0022901D0052010BD417024 -:107C000000F0A8F8002010BD002809D0027E002A4C -:107C100006D00A4601460C31CCE700000667010099 -:107C20000120704730B5044687B00D46062005F0A8 -:107C300046FC2946052005F042FC2078142805D092 -:107C40000020694608702046FFF7DEFF07B030BD10 -:107C50007FB50E4600216A4611730178092903D0C9 -:107C60000A2903D0002407E0446900E08468002C5E -:107C700002D0217E002912D0154601462846FEF783 -:107C8000CCFE032809D1324629462046FFF792FF51 -:107C90006946097B002900D0042004B070BD254648 -:107CA0000C35EAE700B50023012285B005280CD089 -:107CB000062808D1684602700491022101714371BF -:107CC0000021FEF7FBFD05B000BD6846027004917F -:107CD0000271F4E710B590B00C4605216A461170A8 -:107CE000019022480290001D03900AA96846FFF700 -:107CF000AFFF002805D1102220460B990EF015FA8F -:107D0000002010B010BD30B505E05B1EDBB2CC5CCE -:107D1000D55C6C40C454002BF7D130BD10B50024A5 -:107D200009E00B78521E5B00234303700B78401C64 -:107D3000DC09D2B2491C002AF3D110BD70B50C4643 -:107D4000054605F0BCFB782300222146284605F0B5 -:107D500011FB70BD4178012900D0082101707047E6 -:107D6000002801D0007870470820704700670100A4 -:107D700038B50446002069460870204609F053FDD6 -:107D8000002803D1FBA1A3200EF04DFB204609F0F3 -:107D900099FC002803D1F7A1A8200EF044FB684607 -:107DA000007838BD70B5F84D002428462C77203077 -:107DB0008471C47101F09AF928464038047020306B -:107DC0008473847484772C75AC7170BD10B50C46C7 -:107DD000EE4982888A8042884A8000780870084686 -:107DE0000E38847009F050FC08F0FDFFFFF7DAFF51 -:107DF00020460BF013F8E449A8310846813809F011 -:107E0000ADFEE2480CF021FBE0480A3808F0FEFF26 -:107E1000002803D0D7A1C5200EF005FB01F066F9BC -:107E200010BD7CB50E461D46144601A909F008F8A0 -:107E3000002807D10AF091FB022803D1D248007D27 -:107E4000002801D001207CBD01988030807C09F0A1 -:107E50004DFC00280CD0684609F052FC0028F2D0F6 -:107E6000002C03D009F011FCA04206D200207CBDFA -:107E7000C0A1C7480EF0D7FAF8E7009809F0D8F883 -:107E80003146009809F0DBF8E2B22946009809F083 -:107E9000F0F909F045FC002804D1BD48B5A11E3019 -:107EA0000EF0C1FAB94C00250E3C6068A030417953 -:107EB000002902D045710BF0D8F860688030458306 -:107EC000C0E730B40179002904D0012907D030BCC3 -:107ED00000207047831D42880488022103E0428805 -:107EE0000488831D0121204630BC9AE7F8B51D4661 -:107EF00014460E4607460AF030FB022803D0A2487B -:107F0000007D002823D0A1480E3841684988398077 -:107F100040688030807C09F069FD002804D153203E -:107F200094A1C0000EF07FFA684609F069FD0028B0 -:107F30000DD0009809F0BAF83070022808D0012856 -:107F400006D093488BA167300EF06DFA0020F8BD83 -:107F50002946009809F0A4F92080002804D1552072 -:107F600084A1C0000EF05FFA09F05DFD002804D185 -:107F7000874880A160300EF056FA0120F8BD38B570 -:107F80000446831D821C6946FFF7B0FF00280DD010 -:107F90000020607168460078012808D0022806D0C9 -:107FA000FF2074A101300EF03EFA012038BD20718F -:107FB000FBE7F8B50AF0D1FA744D734C0E3D022878 -:107FC00002D0207D00287DD0207F0026102818D1E7 -:107FD000A079002803D067A16E480EF024FA6868E3 -:107FE00001464030827F92070BD526724988618115 -:107FF000C17F2173018CE181408C20820120A0711E -:108000002677614F203FB87C00285ED168686946BA -:108010008030807C09F007FC002805D0694668782C -:1080200009784018687004E05A4852A119300EF0DF -:10803000FAF9207D00283AD06868418852484038D3 -:10804000806D4088814204D00F204AA1C0010EF00B -:10805000EAF968688030807C09F0C8FC002804D107 -:108060004C4844A124300EF0DEF909F0EEFC002863 -:108070001DD068688030807CFFF77AFE69784018F0 -:10808000687041484038806D4030417A01290DD1F7 -:108090002670696849886180807A20710120B877EC -:1080A000207F102801D0282800D1267726756978EE -:1080B00000290AD06868428833484038C286018760 -:1080C000012000E001E0B8746E700AF029FA00287F -:1080D00005D1207D002802D0A878FAF7F9F8F8BD7C -:1080E000F8B50446FFF765FF274D0026203DA87E22 -:1080F000002808D0667010202070E87EA070287FCD -:10810000E070AE769AE0204F403F3878002808D0E3 -:108110002C22B91C20460EF008F80E2020703E706C -:108120008CE0A87B184F002815D0387F102808D085 -:10813000282806D0002804D0FF200EA1C2300EF05F -:1081400072F90120E070E87BA070287C60700F203D -:108150002070AE7372E00121204609F099FC0028DE -:108160001AD0387D002857D10021204609F090FC14 -:10817000F8BD00007372635C6C6C5F6374726C2E8C -:1081800073302E630000000094090020720000206C -:108190004F02000062070000A97CF8480090F848F0 -:1081A000002910D0017805290DD2491C0170667094 -:1081B0000D202070012028750622A01C00990DF0CA -:1081C000B4FFAE743AE0EE480670B879002812D0D9 -:1081D000387F002804D00120EA4940020EF023F93C -:1081E00066700120E54920700A221431A01C0DF0B0 -:1081F0009CFFBE7122E020460CF083F800281DD1C0 -:10820000A87C002802D0DE480178CEE7A87F0028AD -:1082100002D0387D002801D00020A9E7387F00284F -:1082200003D0D849D8480EF0FEF866700A202070B6 -:1082300006223946A01C0DF078FFAE77012097E7A3 -:108240004EE710B5CD4C343C2178002904D01321E1 -:108250000E2000F052FF10BDC9490088091D08F02A -:10826000EFFD002801D0022007E0C5484068014624 -:1082700020318A79012A02D00C20207105E00022E9 -:108280002271097E21724088E080012060711321F3 -:10829000E1700E21A170207010BDB84810B53438BF -:1082A0000178002904D024210E2000F026FF10BD03 -:1082B000012101702422C2700C220271417110BD93 -:1082C00070B5AE4C0546343C2078002804D03E21E1 -:1082D0000E2000F012FF70BD0AF03FF9002808D10F -:1082E0000AF03EF9002804D1A4480C30007F002891 -:1082F00001D00C2003E0287809F033FD0020207124 -:10830000012060713E21E170207070BD9B4810B566 -:1083100034380178002904D03C210E2000F0EDFE15 -:1083200010BD00210171012141713C22C270017018 -:1083300010BDF8B5914C343C2078002804D03B2186 -:108340000E2000F0DAFE13E70020A0710AF005F914 -:108350008A4E01250C36022802D0307D002840D0FC -:10836000874F694678688030807C09F073FA00286E -:1083700003D1844985480EF056F8307D002806D098 -:10838000A06D4030407A002801D0012600E0002690 -:1083900078688030807C09F029FB002804D17B4874 -:1083A000784908300EF03FF809F04FFB684031463D -:1083B000014316D07968FD2249882181217E400041 -:1083C000490849003143114001432176684600784D -:1083D000002802D00420014301E0FB200140217667 -:1083E000A5710020207165713B20E0702570BFE60B -:1083F00010B5624C343C2078002804D00E21084689 -:1084000000F07BFE10BD5E4906220831A01D0DF074 -:108410008CFE00202071012060710E21E17020701F -:1084200010BD70B5554C0546343C2078002804D06A -:1084300038210E2000F061FE70BD50480C30007FE6 -:10844000002807D00C202071012060713821E170D4 -:10845000207070BD287809F072FC28780CF05BF968 -:108460000020F0E770B5454D0446343D28780028DB -:1084700004D037210E2000F040FE70BD3F480C3084 -:10848000007F002801D00C200AE03D4E2188706852 -:108490004088884203D10AF060F8022807D0022001 -:1084A0002871012068713721E970287070BD7168EA -:1084B0007F2020310876487600208876A2788A715D -:1084C000E278CA7122790A72EAE710B52B4C343C83 -:1084D0002078002804D039210E2000F00EFE10BDB7 -:1084E0000AF03BF8032808D00AF03AF8032804D031 -:1084F00022480C30007F002801D00C2003E01F49E7 -:1085000000202C31C8712071012060713921E17087 -:10851000207010BD70B5194C0646343C20780028F8 -:1085200004D03A210E2000F0E8FD70BD0AF015F8E5 -:10853000032808D00AF014F8032804D00F480C30A0 -:10854000007F002801D00C2011E00C4D2C35E8797B -:1085500008280BD20001001910223146683000F0C3 -:10856000D6FDE879401CE871002000E0072020716A -:10857000012060713A21E170207070BD88090020EF -:108580006400002074810000210200001708000030 -:10859000F8B5FA4E04463078002804D03D210E206C -:1085A00000F0ABFDE4E5F5484030007F002801D045 -:1085B0000C2034E0F24D218868684088884203D15D -:1085C00009F0CBFF022801D0022028E06F68648800 -:1085D000FD883A896800B988401C844218D3E9486C -:1085E00041431046E84A50430DF019FE401EFF215A -:1085F00080B2F531884200D90846844200D2204634 -:10860000691C401C0DF00BFE6D1C6843401E85B2BA -:10861000E620C05D002800D1BD84F58000203071C7 -:10862000012070713D21F1703070A1E5F8B5D34C97 -:1086300005462078002804D035210E2000F05DFD8D -:1086400096E5CE484030007F002801D00C2016E08F -:10865000A878002801D0012804D1A888FF21F5318D -:10866000884201D912200AE0C54F298878684088DD -:10867000884203D109F071FF022807D0022020713F -:10868000012060713521E170207071E57968002664 -:108690000846C0310E70AA884A800122A0300271BB -:1086A000AA78012A00D000220A704079002801D05F -:1086B0000AF0DBFC2671E3E770B5B04C0546207884 -:1086C000002804D030210E2000F017FD55E709F0F6 -:1086D00044FF002804D1A9484030007F002801D081 -:1086E0000C2003E028780AF0E0FB00202071012034 -:1086F00060713021E17020703FE770B59F4C0546F6 -:108700002078002804D033210E2000F0F6FC34E756 -:1087100009F023FF002804D198484030007F00284A -:1087200001D00C2018E02978002911D00A290FD097 -:1087300014290DD01E290BD0282909D0322907D0A1 -:108740004B2905D0642903D0FF2901D0122003E072 -:1087500028460AF023FC002020710120607133219B -:10876000E170207009E770B5844C06462078251D1D -:10877000002804D032210E2000F0BFFCFDE6314677 -:10878000002009F0AEFA2870002805D17C480622A6 -:10879000314608300DF0C9FC012060713221E170D2 -:1087A0002070EAE670B5754C2178002904D031219B -:1087B0000E2000F0A2FCE0E600214156012504292C -:1087C00012D0002910D0081D0ED0001D0CD0001DA5 -:1087D0000AD0001D08D0001D06D00A3004D00A308F -:1087E00002D01220207103E0084606F079FD657181 -:1087F0003120E0702570C0E6FEB5604C0746207859 -:10880000002804D025210E2000F077FCFEBD38881A -:10881000694608F015FB594D01460020083500292E -:1088200004D002212171286028710FE00098009E79 -:108830000A30019060360020B07105222846019967 -:108840000DF073FCB0790028F5D13888E0800E2057 -:10885000A0702520E070012060712070FEBD10B571 -:10886000464C2078002804D005210E2000F045FC5D -:1088700010BD0020207108F008FFE08008F0D1FF53 -:108880002072012060710521E170207010BDF1B5EA -:108890003A4C2034A07B002804D010210F2000F097 -:1088A0002CFC65E4354D4035A8790C2610270028AE -:1088B00016D1287F002813D109F04FFE022824D1B9 -:1088C0002F4800994068098842888A421DD1014694 -:1088D000C0310A7A002A05D04030807F80070DD44D -:1088E000E6730EE05E22125C920707D406220A723B -:1088F000A0304079002801D00AF0B7FB2F77002084 -:10890000E07327740120A07332E40220F8E710B569 -:108910001A480178002904D00F210E2000F0EDFB49 -:1089200010BD00210171FF2181710021C943018126 -:1089300013490E310A7882728A8882814988C181FE -:10894000012141710E2282700F22C270017010BD90 -:1089500010B50A4C2078002804D02B210E2000F0FE -:10896000CCFB10BD0821A01D04F024FB00202071C9 -:10897000012060712B21E170207010BD540900208E -:1089800064000020C40900001027000070B5FA4DF3 -:1089900004462878002804D02A210E2000F0ADFBE0 -:1089A000EBE5F54810222146303800F0B0FBF248E4 -:1089B0001022A118203800F0AAFBEF4830380CF044 -:1089C000BCFBED49102210392C46A81D00F09FFB7E -:1089D000002020710E20A0702A20E070012060711C -:1089E0002070CAE5F8B50546E348E34C40300090F6 -:1089F000007F0C2628272034002801D0E6733EE0B3 -:108A0000A07B002804D028210F2000F076FB04E48E -:108A1000A87805280DD013280BD0142809D01528C4 -:108A200007D01A2805D0292803D03D2801D03B289B -:108A300003D12888D149884201D912201EE009F0CB -:108A40008CFD0228DAD1CE482A88406841889142BC -:108A500013D10146C0310A79002ACFD1AA784A71D0 -:108A600001220A710099A0300F770021E17340794B -:108A7000002804D00AF0F9FA01E00220E07327741C -:108A80000120A0735FE4F8B5BB4F064638783D1D62 -:108A9000002804D017210E2000F02FFB53E43146AC -:108AA000012009F01EF901242870002807D1B248DE -:108AB00006226030314605460DF037FBAC717C7103 -:108AC0001720F8703C703EE470B5AB4C0646207839 -:108AD000002804D00B210E2000F00FFB4DE509F01B -:108AE0003CFD032808D009F03BFD032804D0A24830 -:108AF0004030007F002801D00C2016E03378002B96 -:108B000003D0012B01D012200FE09B4DE035297AD4 -:108B1000082909D22846721C0C3006F097FB287AE7 -:108B2000401C2872002000E00720207101206071A5 -:108B30000B21E170207020E510B58F4C20780028C3 -:108B400004D00A210E2000F0D8FA16E709F005FD3E -:108B5000032808D009F004FD032804D086484030DB -:108B6000007F002801D00C2002E000F0BFFA0020B6 -:108B70002071012060710A21E1702070FDE610B5BE -:108B80000AF032F9002803D07E497F480DF04BFCF3 -:108B900008F04BFD0BF051FC002804D01720794958 -:108BA00040010DF040FC08F0ACFF002804D0B920D3 -:108BB000744980000DF037FC00F098FAFFF7F2F8E6 -:108BC0006D4800210171012141710222C2700170C2 -:108BD000D3E610B5684C2178002904D020210E205E -:108BE00000F08BFAC9E601781F290ED8411C0CD081 -:108BF000002121710278411C104609F08FF80120F4 -:108C000060712021E1702070B7E612202071F6E734 -:108C1000F8B5594C2178002904D01B210E2000F012 -:108C20006CFABFE401216171534E0C212171403671 -:108C3000317F00296FD10078514F0025012804D0E1 -:108C400000284AD01220207165E009F086FC002837 -:108C500003D109F085FC002804D009F07EFC02282D -:108C600022D058E008F08FFF002854D0307D002833 -:108C700051D1786801224580032108F0B4FB78685F -:108C800009F05AF97868923008F001FD002803D104 -:108C90003C493E480DF0C7FB0AF00BF9002839D0DB -:108CA00085203849C00015E009F05AFC002832D16F -:108CB000707F00282FD001282DD004282BD008F059 -:108CC00062FF002827D00AF0F4F8002822D02F48AD -:108CD0002C4918300DF0A7FB1CE009F03EFC0328DE -:108CE00004D009F03DFC03280FD014E000200AF066 -:108CF00005F800280FD12571307D00280BD1786848 -:108D00008030807CFFF734F805E0002009F0F6FFA2 -:108D1000002800D125711B20E0700120207041E463 -:108D200010B5154C2178002904D01A210E2000F02E -:108D3000E4F922E601781F290ED8411C0CD000214D -:108D400021710278411C104608F0FDFF012060717E -:108D50001A21E170207010E612202071F6E770B53C -:108D6000054E044630780C25002811D018210E201D -:108D700000F0C3F9AAE4000054090020FF0E00002F -:108D80006400002074810000D3020000240400006D -:108D900009F0E3FB03285AD009F0E2FB032856D080 -:108DA000E14A107F002852D16079002801D00128C3 -:108DB0002DD1A079002801D0012828D1A07B00283E -:108DC00005D0012803D0022801D003281FD1607BE1 -:108DD00000281CD0C0081AD161880120800381427C -:108DE00002D82388834203D9207901280FD119E0C2 -:108DF0002079002806D0012814D0022805D00328A5 -:108E000005D102E020290BD30CE0A02B0AD2207957 -:108E1000042805D12088202802D36188884201D9FE -:108E2000122514E0207950776079002802D00128BB -:108E300003D00CE0BD4A002105E0BB4A2032907906 -:108E4000002804D00121204608F0CEFE054601206E -:108E5000357170711821F170307037E470B5B24C13 -:108E60000546403C2078002804D02E210E2000F03A -:108E700044F92BE409F071FB0C22022815D1AA4811 -:108E8000007F002811D1A9482B88083841684888FC -:108E900083421AD10846C030037A002B05D1203115 -:108EA000C97E0F2903D0102901D0227103E00521CA -:108EB0000172002020710E20A0702E20E070288802 -:108EC000E08001206071207016E40220F2E770B5A6 -:108ED000954C0546403C2078002804D02D210E20DA -:108EE00000F00BF908E409F038FB0C21022814D13A -:108EF0008D48007F002810D18C4E2A88083E70686B -:108F000043889A4220D1C822125C002A05D13B2214 -:108F1000125C0F2A03D0102A01D021710AE010221E -:108F2000A91CD6300DF001F970680421C03001721F -:108F3000002020710E20A0702D20E0702888E08095 -:108F40000120607120700DE40220F2E710B5017875 -:108F50000B000DF059FB3F9E9E399E9E599E9E9E92 -:108F60009E3C3F9E9E8752559E9E999E9E9E432963 -:108F70009E2D319E9E9E9E359E9E9E955C9E9E47FA -:108F80009E4B4F9E21259E6C6064689E709E7F83E1 -:108F90007C788A8D74919E00801CFFF798FF76E0A4 -:108FA000801CFFF75BFF72E0801CFFF7D8FE6EE0CD -:108FB000801CFFF7B5FE6AE0801CFFF729FE66E023 -:108FC000801CFFF706FE62E0FFF7D9FD5FE0FFF7C8 -:108FD000B3FD5CE0801CFFF777FD58E0801CFFF7D5 -:108FE00052FD54E0801CFFF7FDFC50E0801CFFF7B1 -:108FF000CDFC4CE0FFF7ACFC49E0FFF788FC46E015 -:10900000801CFFF744FC42E0FFF729FC3FE0801C96 -:10901000FFF7F2FB3BE0801CFFF7C4FB37E0801C4E -:10902000FFF7A1FB33E0801CFFF767FB2FE0801CFC -:10903000FFF742FB2BE0801CFFF7F8FA27E0801CCB -:10904000FFF7A6FA23E0801CFFF764FA1FE0FFF7A2 -:109050003CFA1CE0801CFFF705FA18E0801CFFF7C3 -:10906000E0F914E0FFF7C4F911E0FFF762F90EE050 -:10907000801CFFF74BF90AE0801CFFF721F906E09E -:10908000801CFFF70AF902E0801CFFF7DAF80120E4 -:1090900073E4002071E470B52349244C054640393F -:1090A000083C0A460126403260682B000DF0ACFAFD -:1090B00005171A1A04171A000122002108F093F963 -:1090C000616800220846C0310A724A7209F067FFDF -:1090D000002803D016A11B480DF0A5F960E4167511 -:1090E00088655DE4174812A13330F5E70E4900208A -:1090F000C031C8612039087270470B4A203A937E0C -:10910000002B03D1D076117701209076704730B5CF -:10911000134606E0CC18203CE47FD51A44555B1E6C -:10912000DBB2002BF6D130BD940900206C0000208A -:109130007372635C6C6C5F6374726C2E73302E633D -:10914000000000005108000070B5FD4D040008D07B -:10915000012C10D0022C07D0032C05D0F9A17020CF -:1091600007E0F8A1672004E02878012803D0F5A1E2 -:109170006D200DF058F92C7070BD70B5F04D04469F -:1091800010280AD0112C16D028468178122C07D02E -:10919000132C0AD0EBA19F200BE0EAA1942008E059 -:1091A000112908D0E7A1992003E0112903D0E5A1F6 -:1091B0009C200DF038F9AC7070BD10B5E04894B04B -:1091C000007B002819D0172069460870DC4900A8E8 -:1091D00006220D3102300CF0A8FF09A96846F9F704 -:1091E000C2FE0446112805D0002C03D0D5A1BB2017 -:1091F0000DF019F9204614B010BD3220E4E710B587 -:1092000001220023114603F0B5FC10BDFFB595B057 -:109210001D460E460746FFF7F2FF04000AD02078ED -:10922000222804D3A07F8006C00FA84204D10820C2 -:1092300019B0F0BDC748FBE7372168460170478089 -:10924000002D05D00121017146711799817102E04D -:1092500000206946087109A96846F9F784FEA07FD5 -:10926000DF21084069010843A0770020E0E770B5DE -:109270000446084620380D4603000DF0C5F90A06DD -:109280000A11232C334249505761FF20ADA1083009 -:1092900052E02078202851D1FF20AAA10B304BE0CA -:1092A000A7480178032949D08078132846D0207830 -:1092B000242843D0252841D023283FD0FF20A1A136 -:1092C0000E3039E02078222838D0232836D8FF20E5 -:1092D0009CA1153030E0207822282FD0FF2099A1C2 -:1092E000193029E02078222828D0242826D02628C2 -:1092F00024D0272822D0292820D0FF2091A11C305B -:109300001AE02078252819D0FF208EA1233013E001 -:109310002078252812D0FF208AA126300CE0207862 -:1093200025280BD0FF2087A1293005E020782828A8 -:1093300004D0FF2083A12C300DF075F8257070BD8E -:10934000FF2080A12F30F7E730B5834C0B88834A8C -:10935000022801D0934204D09D1FA54225D20228A5 -:1093600002D04D88954203D04D88AD1FA5421CD236 -:109370004C88A34219D88B88FF25F435AB4214D80A -:10938000022802D0C888904205D0C888724D0A3899 -:109390002D1FA84209D2C888904208D0944206D016 -:1093A0005B1C63438000834201DB072030BD00204B -:1093B00030BDF0B56A49884245D36A4A0125AD04FB -:1093C0001368A84201D398423DD30279002A06D0FF -:1093D000082A02D8067B082E05D90720F0BD047B99 -:1093E000002CFAD0F6E7002A06D004688C422AD373 -:1093F000AC4201D39C4226D3002E06D084688C4216 -:1094000021D3AC4201D39C421DD300240CE005685B -:10941000A700ED598D4216D30127BF04BD4201D3E9 -:109420009D4210D3641CE4B2A242F0D80022012570 -:10943000AD040CE084689700E4598C4203D3AC423D -:1094400003D39C4201D21020F0BD521CD2B29642EE -:10945000F0D80020F0BDFFB50022099B002802D003 -:10946000994205DC58E0002902D1002004B0F0BD8B -:109470000920FBE7845C002C12D087187D78112D21 -:1094800043D010DC2B000DF0BFF80A401726262C25 -:109490002C2E2E363640835C002B30D1521CD2B29B -:1094A0008A42F8DBE1E71C2D2FDA123D2B000DF08C -:1094B000ABF8042C2C121A2C022CD9D1BB78039CAB -:1094C000072B237001D25B0701D40A20CEE7029B51 -:1094D00001241B7816E0E343DB0708E0012C08D0E9 -:1094E00013E00620C2E70F2523072D075B19002B89 -:1094F000F4D03046BAE7029B1B789C0701D50B20BD -:10950000B4E702242343029C2370835C521C9A1804 -:10951000D2B28A4202DDABE7192676028A42A9DB83 -:10952000A3E710B504780B46002C1FD001210E4A8A -:10953000012C1ED0022C22D0032C2AD125E00000C1 -:10954000740A00207372635C6761705F636F726599 -:109550002E630000023000007B0C0000FFFF0000C3 -:109560000080010028000020023200000021197054 -:1095700011E019708179890903290AD10BE019706A -:1095800081798909012904D105E019708179890956 -:1095900001D0104610BD411C0622581C0CF0C5FD20 -:1095A000002010BD08B51346002806D0FEA00068B4 -:1095B000009048796A468009105C18700622581C91 -:1095C0000CF0B3FD08BD30B50C46097895B02229E2 -:1095D00002D2082015B030BD282369460B704880A0 -:1095E000132A03D03B2A01D00720F3E708460A716B -:1095F00009A9F9F7B8FC050003D121212046FFF79E -:1096000036FE2846E6E700B595B0232369460B7081 -:109610004880108888805088C880D0884881908889 -:10962000088100208881C88109A96846F9F79BFC58 -:1096300015B000BD70B50C00064610D0FFF7DFFD79 -:10964000050003D1D949DA480CF0EDFEA68028893F -:10965000E0802889208168896081A889A08170BD07 -:1096600070B50E46050003D00021092003F027FF46 -:109670000120D04C022E207324D0032E04D0CC48DD -:10968000CA491E300CF0CFFECA4806210D3003F047 -:1096900091FCA07C8006800EA074FFF78EFDA08B4D -:1096A00000280ED0002D0CD08300012200210920BB -:1096B00003F060FE092804D0BD48BC4928300CF0F6 -:1096C000B2FE70BDBB480321103003F073FCA07CD8 -:1096D00040218006800E0843A074B6480C3002F08A -:1096E00015F9DAE77FB501A9012003F0C3FA0028D4 -:1096F00004D0AF48AD4967300CF095FEAE4E01A8DE -:1097000003F0C6FA050002D0052D4CD048E0029CBB -:10971000A07F01072CD520462230009068462346C2 -:10972000628E80882146343301F07BFA0546A07FA3 -:10973000F7210840A077002D05D0B5422FD09C48D6 -:109740009A49783029E0E17F480889074000C90F2D -:1097500008432021095D4007400FC9000843E07716 -:10976000207828281CD129212046FFF780FD17E00A -:109770004007C4D568462246808821460E32FFF74E -:1097800042FF0546A07FFB210840A077002D07D0AF -:10979000B54204D08648854992300CF044FE00253D -:1097A000284604B070BD0020FBE7F8B5040004D1E2 -:1097B000ED207E4980000CF036FE7220207060683B -:1097C00008250178091F0B000CF01EFF11F90A3D56 -:1097D0005FF83D0EF8F83E3D3D3D3DF986F93D0010 -:1097E00073487249AA3074E087883846FFF707FD4E -:1097F000060004D16E486D49B2300CF014FE60785A -:109800000421284360706B4CA07F0843A07721217E -:109810003046FFF72CFDB07F8007800F012801D173 -:10982000801EA080384602F057FE3846FBF72AFE1D -:109830003846FAF7C6F93946022003F040FEB07FF9 -:10984000EF210840B077F8BD86883046FFF7D7FC97 -:10985000002804D156485549D0300CF0E4FD60682A -:109860008078012804D052485049D2300CF0DBFDFA -:1098700060688179304602F04EFF0028E3D06178BD -:10988000294361706168C880F8BD87883846FFF752 -:10989000B6FC060004D146484449E3300CF0C3FD51 -:1098A00060783946284360706068C088308160689D -:1098B0000089708160684089B081022003F0FFFD5B -:1098C0000020B075FFF70EFF0028DDD001203749DA -:1098D00080020CF0A8FDF8BD80783C2815D0002748 -:1098E000022815D00026002804D031482F49F8302E -:1098F0000CF099FD0021084603F0E1FD002107204E -:1099000003F0DDFD002E05D046E001270026F1E73B -:109910000126EAE76078284360702648817F294362 -:109920008177002F38D160688688304601F055F87D -:109930000546807F6168800889798000012900D010 -:1099400002210843A87760680622C08A28816068DF -:10995000008B68816068408BA8816068C079E87579 -:1099600061682846183008310CF0DFFB6068062279 -:10997000807B68706168A81C0F310CF0D6FBA87F53 -:109980008107890F304602F090FDA87F8007800F85 -:10999000012801D10748868006480178032913D0A1 -:1099A0008078132814D00BE00302FF0144950000D7 -:1099B00013030000740A0020023000000CE00FE0E6 -:1099C000FF20FCA1453084E70120FFF7BDFBF8BD77 -:1099D0001120FFF7D2FBF8BD204601F02AFCF8BDAC -:1099E000607828436070F8BDF7B505460078002719 -:1099F00000090C463E4601287ED00022F14902288B -:109A00007BD0072804D00A2878D0EAA1EE482DE1BF -:109A1000686803780D2B31D006DC042B6FD0072B40 -:109A200036D00A2B6AD106E0122B38D0132B40D047 -:109A3000142BF7D1B2E011270726002C72D08088B2 -:109A4000A0806968FB238979A171E04905468A7F76 -:109A50001A408A77032103F0C5F80421284603F051 -:109A6000C1F80021284603F0BDF80221284603F082 -:109A7000B9F80121284603F0B5F8F9E001270926D5 -:109A8000002CDBD08088A080686880792072EFE0AD -:109A900012270E2680882146FFF7CCFDE8E01A2722 -:109AA0000726002CCAD04088A08068680079A07181 -:109AB000DEE081783C2936D010271E26002CBDD050 -:109AC0008088A0806868C08A20836868C08AE08235 -:109AD0006868008B60836868408BA0836968207D1C -:109AE000497F4008C9074000C90F084320756968CD -:109AF000C007C00F497F03E05FE08AE0ADE01CE0F3 -:109B000049084900084320756968A21DC8790831D1 -:109B1000FFF748FD69682246887B0D320F31FFF759 -:109B200041FD05E074E019270726002C70D0A271D2 -:109B3000A648F722817F11407DE01B272E26002CAE -:109B400066D0A1806968A21D0879491DFFF72AFD2A -:109B500068682030C07A60736868C0780428A07B89 -:109B600019D040084000A073F921084069681F22FD -:109B7000C9788907490F0843A07369684007C97A03 -:109B8000400FC9000843A073696820460F300C31AC -:109B90000CF0CBFA6CE001210843E4E71E270E2607 -:109BA000002C6DD0A1806868E21D407AA0716968C0 -:109BB0008878C91CFFF7F6FC5AE0287A012805D0FE -:109BC000022815D080487BA132384FE01D270E2691 -:109BD000002C55D06888A080A889E080E889208181 -:109BE000288A6081688AA0817848DF22817FA2E785 -:109BF00012270E266888FFF71DFD002C40D06878DC -:109C00004007400F032833D17048FD22817F92E73F -:109C100036E0287A03000CF0F7FC06041010202030 -:109C2000202619270726002C2AD0A1806748A27178 -:109C3000817F4908490081771AE019270726002CFF -:109C40001ED0A180287A012805D00320A0715F488A -:109C5000EF22817F6FE70220F8E721462846029A2B -:109C600001F04BFCFEBD532052A100010CF0DBFBC8 -:109C70000298002C068001D0278066800020FEBD5F -:109C800002980680FAE710B5504894B080781328FF -:109C900002D0082014B010BD22206946087009A91E -:109CA0006846F9F760F904460021072003F007FC35 -:109CB0002046EFE700B5454895B08078122801D0DE -:109CC0000820B5E41E216846017000218170C17032 -:109CD00009A9F9F748F90028F3D10021072003F07A -:109CE000EEFB1120FFF749FA0020A1E400B5374848 -:109CF00095B00078022801D0032818D11B2108A8AC -:109D000001730021817369460BA8F9F72CF900282B -:109D100004D1684640781B2801D0032088E4002144 -:109D2000084603F0CCFB68468078002801D0082064 -:109D30007EE40120FFF708FA002079E4F8B5234C0F -:109D400003000CF061FC0A068017808080804B3590 -:109D50006E80FFF7CBFF00282AD1F7F7E9FD002836 -:109D600026D02221017000210172F7F7C2FDA07FE9 -:109D7000012152E08EB23046FFF741FA050004D1CE -:109D800011480CA12E300CF04EFB287821280FD062 -:109D9000F7F7CEFD00281BD01221017002270772B1 -:109DA00046800020A875F7F7A4FDA07F3843A07770 -:109DB000F8BD00007372635C6761705F636F72650A -:109DC0002E630000FFFF000036050000740A00202B -:109DD000132229463046FFF7F6FBE9E7A578122D56 -:109DE00006D0132D07D0FA49FA480CF01CFBDFE728 -:109DF000FFF760FF01E0FFF746FF0028D8D1F7F733 -:109E000097FD0028D4D022210170122D07D0022105 -:109E10000172F7F76EFDA07F10210843C7E701210B -:109E2000F6E7A07C810901290BD0800904D0E9481C -:109E3000E74922300CF0F7FA03210020FFF710FC6D -:109E4000B6E70221F9E7E348E1492930CDE7F7B564 -:109E500014460D0004D1DF48DD4931300CF0E3FA3F -:109E600028780827012807D002281FD0D948D849C8 -:109E700062300CF0D8FAFEBD0098FFF7C0F906007A -:109E800004D1D448D24938300CF0CDFA0220B07554 -:109E90001030207060783843607007CD083407C4F4 -:109EA000CD482022817F11438177FEBD0098FFF7C6 -:109EB000A6F9060004D1C748C54946300CF0B3FAEC -:109EC000A988C648814208D1EA88824205D1132276 -:109ED00031460098FFF777FBFEBD814202D1E8884A -:109EE000002809D01220207060783843607007CDB8 -:109EF000083407C4002006E07823002202200099DD -:109F000003F038FA0120B075FEBDB34840897047B0 -:109F1000FFB591B01498F8F721FF00285DD1012416 -:109F2000684603218471C9028180002201A920466C -:109F3000FAF719F9002850D16846152184714902B1 -:109F4000818000261C2102A800960CF04DF901200A -:109F50000146684610310170002001466846417094 -:109F60008178F9273940891C21438170017A0225C3 -:109F70002943017212998186C6861F2101870C90A0 -:109F800011980F9001A80B9009AA0BA902A8F9F744 -:109F9000B5FE002821D168468F4E808CF08068463F -:109FA00084718F498180807809AA3840801C4108DB -:109FB0004900684681708586058713A80F900BA914 -:109FC00002A8F9F79BFE002807D16846808C3081F3 -:109FD00031460A311498F8F7D4FE15B0F0BD30B50B -:109FE0000C46804995B08C4241D37F4901229204AE -:109FF0000968944201D38C4239D3203800220125CC -:10A0000003000CF001FB06042F494D535C64002152 -:10A01000082003F02EFA002802D0112015B030BD20 -:10A0200024206946087000A80522A11C02300CF00B -:10A030007CF809A96846F8F796FF050002D0082DBC -:10A040000ED031E0082300221146184603F092F9A1 -:10A05000082829D05F485E49D6300CF0E4F923E0A7 -:10A060000620DBE76068002803D0884201D2102078 -:10A07000D4E73D2168460170218841806188818054 -:10A0800009A9F8F770FF05000ED1606800280BD011 -:10A090006946098D018007E0206801F079FC02E043 -:10A0A000204600F0D8FC05462846B7E73E2007E0EA -:10A0B000857000E0827009A9F8F755FFF3E73420B6 -:10A0C000694608702078C0076846F3D0F0E707209B -:10A0D000A4E730B50C46444995B009688C4201D2DA -:10A0E00010209BE7203803000CF08EFA0504212194 -:10A0F000232132002088FFF782F8002804D000785E -:10A10000222803D2082089E7384887E725216846B6 -:10A1100001702188418009A9F8F725FF050015D1B4 -:10A120000AA905220231A01C0BF0FFFF0EE0062554 -:10A130000CE02068002805D0884201D2102505E0F7 -:10A1400001F01BFC24480025808BA080284665E791 -:10A15000072063E720481330704710B520211E48C0 -:10A160000CF040F80120FEF7EFFF1120FFF705F893 -:10A1700000211948C943818000218176E1218900AD -:10A18000818301460C300D310446F7F751FC12482B -:10A190000722214613300BF0C8FFFFF70EF8002806 -:10A1A00003D00B4912480CF03EF900F0D5FF10BD6A -:10A1B00010B504463C210CF015F8A07F8008800003 -:10A1C000A077202020700020A0752034607010BD82 -:10A1D000B49D00008C050000740A0020FFFF000001 -:10A1E000012A000000800100280000200230000049 -:10A1F000FB0600007047FEB50546FF480C4681424D -:10A2000007D301208004844205D3FC4800688442BF -:10A2100001D21020FEBD002D02D0012D32D126E04A -:10A22000F74908220F4668460BF07FFF3946204663 -:10A23000FFF777F90028EDD1FEF7BFFF060006D043 -:10A240000722694638460BF070FF3046FEBD207885 -:10A25000002801D0012805D1E94807223946C01D50 -:10A260000BF063FF0021092003F029F90FE00978C2 -:10A27000002907D0012905D0022905D0032903D0E0 -:10A28000E048FEBD0720FEBD0120FFF7E9F9DC48EC -:10A290000C3885760020FEBD10B5D8490968884283 -:10A2A00001D2102093E7D64902460C390B7B0D31C1 -:10A2B0001846FFF777F9002089E7FFB599B0054602 -:10A2C000002069460871087208A9087408751446C8 -:10A2D000CA480122C849920400681E46002D05D0D4 -:10A2E0008D420BD3954201D3854207D3002C08D071 -:10A2F0008C4203D3944204D3844202D210201DB076 -:10A30000F0BD2846204318D01F270CAB01AA0097A8 -:10A3100028461A99FFF79FF80028F0D10DAB02AA42 -:10A32000314620460097FFF796F80028E7D16846A7 -:10A33000007AC10703D00A20E1E70720DFE78007A2 -:10A3400005D568460079800701D50B20D7E703AF14 -:10A35000002D0FD01A20694608731A988873294671 -:10A36000F81C1A9A0BF0E1FE0EA903A8F8F7FBFD02 -:10A370000028C4D1002C0ED02021684601738673BA -:10A3800032462146F81C0BF0D0FE0EA903A8F8F7C0 -:10A39000EAFD0028B3D19A4908A8007C0C3948701E -:10A3A0000020ACE770B504460A2020700D46204618 -:10A3B000F8F7D9FD002805D139202070294620461C -:10A3C000F8F7D1FD70BDF7B500260C4605460B2702 -:10A3D0001AE02968B00009580978002903D001293A -:10A3E00001D00720FEBDA170296806220958E01C93 -:10A3F000491C0BF09AFE277020460299F8F7B3FD2E -:10A400000028EFD1761CF6B22879B042E1D80026B8 -:10A410003A270FE0A868B10041581022A01C0BF0A9 -:10A4200084FE277020460299F8F79DFD0028D9D1B7 -:10A43000761CF6B2287BB042ECD80020FEBDF0B509 -:10A44000044671A003C897B06B4B00271591149078 -:10A450009C4211D369480125AD040268AC4201D386 -:10A46000944209D32078012809D16168994203D325 -:10A47000A94204D3914202D2102017B0F0BD604926 -:10A480000C390A78012A0CD18A88614B9A4203D090 -:10A49000002806D0012804D08A7F13079B0F06D11D -:10A4A00001E00820E9E7D30701D1910701D5112088 -:10A4B000E3E7218A574B0A46203A9A4207D30128FC -:10A4C00075D1002973D1628A002A70D111E0022867 -:10A4D00001D0032801D1A02969D3012809D0484A15 -:10A4E0000C3A5278D20704D0628A002A5FD0B42A8C -:10A4F0005DD8002806D0012808D0022804D00328FF -:10A5000055D117E0002518E0022516E0002902D1F8 -:10A51000608A00280CD004256068007800280CD0E0 -:10A52000012809D0022807D0032805D03548A4E720 -:10A530000125F1E7032500E00127207A002806D055 -:10A54000012806D0022806D003287CD105E0002689 -:10A5500004E0012602E0022600E00326002D01D0DF -:10A56000022D14D1002E12D0E068FEF722FF002841 -:10A5700083D123480C384078800702D02148401E00 -:10A580007BE7022D03D1022E5DD0032E5BD0182174 -:10A5900068460170218A4180218A8180857118482E -:10A5A0000C38007B002803D001286FD104E04AE07A -:10A5B00000216846C17102E001206946C871684601 -:10A5C000077221780930012937D006210BF00AFEE5 -:10A5D00069460E74207D8207C107D20F4007C90F5C -:10A5E0005200C00F11438000014314A8405C69462B -:10A5F000C873002827D00FE0008001002800002049 -:10A60000800A002002320000070605040302010050 -:10A61000FFFF0000E13F000009A96846F8F7A3FC2E -:10A62000002884D109A96846FFF7BCFE0028A7D1FD -:10A63000002D0AD0022D08D010E061680622491CC6 -:10A640000BF073FDC4E7072017E7002E06D009AA18 -:10A650006946E068FFF7B7FE002891D11B206946E4 -:10A6600008700120887009A96846F8F77CFC00286A -:10A6700086D108A840791B2819D12B000BF0C4FF04 -:10A680000504040707040A00032001E00FE002208C -:10A69000FEF75AFD012D0CD0608A002809D0002257 -:10A6A00083001146104602F065FE002801D0032009 -:10A6B000E3E60020E1E6F3B5032687B00D46002966 -:10A6C0000AD0FA4885426FD301208004854203D323 -:10A6D000F7480068854267D30798FEF790FD0400AD -:10A6E00005D02078222804D2082009B0F0BDF14816 -:10A6F000FBE7A07F8707BF0F002D05D0294638460E -:10A70000FEF722FE0600F0D139460027EA4801296B -:10A7100007D0022931D0E949E9480BF084FE3046E0 -:10A72000E3E7A27D2946012A02D0827F920701D564 -:10A730001120DAE700291BD108216A46049711820B -:10A740000592418904AADF48FAF7FDF80028CCD128 -:10A750006846008A082801D00320C6E768460188B9 -:10A7600001814188418181888181C188C18102A99B -:10A77000079801F061FF0646D1E7A17D022916D1B5 -:10A78000807F800613D4002D04D0A07F40070CD416 -:10A79000002100E00121079801F08FFF0600BED1E3 -:10A7A000A775002DBBD004E01AE01126B7E7002DF5 -:10A7B00016D02A4621460798FEF725FF064611289F -:10A7C000ADD1A07F4007AAD42046082229460E30EA -:10A7D0000BF0ABFCA07F04210843A07700269EE786 -:10A7E000102082E770B50C460546FEF708FD010013 -:10A7F00004D022462846FEF7E6FE70BDAD4870BD87 -:10A8000000B50146143195B0192901D2810707D04E -:10A8100001461E3104D00A3102D0072015B000BD18 -:10A82000312269460A70887009A96846F8F79BFBCF -:10A83000F4E701B582B00220694608809E4802AB69 -:10A8400000896A460021F9F7E7FE6946098802296E -:10A8500000D003200EBD1CB50021009102216A46E4 -:10A860001180934901900968884201D210201CBDD3 -:10A87000914801899348FAF766F8694609880229E0 -:10A88000F5D003201CBDF0B50E46884985B01746AB -:10A8900005468E4207D386480122920400689642FC -:10A8A00004D3864202D2102005B0F0BD1F2F01D97B -:10A8B0000C20F9E7804C8D4226D3954201D3854286 -:10A8C00022D3E08803A9F9F758FE0028ECD12878B4 -:10A8D00069464873E08803A9F9F730FE0028E3D100 -:10A8E0006946009008780221084369460870497B50 -:10A8F000090703D00821084369460870E0886946C3 -:10A90000F9F7B5FD0028CFD169468F80E08833463E -:10A9100001AA0021F9F780FE69468988B942C3D0AF -:10A920000320C1E71CB50C4600210091019122884B -:10A9300069460A805E4901900968002801D0884272 -:10A9400001D38C4201D210201CBD002801D0002A66 -:10A9500009D059486A46C1885A48F9F7F4FF694650 -:10A96000098821801CBD0C201CBD10B50123FEF7F9 -:10A970004DFC2CE4002310B51A461946FEF746FCA0 -:10A9800025E430B505464A4895B000680C4681423A -:10A9900002D2102015B030BD2846FEF730FC00284A -:10A9A00007D00178222902D3807F800603D40820B3 -:10A9B000F0E74048EEE7132168460170458009A999 -:10A9C000F8F7D1FA0028E5D108AA0A2151567F29C3 -:10A9D00001D02170DEE70520DCE7F8B5012304464D -:10A9E0001A46194602F0C6F8074601231A46022104 -:10A9F000204602F0BFF8064601231A4604212046ED -:10AA000002F0B8F8054601231A460321204602F059 -:10AA1000B1F80446002F03D128492B480BF003FD61 -:10AA2000002E04D1AD20254980000BF0FCFC002D48 -:10AA300004D125482149801C0BF0F5FC002C04D1E1 -:10AA400021481E49C01C0BF0EEFC22213846FEF7BF -:10AA50000EFC3846F8BD10B50446006800280CD03E -:10AA60001249884207D301218904884205D310493D -:10AA70000968884201D2102014E400F071FFA08818 -:10AA80000D4CA083A07E01280DD10021092002F0E9 -:10AA9000F0FC002800D00120A17C8909012915D0F3 -:10AAA0000321FEF7DDFD002006E400000080010028 -:10AAB0002800002002300000740A0020B49D00002D -:10AAC000C6090000FFFF0000B30200000221E8E712 -:10AAD00030B5F74B9A4207D301239B049A4205D322 -:10AAE000F44B1B689A4201D2102030BD1578EB065A -:10AAF0005B0F042B07D85478072C04D39378102BC2 -:10AB000001D8A34201D2072030BDD3785B0702D41D -:10AB100013795B0701D5062030BDC37FAC075B0806 -:10AB20005B00E40F2343C3770878EF2318401378C2 -:10AB30009B06DB0F1B0118430870F12318401378A4 -:10AB4000DB065B0F5B001843087050780873002029 -:10AB500030BD30B500240C70C378DB07DB0F0B7001 -:10AB6000C578AD07ED0F6D002B430B70C5786D07F1 -:10AB7000ED0FAD002B430B7014700179C907C90F9D -:10AB8000117003799B07DB0F5B001943117000798B -:10AB90004007C00F80000143117030BD70B51446EE -:10ABA0000D460646F6F7C4FE002809D0A221017022 -:10ABB000142221460830F6F707FBF6F79AFE70BD1F -:10ABC000132229463046FEF7FEFC70BD70B51446D0 -:10ABD0000E460546F6F7ACFE002809D0222101708A -:10ABE00045802178017261784172F6F782FE70BD6E -:10ABF000132231462846FEF7E6FC70BD10B5AE4C78 -:10AC0000207C00280CD1204621461038FDF762F840 -:10AC1000002803D0A9A1F2200BF005FC012020742C -:10AC200010BD70B594B015460C462C226946189E8E -:10AC30000A704880002B17D00822194601A80BF093 -:10AC400074FA68468581102231460E300BF06DFA99 -:10AC500009A96846F8F787F9002803D1A17F1022D7 -:10AC60001143A17714B070BD002001900290E8E775 -:10AC7000F0B50646008A97B080B20D460190FEF707 -:10AC8000BEFA04468C48317848380746E8370990C0 -:10AC90000B000BF0B9FC0EFCFB48085F8798B8D995 -:10ACA000FAF9F8F7F6FC002301221946019801F0A1 -:10ACB00061FF050004D1FF2080A130300BF0B3FB11 -:10ACC000002C04D1FF207DA131300BF0ACFB387E8D -:10ACD000C00904D078486030C06DA86112E02B2014 -:10ACE000694608720BA902A8F8F73DF9002804D0BC -:10ACF000FF2072A13C300BF096FB74490C980BF0CE -:10AD00008EFAA9617068A862B068E862A07F8007C7 -:10AD1000800F012820780DD0252804D0FF2067A1BE -:10AD20004D300BF080FB324621460198FFF736FF8D -:10AD300017B0F0BD2528F6D0222806D0242804D04C -:10AD4000FF205EA146300BF06EFB25212046FEF76A -:10AD50008EFAE8E7002301221946019801F00AFF64 -:10AD6000060004D1FF2055A158300BF05CFB002CED -:10AD700004D1FF2051A159300BF055FB2078252834 -:10AD800004D03078012108433070D1E702202870C8 -:10AD9000B068A860B068002802D000202871C7E71A -:10ADA0000120FBE72B2069460870434968464C396F -:10ADB000F8F7D9F8002804D0FF2040A178300BF034 -:10ADC00032FB03201BE02A206946087000A81022ED -:10ADD000023071680BF0A9F904A810220230B168A2 -:10ADE0000BF0A3F9344968464C39F8F7BCF8002851 -:10ADF00004D0FF2031A189300BF015FB042028700E -:10AE00000998686094E7B068002804D1FF202BA15E -:10AE100095300BF008FBE07F400704D5FF2027A109 -:10AE200096300BF000FBB06806220A3800903379A8 -:10AE30000421019801F0FBF90028A6D0FF201FA1F2 -:10AE40009B300BF0F0FA73E7002C04D1FF201BA11C -:10AE5000A3300BF0E8FA2046223010220546716834 -:10AE60000BF063F928212046FEF701FAA07F800746 -:10AE7000800F022814D100231A462146009501981C -:10AE800006E04BE1BAE0B0E095E03FE071E05FE161 -:10AE9000FFF7C7FE11281BD029212046FEF7E7F94E -:10AEA000E07F317A4007400FC9000843E0773FE771 -:10AEB0000080010028000020400B00207372635CBA -:10AEC0006761705F7365632E6300000040420F008E -:10AED000A07F000704D5FF20FD49B0300BF0A3FA96 -:10AEE000A07F08210843A0770020608620463430E8 -:10AEF0000BF078F9E07FFD220146C9071040890F69 -:10AF00000843E077307A2034207011E700230122D3 -:10AF10001946019801F02EFE040004D1FF20EC49EF -:10AF2000CD300BF080FA2B2069460872E94902A85F -:10AF3000F8F719F8002804D0FF20E549D2300BF0CB -:10AF400072FAE4488188204621300176090A417668 -:10AF50000E2129702146FC316960017E2974407EF2 -:10AF60006874DC482C30A860103030346C61E860C4 -:10AF7000DEE6002C04D1FF20D549E6300BF053FA71 -:10AF80002078212893D93079012802D0022808D1CD -:10AF900003E0E07F04210843E077387E0121084385 -:10AFA0003876324621460198FFF7F8FD23212046E6 -:10AFB000FEF75DF9BCE601220421019801F01FFCB7 -:10AFC0000028A2D0002301221946019801F0D2FDE9 -:10AFD000040003D1BE49C0480BF025FA0F202870A9 -:10AFE000172028716E34AC60A2E60421019801F0AC -:10AFF00056FC002889D11020287099E600230122F0 -:10B000001946019801F0B6FD050004D18720B0492A -:10B0100080000BF008FA2E462036307E41064DD5D2 -:10B02000A17F8F07BF0FC00713D029468031486F1B -:10B0300000280ED0027CF37DD207D20F5B001A43AA -:10B040000274486F5108E27F4900D207D20F1143C2 -:10B050000174307E000713D52A468032116F002913 -:10B060000ED0087CF37DC007C00F5B001843087446 -:10B07000116FE27F40084000D207D20F10430874DE -:10B08000307E80070BD5F8204259002A07D0012FC7 -:10B0900005D02946307C31311032FEF783FA307EFC -:10B0A000C0060BD5F8204259002A07D0012F05D140 -:10B0B0002946307C31311032FEF774FA0523684698 -:10B0C0000370357E4570834822216038019A0170F3 -:10B0D0004178C908C900C91C417042800372457299 -:10B0E000F6F78EFD2078252809D021280BD07A4844 -:10B0F00077495B300BF097F92078222803D9222179 -:10B100002046FEF7B4F80021019801F06BFD0028FD -:10B1100000D10DE670486E49633092E674686D4D5B -:10B1200020786035092802D00A28F2D10BE0E168C6 -:10B13000002902D02846F7F7E8FE2169002902D04D -:10B140002846F7F7E2FE21462846F7F7DEFEEFE550 -:10B1500061485F49883074E65E4810B504222821B2 -:10B160006030F7F7B9FE5B480024EC30017E4906F9 -:10B17000490E01764038C465FCF739FD55493C312C -:10B1800008461038F6F78BFC52484C30047410BD5A -:10B1900070B50D46FEF733F8040004D14E484C4913 -:10B1A000A7300BF040F9FF21053128460BF01CF8C1 -:10B1B000A07F8007800F01280CD00221284688300C -:10B1C000FCF716FD002804D043484149AC300BF091 -:10B1D0002AF970BD0121F1E70A46014610B5104673 -:10B1E0008830FCF71FFD10BD70B5054611200C46D8 -:10B1F0000870002161702121495D002908D00329D0 -:10B200000ED0042910D034483149C6300BF00BF968 -:10B2100020780009012802D9E87FC008607070BD5D -:10B220000007000F203002E00007000F30302070D0 -:10B23000EEE7F0B504464068082601789BB008297F -:10B240000DD00B2903D00C294BD1012181716068ED -:10B2500087883846FDF7D3FF05004CD147E0478883 -:10B260003846FDF7CCFF050004D1172018494001EE -:10B270000BF0D9F82878212833D0282833D16068FA -:10B2800002210C3000F050FF00282CD0606808210B -:10B29000001D00F049FF002825D02D2168460170CF -:10B2A000478029461022223101A80AF03EFF0FA94B -:10B2B0006846F7F758FE002804D007480449EF30E5 -:10B2C0000BF0B1F8A87F10210843A877292105E0E9 -:10B2D000BCAE0000F40A0020030200002846FDF77F -:10B2E000C6FF1BB0F0BD607830436070F9E7FE49DF -:10B2F000FE480BF098F8A87FEF210840A87729783E -:10B3000021290FD061688A79002A02D08978002922 -:10B3100012D08007800F022849D0F448F249343017 -:10B320000BF081F8FEF7DEF90028DAD0EF48EE499D -:10B330003F300BF078F8D4E7607830436070E87FF6 -:10B34000C00701D0042100E00321212041552878C5 -:10B3500029280BD03946062002F0B1F82878242895 -:10B36000E0D122212846FDF782FFDBE700230122FE -:10B370001946384601F0FEFB040004D1C920DA4921 -:10B3800080000BF050F825212846FDF770FF0D20B6 -:10B3900008A90871204609A98830FCF735FC022865 -:10B3A000C0D00028BED0D148CF491D30B8E7607862 -:10B3B00030436070B6E7F7B58AB015460646FDF72C -:10B3C0001EFF002841D0017822293ED323293CD0FA -:10B3D000C17F490739D4807F8007800F01280DD0B5 -:10B3E000002301220021304601F0C4FB0746C0487B -:10B3F0000290F7F781FD040007D101E00123F0E797 -:10B40000BA48B94959300BF00EF8002F1FD08837D1 -:10B4100067610298F7F770FD07460298F7F76CFD31 -:10B4200009212170266225710B99E760A1602061D6 -:10B4300003A92046FCF70CFC022806D0002804D003 -:10B44000AA48A94975300AF0EEFF0DB0F0BD002002 -:10B4500007466061E4E730B5002387B00546012266 -:10B46000194601F087FB04462846FDF7C8FE007820 -:10B4700022281BD9002C04D19C489B4981300AF01A -:10B48000D2FF0F21684601701721017120466E30EE -:10B49000029069461A30FCF7B7FB022806D0002854 -:10B4A00004D0E520904980000AF0BDFF07B030BD10 -:10B4B00030B5002387B005460122194601F05AFB3A -:10B4C00004462846FDF79BFE00782228EED9002C82 -:10B4D00004D18648844993300AF0A5FF10206946BC -:10B4E000087020468830FCF78FFB0028DED0E9206A -:10B4F0007D4980000AF097FFD8E7F7B50546007848 -:10B500000027000982B00C463E4602287ED007285C -:10B5100002D00A284AD14AE068680178082907D091 -:10B520000B2930D00C292ED070486F49D33060E100 -:10B5300014271A26002C6AD04088A080FDF75FFEF1 -:10B540000090002804D169486749AF300AF06BFFCA -:10B5500000980099C07DA21D1831FEF723F8686895 -:10B5600008228089E081696820461030091D0AF0B0 -:10B57000DCFD207E01210843F92108402076009857 -:10B580004021807F47E018270826002CD3D08088F0 -:10B59000A080FDF734FE050004D1F7205249800059 -:10B5A0000AF041FFA11D2846FFF71EFE23E1002CF3 -:10B5B00001D0288BA080287A01287DD0022804D0D1 -:10B5C00003282FD048494B4813E11C270726002C9D -:10B5D000B1D0A088FDF713FE0090002804D1FD2013 -:10B5E000414980000AF01FFF287B8007800F012857 -:10B5F000A07914D040084000A071FD210840297BAB -:10B600004907C90F49000843A07101E0E3E0DFE00A -:10B6100000988021807F084300998877EBE0012122 -:10B620000843E9E713270B26002C84D0A088FDF7F8 -:10B63000E6FD00900023A0880122194601F09AFA45 -:10B6400005460098002804D12A48274960380AF0A6 -:10B65000EAFE002D04D181202349C0000AF0E3FE58 -:10B660000098807F8007800F012859D0E86A817890 -:10B670008907890F0129A17954D049084900A1718E -:10B680008278FD255207D20F294052001143A17143 -:10B69000E322114002785207D20E1143A171DF223A -:10B6A00011404278D207920E1143A1710021E1713D -:10B6B000C1782172427900E037E00179607AD307DE -:10B6C00040084000DB0F18439307DB0F28405B0066 -:10B6D00018435207FB23D20F1840920010436072A8 -:10B6E000A07A4008400007E0BCAE00000E03000056 -:10B6F000540B002067040000CA07D20F10438A07CA -:10B70000D20F2840520049071043C90F1840890042 -:10B710000843A0720098007823286CD92621AFE056 -:10B72000A86AA4E701221143A9E7297BFE48022960 -:10B7300010D017270C26002C4AD0012911D003293C -:10B740001ED004291FD005291DD0F849F8480AF059 -:10B750006AFE23E019270726002C4CD00121A17195 -:10B7600005E00121A171E17989088900E171017E7B -:10B77000CA094906D201890E49000A4302760DE042 -:10B780000220A07106E0687B0007000F8030A071E6 -:10B79000052918D0E07980088000E071A088FDF7C5 -:10B7A0002EFD05460078212825D0232804D0E04826 -:10B7B000DE490C300AF037FEA088002101F012FAB1 -:10B7C000222128465DE0E07980088000401CE4E703 -:10B7D0000498068015E0002C01D06888A080287AA3 -:10B7E000032828D004280FD005284DD0D048CF49B1 -:10B7F00064300AF018FE0498002C068001D02780DF -:10B800006680002005B0F0BD15270C26002CDFD087 -:10B810000023A0880122194601F0ACF9050004D1EB -:10B82000C348C2492A300AF0FEFD0622A11DA869BC -:10B8300009F0DCF9DFE716270726002CC8D0A0881E -:10B84000FDF7DDFC00900023A0880122194601F0DD -:10B8500091F905460098002801D0002D04D1B44884 -:10B86000B24938300AF0DFFD2878C00601D5022041 -:10B8700000E00120A071009800782328BBD927217F -:10B880000098FDF7F4FCB6E717270C26002C9FD094 -:10B89000A088FDF7B4FC00906D7A002804D1A4487C -:10B8A000A2494B300AF0BFFD0621A01D0AF09AFC08 -:10B8B0000020A071207A032108432072FB21084058 -:10B8C0000099C97FC907490F08432072680692D5BD -:10B8D000E07904210843E071A07AE90740084000BC -:10B8E000C90F0843E17A2A0749084900D20F1143DA -:10B8F000FD22AB07DB0F10405B001843A072E80687 -:10B90000C00F114040000143E17274E710B50446D6 -:10B91000807990B08009012804D04D20834900012E -:10B920000AF081FDFFF76AF90120694608707E4838 -:10B930000AA9A0380190201D0290601C0B90684657 -:10B94000FCF786F9002804D07948784987300AF056 -:10B950006AFD0322601C0B990AF0E7FB10B010BDD2 -:10B9600010B5714CA03C002805D00146102220469D -:10B970000AF0DBFB0120207410BD10B50446FFF770 -:10B980003DF969491022A03920460AF0CEFB10BDCE -:10B9900070B50025644C00281CD06649884207D346 -:10B9A00001218904884205D363490968884201D28C -:10B9B00010250DE0062109F003F9411C07D05A4972 -:10B9C0004039C865207E80210843207600E00725A5 -:10B9D000284670BD207E4006400EF6E7F3B50020F5 -:10B9E00089B00D46029000290AD0524885421CD3E6 -:10B9F00001208004854203D34F480068854214D358 -:10BA00000998FDF7FCFB060003D03078222815D1F9 -:10BA100002E04A480BB0F0BD002D08D1B07FC1094B -:10BA200003D08007800F022801D01020F2E7B07FFA -:10BA3000C10601D4000703D5002D01D00820E9E795 -:10BA40003948007EC00712D1F07F400701D50D2094 -:10BA5000E0E7002201231146099801F08BF8070066 -:10BA600005D0B07F8007800F022802D00BE01120A4 -:10BA7000D0E7002D07D02A4639463046FFF728F890 -:10BA800002900028C6D128488C38F7F735FA040010 -:10BA900003D126492A480AF0C6FC0A2020700998DA -:10BAA000206238468830A060B07FFB218007800F7D -:10BAB000012829D0002D4CD002202071381DE060D3 -:10BAC00038780007400F20743878C006C00F6074C3 -:10BAD000A07C2A788008D2078000D20F1043A0747F -:10BAE0000840F17F01AAC907490F0843A074A8784C -:10BAF000E07469462846FFF72CF8684600792075FF -:10BB000068460078607528E001202071207B2A7843 -:10BB10008008D2078000D20F104320730840297894 -:10BB20008907C90F89000DE0E00B0020BCAE0000C2 -:10BB300053040000008001002800002002300000B3 -:10BB4000630500000843207324213046FDF78FFB76 -:10BB50000BE0032020710520207325213046FDF7DE -:10BB600086FBB07F4006400EB07703A92046FCF765 -:10BB70006FF8022805D0002803D0FD49FD480AF0DF -:10BB800052FC029846E7FFB581B00A9D06461C4666 -:10BB90001746142128460AF027FB0B980021016064 -:10BBA000F8070ED0F44920680968884239D312306A -:10BBB00028602068143068602068A8600B982168AD -:10BBC0000160B80726D56068002803D0EA490968F3 -:10BBD000884226D3029900290AD0FC3600280ED0CC -:10BBE00031461030FDF79DFC00281BD1606810E045 -:10BBF000002816D0E86080366068B0670AE0FEF77B -:10BC0000A9FA0146072230460AF08FFAFEF7F6FF3E -:10BC1000DA48E860780707D5D749A06809688842FC -:10BC200001D21020EEE528610020EBE5FFB5D44AF3 -:10BC30000E4607CA97B002AB07C3002700970197CB -:10BC40001798FDF7DCFA050005D02878262804D0DF -:10BC500008201BB0F0BDCB48FBE700231A4619466D -:10BC6000179800F087FF040004D1C248C049803013 -:10BC70000AF0D9FBA87F8007800F1690012814D006 -:10BC8000022824D0BB48BA4999300AF0CCFB0121E4 -:10BC90000022852E31D01EDC002E26D0812E26D00B -:10BCA000822E26D0832E1ED125E0002EEFD12146F4 -:10BCB0002846199AFEF70CFF0028CAD119988078F7 -:10BCC000009019980078C007C00F0190DFE719981D -:10BCD000002808D1DBE7862E11D0882E11D0892EBE -:10BCE00011D08A2E11D00720B3E710460EE0084687 -:10BCF0000CE002200AE0032008E0052006E0062010 -:10BD000004E0082002E0092000E00A20002222715D -:10BD100001216A461176211D0791002801D020716A -:10BD2000FAE0169801280CD0A66AE06A02220121E6 -:10BD300010900020A0602846173002291AD0012157 -:10BD400019E0E66AA06A1090032030702078FB2387 -:10BD5000C006C00F7070B07801221840009BF370CD -:10BD60008008019B800018430221B0700020707190 -:10BD70003071DEE70021890009190861681C022A78 -:10BD800001D0012100E00021890009190861B07883 -:10BD90008007800F01285ED1109880788007800F7F -:10BDA000012858D110980079844610984079009065 -:10BDB000169801281DD0317908A801747179017590 -:10BDC00008A8027C6046024008A8007D009908404F -:10BDD000139010433FD06C491A98884207D3012131 -:10BDE0008904884215D364490968884211D2102019 -:10BDF0002FE70CAA0DA91998FEF7ABFE08A8007C46 -:10BE000061460840307108A8007D009908407071B3 -:10BE1000D6E720463C3021460090F031169801913B -:10BE2000022834D000211A9B20460C33FFF7ABFECA -:10BE30000028DDD12046503021460090F43116987C -:10BE40000191012825D0002120461A9B139AFFF763 -:10BE50009AFE0028CCD110988078400702D4E87F61 -:10BE6000C0072BD0169902A8012914D0109909787F -:10BE70004900405A21780907490F4900C8408707FF -:10BE8000BF0F2AD0012F14D0022F0FD113E00121B0 -:10BE9000C9E70121D8E721780907490F4900405A2D -:10BEA000109909784900C8408707BF0F032F04D0B5 -:10BEB00004E0022711E001270FE00227169801286D -:10BEC0000BD1B078FB210840E97FC907490F08432F -:10BED000B07020780007400F3070207810224008A2 -:10BEE000400020701099D2434978C907C90E114308 -:10BEF00008402070C00623D4022F21D0012F21D06A -:10BF00000020A061E0612062606220461830A060DD -:10BF1000E87F40084000E877204606A98830FBF714 -:10BF200073FE002806D0022804D06F2010490001BB -:10BF30000AF079FA25212846FDF799F9002088E6CC -:10BF4000032008E020460D211B300AF04BF9204663 -:10BF50001830A060042069460875E87F0121084375 -:10BF6000E87705AA29461798FEF730FED4E70000C7 -:10BF7000BCAE00008E05000028000020400B002011 -:10BF8000606701000230000000800100F0B587B05A -:10BF900015460E0004460DD06A48854207D301209D -:10BFA0008004854206D368480068854202D210208A -:10BFB00007B0F0BD2046FDF722F9070004D038781D -:10BFC000272803D00820F3E76048F1E700231A464A -:10BFD0001946204600F0CEFD040003D15C495D48BF -:10BFE0000AF021FA0020002E05D0022E08D0012EE2 -:10BFF00011D00720DCE701216A461171A06018E02A -:10C00000234618336946A360087110222946184652 -:10C010000AF08BF80DE021461831A16069460871DD -:10C02000A061E061206260620621284608F0C8FD38 -:10C03000A0612078C10714D0400840002070022081 -:10C04000694608702046183002907030FBF7DCFD1E -:10C05000022806D0002804D03E483D4923300AF08B -:10C06000E2F925213846FDF702F90020A0E770B576 -:10C0700094B00D460646002B02D0072014B070BDC8 -:10C08000FDF7BDF8040007D02078222802D3A07F56 -:10C09000400603D40820F1E72C48EFE7002D19D023 -:10C0A0002D216846017046801022294601A80AF019 -:10C0B0003CF8E07F297C4008C9074000C90F0843CD -:10C0C000E077297C40078906400FC90EC900084364 -:10C0D000E07703E02E2168460170468009A9684692 -:10C0E000F6F741FF694609782D2905D1002803D1CB -:10C0F000A17F10221143A177A17FBF221140A17718 -:10C10000BCE710B50C46FDF77AF8002805D00E49BB -:10C1100009688C4203D2102010BD0C4810BD214686 -:10C12000FFF762F8002010BD05E00278401C002AED -:10C1300001D0002070470A46491E89B2002AF4D176 -:10C14000012070470080010028000020023000001C -:10C15000BCAE00000F07000030B50346072903D02E -:10C160000820DA781C7916E00720FAE707290BD0B7 -:10C170005500ED186D79072D01D0401EC0B2521C3C -:10C18000D2B20F2A07D105E05500ED186D79072DC1 -:10C19000F3D0F4E700222546641EE4B2002DE5D179 -:10C1A00030BDFFB581B00C461646114620460A9FA9 -:10C1B0000B9DFFF7D1FF00280AD020790F2803D369 -:10C1C000FEA1A0200AF02FF9A078C00907D019E03D -:10C1D000072E02D0112005B0F0BDFD48FBE7019805 -:10C1E0002880381D6880002068712871EF800498CD -:10C1F00028812846F6F7DFFE002803D1EFA1AD2005 -:10C200000AF011F9E07821794018491CC0B2217177 -:10C210000F2801D30F38C0B2400000194671817950 -:10C22000F12249084900114081710020D3E7FFB590 -:10C2300083B01C4616460F4600231A4602210C9D69 -:10C24000039800F097FC010008D033463A46019568 -:10C2500000940398FFF7A5FF07B0F0BDDC48801EEF -:10C26000FAE7F0B5054616460F4650888DB0002314 -:10C270000122022100F07EFC040003D1CFA1DF20C7 -:10C280000AF0D1F8002069460871A078400603D171 -:10C29000CAA1E3200AF0C7F8042F5ED32A78D0079A -:10C2A000C017401C06D161786B78994255D121782E -:10C2B000090752D00121142A46DA012A42D0122A53 -:10C2C00002D0132A40D128E00C2F3DD1A27852068B -:10C2D000520E012A38D0207800090001401C20703D -:10C2E000687860706846017168792A7901021143A3 -:10C2F00068460181E879AA790102114368464181C3 -:10C30000687A2A7A0102114368468181E87AAA7A1A -:10C31000010211436846C1811AE0062F14D120782A -:10C320000009000120707188012001F0C8F8022185 -:10C3300068460171C91E018168792A790102114399 -:10C3400068461FE0062F0AD06A461279002A1BD0E1 -:10C350007088324601A9FDF77AFD0DB0F0BD207856 -:10C360000009000120707188012001F0A8F8022165 -:10C370006846017168792A79010211436846018192 -:10C380000021C9434181E3E70028E6D0748868466C -:10C3900081766978C176022181830021C18304A856 -:10C3A00005220090062311462046FFF740FF002893 -:10C3B000D3D088A1D6200AF036F8CEE7F7B58CB0F6 -:10C3C00015460C990D98F9F7CEF9C0B2082851D14D -:10C3D000002069468885688800230122022100F038 -:10C3E000C9FB040004D1FF2074A163300AF01BF8DC -:10C3F00001230021E07822790BE046003619767996 -:10C400009E4201D1491CC9B2401CC0B20F2800D1C4 -:10C4100000201646521ED2B2002EEED1002902D1C3 -:10C4200017206946888504AB02330BAA00950C9946 -:10C430000D98F7F73BFC0006000E07D002281BD032 -:10C44000032817D0FF205DA1893011E06846808D58 -:10C4500000280FD002A901910090688804230122CE -:10C460002146FFF79EFE002804D0FF2053A176301E -:10C4700009F0D9FF0FB0F0BD68781021084368704B -:10C48000F8E70020584902464300401CCA520828D9 -:10C49000FAD3704700218170017809090901017000 -:10C4A00000214170C1700171704770B50D460023C5 -:10C4B0000122022100F05EFB040004D1FF203FA115 -:10C4C000CF3009F0B0FFA0786906C009C001490E5D -:10C4D0000843A07070BD704710B50146012000F000 -:10C4E000EEFF10BD3EB58DB2002301220221284689 -:10C4F00000F040FB040004D1FF2030A1E43009F03B -:10C5000092FF20786946000900012070022008701F -:10C5100036488880C88000222846FDF798FC3EBD3A -:10C52000F7B505460078002700090C463E4601286D -:10C5300004D0FF2021A1F33009F075FF287A0328E9 -:10C540000CD041201DA1C00009F06DFF0298002C05 -:10C55000068001D0278066800020FEBDEA89702712 -:10C5600010460A3086B2002C0AD06888A080A889BC -:10C570002081E28020460A30296909F0D6FDE5E7EE -:10C5800002980680E8E7F8B543680246D9799C79B5 -:10C59000090221435C7A1E7A25025C88981D354386 -:10C5A000241FA14238D11B79022B35D1042D34D060 -:10C5B000052D3DD0062D34D0402D19E07372635CFB -:10C5C0006C326361705F636F72652E630000000000 -:10C5D000043000007372635C6C326361705F636F80 -:10C5E00072652E6300000000000C0020FFFF0000B9 -:10C5F00012D3061D0F461446284600F0E9F9082814 -:10C600000AD01120207003202072A581E7812661C5 -:10C610006078082108436070F8BD001DFFF7CEFE6A -:10C62000F8BD031D50880A461946FEF7C4FEF8BD42 -:10C63000001DFFF716FEF8BD70B50D4600238CB047 -:10C6400006461A46022100F095FA040031D02078FF -:10C650000007000F01282ED01220694688746078E8 -:10C660000523801CC874082088822888C8826888AE -:10C670000883A8884883E888888302A90C20019150 -:10C6800000901A4621463046FFF78BFD00280ED158 -:10C69000F02300223146012000F06CFE20780009D2 -:10C6A0000001401C20706078801C607000200CB07D -:10C6B00070BDCD48FBE71120F9E770B50D460023AA -:10C6C0008CB006461A46022100F054FA040006D047 -:10C6D00020780007000F012803D00820E7E7C248B0 -:10C6E000E5E71321684681746178C1740221818273 -:10C6F000C58202A906200523019100901A46214611 -:10C700003046FFF74EFD0028D1D120780009000106 -:10C7100020700020CBE7F3B581B00D460023012245 -:10C720000221019800F026FA00260446002803D1D1 -:10C73000AE49AF4809F077FE2079A8423BD2AC4819 -:10C74000AA49401C09F06FFE35E0E07841000F195E -:10C75000401C7979C0B20091E0700F2801D100200F -:10C76000E0702079401E2071B879C00708D0009889 -:10C770000199042815D09D498220183109F053FEF3 -:10C78000B8790007410F08D0400F019904280CD058 -:10C7900096498F20183109F046FE009807280AD1E3 -:10C7A00007E00846FEF784FEEAE70846FEF753FE78 -:10C7B000F3E7761CF6B228466D1EEDB20028C4D110 -:10C7C0003046FEBD10B500230122022100F0D2F94F -:10C7D000040004D1B5208549800009F024FEE078EA -:10C7E00021794018C0B2E0700F2801D30F38E070F3 -:10C7F00000202071A07880210843A07010BDF8B5FA -:10C8000017460D4600231A46022100F0B3F9040032 -:10C8100005D0002D0CD0002F07D0062006E0072DF4 -:10C8200001D00820F8BD0720F8BD0820A84204D890 -:10C830006F486E49423009F0F6FD29462046FFF761 -:10C840008BFC0646002F28D0002E26D1E0782179D7 -:10C850001CE0420012195379072B03D093791B0770 -:10C860005B0F04D0401CC0B20F280CD00CE040007D -:10C8700000198079F12318406B071B0F1843907142 -:10C8800000290AD104E00020491EC9B20029E0D1E4 -:10C89000574856495A3009F0C6FD3046F8BDF8B53C -:10C8A0000D4600231A46022100F064F9040004D169 -:10C8B0004F484E49683009F0B6FD681E052804D37C -:10C8C0004B484A49693009F0AEFD0F21E2782079E2 -:10C8D000002310E0560036197779AF4206D1B179BE -:10C8E00049084900B1715B1CDBB21146521CD2B23F -:10C8F0000F2A00D100220646401EC0B2002EE9D108 -:10C900000F2905D248000019817901221143817154 -:10C910001846F8BD10B50446402801D2072010BDC6 -:10C9200000F056F8082802D03120000210BD002186 -:10C93000304802E0491C082903D24A00825A002AE2 -:10C94000F8D1082903D049004452002010BD04202A -:10C9500010BD10B5402801D2072010BD00F038F8F6 -:10C96000082805D00021234A40001152084610BD76 -:10C97000052010BDF0B58BB016460C00074607D059 -:10C98000002E05D06188402904D207200BB0F0BDED -:10C990001020FBE72088002801D0172801D90C209F -:10C9A000F4E7084600F014F808280FD0258803A8FB -:10C9B0002A463146023009F0B8FB01A8009062888F -:10C9C0002B4607213846FFF732FCDFE70520DDE77D -:10C9D00001460020074A02E0401C082803D2430019 -:10C9E000D35A8B42F8D1704702300000BCC500001A -:10C9F000AD020000000C0020F8B50546E54C079E8E -:10CA0000069821706270A370E6702071681C42085D -:10CA10005200E14B0021880000198446C261605C2D -:10CA200040008218002D0AD0002005E0664647002D -:10CA3000F669401CF353C0B2665C8642F6D8491CC6 -:10CA4000C9B20529E7D30026D21C9708B000BF0061 -:10CA500000198760304600F042F9A15D761C48431A -:10CA6000C219F6B2052EEFD3501B80B2F8BDF0B557 -:10CA70000546C84F8C460020FF247E5DA9009646DF -:10CA80000346CF190CE0F9695A008A5AC2498A4212 -:10CA900004D1401CC0B2FF2C00D11C465B1CDBB291 -:10CAA0009E42F0D86146002909D100280BD0002D04 -:10CAB00007D0B84949788E4203D2401EC0B2002840 -:10CAC00001D071460C70F0BD70B5B24C8D000023E2 -:10CAD0002D19615C09E0EC695E00A45B844202D11F -:10CAE0001370012070BD5B1CDBB29942F3D80020AB -:10CAF00070BDFEB51C4617460D46060008D0002D39 -:10CB000006D0F01C80088000B04203D01020FEBD8B -:10CB10000E20FEBD002F03D0002C01D0A74201D96A -:10CB20000720FEBD0094234622463946002001948A -:10CB3000FFF762FF2988814207D0814201D2042198 -:10CB400000E0092128800846FEBD009423462246C5 -:10CB5000394630460194FFF74FFF28800020FEBD84 -:10CB600010B5044600F0C5F8002801D0E0B210BDB1 -:10CB7000FF2010BDFFB50546874881B01E460C4614 -:10CB8000854204D0052C02D20398022802D300204B -:10CB900005B0F0BD002769460F7028466A46214659 -:10CBA000FFF792FF00280ED068460178204600F07B -:10CBB000A8F8002EECD00028EAD1284600F099F819 -:10CBC000002809D103E03846002EF6D1E0E7FF2027 -:10CBD00072A15C3009F027FC21462846039A00F038 -:10CBE0009CF8D5E7F8B505460C4600206A4E694624 -:10CBF0006E4F0870B5423BD0052C01D30720F8BD1D -:10CC00000A4621462846FFF75FFF002830D06846D5 -:10CC10000178204600F075F8230009F0F5FC0504C2 -:10CC2000090C11161B0001462846FEF7D5FA15E03F -:10CC3000FDF7E0FA12E001462846FFF74CFC0DE054 -:10CC400001462846F6F7B5FF08E001462846F8F702 -:10CC500012FC03E056A17B2009F0E5FB4D4A684633 -:10CC6000A10000788918C96940000E520020F8BD63 -:10CC70003846F8BD524A1268914201D210207047DE -:10CC8000052801D3072070470872002048727047BA -:10CC9000F8B504464A480068844201D21020F8BD25 -:10CCA000207A3C4A83009B18617A3B4D125C11E06C -:10CCB000DE694F00F65BAE420AD04A1C6272DA6946 -:10CCC0004B00D25A228000F01CF860600020F8BDB2 -:10CCD000491CC9B28A42EBD861720520F8BD0EB575 -:10CCE000384B40000ECB0091029301926946085ADE -:10CCF0000EBD28494978814201D9012070470020A2 -:10CD0000704770B50C460546FFF7E9FF214AA900B8 -:10CD1000891889686043401870BDF8B50C4606460E -:10CD200000206946134608706A4619462046FFF7F8 -:10CD30009EFE002500282BD0164A6846A1000078E8 -:10CD40008918C96940000E52684601782046FFF7ED -:10CD5000D8FF0546230009F057FC0504090C0F1401 -:10CD6000170029463046FEF713FA11E0FDF720FAC6 -:10CD70000EE0FFF78FFB0BE029463046F6F7E0FEAA -:10CD800006E0F8F771FB03E009A1622009F04BFB14 -:10CD90002846F8BD100C0020FFFF00007372635C92 -:10CDA000686F73745F636D2E6300000002300000D3 -:10CDB0007372635C686F73745F636D2E6300000051 -:10CDC000280000206C67010010B5014620220948A8 -:10CDD00009F0ABF907490020C877084610BD06499D -:10CDE000012048610548064A0168914201D10021AD -:10CDF00001607047400C00200005004078000020D2 -:10CE0000BEBAFECA8107C90E002808DA0007000F63 -:10CE100008388008C24A80008018C06904E0800891 -:10CE2000C04A800080180068C8400006800F704724 -:10CE3000BD4948788978884201D3401A02E021220E -:10CE4000511A0818C0B27047B74923314878897819 -:10CE5000884201D3401A02E02122511A0818C0B2B8 -:10CE60007047B149463148788978884201D3401AE1 -:10CE700002E02122511A0818C0B27047A94910B522 -:10CE80000C310868FF22120290430122D2031043A2 -:10CE90000860A54900202331487088702339487004 -:10CEA0008870463148708870A04808F0C8F89F48DC -:10CEB000401C08F0C4F8F5F741FC00F028F910BD5B -:10CEC00020207047B4E770B50C4605460026FFF7F2 -:10CED000AFFF9549A04214D30A46203A00232046CA -:10CEE000641EE4B200280BD08878105C2870887823 -:10CEF0006D1C401CC0B288702128F0D18B70EEE709 -:10CF0000012600F004F9304670BD202070479BE7F1 -:10CF100070B50C4605460026FFF796FF824923317F -:10CF2000A04214D30A46203A00232046641EE4B2ED -:10CF300000280BD08878105C287088786D1C401C05 -:10CF4000C0B288702128F0D18B70EEE7012600F086 -:10CF5000DEF8304670BD202101700020704710B50A -:10CF60000446FFF77EFF2070002010BD70B50C4610 -:10CF70000546FFF776FF6C494631A04215D30A46B5 -:10CF8000203A00232046641EE4B200280BD08878A3 -:10CF9000105C287088786D1C401CC0B288702128F5 -:10CFA000F0D18B70EEE7002400E0614C00F0AFF8A8 -:10CFB000204670BD70B50C460546212904D9FF20D6 -:10CFC0005CA1473009F02FFA55484068103840B24C -:10CFD000FFF718FFC6B20D20FFF714FFC0B286425C -:10CFE00007D2FF2053A14D3009F01DFA01E0F5F7FB -:10CFF000E8FB21462846FFF766FF0028F7D070BD02 -:10D00000F8B507464948484C401E474E007825462B -:10D0100046362335002806D1A9786878212200F009 -:10D020006BF800280ED0A1786078212200F064F817 -:10D03000002814D0B1787078212200F05DF8002823 -:10D0400028D033E038496878C91C0F546878401CF0 -:10D05000C0B26870212829D10020687026E03249CA -:10D06000607820390F546078401CC0B2607021286D -:10D0700001D1002060702D4F7F1E3878002815D018 -:10D08000A1786078212200F037F800280ED0002027 -:10D0900038700BE02449707826310F547078401CAA -:10D0A000C0B27070212801D100207070A978687812 -:10D0B000212200F021F800281DD0A17860782122DB -:10D0C00000F01AF8002816D0B1787078212200F00C -:10D0D00013F800280FD0F5F756FB144807F0B7FFF8 -:10D0E00001214903884203D016A1C12009F09BF910 -:10D0F0000E4807F0C4FFF8BD401C884205D090429E -:10D1000001D1002901D0002070470120704710B5DF -:10D11000064807F09CFF002801D1F5F723FB10BD5E -:10D1200000ED00E000E400E0800C00207D00002025 -:10D13000072000007372635C736F635F72616E64DB -:10D140002E6300007372635C736F635F72616E6461 -:10D150002E6300000C4908784A78401CC0B2904207 -:10D1600000D008707047094A074820BF40BF20BF61 -:10D170004178037843701368002B02D103788B4207 -:10D18000F3D00020704700007F00002000E200E0A4 -:10D19000FEB5F34C07466068FF213E0181552178BA -:10D1A000FF2913D00901083141583246491E08327F -:10D1B00009020192090A805800F0C8F9002802D03B -:10D1C0002478254615E06168207888552770FEBDD3 -:10D1D000E34842680198115828010090083010581F -:10D1E00000F0B4F9002806D1DD482C4641680098CB -:10D1F0000D5CFF2DECD1DA4821014068855547547C -:10D20000FEBD70B5D64A04460020157A53680AE080 -:10D210000201561C9E5DA64203D10C329A588A42E6 -:10D2200004D0401CC0B28542F2D8FF2070BDF8B5D2 -:10D23000CB4F3E7801F013FE0146FF2E68D034013B -:10D24000254678680835405900F080F9022802D94F -:10D25000786840595AE0C2494868025D0A70A11CCA -:10D26000425C002A0CD0521E425441590122D20580 -:10D2700089180902090A41513046FFF789FF30E059 -:10D28000631CC25C0092221D94468258002A10D072 -:10D2900001239B029A420FD99205920D43595703DD -:10D2A000DB191B021B0A43516346C3589A1A920AA0 -:10D2B00009E0FF21C1540AE0435952039A181202AF -:10D2C000120A4251002242543046FFF761FFA4483F -:10D2D0000C344168C26800980959800012580098BF -:10D2E00090479F4C2078FF2812D001F0B8FD0146EE -:10D2F0002078626800010830105800F027F90128F2 -:10D3000096D92078616800010830085801F09AFD2C -:10D31000F8BDF8B51C4615460E460746FF2B03D34D -:10D3200090A1D32009F07FF88D48FF21C7604560A8 -:10D3300004720674017000224270104604E002017B -:10D34000521C401CA954C0B2A042F8D3F8BD70B51D -:10D35000834C06466578207C854203D381A1E62074 -:10D3600009F061F8E068A90046506078401C6070E0 -:10D37000284670BDFFB581B01D46FF2401F06FFD4A -:10D38000774F064679780198814203D875A1F42039 -:10D3900009F049F872480021037A406810E00A0158 -:10D3A0009446521C825CFF2A24D0019FBA4205D1C8 -:10D3B00062460C328758029A97421DD0491CC9B266 -:10D3C0008B42ECD8FF2C17D021014B1C019AC25480 -:10D3D0000B33029AC250039B614F0022012B0ED0E7 -:10D3E0000B1DC25001239B029D4216D9AA05920D26 -:10D3F00008D008E00C46E1E7FF2005B0F0BD0B1DAA -:10D40000C550EFE71A4653039B190E461B02083618 -:10D410001B0AAA1A8351920A09E0002D00D10125A6 -:10D420006B039B191D022D0A0B460833C550891C3E -:10D4300042543D463E782046FFF7AAFE2878B04287 -:10D4400015D001F00CFD014628786A68000108300B -:10D45000105800F07BF8012807D928786968000186 -:10D460000830085801F0EEFC01E0FFF7E0FE0198FB -:10D47000C3E770B50C46054601F0F1FC06462146AF -:10D480002846FFF7BEFEFF2817D0354D0401204681 -:10D49000696808300858314600F058F8012109033E -:10D4A00040186968A41C095D400B002901D089025D -:10D4B0000818002800D1012070BD002070BDF3B510 -:10D4C00081B00F460198FFF79CFEFF282AD0244D1B -:10D4D0002E7869683246344604E0844205D02646F8 -:10D4E0002301CC5CFF2CF8D11CE0FF2C1AD0A64203 -:10D4F0001FD11001085C2870FF2818D001F0AFFC84 -:10D500002A780146120168680832805800F01EF837 -:10D51000012809D92878696800010830085801F005 -:10D5200091FC06E00020FEBDFFF781FE01E001F066 -:10D5300091FC39460198FFF79CFF22016968FF239F -:10D54000541C0B558A5C3301CA54FEBD401A0002BC -:10D550000121000AC905884200D900207047000057 -:10D56000CC0C00207372635C736F635F74696D65CC -:10D57000722E6300F0B500241C4A01211C4B0803E5 -:10D58000546018601B4B1C601B4C20601B480469D6 -:10D59000E443E406E617046910252C430461184CA3 -:10D5A0006160184D2960761C00E020BF1F68002FC5 -:10D5B000FBD0002E03D107691026B743076190689E -:10D5C0008005906801D5104A10436960A160002170 -:10D5D00019600121084A09031160F0BD10B5044625 -:10D5E000FFF7C8FF2060002010BD000000C500400C -:10D5F00080E100E000C1004080E200E000ED00E0DA -:10D6000000C3004000C0004000FCFFFF70B51F4990 -:10D610000A68002A17D000231D4601244A68521CBC -:10D620004A60092A00D34D600E792246B2400E6846 -:10D6300016420AD072B60B6893430B6062B6496813 -:10D640000160002070BD052070BD5B1C092BE5D377 -:10D650000FA1362008F0E7FEF5E70120104980050C -:10D6600008607047EFF31081CA07D20F72B601212C -:10D6700081400648036819430160002A00D162B660 -:10D68000EBE7024800210160416070478400002000 -:10D690007372635C736F635F6576742E6300000062 -:10D6A00000E200E001208107086070470120810747 -:10D6B000486070471048C068C00700D0012070471C -:10D6C0000D488068C00700D0012070470A484069B3 -:10D6D000C00700D0012070470748C069704706495D -:10D6E0008A69D20306D589698907890F814201D1E8 -:10D6F000012070470020704700040040F8B5F84C46 -:10D70000207BE17A88421CD00126F64D0027E07A82 -:10D71000215C14200A4642435019037C052B11D08A -:10D72000037C062B1CD0037C072B28D0437C012BC9 -:10D7300033D0EDA1EF4808F076FE207BE17A8842F5 -:10D74000E5D1F8BD0674E07A0A2807D0E07A401CDB -:10D75000E072491CC8B2AA5802210CE00020F7E789 -:10D760000674E07A0A2808D0E07A401CE072491C6E -:10D77000C8B2AA5803219047DFE70020F6E70674F5 -:10D78000E07A0A2807D0E07A401CE072491CC8B24F -:10D79000AA580821EFE70020F7E74774E07A0A2843 -:10D7A00007D0E07A401CE072491CC8B2AA58072191 -:10D7B000E1E70020F7E770B50024CF4E0620707235 -:10D7C000CE4825464477047738300473C472CC4879 -:10D7D00007F035FCCB480575F572CB49601E8860B3 -:10D7E0007571B570F57035717570C848643905701C -:10D7F00045701420604340180574641CE4B2052C85 -:10D80000F7D30120F5F764F80020F5F761F801205F -:10D81000B071F4F727FDBE48F4F736FDBD4C20701B -:10D82000BD48F4F731FD6070F4F7F2FF70BD10B53C -:10D83000F5F719F8B74C2078F4F744FD6078F4F761 -:10D8400041FDAD4C207A002803D0F4F7CAFD00203A -:10D85000207210BD70B5A84CA079002804D0A2A1F8 -:10D86000AE4808F0E0FD70BDE07A002803D19EA12B -:10D87000AB4808F0D8FD0126A6710025E572607A54 -:10D88000042114225043974A801801749E488168ED -:10D89000491C04D0691E81600120F5F719F80020A9 -:10D8A000F5F716F8F4F7FAFF07F00AFDF5F7FBF8BD -:10D8B0009C480560056001209B49C0030860F5F79E -:10D8C00071F992480078022804D0032804D1E07846 -:10D8D000002801D0A67000E0A570F5F7D0F870BD63 -:10D8E000034680490520142242435218203A127FF1 -:10D8F000002A04D0401E0006000EF4D17047142206 -:10D90000424351180A46803AD366012220390A77E9 -:10D910007047012805D0032805D1002903D1002034 -:10D9200070470029FBD010B4734C00236370774A12 -:10D93000002890700CD002280AD007291AD20800BB -:10D9400078440079001887441505070D0F1113005E -:10D95000D37003E01B2000E03A20D07001206070FB -:10D9600010BC70475820F8E77720F6E79620F4E7D8 -:10D97000B520F2E710BC0020704710B5634840782E -:10D98000F5F798F880B210BD411E1422504310B52F -:10D99000544A8418203C042902D8207F002803D14F -:10D9A00051A1624808F03FFD207F012804D0B32038 -:10D9B0004DA1800008F037FD0020207710BD70B524 -:10D9C0004E4C607F217F884201D1012500E0002577 -:10D9D000F5F709F8F5F76EF8617F227F914201D1E2 -:10D9E000012100E00021A942EBD170BDF7B5074647 -:10D9F000481E84468EB0C0B2142205905043394A66 -:10DA000085180495287C2D1D07282AD1344C002622 -:10DA1000E07A227B824221D0235C059A934201D195 -:10DA2000012601E0002E04D00A2811D0421CA25C7D -:10DA300022540A280ED0401C227BC0B28242EBD175 -:10DA4000002E0BD0207B002806D0207B401E04E057 -:10DA50000022ECE70020EFE70A202073049A01205F -:10DA600010746046244C042813D8142041431D48E8 -:10DA700008182038007F00280BD00498007C01286B -:10DA80000BD00498007C012803D01098807A0128DC -:10DA900007D015A1264808F0C6FC1098807A012806 -:10DAA0006FD104980F4B007C022845D00C4C207B92 -:10DAB0000A2872D0207BE17A401C884203D10AA157 -:10DAC0001C4808F0B0FC049901204874217B05989B -:10DAD0006054207B0A2864D0207B401C20731CE10A -:10DAE000D80D0020E80D00207372635C72656D2E06 -:10DAF00063000000CF0500006C0E0020A00D002088 -:10DB0000780E0020C00D00204C0E00208E0000205A -:10DB10002FD200008C000020FDD600007D02000006 -:10DB20005E02000000F5004080E200E0CB02000051 -:10DB30001503000022030000607A059A0146904216 -:10DB400006D0014614267043C018807C9042F8D15C -:10DB5000627A824208D1617A14225143C918897CC1 -:10DB600061720121A17207E014224243D2181426E7 -:10DB70007143927CC9188A74142206215043C0183C -:10DB800081741098007A062819D201007944097925 -:10DB900049188F440812100E0C0AE07A00288ED023 -:10DBA00091E700209AE700200FE0B4200DE07320F9 -:10DBB0000BE0322009E00A2007E0062005E0FF2004 -:10DBC000FDA1E03008F02FFC0020029010980168C1 -:10DBD0000298081A28601099097A002912D00221A7 -:10DBE000401A0102090A296010980268406810185A -:10DBF0000002000A68601098807A0228109803D00A -:10DC0000007B74E00421EBE7007A002813D00222A5 -:10DC1000029810188446109842686046083016181A -:10DC2000E848029A4078904202D9E278002A04D06B -:10DC30003046083005E00422EAE7029A801A80198B -:10DC40000830627A062A1CD0627A14235A43DE4BCB -:10DC5000D2185268914214D0DC4B0793617A142297 -:10DC60005143D94A89184A688968D21BC91B1202D4 -:10DC70000902120A090A90423AD89A4238D89942BF -:10DC800036D83818801B0002000A286010996044BA -:10DC9000CF4AC9680002000A9446421A01239B0534 -:10DCA00007929A4201D2104614E00A1A09929A4247 -:10DCB00001D207980EE0079A6346624503D9591AC4 -:10DCC0000818401C06E0099A624506D9181A40183F -:10DCD000401C4042002860DC03E0B7A1BD4808F0CA -:10DCE000A2FB286880190002000A686000202872E0 -:10DCF0006868082608300002000A68601098407AB8 -:10DD0000A8721098007A687203280ED200280CD0EE -:10DD1000FFF7D0FC002803D007E0002011B0F0BDD1 -:10DD200002983A210E1A32200290A6480178012961 -:10DD300001D0032909D141780298814205D9E078C0 -:10DD4000002802D10298081A861928689F4AC01B29 -:10DD5000844601026868090AC01B03021B0A029379 -:10DD60008E421AD81346914217D80299994214D874 -:10DD7000617A062915D0667A6146062203920092DE -:10DD80001422914B7243D2189368DB1B8B4216D836 -:10DD90000396967C062EF3D177E0059801F055F9AD -:10DDA000BBE70499022205980A74627A062A00D019 -:10DDB000627A8A7460720120A07211B0F0BD062EE2 -:10DDC00063D000223146944614227F4B4A43D21836 -:10DDD0005368DB1B834229D2917BAB7A99421FD8CF -:10DDE00004980521059C01747B4D287B0A2811D0DD -:10DDF000287BE97A401C884203D16FA1774808F05C -:10DE000012FB287B2C54287B0A2807D0287B401C37 -:10DE1000287382E7E87A0028EFD0F2E70020F7E7DE -:10DE200001218C46917C0629CED102E06046002873 -:10DE30002AD03546009114202A46424362480621E2 -:10DE4000171839741038007B0A28634816D0017BF4 -:10DE5000C07A491C814203D157A1614808F0E3FA16 -:10DE60005D48017B4554017B0A290BD0017B491C8D -:10DE70000173BD7C0098A842DDD106E0C07A00287D -:10DE8000EAD0EDE70021F3E70096049902204E4D19 -:10DE90000874607AB04207D1049900988874059894 -:10DEA00060720120A07221E00398062E0FD0062890 -:10DEB00003D141A14B4808F0B6FA0398142250430D -:10DEC0004019059981740499009888740EE0062819 -:10DED00003D139A1444808F0A6FA0398142250430C -:10DEE000401905998174049906208874012011B0A5 -:10DEF000F0BD70B50D463D4A441900210B46101A7D -:10DF00008B4103D22CA13A4808F08DFA394885425A -:10DF100003DD29A1384808F086FA3848854203DA3B -:10DF200025A1374808F07FFA3648844205DA002CEC -:10DF300001DB204670BD334800E03348201870BD37 -:10DF4000401E70B5C0B2142148431F494418607B7D -:10DF5000062813D201007944097949188F44020C2C -:10DF60000A080604002068E0B42010E073200EE0E8 -:10DF700032200CE00A200AE0062008E0FF200EA173 -:10DF8000E03008F050FA617B0020002955D00221D2 -:10DF90004018616840180002000AF4F78BFD0C2558 -:10DFA0006557124A441900210B46101A8B412FD293 -:10DFB00001A10F482AE000007372635C72656D2E48 -:10DFC000630000008E000020E80D0020FFFF3F00EE -:10DFD000FFFFFF000E070000D80D00200702000021 -:10DFE000C5030000DD030000E3030000FF7F841E83 -:10DFF000F50300000020A107F603000000E05EF832 -:10E00000F70300000080841E00807BE108F00BFA1B -:10E01000FB48854203DDFB49FB4808F004FAFB4856 -:10E02000854203DAF749FA4808F0FDF9F9488442D5 -:10E0300007DA002C03DB204670BD0421A8E7F54871 -:10E0400000E0F548201870BDF0B5064683B0F348EF -:10E050000190457A029534687068001B0702F04809 -:10E060003F0A001B0090062D2DD014202946414365 -:10E07000EC480122081884464168E9489205864622 -:10E08000081B904210D3631A93420DD30246704688 -:10E09000724503D900984018401C05E073450ED91D -:10E0A000411A0819401C404200280CDA60460295CB -:10E0B000857C0198C0790028D5D003B0F0BDD14946 -:10E0C000D94808F0B0F90298854226D01421484377 -:10E0D000D4490123401802908068D1499B058C46A1 -:10E0E000011B8646994210D3221A9A420DD36346E9 -:10E0F000614503D900997144491C06E019466245FF -:10E100002DD9091A0819401C4142002905DD029841 -:10E11000B17A807B814200D37446062D15D0C14967 -:10E120001420454368184268121B1202120ABA42B0 -:10E130000BD2B37A827B934200D38468857C0198AA -:10E14000C0790028B9D1062DEAD13068A042B4D0F8 -:10E15000E0190002000A3460706003B0F0BDA94904 -:10E16000B14808F060F9D8E7F0B5B049044648680E -:10E1700085B0C005C00D1CD0103840B200280CDAA4 -:10E180000207120F083A920892005118C9698007D5 -:10E19000C00EC1400806800F09E08108A44A89002A -:10E1A000891809688007C00EC1400806800F002842 -:10E1B00008D000272078002806D0012804D00020AD -:10E1C00005B0F0BD0127F5E72079062813D201003C -:10E1D0007944097949188F44020C0A080604002082 -:10E1E00018E0B42010E073200EE032200CE00A208A -:10E1F0000AE0062008E0FF208249E03008F013F929 -:10E2000021790020002905D002214618834D002FD6 -:10E2100002D003E00421F8E70020E871694602AA71 -:10E22000A068F4F751FC694608228A56E06801A903 -:10E2300080180122C01C1F2801DA019209E003AAFC -:10E24000F4F742FC6846007B002802D00198401C8D -:10E25000019000990198401808300002000A0190CE -:10E26000881B0002000A0090607969468872009855 -:10E270000390F4F7B8FB009A019B121A181A6D4923 -:10E2800012020002120A000A8A4216D8884214D8E2 -:10E290006846FFF7D9FE00990398814205D0881996 -:10E2A0000002000AF4F706FCA0600120E9790029C9 -:10E2B00086D0002FB0D005B0F0BD0020F6E7F3B552 -:10E2C0008FB05D480C460B9006F0C1FE5B4A0F997B -:10E2D000524F56185A4D203E00280BD05948007D09 -:10E2E000002803D058A15B4808F09DF82078012849 -:10E2F0007ED060E1687F0A280CD0687F297F401CAF -:10E30000884203D150A1544808F08DF820780128A4 -:10E3100004D00CE0287F0028F4D0F7E7F07F002835 -:10E3200003D049A14D4808F07EF80120F077697FBD -:10E330000F9814224A4E51438919087420780228F4 -:10E3400022D0687F14214843861920793072607981 -:10E35000707232460C323146A068F4F7B5FB0C20DF -:10E3600030560F2804DD1F3830733068401C306091 -:10E370000C217156301DE26801905018C01C1F28F6 -:10E3800070DA01200199FDE028494868C005C00DF8 -:10E3900021D0103840B200280CDA0207120F083AD8 -:10E3A000920892005118C9698007C00EC140080642 -:10E3B000800F09E081081E4A8900891809688007D2 -:10E3C000C00EC1400806800F002804D105201EA100 -:10E3D000000208F028F8687F1421484386190021BC -:10E3E000E0686A460691117006A9F4F76DFB00E03B -:10E3F000D7E06A46002010560F2834DD012033E0B4 -:10E400000020A107B8DF0000F603000000E05EF87E -:10E41000F70300000080841E00807BE16C0E00206A -:10E42000FFFFFF00E80D00200E07000000ED00E0F8 -:10E4300000E400E0FFFF3F00780E00209200002083 -:10E44000A00D0020C00D00207372635C72656D2EFC -:10E450006300000011050000EF040000F404000058 -:10E46000E00C002082E0002006994018079002206E -:10E47000B0722079307260797072A068311DC01C52 -:10E4800006911F2801DA012009E0F4F71DFB684618 -:10E490000078002804D0069806990068401C08609F -:10E4A000307A062813D201007944097949188F443B -:10E4B000020C0A08060400200FE0B4200DE07320CF -:10E4C0000BE0322009E00A2007E0062005E0FF20EB -:10E4D000FD49E03007F0A7FF00202179002943D053 -:10E4E00002214018069071680830081807990890B2 -:10E4F00009180698081A0C900020F871F4F773FABE -:10E5000004463060079820180002000AF060787A0C -:10E51000062825D0797A14204143EC480818406831 -:10E520000899029040180002000A0390707A694628 -:10E53000887402A8FFF788FD0299039A091B121B31 -:10E5400009021202E24B090A120A0C98994207D8F2 -:10E55000824205D80299069808180002000A306025 -:10E56000F8790028C8D110E00421BAE704AA01997B -:10E57000F4F7AAFA6846007C002804D001980199B3 -:10E580000068401C08602078B072687F0A2806D0B6 -:10E59000687F401C68770B9806F071FD47E000200B -:10E5A000F8E7F07F002804D0A320CAA1C00007F03C -:10E5B0003AFF0120F077CA490F98087420780228A2 -:10E5C00003D1C4A1C74807F02EFFC54E2079307291 -:10E5D0006079707232460C323146A068F4F774FAF2 -:10E5E0000C2030560F2804DD1F3830733068401C73 -:10E5F00030600C22B256301DE16801908818C01CB2 -:10E600001F2802DA012001990BE003AA0199F4F70F -:10E610005BFA6846007B002804D0019801990068E5 -:10E62000401C08602078B072AD4901200875687FF1 -:10E63000297F884224D07C7A062C23D0F4F7D3F9A2 -:10E6400014214C43A14961180A7C042A18D00A7C81 -:10E65000032A15D04B6889681B1A081A1B0200028E -:10E660009B4A1B0A000A082B0AD31146934207D87B -:10E67000884205D8687F297F884201D0F4F7FFF9E6 -:10E6800011B0F0BD687F297F8842F7D111B0F0BD8D -:10E6900010B50020F4F709F910BD10B50120F4F70A -:10E6A00004F910BDF1B5009802281ED08E4C607A96 -:10E6B000062803D187A18D4807F0B5FE0026A67174 -:10E6C0000125E572607A03211422804F5043C0195E -:10E6D0000174F4F7D9F9009800280BD0012829D04B -:10E6E000032879D07BA1824844E082480078F3F780 -:10E6F000EFFDF8BD8048007F002803D075A17F485A -:10E7000007F091FE65717C4D00202E60F4F7E0F873 -:10E71000A968481C04D0012300221846F4F70EF91A -:10E72000607A617A401CC0B2142251437A580121A8 -:10E730009047F8BD0120F4F7CBF8607900280DD0A0 -:10E740006D488068401C09D0607A617A401CC0B274 -:10E75000142251437A5806219047F8BD6648007F3D -:10E7600001280AD0022812D0032822D0042834D04D -:10E7700058A1634807F057FEF8BD2079002803D060 -:10E780002671F4F786F9E5705B480677F8BD207AC4 -:10E79000002802D1F3F7FCFD2572607A617A401CF3 -:10E7A000C0B2142251437A5800219047524806774C -:10E7B000F8BD514F0123397B78680022411A184671 -:10E7C000F4F7BCF82079002803D02671F4F761F93A -:10E7D000E57002203877F8BD19E0474E217870685F -:10E7E0000123411A00221846F4F7A8F8207A0028DD -:10E7F00002D1F3F7CDFD2572607A617A401CC0B278 -:10E80000142251437A58002190473577F8BD607A39 -:10E81000617A401CC0B2142251437A5805219047B6 -:10E82000F8BD10B5304C607A062803D129A13548CF -:10E8300007F0F9FD607A617A401CC0B2142251439E -:10E84000224A52580421904710BDF0B583B00620EB -:10E850000290F4F7C8F8244C0090617A2A4801909D -:10E86000062920D0617A1420414318480918097CF0 -:10E87000042918D0617A142251430818007C032817 -:10E880007BD0019900980B6849681B1A081A1B0273 -:10E8900000020F4A1B0A000A082B6ED3114693424E -:10E8A0006BD8884269D814488068401C03D009A1FD -:10E8B000164807F0B8FD00206071607A06282CD158 -:10E8C0006078002829D023E0B8DF0000E80D0020A0 -:10E8D000FFFF3F007372635C72656D2E6300000082 -:10E8E000C00D00201E0500006C0E00204F0500002A -:10E8F000A20500008C0000204C0E00205B050000EB -:10E9000096050000A90500005C0E0020E50500004A -:10E91000FE48C178417081780170607A062815D070 -:10E92000607A1421FA4A48438018007C04280DD1EB -:10E93000607A0290607A0121142358438018017490 -:10E94000607A58438018807C6072A172F14D687FB4 -:10E95000297FF14F884233D0F04E287F142148435D -:10E960008019007CC05D0128287F07D048438019AA -:10E97000007CC05D02282FD044E0FDE11421484313 -:10E980008019807A01280AD0287F0221142250435E -:10E990008019007CC155287F0A2808D009E0287F0B -:10E9A0000021142250438019007CC1552AE0002028 -:10E9B00001E0287F401C2877687F297F8842CCD1DE -:10E9C000D74D287D00284CD0287CC15D012928D056 -:10E9D000C05D022830D03AE0287F142148438019D6 -:10E9E000807A012803D0CFA1D14807F01CFD297FF0 -:10E9F00000201422514389198872297F51438919B3 -:10EA0000097CC855287F142148438219287F484330 -:10EA10008019017C0098FEF7E9FF287F0A28C8D1F9 -:10EA2000C5E7A97A012904D00221C1550020287523 -:10EA30000DE00021C1550AE0A87A012803D0B9A150 -:10EA4000BC4807F0F0FC0020A872297CC855287D3E -:10EA5000002806D0297CB24A0098FEF7C7FF0020A4 -:10EA60002875029806281ED014214843A84940184A -:10EA7000017C012917D107210174AF4D287B0A2899 -:10EA80003CD0287BE97A401C884203D1A5A1AB4841 -:10EA900007F0C9FC297B02986854287B0A2831D0EA -:10EAA000287B401C2873607A06287DD0A07A002835 -:10EAB0007BD00020A072617A1420414394480E1844 -:10EAC0009F49B56873680A46F6687C32CB679660E2 -:10EAD00055609C4D697E002916D00226617A142269 -:10EAE0008B4851430818407B06281BD2010079440B -:10EAF000097949188F440A1412100E0CE87A00287C -:10EB0000C4D0C7E70020CDE70426E7E700210FE0E7 -:10EB1000B4210DE073210BE0322109E00A2107E066 -:10EB2000062105E0FF208849E03007F07CFC002149 -:10EB30002973687E022801D0012810D12869009A23 -:10EB40004018821A1202120A3A2A08D932380321CE -:10EB500000026976000A28613220287308E0322911 -:10EB600006D2207A00280AD1F3F712FC012005E032 -:10EB7000207A002803D0F3F734FC00202072634988 -:10EB80000822487820700978012901D0032906D18C -:10EB900001212171297B884201D9421A0832A378C8 -:10EBA000002B00D0921C01E08DE09BE02179002930 -:10EBB00001D1002B5DD09446644A00990092019ADD -:10EBC000176852687F1A511A3F0209023F0A090A60 -:10EBD000BC451BD85D4A974218D8009A914215D877 -:10EBE000297B884223D92B69421A9A1A1202120AE7 -:10EBF000101880190002000A2A616860002914D0E8 -:10EC0000032028770006000E3ED14CE00020207142 -:10EC1000A070297B002925D028694018801900029E -:10EC2000000A6860022028772EE00120E9E781428F -:10EC30000BD92A69511889190902090A6960002843 -:10EC400001D00420DDE70220DBE7002B03D135A152 -:10EC50003F4807F0E8FB286980190002000A686055 -:10EC6000002004E0296989190902090A69602877E6 -:10EC700019E0287B00280FD02969081880190002A4 -:10EC8000000A686002202877286901238119002280 -:10EC90001846F3F753FE09E0286980190002000ABC -:10ECA0006860002028770120F3F712FE607A1421B3 -:10ECB000484317490C2240188256012300206968F6 -:10ECC000F3F73CFE0EE00120F3F702FE0020F3F71D -:10ECD000FFFDF3F7E3FD207A002803D0F3F781FB73 -:10ECE00000202072A078002804D0F3F7D2FE002084 -:10ECF000E070A0706078002804D00448C1784170AA -:10ED000081780170207900282BD023E08E0000202C -:10ED1000E80D0020A00D002091000020E00C002054 -:10ED2000C00D00207372635C72656D2E630000007D -:10ED30000706000023060000D80D0020350600005D -:10ED4000E00D00204C0E0020B8DF0000FFFF3F0068 -:10ED5000870600000020CF49E0700978002900D123 -:10ED60002071CD48017BC07A814203D0CB484078E6 -:10ED7000F3F7AEFA0120E07103B0F0BDF0B5C84C76 -:10ED80000746607A83B0062803D1C6A1C84807F0B9 -:10ED90004AFB607A1421C74E48438019007C03283F -:10EDA00003D0C0A1C44807F03EFBC44DA868401C76 -:10EDB00003D0BCA1C24807F036FB607A1421484357 -:10EDC00081190C20085600216A4600911171C01962 -:10EDD00001AA6946F3F778FE6A46042010560F2808 -:10EDE00001DD012000E0002000994018696840180A -:10EDF0000102090AA9606079002804D001230022D9 -:10EE00001846F3F79BFD03B0F0BD70B5AE4CAD4AAC -:10EE10000B1AA34214D3451AA54211D3934203D926 -:10EE2000101A43185B1C0BE0954204D9511A0818BC -:10EE3000401C434204E0A549A54807F0F4FA00232A -:10EE4000184670BD10B50146012300220220F3F7D9 -:10EE500075FD10BD10B50220F3F73AFD10BD10B5D9 -:10EE6000F3F7C1FD10BDF0B58D4D0446E87A83B0CF -:10EE7000002803D18BA1974807F0D5FA642C4DD315 -:10EE8000954900200246091B824147D39348417FA0 -:10EE9000007F814242D19248007D00283ED1687AAD -:10EEA0001421844F4843854EC519306801AA0019C2 -:10EEB0006946F3F709FE694604200856002802DD7A -:10EEC0000098401C0090A96800986B680A18D21A34 -:10EED0001202844B120A9A4220D8AA7C062A08D031 -:10EEE00014235A43D2195268511A0902090A81425D -:10EEF00014D3B068401C05D00120F3F7E9FC0020D2 -:10EF0000C043B060306800193060A86800994018AC -:10EF10000002000A7061012003B0F0BD002003B0C0 -:10EF2000F0BDF8B50646401EC5B2142061496843DD -:10EF30004418207C002803D15AA16B4807F073FACB -:10EF40006648017F407F81420CD0684A14234B43BE -:10EF50009B181B7CB3420CD00A290CD0491CC9B2A7 -:10EF60008142F3D15E48017D002964D0007CB0422B -:10EF700061D10020F8BD0021F1E7217C052905D0F1 -:10EF8000217C062902D0217C072928D10121217466 -:10EF9000C17A0023027B8A4221D00246565CAE42EF -:10EFA00001D1012301E0002B04D00A2911D04E1C0D -:10EFB000965D56540A290ED0491C167BC9B28E4262 -:10EFC000ECD1002B0BD0117B002906D0117B491E00 -:10EFD00004E00026ECE70021EFE70A211173617CD1 -:10EFE00000292AD06774C17A0023027B8A4224D088 -:10EFF000425CAA4201D1012301E0002B04D00A297E -:10F0000012D04A1C825C42540A290FD0491C027B50 -:10F01000C9B28A42ECD1002B0FD0027B0146002AF4 -:10F0200006D00A7B521E04E00022EBE70021EEE747 -:10F030000A220A7301E018480027217C01299CD18B -:10F04000617C002999D10120F8BD70B505461420D6 -:10F05000184A05216843801801740F4C207B0A2848 -:10F0600011D0207BE17A401C884203D11749204807 -:10F0700007F0D9F9207B2554207B0A2807D0207B74 -:10F08000401C207370BDE07A0028EFD0F2E700202A -:10F09000F7E700008E000020D80D00208C00002033 -:10F0A0006C0E00207372635C72656D2E630000004D -:10F0B000EA060000E80D0020EB0600004C0E0020E0 -:10F0C000EC060000FF7F841E0020A107B8DF0000CF -:10F0D0000E0700002D070000FF1FA107A00D002054 -:10F0E000C00D0020FFFF3F006A070000E00C002079 -:10F0F0000702000070B5FF4D00246C702C70AC61ED -:10F1000000F0CEFC284620304470C473AC6214304A -:10F110002C6305F094FF002804D0FF20F6A14E30A8 -:10F1200007F081F92C7770BD0B23DB4310B5C21AB1 -:10F13000F54998421FD008DC1C3222D00A2A20D080 -:10F14000142A1CD0182A08D117E0083011D004283E -:10F150000DD0082809D00C2805D0FF20E6A1753075 -:10F1600007F061F910BD04200CE000200AE0FC204B -:10F1700008E0F82006E0F42004E0F02002E0EC20B3 -:10F1800000E0D820C86010BD70B50125DF49022617 -:10F190000E60DF490022CA63CD63DE49C96A0907F0 -:10F1A0000ED4DC494031CB6ADB4A53620B6B93626D -:10F1B0004B6BD3628B6B1363C96BD30519435163DC -:10F1C000D14C002826D0012828D0FF20CAA1A13088 -:10F1D00007F029F9D148A063FF200430606325635C -:10F1E00003202061C849962040314860C1491C2055 -:10F1F0000856FFF799FFCB49C9488860C948CA49F2 -:10F2000080304160C9490160C9480660C949102081 -:10F21000486070BDC8486061C84803E0C848606184 -:10F22000C648801FA061D5E770B50C46B14D0146B8 -:10F230000622A81C06F079FF2C7270BDAD48203064 -:10F2400040787047AB4A517010707047F8B504466B -:10F250000D465079117900020843690009190884A4 -:10F260001F461646501C06F0C1FF317800020843C5 -:10F27000A90060502846083001268640002F0ED095 -:10F28000012F04D0FF209CA1E83007F0CCF8206BC0 -:10F29000304301460120A84001432163F8BD206BA3 -:10F2A000B043F6E770B50D460446082904D9FF209F -:10F2B00091A1F93007F0B7F80022A24809E09100C7 -:10F2C000635809180B6053001B191B8C0B62521CEE -:10F2D000D2B2AA42F3D3206B9A494031086070BD84 -:10F2E00010B50446FFF720FF8248047710BD81481F -:10F2F0002030007B704710B5834CC178616206F006 -:10F3000075FF0002E06110BD252808D0262808D02E -:10F31000272808D041000A2807D8091D06E0022145 -:10F3200005E01A2103E0502101E0891DC9B2764AA7 -:10F33000916075494031486170476E4988617047F6 -:10F3400070B5002818D002226A4C784B0320A272B4 -:10F35000F0331860734D72486860002001262075F4 -:10F3600000290BD0012910D002291BD0952062A1C1 -:10F37000800007F058F870BD0122E5E77248012AC5 -:10F3800001D0466070BD066070BD5A48012A006B0E -:10F3900005D00121490508432063696070BD012142 -:10F3A0000905F8E7A069002803D153A1674807F0D1 -:10F3B0003AF8A169A06A40186549886059486549CA -:10F3C0008030816060491031C1600120216BC00331 -:10F3D00001432163686047482030C67370BD08B59B -:10F3E0000C20694608705148002110380161564AC6 -:10F3F000012111610BE000BF00BF00BF00BF00BFD3 -:10F4000000BF00BF00BF6A461178491E11706946EF -:10F410000978002902D001690029ECD068460078FB -:10F42000002804D1494834A1203006F0FCFF08BD73 -:10F43000F8B53E4CF034206886083E48B600416876 -:10F44000C906CD0F10218160002727603549344857 -:10F450008860FFF7C4FF35481038076100F020FBD3 -:10F460002660002D02D0334910204860F8BD10B549 -:10F4700006F0BCFE00022449000AC86310BD2349FF -:10F48000022008602A49086070472049022080391C -:10F4900008607047304908707047164810B534301E -:10F4A00005F0D5FD002804D0284813A15A3006F0F5 -:10F4B000BAFF10BD0F4810B5343005F0E0FD10BDA7 -:10F4C00011494860704770B50A4D0446A86AA042C9 -:10F4D00004D31E4808A16B3006F0A5FF0120287355 -:10F4E0001C49002008392C6148601948446000F02C -:10F4F000DEFA70BD7C0E00207372635C68616C5F25 -:10F500007263732E630000000015004080E100E08C -:10F51000C01F004080000010001700405B06000084 -:10F520000040000400F50140408000401011004000 -:10F5300080E200E000130040060102002500030203 -:10F5400005010300001600400010004047020000C3 -:10F5500040850040488100409700002010B5FF48DA -:10F5600002210173C6210161FD4A00215160806AB8 -:10F57000FC49C630486000F09AFA10BD0121FA48F3 -:10F5800089058160F548026B8A430021026301739B -:10F590007047F64801214160C160F1490020486090 -:10F5A000F0494860ED4988627047F149402008629F -:10F5B000F0490A6802430A607047EE480168402239 -:10F5C00091430160EA49002008627047E9480168F8 -:10F5D000102291430160E849012088617047E749A2 -:10F5E0000020C861E34801681022114301607047A0 -:10F5F000E249CA69012A01D000207047DC4A9268BA -:10F600005206520E524202700020C861012070471B -:10F6100070B5D248D24D017B002902D0696801291A -:10F6200009D00024D5490A69012A06D00023807A2E -:10F63000012804D006E00124F4E74023F7E7CA6874 -:10F64000012A04D000221A43012802D004E020221B -:10F65000F9E74B68012B05D000231343C84A022861 -:10F6600002D007E01023F8E71668012E02D1CE6819 -:10F67000012E04D000261E43022802D007E00826EF -:10F68000F9E71268002A02D1CA68012A04D00022D0 -:10F690003243022802D005E00422F9E7002C01D011 -:10F6A000022300E000231343022807D14868012801 -:10F6B00004D16868012801D0012600E00026B14885 -:10F6C0001E4302681206120E02D04A69012A00D0B7 -:10F6D0000022A24C2034227300680006000E02D0E3 -:10F6E0008869012800D000206073A148006A0028C2 -:10F6F00003D000F0A8FA012800D00020A07300F089 -:10F70000C7F9002068603046F3E670B50C00054686 -:10F7100003D19D499D4806F086FEE00706D0012CE6 -:10F7200004D06D209849C00006F07DFE002D0ED05B -:10F7300002218A4801294172C4728E4809D00229E7 -:10F740000AD0924890491A3006F06DFED1E60121A8 -:10F75000EFE70168042201E001680822114301601B -:10F76000C7E670B57D4C0022E37A990701D54107C1 -:10F7700014D47A49DD062031002D05DA4D7B002DA9 -:10F7800002D08D7B002D09D01D0702D50D78002DEC -:10F7900004D15B0703D54978002900D10122637A9F -:10F7A0007449002B06D00225284010430CD0FFF7E7 -:10F7B0003FFE9EE66C4A76489060086880088000AC -:10F7C000086000F06DF994E6012B07D0022B0ED0F3 -:10F7D0006E486D496B3006F026FE8AE60868042202 -:10F7E0009043086000F05CF90120A07281E608688F -:10F7F00008229043086000F053F9A57279E6574952 -:10F8000008757047F8B5554F544D2037FA7B564C64 -:10F810000021286B002A31D00122D203A26090433C -:10F820002A46544D10632E685A4A102090600020DA -:10F8300028601014A060FFF7D2FD00F029F92E60B7 -:10F84000281460605349102048604448817A4A482F -:10F8500001290DD002290ED04C484FA1801F06F07F -:10F86000E2FD0020F8733D48007D022874D0F8BD09 -:10F8700001210160F5E701214160F2E73A4A906019 -:10F880000E462963FFF7C4FE044636482E754168CC -:10F8900069620068A862AA7A022A0AD16A78002AF4 -:10F8A00007D0334B403B5B681B7813402A789A4360 -:10F8B00008D03E70E20708D0084603F04AFD012157 -:10F8C000A86A09E001223A70F4E7A10601D50221F5 -:10F8D00002E0A10702D5002103F04BFD2448403887 -:10F8E00041680622A81C093106F0F2FB002809D164 -:10F8F0001F48297A403840680078C009814201D108 -:10F90000012000E0002078702046FFF72AFF2648FB -:10F91000007800280DD001284AD002285BD00328A7 -:10F9200078D01DA1214806F07EFDA87A022870D06B -:10F93000A3E0A00701D502F0EDFB200702D50120CE -:10F9400002F020FC600702D5002002F01BFCA0069C -:10F95000EBD502F07CFBE8E793E000007C0E002092 -:10F96000408100404085004000F50140008000409B -:10F9700040150040001200400010004000110040FF -:10F980000014004040160040F8F40000630300003B -:10F9900000400004001300407372635C68616C5F98 -:10F9A0007263732E6300000097000020E6040000DD -:10F9B000A00701D504F0BBFF200702D5012004F009 -:10F9C00021FF600702D5002004F01CFFA006ACD583 -:10F9D00004F0A4FEA9E7A007BF27002802DA3C40F4 -:10F9E000F3F702FB200703D53C400120F3F7FBFAB5 -:10F9F000600703D53C400020F3F7F5FAA00602D5D6 -:10FA00003C40F3F7EFFA60068FD5F3F7EEFA8CE798 -:10FA100000E012E0A00701D5F3F7EAFA200702D5CB -:10FA20000120F3F7E4FA600702D50020F3F7DFFACC -:10FA3000A00690D5F3F7DAFA77E7287B00281CD0E8 -:10FA40001F494E6002281FD0012803D01D491E48BF -:10FA500006F0E9FCA96A2869884204D81A481949BD -:10FA6000401C06F0E0FC2969184841600120296B20 -:10FA700080050143296316494860287D012800D08C -:10FA8000F5E6F3F7C5FAF8BD2969A86A4118EBE76E -:10FA900010480021C160016141604161816170478E -:10FAA0000D480021417281720121C17270470A48DC -:10FAB0000121026B89050A430263054841607047D2 -:10FAC0004081004098F90000FB04000040850040A0 -:10FAD00000F50140001100407C0E00202E4800215E -:10FAE00001704170704770B5064614460D460120FE -:10FAF000F1F758FC28490120284B08709E60DC6013 -:10FB00001D6170BDF8B504460120F1F74BFC224998 -:10FB10000120087021494C60214900264E600321D4 -:10FB2000204D0906A960204F002C0AD0012C03D0DB -:10FB30001EA1412006F077FC3E60032000066860AD -:10FB4000F8BD386001200006F9E710B512480178C9 -:10FB500000290ED00321134A0906916010494A6812 -:10FB60000021002A03D0154A1268427000E041705B -:10FB700001700020F1F716FC10BD0748017800293C -:10FB800007D007484068002802D00C480068C0B27F -:10FB900070474078704700009800002000F5004052 -:10FBA00000F1004000F5014000F200407372635C18 -:10FBB00068616C5F63636D2E6300000000F40040B9 -:10FBC0003A4800210170417010218170704770B572 -:10FBD000064614460D460220F1F7E4FB01203349A6 -:10FBE000334A0870E41E14619660556070BD10B50C -:10FBF0000220F1F7D7FB2D49012008702D48002184 -:10FC000001604160816001202B49C005486010BD42 -:10FC100010B5264C2078002811D001202649C005B7 -:10FC2000886000F034F80021002804D001206070C2 -:10FC30002248006801E061701020A070217000204F -:10FC4000F1F7B0FB10BD10B51848017800290BD0B2 -:10FC500018480068002805D000F019F8002800D0E6 -:10FC6000012010BD022010BD407810BD10B50F4816 -:10FC70000178002909D000F00AF8002803D00F48C5 -:10FC80000068C0B210BD102010BD807810BD0948BA -:10FC90000168002905D04168002902D08068002849 -:10FCA00001D0002070470120704700009A0000201A -:10FCB00000F5004000F1004000F5014000F4004074 -:10FCC000FFB593B0044600201D9E049015981C9D1E -:10FCD0001027082806D0E06901F014F8002809D0A0 -:10FCE0003770CCE028880921384328801F980227E4 -:10FCF000017016E0E169012088710521E269C902FD -:10FD00009180E1698872E169F9480881E169002020 -:10FD10008873288820210843288011211F980427F0 -:10FD200001701F980225801C0390307810900A20E3 -:10FD30003070204618301190F6F76BFC00206FE011 -:10FD40001598102809D1022D07D06846828A049997 -:10FD50000398401A8270110AC1706846C08A1699C9 -:10FD6000884203D9E349097A149106E0884204D114 -:10FD70001099002901D0317021E003990870000A20 -:10FD800048701E980088401BC01B83B2FF20C01B18 -:10FD9000984200D203460398149AC0190CA9009205 -:10FDA000019002912020015D6846C08A0022F6F78A -:10FDB000A5FC3070002806D0C0B2832862D0684607 -:10FDC000C08A208345E00F98002805D0C948006804 -:10FDD00000790A2830D33CE06846008EC119C9B2C8 -:10FDE0000491022D0FD01F99049A4978914203D1B2 -:10FDF0006A46128C824209D0BE480491006801789C -:10FE0000032909D027E008461F994870B9480068BF -:10FE10000178042906D008E000790A281BD20120C5 -:10FE20000F9009E06946C98A8180039904980818EF -:10FE300003900498281885B205AA14991198F6F72A -:10FE4000EBFB002805D11E980088401BB84200DB60 -:10FE500076E7022D0ED01598102807D1049A039941 -:10FE60006846808A891A8870000AC8701E980580C2 -:10FE7000002030709F4800680078032802D00020DE -:10FE800017B0F0BD0220FBE7F8B50446406B002632 -:10FE9000134600282BD0491F8DB2618F2A460832A5 -:10FEA000278F8A18BA4221D89A7840185F781102B1 -:10FEB00039430170090A41701A79DF781102394318 -:10FEC0008170090AC1700571290A41712A46591DBC -:10FED000801D06F02AF9608FAD1D401980B2608741 -:10FEE000626B002110180170417000E00926304655 -:10FEF000F8BD30B50B88048F9C4212D9446BE018D2 -:10FF00004478057824022C430BD0447905792402E7 -:10FF10002C436404640CA41D1B190B80106000208A -:10FF200030BD822030BDF7B588B000256846058217 -:10FF300005275DE00398417802780E021643417967 -:10FF4000027908021043000452D40A980123068063 -:10FF500005A802905B02002200970195304609999E -:10FF6000F6F7CCFB04004AD16846018A0183039866 -:10FF70004179027909021143437802781C02144343 -:10FF8000B4421ED10A041CD44B0401215B0C89032A -:10FF900000950B4301970295C17880780A020243CD -:10FFA00020460999F6F7C6F9040011D1039948795A -:10FFB0000A79000210430122D20310430871000A9B -:10FFC000487103AA06A90898FFF793FF0400CED052 -:10FFD0000399009501970295487809780002084333 -:10FFE00069468B8A00220999F6F7A4F9822C06D17A -:10FFF00003AA04A90898FFF77CFF04009AD068467A -:020000040001F9 -:10000000058209E003984179027909021143490404 -:10001000490C0171090A417103AA04A90898FFF764 -:1000200068FF0028EED0822C02D020460BB0F0BD35 -:100030000020FBE730B50446406B002597B0002850 -:100040000DD00B2268460270228F0281606B0391F3 -:10005000019000216846F3F7E2FA6846057065638F -:100060006587258717B030BDF8B50F460546696B23 -:100070000020069E144600290FD0012B0DD13246D8 -:1000800039462846FFF74FFF002806D1002C04D040 -:1000900032463946284600F044FEF8BD0022028070 -:1000A000C262831D0263C3614263428702872030BC -:1000B0000170704710B50022D24302800420FDF782 -:1000C000FEF910BD10B596B00446FFF7B3FF208EC1 -:1000D000002808D0012069460870E06A01900021DC -:1000E0006846F3F79CFA0020E062206316B010BD6A -:1000F00001280000B40E00200146098800200A07EC -:1001000000D501200A06120F01D002221043CA05B1 -:1001100001D5042210438A0501D510221043490558 -:1001200001D5202108437047FFB5A9B00600329DD4 -:10013000359C2B981F46229016D0007841060FD48C -:100140008106890E1E2909D021884A05520E0BD13D -:100150003A88172A08D3FE4A914205D0C10906D031 -:100160008006800E122802D003202DB0F0BD20465C -:100170002C302690F7492A980872002018AA03907C -:1001800010726A46107404AA0A60339A4A6020AA60 -:10019000908090812298007801908106681C1C90C4 -:1001A000701F1D902B98890EC21C2492224620326B -:1001B0001B92083A401C02920B0006F025FA1FFD24 -:1001C000FD11FD1FFD8EFDFCFDFBFDFAFDF9FDFCA3 -:1001D000FDF8FDFDFDF7FDF6FDFDFDFDFDF5FD0066 -:1001E000032E76D102E018A9087219E303202870C3 -:1001F0001C9917220A7000224A70CFE2052EF0D116 -:100200004178027808021043208320A98880249A2C -:100210005178127809021143618300287ED0884208 -:100220007CD800202072E080401E60840298F6F79F -:10023000F0F905202870A81C0190022000901BAA4C -:100240002A990298F6F7E8F9002868D118A8807C66 -:10025000012803D002206870102002E0012068709D -:1002600002202490002225A91CA8F2F746FD0028B0 -:100270002BD120A8007D2499814226D13A8800996B -:10028000801C511A814220DB10A8C18D0198017099 -:10029000090A417001991CA8891C01910099019AD1 -:1002A000891C009125A9F2F728FD20A8007D01995D -:1002B0001BAA091801910099081880B200902A9988 -:1002C0000298F6F7A9F90028CCD00098022826D089 -:1002D00064E272E018A9087261E2072E6DD34178DA -:1002E0000346027808021043208320A98880249ABC -:1002F0005178127809021143618300280ED0884298 -:100300000CD8012020725879197900020843E08046 -:1003100000202073E06900F0F5FC01E098E0A9E01E -:1003200000280ED1E169012088710521E269C90226 -:100330009180E1698872E16987480881E16900205C -:100340008873F01F60842298C01D60620298F6F7DF -:1003500060F907202870681C00900120019000209F -:1003600010A9C8852FE00198012814D0E069807990 -:10037000012830D000981E38417F007F09020143D8 -:1003800000980170090A41700098801C0090019843 -:10039000801C80B2019010A8C18D00980170090ADC -:1003A00041700098801C09E00AE296E13BE1DFE041 -:1003B00004E29BE077E036E016E2AFE000900198BF -:1003C000801C80B201901BAA2A990298F6F724F9A2 -:1003D000002803D007E010A8818DD1E73988019863 -:1003E000081A0428BFDA0198012843D0E06980790F -:1003F000012804D010A8818D5548814206D110A84B -:10040000818D00980170090A417009E000981E383A -:10041000417F027F0802009910430870000A48706B -:100420000198801CBAE1072E01D0152E76D14178B3 -:10043000027808021043208320A98880249A5178EA -:100440001278090211436183002801D0884201D942 -:1004500001203FE7012020720020E0802073052E5C -:100460000AD01D982299E269C0B2491DF2F71FFC1B -:10047000002801D00A202DE70020C04360841AA87C -:10048000019023A9229802970395009100780023F8 -:100490008206920E20462A99FFF712FC0390208BC9 -:1004A00020A988807BE1032EC0D1402220A98A8127 -:1004B0004178027808021043208320A988802A9975 -:1004C0001EAB1C9A02930192009139880022491EAA -:1004D0008BB21B990978F6F711F918A90872002850 -:1004E00033D10B20287010A8008F3FE0052E9DD13E -:1004F000802220A98A814178027808021043208353 -:10050000249984464A78097812020A43628420A911 -:1005100088801248824202D30720DBE6AFE03F200A -:100520008002024362842A981FAB1C9902930191B6 -:1005300000903888401E83B21B9801786046F6F719 -:10054000DDF818A9087200280CD08328AAD107E08A -:10055000FFFF0000B40E002001280000010200008F -:100560000220B8E00D20287010A8808F401C15E1F3 -:1005700001990C22C9095143C91CB14204D90198FF -:1005800040067CD5002009E1427803781002184328 -:1005900020AA9080844622980078400609D505203C -:1005A0006A46107422980078C00905D000201074A3 -:1005B0001DE106206A46107424981F902A9A009024 -:1005C0000023701A029383B21E9001921B9800229E -:1005D00001786046F5F7AEFE18A908720022694658 -:1005E0000A74832801D102200390229800784006E3 -:1005F0000DD52088C00506D520A9208B8988884282 -:1006000001D100206062002018A90872C6E0FF2115 -:10061000013120A88181808820831E9860841F98E2 -:1006200060621320B8E0052E29D3417802780802D1 -:10063000104320A98880218F002902D0FE4A9142D0 -:1006400006D10A216A4611740121C943218702E0BB -:1006500007216A46117422992A9A491D0192009134 -:1006600001221D990023D203029311438BB22499D6 -:100670004A78097812020A431B99097800E0C9E018 -:10068000F5F758FE18A90872002269460A7401227B -:10069000520220A98A81832808D0002809D0218FFE -:1006A000E54881427ED10020208778E08888208339 -:1006B0004DE7606B002808D031462046229AFFF7AC -:1006C000E3FB18A90872002869D12B463A46304648 -:1006D000229900F056FB039061E02298022E4078A8 -:1006E00001907DD1002801D0012879D108206946E8 -:1006F00008740198087521A800901B9800220178C1 -:100700002046019BFFF7B0FC6946002248758A75B8 -:10071000002802D10198012809D0208F002806D096 -:10072000002008740120800220A988810EE004A81E -:100730003399F2F774FF0390002069460874012092 -:10074000800220A988810398022807D0BB4800684E -:100750008079002805D018A908722BE00198208321 -:100760001DE00398002803D0812018A9087240E0FA -:1007700021A800901B98012201782046019BFFF7D9 -:1007800073FC18A9087220463499FFF753FC18A986 -:10079000087A002803D11920287001203880684683 -:1007A000007C00E03CE0002804D004A83399F2F774 -:1007B00036FF0390039800282ED01AE0062012E599 -:1007C0002078000713D5012E11D109216846017444 -:1007D000A188818204203499FCF771FE082100E091 -:1007E00005E020A88181CDE60198400612D50320BE -:1007F000039020A9208889890843208020A988891E -:100800004005400E04D026992B98086026988680D3 -:100810000398AAE40420E6E418A8007A00280ED081 -:100820000120287022980078687020A88088A8701D -:10083000000AE87018A8007A28710520388020A9DD -:100840002088898988432080E2E7FFB50746A1B068 -:1008500000201C903A7801209040794A7C68104032 -:1008600010AA1087744B22885B1C9A4203D0002880 -:1008700004D0100702D5012025B0F0BD249E002031 -:10088000307023980025028810A8028518A80575E5 -:100890006A4B68461972057404A8186020462C300B -:1008A0001B902A985860249E94463878721C052123 -:1008B000039201282DD0022808D003287DD130785A -:1008C000800980011D303070B889A08038780228F6 -:1008D00004D13078800980011B303070F01C1FAAD1 -:1008E00001900292009110A8008D0022C01E83B2D8 -:1008F0002020015DB889F5F701FF0028DED10398BB -:10090000B9890170090A417010A9888FC01C088537 -:1009100028E1787B18AA10753A7B012A02D0022AB6 -:10092000CCD1FCE022887F231B011A4010AB1A8730 -:10093000802A4AD006DC102A10D0202A0ED0402A65 -:100940000AD124E0FF3A013A65D0FF3A013A79D062 -:10095000FF3AFF3A022A76D00525A2E02078C006A9 -:1009600001D5082000E010201C9004206A46107475 -:10097000002090821AA81DAA1EAB03960192029035 -:1009800000933B8A20461C9AFFF79AF984E0228B59 -:100990003B8A9646934268D10A221C92002839D19C -:1009A000039801906046401E1FAA83B20292202045 -:1009B0000091015D0022704600E0BAE0F5F79EFE6E -:1009C000014618A801750B201AE0228B3B8A964637 -:1009D00093424AD10C221C92002862D103980190C4 -:1009E00060461FAA401E0292009183B22020015D42 -:1009F000628C7046F5F782FE014618A801750D203D -:100A0000307010A8818F491C01850421684601744B -:100A1000218B818245E0238B3A8A9C469A4224D1DD -:100A200012221C9200283CD1606A002813D00022B8 -:100A30006B4607C3638C07E0FEFF0000B40E002086 -:100A400009F800000DE04BE02020015D6046F5F75D -:100A500071FC18A9087513203070012010A90885B1 -:100A60001FE0398A228B914201D00425B6E016217D -:100A70001C91002815D11B98818802682046FFF739 -:100A800003FA18A9087500280BD11B983346016892 -:100A900080881AAA00F075F9054602281BD0042D9B -:100AA00019D01B988088002811D06846007C002847 -:100AB00004D004A82A99F2F7B2FD05460120694640 -:100AC00008741B981B990068059000208880002DF1 -:100AD00048D0052D2ED06846007C032878D07DE0D4 -:100AE00018211C91002806D0388A20832046B96836 -:100AF000FFF7A0FAD5E72046183000902020015DCE -:100B0000237E01222046FFF7AFFA18A908750028B6 -:100B1000ECD119203070012010A90885E6E7208863 -:100B200001214902084010A90887FF38FF38022830 -:100B300006D0052510A92088098F884320804DE024 -:100B4000208F9849884290D116201C90386900283F -:100B500005D06063B88A20870020608702E000200B -:100B6000C043208710A8008F7F21090102468A43D5 -:100B70000DD0782300220420B968FCF7FBFB3878FD -:100B8000A07010A92088098F0843208002E02188E6 -:100B9000814321806846007C002805D08248416856 -:100BA00004A8F2F73CFD054618A8007D002815D0E2 -:100BB0001C98707001203070208BB070000AF070AB -:100BC00018A8007D3071052110A8018506E0FFE717 -:100BD0007548416804A8F2F722FD05467248017A7B -:100BE00020884005400E22D11B98808800281ED006 -:100BF000239A0026138810AA1385249A2A9B6F46ED -:100C00004CC71B9A039412681AABFFF78DFA05467E -:100C100002280CD00120694608741B982A990068A4 -:100C2000059004A8F2F7FBFC05461B98868010A8E7 -:100C3000018D2398018028461EE600B597B0042850 -:100C400007D102206A461070019100216846F2F730 -:100C5000E6FC17B000BD10B5534C037800222168A4 -:100C6000012B02D0022B42D126E00B78002B01D0C1 -:100C7000042B03D10A712268032111702168838833 -:100C80000A79D200921D8B5221680A79D20008326B -:100C90008918C2880A80216803890A79D2000A3239 -:100CA0008B52428920680179C9000C314252216877 -:100CB0000879401C08711EE00A7482888A802168C5 -:100CC000C288CA80226801891181226841895181C4 -:100CD000C1682068C1606168F2F7A1FC0146022882 -:100CE00007D02068007C002802D1002903D0812091 -:100CF00010BD832010BD002010BD406B002800D027 -:100D0000012070478178012909D100880521C90295 -:100D1000884202D0491C884201D10020704705203A -:100D20007047F7B586B00024684615460F468481A3 -:100D300005261AE0049841780278090211432980B7 -:100D4000811D019602940091417902790B021343AF -:100D5000C178827809020A43417800780902084381 -:100D60003946F5F7E7FA002806D104AA03A9069840 -:100D7000FFF7BFF80028DDD0822800D1002009B09D -:100D8000F0BD10B51488844201D2052010BD17248F -:100D90001C701080421E581C491C05F0C6F900202A -:100DA00010BD0000FEFF0000B40E002010B540484A -:100DB00004F04DF9002801D00C2010BDFF211131A5 -:100DC0003C4805F011FA3B4901200870002048809A -:100DD000E03188718874887520310871344804F0D6 -:100DE0004EF9002010BD10B5314804F028F9002854 -:100DF00003D031A1312005F016FBFFF7D7FF002803 -:100E000003D02DA1382005F00EFB10BD10B504460F -:100E1000274804F01CF9002801D00C2010BD2549FA -:100E20000878002807D0002008702148216004F0CD -:100E300026F9002010BD1E4804F021F91F2010BD26 -:100E400070B505460C461A4804F001F9002801D097 -:100E50000C2070BD174A5088A84202D11078002893 -:100E600004D0134804F00BF9122070BD1048226022 -:100E700004F005F9002070BD10B504460C4804F0DC -:100E8000E6F8002801D00C2010BD0A48017800299E -:100E900007D00020C0432080054804F0F0F812205D -:100EA00010BD40882080024804F0E9F8002010BD01 -:100EB0009D000020C00E00207372635C6C6C5F6448 -:100EC000622E630010B5282105F08CF910BD70B5B5 -:100ED000054600780A0700090001120F1043287028 -:100EE0000B0005F091FB07050705070509050B0039 -:100EF000062408E00C2406E0222404E00024F2A1E9 -:100F0000572005F090FA68788009800120436870C6 -:100F100070BD00780007000F704710B50622C01C96 -:100F200005F003F910BD10B50622093005F0FDF8F3 -:100F300010BD0278BF23C9071A40490E0A43027048 -:100F4000704702785206520EC9010A430270704778 -:100F500070B515460E4604461F2A03D9DAA1A8200B -:100F600005F061FA20462A463146093005F0DDF8E1 -:100F70006078AD1D80098001A906890E0843607064 -:100F800070BD70B515460E4604461F2A03D9CEA182 -:100F9000CC2005F048FA20462A463146093005F0B3 -:100FA000C4F86078AD1D80098001A906890E084348 -:100FB000607070BD70B501780907090F03292ED044 -:100FC000052931D1411C827E0C46437E1102194312 -:100FD000037FC27D1D02037EC67E1B021343827DFA -:100FE000407835438006800E22281DD106291BD368 -:100FF0001920C001814217D8FF26F436B54213D814 -:10100000002A11D0082A0FD88A420DD28B420BD861 -:10101000617F227F09021143814207D904E04078B1 -:101020008006800E0C2801D0002070BD012070BD0C -:1010300000210A464254491C2229FBDB704710B5A7 -:1010400002788B07920892009B0F1A430270427835 -:10105000520952014270012908D0022906D0032901 -:1010600005D0FF2098A1EE3005F0DDF910BD01217B -:101070000A43427010BD10B502788B0792089200A7 -:101080009B0F1A43027042785209520142700129A3 -:1010900007D0022905D0032904D08BA18E4805F082 -:1010A000C2F910BD01210A43427010BD00788007CB -:1010B000800F70470278EF23C9071A40C90E0A4310 -:1010C0000270704770B50546C1700B0005F09CFAC0 -:1010D0000E080A0C0E1012120C14141212160C1810 -:1010E0000C2413E0082411E002240FE017240DE083 -:1010F0000D240BE0012409E0092407E0062405E0A3 -:101100007548002470A1A03005F08DF96878400979 -:1011100040012043687070BDC0787047017AC27981 -:10112000080210437047817A427A080210437047E0 -:10113000017BC27A08021043704781794279080224 -:101140001043704700797047817B427B080210434F -:10115000704770B5017AC37909021943431C857A37 -:101160001C46467A2B023343657926792C02344398 -:10117000C21C5A4E00798D1FB54214D8FF25F43594 -:10118000AB4210D800280ED008280CD888420AD2CA -:101190008C4208D8507A117A00020843B11D884267 -:1011A00001D8012070BD002070BD0B4610B5011D97 -:1011B0000522184604F0B9FF10BD817A427A080270 -:1011C0001043704701717047007970470B4610B5A6 -:1011D000011D0822184604F0A8FF10BD027B0A700A -:1011E000407B487070470B46014610B508220E310F -:1011F000184604F09AFF10BD0B46014610B50422B4 -:101200001631184604F091FF10BD10B50822001DDC -:1012100004F08BFF10BD10B504220C3004F085FFE4 -:1012200010BD017170474171090A81717047C17128 -:10123000090A017270470079704781794279080282 -:1012400010437047017AC279080210437047017158 -:101250007047017170470B4610B5011D08221846F2 -:1012600004F063FF10BD10B50822001D04F05DFFFF -:1012700010BD70B515460E4604461B2A03D912A1AF -:10128000174805F0D0F82A463146E01C04F04DFF1F -:101290006078E90640094001C90E0843607070BDDE -:1012A00070B5054640780E46C406E40E1B2C04D9E2 -:1012B0000B4805A10C3005F0B6F82246E91C304673 -:1012C00004F033FF204670BD7372635C756C5F7011 -:1012D00064752E6300000000070200007A0C000015 -:1012E000F7030000C1074008C207C90FD20F511809 -:1012F0004008C207D20F51184008C207D20F511838 -:101300004008C207D20F51184208D007C00F40183A -:101310005208D107C90F0918500840187047002219 -:1013200002808271C271C2720273427382738270D0 -:10133000C270027142714276828303464284203336 -:101340009A7102859A72C2750276C2730274DA7259 -:101350001A739A7319750284FF21603081709A752F -:10136000704770B504460020A083208C1E46484379 -:101370001546114604F061FF2084F000294604F070 -:101380004EFF401C80B20146192269439202E0835D -:10139000914201DD401EE0837D202946000204F0D9 -:1013A0003EFF401CA08470BD70B50546087B0E460C -:1013B000C006C00E08730020A87504463019007AD4 -:1013C000FFF790FF29194874A97D641C0818E4B23E -:1013D000A875052CF2D3C0B2252803D979A18A209B -:1013E00005F021F870BDF8B5044630302646274692 -:1013F0002546C036A03780350090032909D0002942 -:101400001AD0012924D0022902D1A11CFFF7CCFF58 -:10141000F8BD1146FFF783FF002028836883A88367 -:10142000E883288468847871E88538732621085514 -:10143000A08430703071F8BD0020E885B871A188B3 -:1014400023890A460098FFF78CFFA11C0098DDE76E -:101450000020E885B38A328AA1880098FFF781FFCF -:10146000F8BD70B5867D0D460446002E01D0252EB0 -:1014700001D9122070BD002A18D0287EE17D50438A -:101480000818252104F0CBFE0846E1754207520FEB -:10149000C908504B69189A5C097A8A4368D031466A -:1014A00004F0BDFE491CCAB2002007E0002070BD58 -:1014B000002803D02118097C511ACAB22118497C8E -:1014C00091423AD32918097AC943CB07DB17D21ABC -:1014D000521E1206120E35D08B07DB17D21A521E7F -:1014E0001206120E30D04B07DB17D21A521E12060C -:1014F000120E2CD00B07DB17D21A521E1206120E38 -:1015000028D0CB06DB17D21A521E1206120E24D098 -:101510008B06DB17D21A521E1206120E20D04B0673 -:10152000DB17D21A521E1206120E1CD00906C9175A -:10153000511A491E0A06120E18D0401C0528B7DBA6 -:101540001F2070BDC00013E0C000401C10E0C000B0 -:10155000801C0DE0C000C01C0AE0C000001D07E0B8 -:10156000C000401D04E0C000801D01E0C000C01D9F -:1015700020769BE738B505460C466846FEF738F8F6 -:1015800000281ED0694600200856207209216156A5 -:101590000022411A00D5494220356B798B420FDC7D -:1015A000FF2B0DD0A17A491CC9B2A172AB79994227 -:1015B00002D8617A7F2903D160720020A0720122D3 -:1015C000104638BD7372635C6C6C5F7574696C2E09 -:1015D000630000007667010010B5040004D0FF200E -:1015E000FAA1AB3004F01FFFFB4821464143FB4802 -:1015F000FF230918FF330022581C5A544254C81DB7 -:10160000FF30FA3002704270F448001FC378A342E2 -:1016100002D18270FF23C370EF48EF4BC01E081841 -:101620009B1EC91802700A7010BD70B5EB480026E9 -:10163000001F8670FF24C47035462846FFF7CCFF94 -:101640006D1C2D062D0EF8D00020E4490B229201CE -:10165000E14B43435B189B181E74401C0006000EB0 -:10166000F6D0DF48FFF7E4FC0021DD48FFF722FD5C -:101670000121DB48FFF7E3FCDA4804704470847012 -:10168000C4700471447170BDCFE71B20704730B542 -:101690000021D24A0B239B01CF4C4C43A418E418E1 -:1016A000247C002C05D0491C0906090EF4D000202A -:1016B00030BDC94C01254C43A218D21815740170D5 -:1016C000284630BD10B5044600F0D0F900280CD0F3 -:1016D0002046FFF781FFC0490B224C43BF49002041 -:1016E0006118920189180874012010BD10B50446D4 -:1016F00000F0BCF9002802D0BA484471012010BDA6 -:10170000034610B5B748B44940794843B349421835 -:101710001046FF30E130C17F807F04F0D5FF10BD5F -:1017200010B5B048AC4940790F224843AB49401846 -:10173000A949D239095CFF30FF3004F09FFF10BD8A -:1017400010B5044600F092F9002802D0A5480471B3 -:10175000012010BD034610B5A2489F4900794843B7 -:101760009E4942181046FF30E130C17F807F04F06F -:1017700098FF10BD70B59B4C97492079974D484311 -:101780004019C11DFF31F931FF30E130807F0F2258 -:1017900004F064FF002813D020798F494843401992 -:1017A000FF30FF3002300178491C01700178407829 -:1017B000814204D1884885A1773804F034FE0120A5 -:1017C00070BD884884490079484384494018FF30F7 -:1017D000E130C17F807F814201D10120704700202C -:1017E000704770B57F487C49007948437B49401871 -:1017F000FF30E130867FC57F0F242946304604F054 -:1018000026FF002801D0204670BD70066906400EF4 -:10181000490E884201D3401A01E0081A201AC0B2CA -:1018200070BD0F20704770B50C46054600F01EF9DC -:1018300000280ED0002020706748454367482818CC -:10184000FF30FF300230017842788A1A22704170EE -:10185000012070BD70B50C46054600F007F9002860 -:101860000BD05D4845435D482818FF30FF300230FB -:1018700001784078081A2070012070BD5849016035 -:10188000704710B5044600F0F1F8002802D0554822 -:101890000470012010BD5149091FCA78FF2A02D0E7 -:1018A0000021016007E08A784C492439012A02D0DE -:1018B000016001207047002070474848801E017871 -:1018C000012908D001210170464801784348001FD2 -:1018D000C170012070470020704710B5044600F029 -:1018E000C5F8002802D03F484470012010BD3B4994 -:1018F0003C4B091FCA785B789A4206D18A78203916 -:10190000002A02D001600120704700207047334850 -:10191000344A001FC1785278914209D1FF21C17029 -:10192000801C0178002903D000210170012070473C -:101930000020704729482B4A001FC17852789142F5 -:1019400004D18078002801D0002070470120704722 -:1019500010B5044600F08AF8002802D02148C4706F -:10196000012010BD034610B51E481B49C0784843EE -:101970001A494018C21DFF320B21FC328901401860 -:10198000C17B807B04F0A0FE10BD10B51548124944 -:10199000C0784843114940180B2189014118C97B7F -:1019A0000D4AD21E8018062204F068FE10BD0D48B4 -:1019B0000949C0784843094941180B20800108189B -:1019C000C17B807B81420FD1012070477372635CC1 -:1019D000646D5F712E630000D1020000F40F0020DF -:1019E000C51200209E0000200020EEE710B504463E -:1019F00000F03CF8002802D021488470012010BD7E -:101A0000034610B51E481F49807848431E494018B8 -:101A1000C21DFF320B21FC3289014018C17B807B43 -:101A200004F03FFE10BD10B51548164980780B2212 -:101A300048431549920140181249891E41188018DF -:101A4000807B062204F00AFE10BD0D480D49807807 -:101A500048430D4941180B2080010818C17B807B49 -:101A6000814201D10120B0E70020AEE7002805D176 -:101A70000648007C002801D00120A6E70020A4E74A -:101A80009E000020D1020000F40F0020B4120020BC -:101A9000F8B5FF4E0446B079002500280AD0002989 -:101AA0002DD1657010202070F079A070307AE07030 -:101AB000B57124E0F64F203F387A012804D0707ABF -:101AC000012810D00020F8BD002918D1657013201E -:101AD000EF4920701C221639A01C04F026FB0120BF -:101AE000A0713D720BE0002909D165701420E8490E -:101AF000207008220A31A01C04F017FB7572012027 -:101B0000F8BDF8B5E3480178002902D00C2630462C -:101B1000F8BD0026DE4D3446403D2E756E75EE75DF -:101B20002E76AE75294620396E730F464E734037B8 -:101B30007E717F218170687E002804D0FDF73DFD15 -:101B4000FEF766F86C763C72D14884711430FFF76A -:101B5000B9F9CF483C30FFF7B5F9D8E710B5CD4B10 -:101B600000221A70CA4B203B1A711A46603A11665D -:101B7000D065FFF7C6FF002804D0FF20C6A187303C -:101B800004F051FC10BDC2484038007D7047C04988 -:101B900010B54039C87B897B42078307D20FDB0F22 -:101BA000D218C007C00F101840000B0004F02CFD25 -:101BB000050B060B04080F00BB4906E0BB4810BD2F -:101BC000B949083101E0B8490839085A10BDFF2069 -:101BD000B1A1A73004F027FC002010BDAC48B449E7 -:101BE0004038008A48437047F8B5A94C0646407B08 -:101BF000403CE07337791346A773012F26D0308815 -:101C00002082A348B27B203882710546603D29704E -:101C100006221946681C04F088FAB0796873062217 -:101C2000F11DE81D04F081FA607B0126002800D038 -:101C3000667597486038407B002800D0A6753B0049 -:101C400004F0E2FC0506082549084B000020D7E710 -:101C500000211DE08E4801211430FFF738F98C482F -:101C6000E91D1430FFF75FF9687B002807D00128D1 -:101C700007D0FF2088A1EE3004F0D5FB0CE0002156 -:101C800000E0012182481430FFF75BF904E00621EF -:101C90007F481430FFF71BF90020E07520767C4860 -:101CA000691C1430FFF739F9794829781430FFF7A7 -:101CB00040F9774804213C30FFF709F97448691C62 -:101CC0003C30FFF72AF9724829783C30FFF731F9A8 -:101CD00026750020F8BD0221DAE7FF206EA1F8305A -:101CE000CAE770B56A4C0125403C0346257620467C -:101CF0002030007A002801D03A2070BD64480022CC -:101D0000803806789E4206D1E2750622401C04F017 -:101D10000CFAE57500E02276002070BD70B504462F -:101D20005B4D0020403DA87528462246323804F01D -:101D3000FCF92846203844730120A87570BD544929 -:101D400020390871704710B5514C0022403C627533 -:101D5000607302462046123804F0E7F901206075EE -:101D600010BD4B49203948717047F8B500F0A4FB0D -:101D7000474C0025403C607E002804D0FDF71DFC48 -:101D8000FDF746FF6576434F3D70FDF793FBA07B63 -:101D9000012804D00021084601F0A6FAF8BD002170 -:101DA000022001F0A1FA3A4C203C207A002809D008 -:101DB000374881790029F1D11321C17105720121C0 -:101DC0008171F8BD78780028FBD0314E0622803E24 -:101DD000707BE0733078A0753046F11D703004F0F0 -:101DE000A4F930460622711C773004F09EF93C209D -:101DF000A072012020727D70F8BD10B5244C403CCB -:101E0000E17BA07CCA0701D0C2070BD08A070FD59F -:101E100082070DD42620FDF777FAA07C0221084323 -:101E2000A07410BD2520FDF76FFAA07C0121F6E714 -:101E30004907F6D54007F4D42720FDF765FAA07CC2 -:101E40000421ECE770B5134E3078002872D1104CA5 -:101E5000403C207D00286DD0FDF71FFB0025A574B8 -:101E6000E57475702846FDF715FB0020FDF78CF929 -:101E70000D480D38FDF73FFA0B481038FDF7F7FA1B -:101E8000FDF76CFBFFF7B9FFFDF7FFFA012111E049 -:101E900068130020A40000207372635C6C6C5F61A7 -:101EA00064762E63000000008E6701009A8913009B -:101EB000710200000020FDF743FA0F210520FDF715 -:101EC000C1F92646403E3178701CFDF7ADF9A07B84 -:101ED00001280CD004280AD0607D002807D02146B4 -:101EE00012390846627B6630FFF732F86575A07DCF -:101EF000002807D0FE480146427B12399C30FFF78C -:101F000040F8A575306E0178002903D00178001DD6 -:101F1000FDF7C8F9F06D0178002906D0F44A401C9D -:101F2000C732FDF754FE01206076FDF7C3FA0020AA -:101F300070BDFFE70C20FBE7EE494860704770B5C5 -:101F4000050001D0FFF759FFE94C2034E07C002860 -:101F50000AD0A07B012804D19920E749C00004F0F1 -:101F600062FAFFF702FFE3E7002D0DD00221002007 -:101F7000FDF7E6F9DE4840300079032801D001285A -:101F800002D10220FDF73BFCE07D002600280DD0A9 -:101F9000D74D203D2846691C9430FEF7BEFF2846E9 -:101FA000691CBC30FEF7B9FFE6752676D048743060 -:101FB000FDF786FAA07B030004F026FB0504040469 -:101FC0000D04090001210846FDF79FFB03E0CA4903 -:101FD000CA4804F028FAE17BA07C81430120002953 -:101FE00003D1A17B012903D0E074C24908709FE7A7 -:101FF000A674FAE710B5FDF750FABE48007800283D -:1020000018D1BB482030007D002813D00020FFF7F6 -:1020100096FFB74840300079002809D001280FD03A -:10202000022805D003280BD0B349B54804F0FBF9CA -:10203000002010BD00F040FAFDF73CFA0C2010BD66 -:10204000F0F7E6FFF4E7AB49012048707047F8B5B8 -:10205000002400F0E0FF002824D0FF202D30FDF701 -:102060006CF9A44D2878A24F403701281DD00228D2 -:1020700001D0032834D0A2489F496B3004F0D3F933 -:10208000287800280DD0387900280AD0012808D0F7 -:10209000022838D0032836D099489749803004F078 -:1020A000C2F9F8BDFFF761FEF8BD914E2036B07B56 -:1020B000032815D0707E002803D0FDF798FDFDF7AA -:1020C00074FA8B48C430FDF7FBF9B07B012812D0BD -:1020D000042810D0B879012806D0032804D004E0E1 -:1020E0000120FFF72CFFCBE7102421460E200143EF -:1020F0000020FDF70AFB7879012801D1FDF76FFA7E -:1021000002202870BCE728780228CDD10120FDF7F5 -:1021100076FBF8BD70B5764840304079012801D192 -:1021200000F0D4F9724C2034607E002803D0FDF713 -:1021300044FAFDF76DFD00F06EFF00280CD06D4DE8 -:102140002878022804D06E486B49A33004F06BF95C -:10215000A07B012803D006E0FFF707FEE8E6992000 -:102160008000FDF7EAF80120FFF7E9FE2878002853 -:10217000F4D028780128F1D039205F49000104F01B -:1021800052F9D5E6F0B5074689B000200690FDF774 -:10219000AEF800900020019056480078022804D044 -:1021A00057485549F03004F03EF9514D40356879B3 -:1021B000012801D100F08AF94D48C430FEF7A9FE8C -:1021C0004B4E04462036002F70D03046A430FEF728 -:1021D000F1FE0028F8D0FDF731F80028F4D0707E29 -:1021E00000280AD005277F1EFFB2FDF72CFD02282C -:1021F0000FD0012800D0002001903D492046C43175 -:102200000C46643C030004F0FFF906A4A4A40CA44B -:1022100056A4002FE7D177203AA1C00004F003F9BB -:10222000E9E7B07B012841D004283FD0019A00980B -:10223000104304D1A879002801D0022836D168794A -:1022400001281DD1607A00281AD101206072087817 -:1022500006224006C00FA0722548C91C6B3003F04F -:1022600064FF244C224FA07871377F2804D1A92025 -:1022700024A1C00004F0D7F8A07838707F20A070A7 -:102280001B489C30FDF71CF91A480321017028797E -:10229000002860D001280AD002285CD0032806D08C -:1022A000164818A1E03804F0BEF854E051E00120CF -:1022B000FDF7A5FA4FE00E480F462038C978C079DF -:1022C000814230D10A4839792038027A91422AD1A4 -:1022D0007979427A914226D1B979827A914222D192 -:1022E000F979C27A91421ED1397A027B914211E08A -:1022F00008130020A4000020981E0100F60400002E -:10230000DE0200007372635C6C6C5F6164762E6346 -:102310000000000007D13978407B4906C90F81428F -:1023200001D1012100E00021B07B012801D0042867 -:1023300001D100290AD100280BD101990098084346 -:1023400004D1A879002801D0012802D1307E0028CC -:102350001FD001200690707E002803D0FDF72DF9D4 -:10236000FDF756FC0698002802D00120FFF7E7FD94 -:102370005D48017800290AD00178012907D000784A -:10238000032804D095205949C00004F04CF809B046 -:10239000F0BD55480422406855490F3003F0C5FE92 -:1023A000387806224006C10F4F4840680177F91C73 -:1023B0001D3003F0BAFE4C484D4940680322091D08 -:1023C000133003F0B2FE4848494A4068B97D817530 -:1023D0000F3A117ED37D09021943018311468B7E8A -:1023E0004F7E1B023B438380137FD77E1A023A4302 -:1023F000C2808A7F4B7F1102194301813C4905222B -:1024000010310A3003F091FE3948374A1130017912 -:102410005768C906C90EB97600794009F876287A56 -:10242000002809D0A07900283AD11320E0710020BB -:1024300020720120A07133E00020A8727888B08556 -:10244000387FE8732A48394606221D31833803F065 -:102450006CFE27490622F3390878A87508467730BC -:10246000491C03F062FEB888F087F888208038891C -:102470006080F87E20710198002860790BD00121DE -:1024800008436071FDF7F2FB61794000C907C90F8D -:102490000143617102E04008400060710120287230 -:1024A000114C0020207000F007F8FDF703F8012020 -:1024B000616800F019FF4EE710B5FDF76AF8FDF707 -:1024C0005DF8FCF7B5FFFCF7DAFF10BD064810B564 -:1024D000801CFDF78DF8002802D103497F20887009 -:1024E000FDF774F810BD0000A400002004230100D3 -:1024F000DB1300208107C90E002808DA0007000F4F -:1025000008388008F74A80008018C06904E0800815 -:10251000F54A800080180068C8400006800F7047A8 -:1025200010B500F03BFF10BD70B5F04C0546626879 -:10253000002908D0002A04D0FF20EDA10C3003F0C0 -:1025400072FF656070BD002A04D1FF20E8A112303F -:1025500003F069FF0020606070BDE948C07E7047ED -:10256000E7482830C07E704738B5E04C20680168E5 -:102570004978012925D001216846FAF7C9FC684647 -:102580000078E049000203F04AFE2068426AC06811 -:1025900012685118FBF7ADFC2168C860D84A206862 -:1025A00028320321904218D0028B002A15D0012234 -:1025B0004272017200210171021D017F00F0FBFED9 -:1025C00038BD7D21C068C900FBF793FC2168C86055 -:1025D000FFF7DDFA21680861E0E7028B521C0283F5 -:1025E0004172E6E7FFB5C64E85B0706A346805688B -:1025F00060680190306A0390298E0798401A80B273 -:1026000002900898002804D02746383720464830E2 -:1026100002E0371D2846A830009003203871059845 -:10262000002820D001287DD002285ED003287AD04F -:10263000AFA1B54803F0F7FE0898002807D0387915 -:10264000032804D0B048AAA1093003F0ECFEA16A27 -:102650007069FBF74EFCB860616A206A88427DD9D8 -:10266000009801601FE1306A002804D1A648A0A1AB -:102670007A3803F0D8FEA449288B373948434018EC -:10268000069900F0A6FEA0619F49A8883739484303 -:10269000069900F09EFEE061316A9B48891CA162A8 -:1026A0002A8B37384243A069974B121AE63BD2185F -:1026B0005118A162944BAA7D373B5A4340008018C1 -:1026C000FF30193020626062306A081AED21FF384D -:1026D000C90015388842AFD28C49884204D28A4852 -:1026E00083A15D3803F09FFEB6E0874A288B373A16 -:1026F000E16850430818069900F06BFEA06182491A -:10270000A88837394843069900F063FEE061306AD3 -:10271000002804D17C4876A1553803F084FEAE2011 -:10272000405B01E02CE05AE00028288B784AE16801 -:102730001DD050430818A169401AA0622169A06801 -:10274000734A4843A1694018A97D4000514340188D -:10275000FF3017302062A888504300E0A1E0E16913 -:10276000411A6F20C000081A6062A06A34E050432A -:102770000818A169401A3168D63849684018DCE762 -:10278000284680300190C08D002802D0306A002891 -:1027900004D15F4856A1401F03F045FEA8885C495C -:1027A000E3694843C01AA06201999C46CA8D216919 -:1027B000A368521A4B43A169591863465343C91879 -:1027C000AA7D534B49005A438918FF3117312162C2 -:1027D0006F21C900411A6162316A401A35E00898D8 -:1027E000002803D03420005D002878D1A88848490B -:1027F0004843E169401A02994843A0622846803064 -:102800000490C08D0028019829D0002804D03E48AB -:1028100037A1163803F007FE04983D4AC18D02988F -:102820000818E16948434000FF3017302062A8884B -:102830005043411A6F20C000081A606200F0AEFDDC -:1028400000281CD0A16A0398081AED21FF38C9009E -:102850005538884200D3EFE601203871ECE60028B5 -:1028600002D00398002804D1294821A11A3003F08E -:10287000DAFD0198A16AD6380818A062CCE7FBF708 -:102880009EF8726901461046FCF7BFFAA16A081A61 -:10289000ED21FF38C90050388842DCD2012009B050 -:1028A000F0BD0099086000981A4900688035081842 -:1028B000F860298B0798081A00B2002804DD0598F3 -:1028C000022801D0032000E00120787108983870B8 -:1028D0000898002820D03420005D00281CD0022059 -:1028E000DDE7000000ED00E000E400E0B4000020BF -:1028F0007372635C6C6C5F6C6D2E73302E630000C2 -:10290000F413002010270000190500002902000020 -:10291000E20400004B1700000898012148402034D1 -:102920006075317F3A46304600F045FD0020B6E73D -:1029300010B5FE4900280A68516A096807D0126874 -:102940008988FB4BD2695943891A03F068FC10BD92 -:10295000F8B5F64F38680468416A26460D68203697 -:10296000717D00290AD0618E2A8E914206D1407A6B -:10297000012803D1EF49F04803F055FDFBF71FF89C -:10298000014638684069FCF740FAFFF7D1FF2A8E0C -:10299000618E1318994202DB491C618602E0401CDB -:1029A00010186086B07D002806D19C21608E495B9E -:1029B000884201D1401C6086DC480168088B0328EE -:1029C00002D2401C088302E0618E982041532846C1 -:1029D00040300646C1898089081A298E401E401859 -:1029E00087B218E0D148EB7E00685B00406A00794E -:1029F0004100D248415AC05A401881B2207D00237C -:102A0000FFF7F0FD00280FD001280ED0CA48C949B1 -:102A10003A3003F008FD628EB81A00B20028E1DAFD -:102A20000820B07200F010FEF8BD608E401C608679 -:102A3000F1E770B5BD4D002168680162C27E1300E8 -:102A400003F0E2FD045656034A56426A14680268CF -:102A500011700268516000682030407D002808D164 -:102A6000FAF7ADFF69680968096CFCF7CEF9002830 -:102A700018DC6868228E0168498E914206D1214691 -:102A800080318B8B9A1ACA83238605E0891A9E228D -:102A900011530168498E21860268C1681164C168BA -:102AA000416111E068680168098E228E8B1A224606 -:102AB0008032D3830168098E218601680B6CC36064 -:102AC0000B6C4361886C9062204601F0D8FC0028B2 -:102AD0000DD098499A4808E0C1684161FFF7B2F902 -:102AE000002804D096489349801D03F09CFC70BDDB -:102AF000934890490D30F8E710B58C4A0B001268E6 -:102B000003F082FD0906090F1F0C2E2E082B2E0044 -:102B1000FFF78FFF10BD00F068FC10BDFCF772FEE0 -:102B200010BDD07E022806D0D07E032806D0FF201C -:102B30008049A3300EE0FFF70BFF10BDFFF714FD37 -:102B400010BDD07E0228F6D0D07E0328F6D0FF201C -:102B50007849AE3003F067FCF0E7FAF715FF10BDD7 -:102B6000FF207449BC3003F05EFC10BDF3B581B0AA -:102B70000E4601276D4D734C0B0003F045FD090611 -:102B80002F39392F40403939400001216D48FFF776 -:102B9000CBFC31460198FFF7AFFFE07E022826D13B -:102BA00068680568406A0668FAF7E7FEB188604A17 -:102BB0005143EA69891AD639E962B72802D26248D4 -:102BC000081803E0081A6049B7314018E8625F4806 -:102BD000E96A814200D80846E86205E00198FFF7FB -:102BE0008BFFE07E022802D1206820300775FEBDF1 -:102BF0002C600198FFF780FF00202860FEBDFF20B9 -:102C00004C495C3003F00FFCFEBD70B50C46064627 -:102C10000B0003F0F9FC09060D10100D1A1A101024 -:102C20001A00484801212830FFF77EFC2146304633 -:102C3000FFF762FF70BD43483C4D283028603046A6 -:102C4000FFF75AFF0020286070BDFF20394982300D -:102C500003F0E9FB70BDF0B5344C0020216885B06D -:102C600003258D76CA7E0746032A03D0C97E002934 -:102C700029D029E0087F002803D12E49344803F0E9 -:102C8000D2FB2068067F684605714571FAF797FE0A -:102C90000290FF20F53003900121684601706946DB -:102CA0003046FBF70CFB00E020BF2068007FFCF7FC -:102CB00038F90028F8D02068007FFAF765FE206810 -:102CC000077700F072FB012021688F7605B0F0BD18 -:102CD00016490A68907600E020BF0A68D07E002876 -:102CE00003D0D07E937E9842F6D0D07E002803D0C9 -:102CF00000200021917670470120FAE770B5114954 -:102D00000024CA7E094D032A03D02831CA7E032A33 -:102D10002ED12960002827D0012821D00C48054950 -:102D2000973003F080FB0020296813E0B4000020F6 -:102D3000E2040000F0280100F70500009E67010092 -:102D4000A1030000F4130020C4F8FFFF38120000B4 -:102D500072020000086048622860002C08D070BD34 -:102D60000320FFF7B5FF01E0FFF775FF0446DAE740 -:102D70000C2070BDF8B5F94F04461F25E67E3300E0 -:102D800003F042FC042920031B20F548844204D0B0 -:102D9000FF20F449FC3003F046FB02203C60FFF7C3 -:102DA00097FF002805D03968002008604862386025 -:102DB00011E00C25002038600AE00120FFF79EFF9B -:102DC000054603E0E749E84803F02DFB002D02D05B -:102DD000E07EB042D2D1E07E002804D0E248E14952 -:102DE000801D03F020FBF8BD10B5DD48FFF7C2FFE2 -:102DF000DB482830FFF7BEFFD94900205031087565 -:102E0000D649C91F4870D64948610A4628325061E0 -:102E100088769076D1494860086010BD70B5044648 -:102E20000120FFF767FBC5B20B20FFF763FBC0B2C1 -:102E3000854204D0FF20CB49C63003F0F4FA0120CC -:102E4000FFF758FBC5B21820FFF754FBC0B285420C -:102E500004D0FF20C349C73003F0E5FA0420C04383 -:102E6000FFF748FBC5B21920FFF744FBC0B285420B -:102E700004D0FF20BB49C83003F0D5FAB748B849A1 -:102E8000083804700020C87688760A462832D07642 -:102E90009076B24B012408331C711860486250626E -:102EA00008601060FFF7A0FF70BDAC4908310871E1 -:102EB0007047FEB5AA49CA7E08462830A74C002AAA -:102EC00002D1C27E002A03D0C97E022903D005E0C8 -:102ED000A648216006E0C17E002901D00C20FEBD7D -:102EE0002060A348FAF7FCFC216808779B4920681A -:102EF000C91F0160C91C4162007F002804D1AD20B8 -:102F00009849800003F08FFAFAF737FD9949884213 -:102F100000D20846FF30C83086B220680325C57647 -:102F2000FEF735FE21680861FEF758FE00270028ED -:102F300027D0FEF753FE21684A6A10600968012015 -:102F4000087001466846F9F7E3FF684600788A4949 -:102F5000000203F064F90191FAF731FD019971184B -:102F6000FAF7C7FF2168C8602068057245720771CB -:102F7000021D017F00F01FFA2068078300202760F0 -:102F8000FEBDFAF71CFD3146FAF7B3FF2168C860B1 -:102F900008680770096801204870E5E77047F8B5D0 -:102FA0006F4EF17E002904D131462831C97E0029B7 -:102FB00001D00C20F8BD0221F176694C674F5034E6 -:102FC0000837776234600025386025753979C07E0E -:102FD0004A006A4940008A5A085A2B46101881B2A2 -:102FE0002A462846FFF7FEFA002804D0CF205D4984 -:102FF000800003F018FA25610120A5602075658620 -:1030000025865748703085753968088E401E0886B9 -:1030100035830020F8BD10B5504801244068817EFA -:1030200003290CD001684978002906D0006A544968 -:10303000884202D90024FFF706F8204610BD00247C -:10304000FBE74648406802681178491C1170016A24 -:103050000068C26A914204D8007D012801D0012095 -:1030600070470020704700207047F8B53B4C3C4843 -:103070002060416A00680D68002634210E54A621A4 -:10308000495D00294BD1007D032848D1FAF797FC10 -:10309000014620684069FBF7B8FE00283FDDFFF7D6 -:1030A00047FC298E401C4118206802681186006880 -:1030B000018E9C22525B511A09B200292FDD012199 -:1030C0002030817528464030C1898089081A298EB0 -:1030D000401E401887B21BE0496A09794A00274917 -:1030E0008B5A028E007D9446EA7E5200895AC91896 -:1030F00089B201236246FFF775FA00280FD0012834 -:103100000FD002280BD01B481649193803F08BF951 -:1031100021680868028EBA1A12B2002ADCDA266028 -:10312000F8BD20680068018E491C0186F0E7F8B5FB -:103130000A4D00266A680128516A0C6853D1087943 -:103140000E4940000B5A1068077D032F1AD0027DEC -:10315000022A24D0007D012834D044E0B4000020AD -:10316000F4130020F0280100070200006D2B01007D -:103170000B2C0100F6050000102700009E670100DF -:10318000D98213000661106886609C20025BE07E95 -:103190004000085AC01881B2002303201BE02246D9 -:1031A0008032D78D0761E07E928B4000085AC018AC -:1031B00081B200230220FFF715FA6A680121126824 -:1031C00011750AE09C20025BE07E4000085AC0189E -:1031D00081B200230120FFF705FA002803D09C49A3 -:1031E0009C4803F020F9FAF735FB9B480078EFF78D -:1031F0006FF8686806830268218E51860068203067 -:103200008675F8BD38B5944C0021083460680D46C9 -:1032100000684278002A01D045701FE0007800283D -:1032200009D001216846F9F773FE684600788B499A -:10323000000202F0F4FF6068426AC0681268511828 -:10324000FAF757FE01466068C160057103214172BB -:10325000021D017F00F0AFF860680583FAF7FAFA03 -:103260007D480078EFF734F838BD7B4A10B5014649 -:10327000083250680B0003F0C7F9060D1504081753 -:103280000C31012100F0D1F807E00021106800F0B6 -:10329000CCF810BD0120FFF74AFF00210846FFF7D8 -:1032A00043F910BD032116E0416A02680968D36939 -:1032B00093608A886A4B5A430368DA600A46C032D0 -:1032C000D3890B83137B8B75138A8B80538ACB80B6 -:1032D000928A0A8102210068017510BD5D485C492F -:1032E000913003F0A0F810BD70B500280BD05A4CF7 -:1032F000083401280ED002281ED056485449B43054 -:1033000003F091F870BDFFF77DFF00210846FFF73D -:103310000BF970BD6068002501684D7000F045F83C -:103320000320F5F7B8FEFAF795FA4B486560007888 -:10333000EEF7CEFF656070BDFFF764FF606800F0D8 -:1033400034F800210846FFF7EFF80420F5F7A3FE54 -:1033500070BD414908314968CA7E022A08D10A680D -:103360001378002B04D150600968CA6A1018C8622B -:103370007047394A10B50832526800290CD001292B -:1033800007D0022907D033483149D93003F04BF830 -:1033900010BD801E00E0401F106210BD2E48083096 -:1033A0004068002800D0012070470021C176817656 -:1033B00001604162704710B50B46C17E847EA14218 -:1033C00004D011461846FAF77AFF10BDFFF7EDFF5B -:1033D00010BD024610B50020002905D00846504314 -:1033E000204902F01CFF401C10BD1B4810B50830DE -:1033F0004068C07E030003F007F9041515030B15A0 -:1034000001F05EF900280CD00F2017A1800106E022 -:10341000FEF7F0FD002804D0F12013A1800003F096 -:1034200002F810BD10A11448F9E710B504460029B0 -:1034300003D00020FFF77BFE03E007480078EEF79B -:1034400047FF2046FFF7B1FF0020F5F724FE10BD2F -:10345000F028010092060000AC00002010270000B8 -:10346000E204000040420F007372635C6C6C5F6C9E -:103470006D2E73302E630000CB030000F8B5FEF70D -:10348000B0F90446FEF756FAF84E0546706920304A -:10349000407D002809D0012827D002282AD00328FF -:1034A00032D0FF20F2A19A3037E0F0481830FEF712 -:1034B0001EFA002801D003200FE0EC481830FEF778 -:1034C00049F9002804D070695B21095C002908D003 -:1034D000E6481830FEF7D2F90120716920314875AD -:1034E0001DE002212030417519E0E0481830FEF758 -:1034F000C5F914E0DD481830FEF72CF900280ED18C -:10350000FF20DBA18C3008E0D8481830FEF7EFF937 -:10351000002804D1FF20D6A1943002F084FFB069C6 -:10352000F72201781140017072692032937DDB0728 -:103530001B0F1943FB2319400170D37DDB075B0F81 -:1035400019430170577DEF23022F04D0012F07D0BC -:10355000032F07D00CE0012C06D8002D04D007E083 -:103560006D1E2C43002C03D019401023194300E09A -:1035700019400170D17F002916D0517D012913D047 -:10358000BF48FBF79DFFBE480021283001767269D5 -:10359000916ED26E42610161B949B269FCF7A3FA3A -:1035A0000020FCF7AFFA03E0FBF78AFFFCF7CDFA47 -:1035B000B0690078C00606D4F0690078C00602D46D -:1035C000F079002806D0B079002803D101210846FF -:1035D000FCF79BF8032030703079002803D1FBF70B -:1035E000BDFF01203071F8BD70B5A0481C30FEF75A -:1035F000B9F901259D4C002802D00020607002E03E -:1036000065709F48E061606940300078002802D012 -:103610006078002805D0E069FBF752FFFCF795FAC7 -:1036200070BD9748FBF74CFF9548283005766269D6 -:10363000116F526F42610161914AE169FCF753FADF -:103640000120FCF75FFA70BD10B588490023486976 -:1036500002462030C3768377012049239854A03254 -:103660009279002A03D008700021022001E0002195 -:103670000320FFF7FAFD10BD70B57C4C6079C206DF -:103680002046406901468031002A01DA002202E02A -:10369000CA8DCB8BD218CA850246C0321379002B53 -:1036A00005D0034640331D8AC98B69181982617A97 -:1036B000002903D03D2001F051F94AE003462033B0 -:1036C000D97E042945D0217A002913D0480701D496 -:1036D000C80601D51E2030E0080701D53D202CE0AA -:1036E000C80705D1880703D461A1664802F09BFE94 -:1036F0002A2022E04030817D002905D0418A4D1CDE -:103700004582858AA9420FD2517A062902D0117AC0 -:10371000062905D1018B4A1C0283828A914203D279 -:10372000028AC1898A4201D3222006E09A7F8089D9 -:10373000002A0AD088420FD3082001F00FF96069EF -:103740002030C07E042804D006E0062804D33E20A2 -:10375000F3E7FFF779FF70BD0120207000210846D4 -:10376000FFF783FD70BD10B5404840690146203128 -:103770008A7F002A29D0012A27D0022A06D0032ACC -:1037800004D03BA1404802F04EFE10BDC97E032983 -:103790000FD0082919D001464031CA898989511AA8 -:1037A000891E89B2032900D303218030828B5118EE -:1037B00009E0014640318A89032A06D3028EC9896D -:1037C00080305118491C018310BD8030818BFAE78D -:1037D00000B5030002F018FF0604070B0F121217C2 -:1037E00000290ED00FE0891E02290AD90BE0891F9B -:1037F000012906D907E0082903D004E00B390C2978 -:1038000001D8012000BD002000BDFEB505461748C7 -:103810001830FEF740F8002804D11B4814A1D13815 -:1038200002F001FE114CA069FDF702FC0321A06922 -:10383000FDF721FCA069EF220178114001702946B3 -:10384000FDF740FC002601272B0002F0DDFE0E5C98 -:103850005C085C2C6060255C4C5C603C375C60699B -:103860006521095C002911D0062111E0C400002067 -:103870007372635C6C6C5F736C6176652E630000C1 -:1038800090140020430200005C080000C030417921 -:10389000A069FDF797FC3AE060698030417CA0693F -:1038A000FDF7D7FC33E06169A069B831FDF7ADFCE5 -:1038B0006169A0698C31FDF7AEFC28E00621A069A2 -:1038C000FDF7C5FC23E020690178A069FDF7A9FC9C -:1038D00020698188A069FDF7A6FC20694188A0695C -:1038E000FDF7A5FC13E00096019660696030007951 -:1038F000002803D069460878384308706946A069F3 -:10390000FDF7B1FC03E0F949F94802F08CFDFDF741 -:10391000D4FF002804D1F648F449801D02F083FD4D -:103920000C2D06D0072D03D0606940304682877584 -:10393000FEBD606940300683FEBDF0B5ED4CC82089 -:1039400061698DB0405C04280AD0052835D15C201F -:10395000405C00282AD0012060314871022026E016 -:1039600010226846D63101F030F86169102204A8AF -:10397000B03101F02AF8684601F0DFFB08AE8DCEC9 -:10398000616984250E4678360DC66F5000250D6797 -:103990004D67012540267554D74D88318DC5284681 -:1039A0000822093002F0C1FB052000E00D20FFF7DE -:1039B0002CFF61690020C03108720DB0F0BDF8B570 -:1039C000CC481830FDF767FF002848D0C94C207A52 -:1039D000002844D16069C421095C002500290ED06B -:1039E0002030C17E0120FFF7F3FE002807D1606977 -:1039F0002030C17E0420FFF7EBFE002806D060696E -:103A0000C921095C0126062907D00DE06069502113 -:103A10000D526030457102204EE02030C17E0420FE -:103A2000FFF7D6FE002813D0616908462030C27E19 -:103A3000921E130002F0E8FD166262621D6262626D -:103A400060621F6262622843626262626262466210 -:103A500060695E21095CC90702D0C0304572F8BDBB -:103A60000C20FFF7D2FE60694030817F31438177BF -:103A7000F8BD072020E0FDF79AFF0028F8D0606924 -:103A8000403005700B2017E0F9F741FA0C28EFD30E -:103A900060690821B830F9F73BFA002806D0606960 -:103AA00004218C30F9F734FA002804D1C72093A1FF -:103AB000C00002F0B8FC0420FFF7A7FEF8BDFFF736 -:103AC0003CFFF8BD00228A66CA66C6770A4678318E -:103AD000C8C9894878322838D26842632830C8C0BB -:103AE00008220D30091D02F020FB0620FFF78DFE95 -:103AF000606940308575F8BD0920DDE700F036FFCC -:103B0000F8BD70B57B4C3B216069095C08292FD159 -:103B10000146028EC0314B89521C9A4228D1227A2A -:103B2000002A25D10A8A83889A4207D14B8AC58800 -:103B3000AB4203D18B8A0589AB4209D043884B85C0 -:103B40008A854A8ACA858A8A0A860122E6210A5417 -:103B500001221146FDF747FC00210420FFF785FBF9 -:103B600060690021C92211542030C1760321817778 -:103B700070BD70B55F4C60692030C07E172803D0DF -:103B80005EA1624802F04FFC616900220B4640339F -:103B9000DA7608469A75E030867D0B240125002EE2 -:103BA00006D0837C002B14D1C4740275857410E098 -:103BB0001E7F002E07D01A774C88FA235C520276BB -:103BC0000C23837505E04E88FA235E520276057752 -:103BD00084752031CA7670BD70B5464CA0798007D7 -:103BE00036D5207A002833D160692030C17E01208B -:103BF000FFF7EEFD00282BD1A0690126C078002533 -:103C0000030002F001FD0E8585088537465F0A85B1 -:103C1000168526625285032152E060692030C07EFD -:103C2000052804D0394835A1333802F0FCFB60691F -:103C30000CE060692030C07E092804D033482FA1F1 -:103C40002D3802F0F0FB606956210D542030C57606 -:103C500070BD60692030C07E0B2804D02B4827A19E -:103C6000263802F0E0FB60695B210E540C21203005 -:103C7000C17670BD60692030C07E0F2804D0234813 -:103C80001EA11F3802F0CFFB60695B210E5410218A -:103C9000EDE760692030C07E102804D01B4817A1D2 -:103CA000183802F0C0FB12210AE060692030C07EA3 -:103CB000102804D0154811A1123802F0B4FB1421C9 -:103CC0006069D4E7FFF755FF70BD60690146C030F9 -:103CD000027A062A04D14031897F890700D505720E -:103CE000417A0629F0D1457270BD0000703801009C -:103CF000CD070000C4000020B81400207372635C7C -:103D00006C6C5F736C6176652E6300004C0500007F -:103D1000FD49FE4802F087FBE6E710B5FC4C606900 -:103D20002030C17E0020FFF753FD002803D1207A08 -:103D3000012108432072207A002808D1E069FDF7AC -:103D4000EBF961699122505405202031C87610BDED -:103D500010B5EF4C60690146C0314A7A002A06D09E -:103D6000097A062903D0217A012211432172217A8E -:103D7000002928D14030807F800715D4E069FDF705 -:103D80005AFA61694031C877E069FDF756FA61690E -:103D900040310884E069FDF755FA6169022240313B -:103DA0004884887F10438877606900220146C031CB -:103DB0000B7A062B00D10A724030837FDB0702D1D9 -:103DC00006234B72028310BDF8B5D14C60692030D8 -:103DD000C17E0020FFF7FCFC0125002807D16069A7 -:103DE0004030007F002802D1207A28432072207AB8 -:103DF000002830D160690026014640304682857532 -:103E0000B031E069FDF7EFF96169E0698831FDF7EC -:103E1000F3F960690146E030827D0827002A06D068 -:103E2000817C002913D1C774067585740FE04A8818 -:103E3000F8204252FA31E069FDF7C8F96169E0699A -:103E4000FF310331FDF7CAF96069E03087756069B9 -:103E50000F212030C176F8BD10B5AD4C606920301F -:103E6000C17E0020FFF7B4FC002803D1207A012195 -:103E700008432072207A002812D1E069FDF769F921 -:103E800000280ED0E069FDF75FF96169CA2250523F -:103E9000098E00F0D6FD002806D0282000F05EFD37 -:103EA00010BDFFF73AFF10BDE069FDF74BF96169FE -:103EB000C0310873E069FDF740F96169C031C8811C -:103EC000E069FDF72BF96169C0310882E069FDF70F -:103ED0002AF96169C0314882E069FDF729F9616911 -:103EE000D422505208202031C87610BDF8B5884C35 -:103EF000A079C00776D0207A002873D1606920307D -:103F0000C17E0120FFF764FC002863D1E069002531 -:103F1000C178022701260B0002F076FB0D1613086C -:103F2000415A5A445C575A192F545A00FDF74CF91C -:103F30006169C62250543B20475440314D828E75F2 -:103F400048E000F093FD45E0FFF786FF42E060693E -:103F50002030C17E0020FFF73BFC002802D1207AF0 -:103F600030432072207A002834D160690146403104 -:103F70004D828E750B2120300FE0606901462030A4 -:103F8000C27E0C2A02D0227A3A432272227A002A76 -:103F900020D1C57740310E770D21C1761AE0FFF7A9 -:103FA00013FF17E0606901462030C27E122A02D05A -:103FB000227A3A432272227A002A0BD140318D753F -:103FC0001721EAE7FFF7C4FE04E000F00DFD01E071 -:103FD000FFF7A3FE62690023106F516F401C594127 -:103FE00051671067F8BDF8B5494C05466069203047 -:103FF0008079012801D1FBF7E9FA012D14D160691C -:104000004021095C002903D12030C07F002801D065 -:10401000FBF79BFDFBF7BDFAFBF7B0FAFBF708FADD -:10402000FBF72DFAFBF746FA60790225C107012656 -:10403000002901D180070ED560692030817F0029D9 -:1040400002D0032902D006E0867700E085770021C0 -:104050000120FFF70AF960692030817F012903D12F -:104060006179090700D58577607A002803D100F0CF -:1040700027FDFFF7A4FC207900250028606902D005 -:104080008030058403E08030018C491C0184607914 -:10409000C00705D06069AC210D544030858104E033 -:1040A000616940318889401C8881E079002806D008 -:1040B0006169A031087B022806D8401C087360693A -:1040C000A030007B022806D9606901468030058453 -:1040D0004584A0310D7360692030C17E0020FFF758 -:1040E00077FB002804D160692030C07E072855D1B5 -:1040F00060690146C0310A7A062A4FD0497A0629FA -:104100004CD03E21095C05E0FC3C0100BA050000F2 -:10411000C4000020022941D1A030007B00283DD1FD -:10412000FDF74FFB002839D0FDF704FC002835D0FF -:1041300061690A468032508B01282FD90846A03089 -:10414000844646716038C7898389B81E834201DB83 -:10415000012002E0F81A401E80B2138CA789BB42EE -:1041600001D3012302E0FB1A5B1C9BB2984200D9E9 -:104170001846012801D163465D71C0310B78002BD0 -:1041800010D0528C49888A4201D3012102E0891A59 -:10419000491C89B2884205D9084603E061690120BB -:1041A000A0314D7161690A8E803110188883FFF744 -:1041B000DAFAFFF761FAFEF756FF002809D06069C6 -:1041C0000146FF3001300279002A02D14988C180BE -:1041D00006716069A0308571F8BD70B5F84C6069F2 -:1041E0002030407D00283ED0022810D1FDF7C2FAD1 -:1041F000002804D17120F349000102F014F962692A -:104200000023916ED06E491C58419166D06660695A -:10421000002520304575017D012904D10575A1795E -:1042200010221143A171C17C012915D1C574A07957 -:1042300008210843A071FDF76AFB002804D1E5209E -:10424000E049C00002F0EFF860690023816EC26EA1 -:10425000491C5A41C266816660692030817D01290E -:1042600002D0012181753FE585753DE570B5D44CDF -:104270000026E169012508788207920F0420012AAF -:1042800015D0022A13D0032A03D0217A01432172C8 -:104290002AE560780028FBD1606920308574A17917 -:1042A0002943A17122E0C6751EE5C5751CE5497854 -:1042B000CA0624D06278002AEAD1C906C90E1B2991 -:1042C00018D8617901436171FDF75FFB002804D1C3 -:1042D0003B20BC49400102F0A6F860690023016F51 -:1042E000426F491C5A41426701672030C17D012954 -:1042F000DBD1D8E7207A102108432072F4E460690A -:10430000F3E77CB504460020C0436946888001A8D5 -:10431000FCF7B2FD00287AD169468888FCF790FD49 -:10432000002803D0A749A84802F07DF8009801466C -:10433000E030827C0025002A08D0657010212170B1 -:10434000C17CA170017DE170857472E082799C4E20 -:10435000002A13D065700720207008E07169E620FC -:104360008D8445540A22A01CE83101F0DEFE00983D -:10437000E03080790028F1D1A5705AE0827D002AD2 -:1043800038D0827D130002F03FF90D2F2F2F2F2FF1 -:104390002F2F2F112F2F24082F0065700C21217033 -:1043A000017EA17071694988A18010E065700820C4 -:1043B00020707069082240886080201DFA3101F069 -:1043C000B4FEFF2100980331095AA181E0308575C0 -:1043D0002FE065700B212170017EA1707169498801 -:1043E000A180017FA171F2E7774876495D3002F044 -:1043F0001AF81EE0C81DF9300279002A08D01122EF -:1044000065702270811C89886180057111E012E05D -:10441000027A002A0FD012226570FF312270033118 -:1044200004E005720A8962804A89A280027A002A21 -:10443000F7D101207CBD00207CBD614800780128B7 -:1044400001D00C2070470020704770B55C4C0546C9 -:104450002078002804D05C485A49933001F0E3FFEB -:1044600000202561A07201202070FFF7E6FF0028E0 -:1044700004D0554853499E3001F0D5FF34E4F8B5D7 -:104480004F4F3978012901D00C20F8BD0126A62113 -:1044900078610E548030807CFDF752F900282FD0CF -:1044A00078698030807CFDF753FA002828D078693D -:1044B0008030807CFDF7E5F9002821D078698030D4 -:1044C000807CFDF70AFA00281AD0FAF7E6FF78692F -:1044D00000258030408B002827D039481830FDF760 -:1044E000DAF9002821D07869C421095C00291CD0A0 -:1044F0002030C17E0120FFF76BF9002802D014E0C4 -:104500001220F8BD78692030C17E0420FFF760F9E1 -:1045100000280AD1786950210D526030457102207F -:10452000FFF773F97869A03045717869E621095C75 -:10453000002903D1818CC288914200D8C188B981F9 -:1045400001468031CA8B521E93B20A8CD21892B2A5 -:104550000A8494460246A0321479002C02D04D847D -:10456000157102E04C8CE4184C8404464034A78951 -:10457000FF18A7814C8B012C01D8641C4C83002BA5 -:1045800000D015732030C07E0D4C04281ED0507909 -:1045900000281DD0A1898C451AD2FDF712F90028F8 -:1045A00016D060690146C0310A78002A10D08030E8 -:1045B000408C498888420BD3A570E6700AE0000061 -:1045C000C4000020FC3C010081080000A67001E04E -:1045D000A570E5706069A5210D543B21095C062991 -:1045E00001D0072918D1CA21028E095A511A09B2DD -:1045F000002911DB01460522CC310A3001F095FD7E -:10460000012202216069FCF7EEFE6069C9210D54A8 -:104610003B210D546030867160699E210A5A811CCD -:104620003030FCF71EFFA07800283DD16069C02122 -:10463000095C002901D0803045840120FAF7A4FDEF -:1046400060691330FAF713FF60690F30FAF753FE11 -:104650000120FAF71FFF61694020405C002803D168 -:104660003F20405C00280DD00A467831C8C9F9487F -:104670007832D26842632830C8C008220D30091D44 -:1046800001F053FDFAF701FF01210846FAF758FE41 -:1046900060698030806AFAF716FFFEF7A5FF60694F -:1046A0004030007AFAF730FE6571E571A571257228 -:1046B0006572257102202070FAF7FCFE0020F8BD1B -:1046C00010B5E54C2078022801D00C2010BDA07850 -:1046D000002803D00020FFF786FC17E0FAF7DDFE84 -:1046E00000F033F9606920308079012801D1FAF7B0 -:1046F00076FFA07A002809D0012807D0022807D029 -:10470000032805D0D549D64801F08DFE002010BD04 -:10471000EEF77EFCFAE7D0498872704710B5CE4CB0 -:104720002078032804D0CE48CC49293001F07BFE04 -:10473000606901212030827C002A06D00022827428 -:104740000175A27904231A43A271A2691378DB438D -:104750009B0707D1C37C002B04D1C174A07902212F -:104760000843A0711078C00606D4E0690078C0063E -:1047700002D4E07900280CD06078002809D1A07913 -:10478000002806D1FEF75DFC002802D0207A002820 -:1047900003D00120FFF727FC03E0FEF725FF00F020 -:1047A000D4F8207801280DD0A07A00280AD001285A -:1047B00008D0022807D0032805D0A948A7496830A7 -:1047C00001F031FE10BD0120FBF719F810BD10B546 -:1047D000A14C606920308079012812D1FAF7F6FEE9 -:1047E0006169881C3031FCF7C5FE002809D060697A -:1047F000C21D4388F93253812030007E107301209E -:10480000107210BD70B5944C05462078042804D071 -:1048100093489249803001F006FE617910200143EF -:104820006171002D50D0FBF7A8F96178012508438C -:10483000002811D160694021095C00290CD0E16990 -:104840004A78D20608D0097820300907C07DC90F00 -:10485000814201D165724EE0E078002809D0E0691C -:104860004178C90605D10078C00602D4FFF7AFFF32 -:1048700041E0FFF7ACFFE06900784007C10F6069D5 -:104880002030807D814205D0FFF7A7FC60790821A8 -:1048900008436071E06900780007C10F606920304B -:1048A000C07D814201D1FFF7E1FC6079284360714E -:1048B0000020E071A079000704D560692030C07E37 -:1048C000032818D0207A14E0022001436171E079B6 -:1048D000401CC0B2E07101280DD8606940300078FA -:1048E00000280CD05B484078C106C90E052906D2C5 -:1048F000C006002803D00120FFF775FB01E0FEF79A -:10490000BDFD207801280DD0A07A00280AD001280A -:1049100009D0022806D0032805D051484F49E2307B -:1049200001F081FD9FE40120FAF769FF9BE410B5D7 -:1049300049480078042804D049484849EA3001F041 -:1049400072FD0120FFF74FFB10BD10B501210020C3 -:10495000FAF7DBFE40490420087010BD3E494A22A8 -:104960004969505404202031C876704710B53A4C3C -:10497000C8206169405C00281CD0062806D0203180 -:10498000C97E0020FEF724FF002813D0606901468D -:10499000C0310A7A130001F037FE070D0D0D0D0D21 -:1049A0000D050D004030807FC20704D0C043800752 -:1049B00000D1087210BD0C20FEF727FF60690122AC -:1049C0004030817F1143817710BD10B5002A0AD095 -:1049D000002306E0D41A6418203CE47FC4545B1C16 -:1049E000DBB29342F6D310BD7CB51B4C606920301E -:1049F000C17E0020FEF7ECFE0125002802D1207ABE -:104A000028432072207A00281AD16946E069FCF711 -:104A100022FC684600780022C107C90F6846017071 -:104A20006069002902D06030057101E060300271D8 -:104A30006069014640304282857509202031C87680 -:104A40007CBD401A074900B2884201DC00280BDC1B -:104A50000120704790140020C4000020FC3C01009D -:104A6000F4090000FE7F00000020F2E710B5534C6F -:104A700060692030C17E0020FEF7AAFE0028207A5F -:104A800010D000280DD1E069FCF797FB6169CA22BC -:104A90005052098EFFF7D5FF002807D02820FFF7D6 -:104AA0005DFF10BD01210843207210BD6169E069FE -:104AB000CC31FCF77AFB606906212030C17610BD4D -:104AC00010B500F04EF83D4C607940070BD5606999 -:104AD0002030C17E0520FEF77BFE002803D0207A1F -:104AE000082108432072FFF701FA00F018F8FFF7D9 -:104AF00073F8A079C0060FD5207A00280CD1606920 -:104B00002030C17E0B0001F07FFD07070707070774 -:104B1000070507000721C176FEF7F3FF10BD10B5AA -:104B200026488179490715D5017A002912D14069B3 -:104B30003B21095C891E0B0001F066FD07050C0C8A -:104B40000C0D0C0F0C00002256210A54C030807945 -:104B5000FFF704FF10BD012100E00221C0304172C7 -:104B600010BD10B515488179090720D5017A0029B3 -:104B70001DD1406902462032D47EA41E230001F0DC -:104B800043FD13160B1616161616161616161616BF -:104B90001616161616171600562211546030407954 -:104BA000002801D0062000E01620FFF7D7FE10BD38 -:104BB0004030C1768175D17610BD0000C400002060 -:104BC00030B50346002002460DE09C5C2546303D92 -:104BD0000A2D02D30020C04330BD0A256843303877 -:104BE0002018521CD2B28A42EFD330BD70B50D46A8 -:104BF000144608E00A2101F012FB2A193031203A4C -:104C0000641ED177E4B2002CF4D170BD10B500233E -:104C100010E0040A00020443A0B2CC5C4440200629 -:104C2000000F60400407240C44402006C00C604084 -:104C30005B1C9BB29342ECD310BD000010B572B662 -:104C400000F0DCF800280BD0ECF72AFBF8F7EFFDBA -:104C500000F0A5FD6E490020C86288626D490860B9 -:104C600062B6002010BDF3B5002501200007C06A20 -:104C700081B0C0430006000E04D167480068401CA4 -:104C800000D1012572B600F0B9F8002802D062B652 -:104C90000820FEBDECF75AFAECF706FB5F4B604EBE -:104CA00000211A68CA40D2071FD00246CA40D20764 -:104CB00018D14AB2002A07DA1407240F083CA408C6 -:104CC000A400A419E46904E09408564FA400E41970 -:104CD00024689207D20ED4402206920F012A04D0F3 -:104CE000032A02D062B65048FEBD491C2029D8D301 -:104CF0000198030001F088FC14212323232323239C -:104D000023230B0D0F11131F1517191B1D2E002424 -:104D100016E0012414E0022412E0032410E004242D -:104D20000EE008240CE009240AE00A2408E00B2421 -:104D300006E00C2404E0052402E0072400E0062439 -:104D4000F06901210002000AC9070843F061002D43 -:104D500004D009E062B601200003FEBD2C4D3348AB -:104D6000E862ECF7A1FAA8622A49314808603149A3 -:104D700002980860ECF798FA214600F0F7FCF8F783 -:104D80001AFD00F0FDFE00F073FD0198ECF756FAF5 -:104D9000040062B603D0FFF751FF2046FEBD00209D -:104DA000FEBD10B5044600F029F8002800D001200F -:104DB0002070002010BD204908600020704710B509 -:104DC0000C46102808D011280BD012280CD013281C -:104DD0000ED00120086010BD03CC083CFFF743FF54 -:104DE0000AE0FFF72BFF07E02068FFF7DAFF03E098 -:104DF0001149206808600020206010BD05480C495A -:104E00000068884201D101207047002070470000EF -:104E100000050040780000200010001000E100E0D4 -:104E200000ED00E000E400E00110000000190000C7 -:104E3000BEBAFECAE40000200400002010B52038ED -:104E40000C46030001F0E0FB33A6AAAEB2B8BCC02A -:104E5000C5E0DBE41B1F23272C31373C41474D5075 -:104E600054585C606D71656974787C8084888C901E -:104E700094989C9FA2CACFE9F0F3D3D7F80020689A -:104E800000F0DDF8D6E0206800F0E1F8D2E020681C -:104E900000F0F5F8CEE0207840B200F0D7FAC9E093 -:104EA000207840B200F0F5FAC4E02078616840B2A2 -:104EB00000F008FBBEE0207840B200F018FBB9E03B -:104EC000207840B200F023FBB4E02078217940B292 -:104ED00000F02EFBAEE02078616840B200F058FB95 -:104EE000A8E000F064FBA5E0206800F068FBA1E00A -:104EF000207800F07DFB9DE02068F8F72CF899E021 -:104F00002068F8F72CF895E021792068F8F72EF85A -:104F100090E0206800F0E6F98CE0206800F0E7F906 -:104F200088E0207800F0E7F984E000F0F1F981E012 -:104F3000207800F0F3F97DE0207800F005FA79E0C0 -:104F4000206800F01EFA75E0206800F020FA71E099 -:104F5000206800F022FA6DE0206800F023FA69E092 -:104F6000206800F025FA65E0206800F027FA61E08B -:104F7000206800F028FA5DE00846ECF7FFF859E0F9 -:104F8000EDF719FA56E0EDF746FA53E02068EDF731 -:104F90004EFA4FE0206800F0E1F84BE0206800F0A6 -:104FA000E9F847E0206800F0F0F843E02078A268D4 -:104FB000616800F0F5F83DE0207800F006F939E08E -:104FC000207800F017F935E02078616800F027F9C3 -:104FD00030E02078616800F03AF92BE02179207800 -:104FE00000F016FC26E0206800F06BF822E0206854 -:104FF000F8F70CFB1EE02068F8F7F0FA1AE007CC8F -:105000000C3C00F0FFFC15E0206800F052FD11E0C0 -:1050100003CC083C00F07DFD0CE0206800F06EFF42 -:1050200008E009E003E0FFE700F080FF02E020680D -:1050300000F0B8FF206010BD0120086010BD002105 -:105040000170084670470146002008707047EFF372 -:105050001081C907C90F72B60278012A01D0012256 -:1050600000E0002201230370002900D162B6002A6B -:1050700001D000207047012040037047E7E7EFF3BD -:105080001081C907C90F72B600220270002900D131 -:1050900062B600207047F2E710B52848FFF7CFFF4F -:1050A000002803D026A11D2001F0BDF92348401C93 -:1050B000FFF7C5FF002803D021A1212001F0B3F99B -:1050C00010BDF1B5224D6F6801261C48FFF7BFFFE8 -:1050D0001A4C002803D10026601CFFF7D0FF1D4AA0 -:1050E0001D490120506000BF00BF00BF00BF00BFCE -:1050F00000230B604B60009B6B60106000BF00BF23 -:1051000000BF00BF00BF0868002802D1486800281F -:10511000F9D048680028E4D1002E04D06F60601CEC -:10512000FFF795FF07E0601CFFF791FF0028D3D140 -:105130000248FFF7A4FF0020F8BDC2E7E800002006 -:105140007372635C736F635F6563622E630000005C -:1051500000E5004000E0004000E100405A495B4BA0 -:105160000A685B499A42096801D18904890C016087 -:10517000002070475449554B0A6855499A4201D15D -:105180008004800C4860002070474F494F4B0A68EC -:105190004F499A4201D18004800C886000207047FA -:1051A00030B5494B494D1C684A4BAC4202D01028DF -:1051B00002D203E00E2801D3184630BDC300444894 -:1051C000181801614261002030BD3F493F4B0A6819 -:1051D0004049491C9A4202D0042802D203E0022826 -:1051E00001D3084670473C4A0121C0008018016085 -:1051F000002070473449354B0A683649491C9A42A9 -:1052000002D0042802D203E0022801D308467047E6 -:10521000314A0121C000801841600020704770B5FC -:10522000294A2C4B14682D4E284D82005B1C921984 -:10523000AC4203D0042803D2116006E0022801D357 -:10524000184670BD8804800C1060002070BD70B5D9 -:105250001D4A204B1468214E1C4D82005B1C921984 -:10526000AC4203D0042803D2106806E0022801D320 -:10527000184670BD10688004800C0860002070BD66 -:1052800010B5134A164890600E200021C3009B18E9 -:1052900019615961401C1028F8D300200F4A05E01D -:1052A000022803D383009B18196005E083009B1834 -:1052B0001C68A404A40C1C60401C0428F0D310BD7E -:1052C000034907488860704778000020BEBAFECACC -:1052D00000F501400820000000F0014000F8014006 -:1052E00000C0FFFF47490968016000207047454939 -:1052F0000860002070470121434A002803D001289C -:1053000003D042487047916300E0D16300207047AA -:105310003F49012008603D48801C704704223D4BF6 -:105320003B49002805D05A600869012210430861F2 -:1053300008E008694008400008619A60324900208E -:10534000C03188600020704731490622002808D00B -:10535000012809D002280DD003280FD02B48401C6B -:1053600070470869904302E008699043801C086117 -:105370000020704708699043001DF8E70869104352 -:10538000F5E723494A6A02434A62002070472049F0 -:105390004A6A82434A62002070471D49496A016097 -:1053A000002070471A49CA690243CA610020704749 -:1053B0001749CA698243CA61002070471449C96904 -:1053C0000160002070471249024600204031002A47 -:1053D00003D0012A01D0072070478A6370470D4926 -:1053E0000420886008490020C03188600A480168AC -:1053F0008022090A0902114301600849012008605E -:1054000070470000000400404000004004200000FD -:10541000000500400003004000E400E000E100E07F -:105420008107C90E002808DA0007000F0838800835 -:10543000814A80008018C06904E080087F4A8000AB -:1054400080180068C8400006800F704710B50446F9 -:1054500000F0DBF8002813D02046FFF7E1FFC0B2D0 -:1054600000F0E1F800280DD07549E2060B78D20E65 -:1054700001209040002B08D04A681043486006E0A5 -:10548000704810BD6F48401C10BD6F490860002077 -:1054900010BD10B5044600F0B8F800280BD06849DC -:1054A000E2060B78D20E01209040002B05D04A680E -:1054B00082434A6004E0634810BD6349803108605C -:1054C000002010BD70B50D46044600F09EF800287F -:1054D0000BD05E480068E206D20E012191400840E0 -:1054E00000D001202860002070BD564870BD10B566 -:1054F000044600F08AF8002807D0E106C90E012012 -:10550000884052490860002010BD4E4810BD10B5BB -:10551000044600F07AF8002808D0E106C90E012000 -:1055200088404A4980310860002010BD454810BDC0 -:1055300070B50D46044600F068F8002819D02846DA -:1055400000F071F8002816D0A007C10EFF228A4093 -:10555000A807000E8840002C10DA2107090F08392F -:105560008B0835499B005B18D96991430143D96188 -:105570000CE0344870BD3348401C70BDA3082F496F -:105580009B005B181968914301431960002070BDAE -:1055900070B50C46054600F038F8002805D02846BE -:1055A000FFF73EFF2070002070BD264870BDBFF39E -:1055B0004F8F21492648C860BFF34F8FFEE770B573 -:1055C0001F4C05462178012000290ED1207072B6AB -:1055D00000F0F4F81C4E803631688143616000F0C1 -:1055E000EDF8C043306062B600202870002070BD26 -:1055F00013490A78002A06D0002804D1124A4868C4 -:105600001060002008700020704710B50446202864 -:1056100007DA00F0D3F80121A140084201D10120AE -:1056200010BD002010BD012803D0032801D00020A8 -:10563000704701207047000000ED00E000E400E04A -:10564000EC0000200120000000E100E000E200E0AA -:105650000400FA05F8B50446800700250126002855 -:1056600004DA5848C563C66302208443E00404D5C5 -:105670005548C563C66380148443600003D553480E -:10568000456080058443E00504D55148C563C66381 -:1056900080158443A00404D54E48C563C6634014F6 -:1056A000844360042704C00FF90F884203D04AA145 -:1056B000612000F0B8FEB80F0AD04C49CD634C48C9 -:1056C000C563C563CE63C663C6630320800384439A -:1056D00020050AD5474FFD632F20EBF765FDFE63DC -:1056E0002F20EBF761FDF8148443FFF7C9FD424812 -:1056F000044203D038A18D2000F095FEF8BDF0B52E -:1057000000210A46FF230446CC40E4072AD04CB2CD -:10571000E606F60E0125B540384E3560384E356048 -:10572000002C11DA25072D0F083DAE08354DB600C7 -:105730007719FD69A407E60E1C46B440A54314463C -:10574000B4402543FD610DE0A6082F4DB600761943 -:105750003568A407E70E1C46BC40A5431446BC4070 -:1057600025433560491C2029CDD3F0BD70B5274CA9 -:105770000D462060FFF76EFF2068FFF7C0FF284648 -:10578000ECF7EAFEFFF788FCF7F778FBFFF778FD08 -:10579000FFF725FEECF766FD00F06AF870BD10B566 -:1057A0001A4C2068FFF756FF2068FFF7A8FFFFF7A5 -:1057B00067FDECF74BFF0020206010BD1348006828 -:1057C00070470000C01F0040C0CF004000E501400E -:1057D000C08F0040C0DF00407372635C736F635F13 -:1057E000636F6E6669672E6300000000C0EF0040C3 -:1057F000C0FF0040C0BF0040FEFF0FFC80E100E0A2 -:1058000080E200E000ED00E000E400E0F4000020B1 -:1058100070B5002402460D4620462146002A1ED0BF -:10582000012A04D0022A04D0032A1ED103E0012059 -:1058300002E0022013E003202B0000F0E5FE071633 -:105840000507090B0D0F1600012108E0022106E0F3 -:10585000032104E0042102E0052100E00621F8F71D -:1058600058F8002801D0204670BD0724FBE700004F -:10587000B348002101708170704770B5B14D0123AC -:105880006B60B14B1C68002CFCD0002407E00E6854 -:1058900006601E68002EFCD0001D091D641C944289 -:1058A000F5D30020686018680028FCD070BD70B582 -:1058B000A34C0E466178884203D0A4A16F2000F06B -:1058C000B2FD0325330000F09FFE09520624245246 -:1058D0005252524952002078022803D09BA17320D3 -:1058E00000F0A1FD2570A078022802D0012804D084 -:1058F00008E0A06800F0D2FB04E02046083007C8AA -:10590000FFF7BBFF0020A070F7F7A4FF0420207072 -:1059100070BDF8F754F801466068F9F776FA064664 -:105920002078022803D089A1872000F07CFD8B4AD3 -:105930008B498C48964205D86269032A02D2521CD0 -:10594000626102E0864207D84D71801BC8608449BD -:105950006078F8F7B4FC70BD032003E0A07800285D -:10596000FAD10220F7F77EFE00F0E1F870BD77A1D2 -:10597000B12000F058FD70BD70B50546F8F71FF86E -:105980006F4C60602078012803D070A1B82000F02F -:105990004AFD73490220087000220A718D600422BA -:1059A0004A71704ACA6020706078F8F788FC70BD50 -:1059B00010B5634CA078002802D12078002801D0CF -:1059C000112010BD6848F7F78BFF607060780028E1 -:1059D00004D0012020700020606110BD032010BDA4 -:1059E00010B50124020B64040121604BA04202D2D5 -:1059F0009140186802E0203A58689140084000D071 -:105A0000012010BDF8B50E46910005464F19144609 -:105A10003F1F009100F053FB009980028919091F74 -:105A2000B14201D2012200E00022002C03D0FF216C -:105A300001318C4201D90920F8BD4D498D4219D35D -:105A4000AF4217D3854205D2874203D2284630435E -:105A5000800701D01020F8BD8E420BD3002A09D157 -:105A60002846FFF7BDFF002804D13846FFF7B8FFEE -:105A7000002801D00F20F8BD3E483F490068884209 -:105A800005D0224631462846FFF7F7FE0FE0FFF724 -:105A90008FFF0028EFD12A480121C660856004618C -:105AA00081702046302148431830FFF765FF002001 -:105AB000F8BD10B504462E48800A84420BD300F08E -:105AC000FEFAA04201D8102010BDA0020446FFF744 -:105AD00087FF002801D00F2010BD26482649006806 -:105AE000884203D0204600F0D9FA0AE0FFF760FFB1 -:105AF0000028F1D112480221846081701F48FFF70D -:105B00003BFF002010BD1A48010B01208840401EB9 -:105B1000704700B50B460246FFF7F5FF104201D073 -:105B20000F2000BD114802604360002000BD10B589 -:105B3000034C6078F7F728FF00202070A07010BD9C -:105B4000F800002000E5014000E401407372635C4E -:105B5000736F635F666C6173682E6300307500005D -:105B6000E0140020D0FB0100AF5801000006004007 -:105B70000080010078000020BEBAFECA3A5600003C -:105B8000F74805218170002101704170C17081606A -:105B9000704710B5F3490A78022A07D0CA6810186E -:105BA000C860C8689638F9F7E9F810BD8A68101817 -:105BB00088608868F6E70378EB49EC4A002B02D04E -:105BC000012B10D014E00379002B01D0012B0FD151 -:105BD0004379002B01D0012B0AD18368643B8B42AF -:105BE00006D2C06810E00379002B03D0012B01D04E -:105BF000002070474379002B01D0012BF8D1C368F6 -:105C0000643B8B42F4D280689042F1D80120704707 -:105C1000F8B504460226F8F740FD0068002803D0D6 -:105C2000D3A1BD2000F0FFFB0127CD4D002C08D0F3 -:105C30002078002817D0012805D0022811D0032889 -:105C400013D02F710DE06068C82808D3F9F70BF95D -:105C5000002804D06068FFF79CFF012603E00026BF -:105C600001E000F0F9F93046F8BD28780028F8D1B5 -:105C70006068FFF7A0FF0028E3D060680078002884 -:105C800026D0A878042803D0B9A1F72000F0CBFBD8 -:105C9000B44F0020387060680079012800D00020DF -:105CA000387160684079002837D0042078716068C6 -:105CB0008168E868F8F71DF9B8606068C0689630D8 -:105CC000F8600320A870A749E878F8F7F8FAC8E761 -:105CD000A4480221017061680979012919D00021C5 -:105CE000017161684979002915D004214171616809 -:105CF0008968963181606168C968C160C068984CE4 -:105D000014346060F7F75BFE20606F700220A870AB -:105D1000A7E70321E4E70321E8E70320C6E7F8B596 -:105D20008F4C0D46E178884204D0FF2090A11930B5 -:105D300000F079FB28468A4F00250126143703001E -:105D400000F062FC090612375A7C8D97C4A0C4008B -:105D5000A078032807D0A078022804D0FF2084A1CF -:105D60001D3000F060FBF8BDA078032807D0A078B4 -:105D7000022804D0FF207EA1213000F054FB042033 -:105D8000A07025712078002810D1FFF702FFE0787D -:105D9000F8F7D6F8E0607D49886A7D4A02402261C2 -:105DA0007B4AD24310408862002050E000F054F952 -:105DB000F8BDA078032807D0A078022804D0FF20DF -:105DC0006BA1423000F02FFB2078002802D000F0B9 -:105DD0004FF9F8BDA07803281FD104202AE0091A42 -:105DE0006048C1600146E078F8F769FAF8BD042020 -:105DF000F7F738FCA570F8BDA078032807D0A07885 -:105E0000022804D0FF205AA1633000F00CFB207858 -:105E10000028DCD1A07803280BD0F7F7D0FD01468D -:105E20003868F8F7F2FF0028E1DB79688142DEDBB1 -:105E3000D5E70520F7F716FCA670F8BDA078042872 -:105E400004D0FF204AA1843000F0EDFA0220A168BE -:105E50008847FFF7DDFEFF260546BD3642E0A07805 -:105E6000042804D0FF2042A1893000F0DCFA012090 -:105E7000EDE7A078042899D0FF203DA18E3000F0F6 -:105E8000D2FA93E7A07804280AD06078002802D0DC -:105E9000A078022804D0FF2035A1933000F0C3FA87 -:105EA0002078002893D12079002804D00620F7F725 -:105EB000D9FB2571C0E76078002805D02949E07832 -:105EC000F8F7FDF96570F8BD0720B3E7FF2028A1BA -:105ED000AE3046E7002D0AD0012D06D024A1304671 -:105EE00000F0A1FA022DF5D1F8BD042000E0032056 -:105EF000A1688847FFF78CFE0546F3E770B50500FB -:105F000005D0174CA078052803D0112070BD1020B3 -:105F100070BD2048F7F7E4FCE070E078002803D07B -:105F2000A5600020A07070BD032070BD10B50C48A6 -:105F30000178002901D0112010BD817805292BD0CE -:105F4000817801292AD08178002927D00121017088 -:105F50008178012922D0807800281FD020E000001D -:105F600010010020F01400203D860100FF1FA10752 -:105F70007372635C736F635F726164696F5F74698E -:105F80006D65736C6F742E630000000000050040A7 -:105F9000028100001F5D01000F2010BD00F068F8B5 -:105FA000002010BDF8B5394E0446B078002801D065 -:105FB00001280DD1002C0DD02046FFF7FCFD002854 -:105FC0000AD02078324D002808D0B078012823D09C -:105FD0000F20F8BD1020F8BD0720F8BD02272F7054 -:105FE0002079012814D0002028716079002811D070 -:105FF00004206871A0689630A860E068E860E868EE -:10600000224C14346060F7F7DAFC2060B77019E0B6 -:106010000320E9E70320ECE700202870207901281D -:1060200016D0002028716079002813D004206871F0 -:10603000A168F068F7F75DFFA860E0689630E86057 -:106040000320B0701249F078F8F739F90020F8BD54 -:106050000320E7E70320EAE710B50E48816A0E4AFD -:1060600011400A4A126911438162F7F7F3FB10BD30 -:1060700010B5064CE078F7F787FC0820F7F7F2FA3E -:106080000520A07000202070607010BD100100205D -:10609000F014002000050040FD7EFFFF0A4A0221A7 -:1060A00051600A490B68002BFCD0906008680028FA -:1060B000FCD00020506008680028FCD07047012008 -:1060C000000740697047000000E5014000E401401E -:1060D000034610B50B439B070FD1042A0DD308C804 -:1060E00010C9121FA342F8D018BA21BA884201D9A8 -:1060F000012010BD0020C04310BD002A03D0D307EB -:1061000003D0521C07E0002010BD03780C78401C1F -:10611000491C1B1B07D103780C78401C491C1B1B16 -:1061200001D1921EF1D1184610BDF8B5042A2CD326 -:10613000830712D00B78491C0370401C521E830742 -:106140000BD00B78491C0370401C521E830704D0EF -:106150000B78491C0370401C521E8B079B0F05D007 -:10616000C91ADF002023DE1B08C90AE0EBF72CF870 -:10617000F8BD1D4608C9FD401C46B4402C4310C064 -:10618000121F042AF5D2F308C91A521EF0D40B7854 -:10619000491C0370401C521EEAD40B78491C037042 -:1061A000401C012AE4D409780170F8BD01E004C064 -:1061B000091F0429FBD28B0701D50280801CC90767 -:1061C00000D00270704700290BD0C30702D00270C4 -:1061D000401C491E022904D3830702D50280801C7B -:1061E000891EE3E70022EEE70022DFE70378C278AA -:1061F0001946437812061B0219438378C0781B04A2 -:10620000194311430902090A000608437047020AAC -:1062100008704A70020C8A70020ECA707047002221 -:1062200003098B4273D3030A8B4258D3030B8B426F -:106230003CD3030C8B4221D312E003460B437FD4A3 -:10624000002243088B4274D303098B425FD3030AB5 -:106250008B4244D3030B8B4228D3030C8B420DD3C8 -:10626000FF22090212BA030C8B4202D31212090256 -:1062700065D0030B8B4219D300E0090AC30B8B4294 -:1062800001D3CB03C01A5241830B8B4201D38B0342 -:10629000C01A5241430B8B4201D34B03C01A5241E7 -:1062A000030B8B4201D30B03C01A5241C30A8B422A -:1062B00001D3CB02C01A5241830A8B4201D38B0215 -:1062C000C01A5241430A8B4201D34B02C01A5241B9 -:1062D000030A8B4201D30B02C01A5241CDD2C3092B -:1062E0008B4201D3CB01C01A524183098B4201D3A7 -:1062F0008B01C01A524143098B4201D34B01C01A92 -:10630000524103098B4201D30B01C01A5241C30809 -:106310008B4201D3CB00C01A524183088B4201D378 -:106320008B00C01A524143088B4201D34B00C01A64 -:106330005241411A00D201465241104670475DE079 -:10634000CA0F00D04942031000D3404253400022FC -:106350009C4603098B422DD3030A8B4212D3FC22A5 -:10636000890112BA030A8B420CD3890192118B4224 -:1063700008D3890192118B4204D389013AD092113A -:1063800000E08909C3098B4201D3CB01C01A5241F5 -:1063900083098B4201D38B01C01A524143098B42BE -:1063A00001D34B01C01A524103098B4201D30B01A7 -:1063B000C01A5241C3088B4201D3CB00C01A5241CC -:1063C00083088B4201D38B00C01A5241D9D24308B3 -:1063D0008B4201D34B00C01A5241411A00D20146F0 -:1063E000634652415B10104601D34042002B00D55A -:1063F0004942704763465B1000D3404201B500201C -:10640000C046C04602BD70477047704710B500F0E7 -:106410003BF810BD012308CB134B1860134B1960D8 -:10642000134B1A607047134A134B13607246053AB8 -:10643000F0E7114A0F4B1B689A420ED10D4B00201A -:10644000186001980D4B04B598470CBC9E46024657 -:10645000029800990A4B1B68184706980599094B42 -:106460001B68DB6818470000340100203801002059 -:106470003C0100202C010020EFBEADDEC9CD0000A4 -:10648000E4000020040000201D481E497047FFF76B -:10649000FBFFEAF753FE00BD01200007C06AC0B24F -:1064A000FF2804D1184819490968884202D01848C1 -:1064B00018490160184819490968884203D1184AE7 -:1064C00013605B68184700BD20BFFDE71248134901 -:1064D000096888420ED1134B18680B498842F3D0E3 -:1064E00080F308881049884204DD104802680221C0 -:1064F0000A4302600E4880470E4880470E48004716 -:106500000015002000150020FFFFFFFF0010001005 -:106510002C050040080000000010000000000020D2 -:10652000040000200080010000200020240500401D -:10653000DFCD000099640100156401001348704527 -:1065400002D1EFF3098101E0EFF308818869023895 -:106550000078102814DB202810DB2B280BDB0C4ADA -:1065600012680C4B9A4203D1602804DB0A4A104798 -:10657000022008607047094A10470000084A104787 -:10658000084A12682C32126810470000FDFFFFFF16 -:1065900078000020BEBAFECAAD1200003D4E0100D8 -:1065A000BF4D0100040000200D4B0E4908470E4B63 -:1065B0000C4908470D4B0B4908470D4B0949084743 -:1065C0000C4B084908470C4B064908470B4B05493B -:1065D00008470B4B034908470A4B0249084700008C -:1065E00079250000192200009D2B00003F2A0000A1 -:1065F000ED2900009F270000B912000013140000CD -:10660000012B00000F23000030B47446641E25786F -:10661000641CAB4200D21D46635D5B00E31830BCD6 -:10662000184703B5684600784006400E401C884273 -:1066300005D269460878401CC0B208700CBD684697 -:106640000078000601D500200CBD80200CBD414023 -:10665000802901D0002070470120704737B50878A5 -:106660000C4669460978884206D020781146FFF723 -:10667000D8FF207001203EBD00203EBD37B5044646 -:106680000078154669460979FFF7E1FF002801D037 -:1066900000203EBD20782946FFF7C3FF207001206F -:1066A0003EBD0FB568460179007881420AD0684640 -:1066B000007922214006400E4843801818600120CE -:1066C00004B000BD0020FBE77FB5684601791C4699 -:1066D00015460078FFF7BBFF002802D0002004B069 -:1066E00070BD6846007822214006400E484340199C -:1066F00020600120F3E70000FFFFFFFF0000FFFF25 -:106700000100030000000100000000000000000084 -:1067100000000000000000008700000000000000F2 -:10672000000000000000000000000001020304005F -:106730000D0E0F100000000033690000516B0000C7 -:10674000196C0000736C0000C76C00002F6D000016 -:106750008D690000456A0000D16D0000DF790000FE -:10676000100110013A0200001A02000004013C006E -:10677000230044000E0001020408102040805555FB -:1067800055D6BE898E0000007006120DB4130000AD -:1067900014035A06A00900006004F208840DF401F5 -:1067A000FA00960064004B0032001E001400000046 -:1067B000E067010008000020100000000411000044 -:1067C000F0670100180000202801000004110000FB -:1067D0001869010040010020C013000020110000D2 -:1067E0000249022208681042FCD0704700E200E033 -:1067F0000000000000000000000000000000000099 -:106800000000000000000000000000000000000088 -:106810000000000000000000000000000000000078 -:10682000000000000100010054000020FB349B5FC9 -:106830008000008000100000000000000000000048 -:106840000000000000000000000000000000000048 -:106850000000000001000000000000000000000037 -:106860000000000000000000000000000000000028 -:106870000000000000000000000000000000000018 -:106880000000000000000000000000000000000008 -:1068900000000000000000000000000000000000F8 -:1068A00000000000000000000000000000000000E8 -:1068B00000000000000000000000000000000000D8 -:1068C00000000000000000000000000000000000C8 -:1068D00000000000000000000000000000000000B8 -:1068E00000000000000000000000000000000000A8 -:1068F0000000000000000000000000000000000098 -:106900000000000000000000196401000000000009 -:0869100000000000000000007F -:00000001FF diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index 55bc26fec68..3075ff4eaf0 100755 --- a/workspace_tools/targets.py +++ b/workspace_tools/targets.py @@ -827,6 +827,10 @@ class NRF51822(Target): # the following is a list of possible Nordic softdevices in decreasing order # of preference. EXPECTED_SOFTDEVICES_WITH_OFFSETS = [ + { + 'name' : 's130_nrf51_1.0.0_softdevice.hex', + 'offset' : 0x1C000 + }, { 'name' : 's110_nrf51822_8.0.0_softdevice.hex', 'offset' : 0x18000 From 726f3f281c2b2df0ecb16b7201edee7a1b088423 Mon Sep 17 00:00:00 2001 From: Andrew Fritz Date: Wed, 29 Apr 2015 13:14:02 -0500 Subject: [PATCH 17/24] [mbed][k64f] Removed configuration of MII pins --- .../arch/TARGET_Freescale/hardware_init_MK64F12.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/hardware_init_MK64F12.c b/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/hardware_init_MK64F12.c index 708764abb87..aa832ab8c20 100644 --- a/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/hardware_init_MK64F12.c +++ b/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/hardware_init_MK64F12.c @@ -64,16 +64,7 @@ void k64f_init_eth_hardware(void) PORT_HAL_SetPullCmd(PORTB_BASE, 0, true); PORT_HAL_SetMuxMode(PORTB_BASE, 1, kPortMuxAlt4); - /* Configure GPIO for MII interface */ - PORT_HAL_SetMuxMode(PORTA_BASE, 9, kPortMuxAlt4); /*!< ENET MII0_RXD3*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 10, kPortMuxAlt4); /*!< ENET MII0_RXD2*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 11, kPortMuxAlt4); /*!< ENET MII0_RXCLK*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 24, kPortMuxAlt4); /*!< ENET MII0_TXD2*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 25, kPortMuxAlt4); /*!< ENET MII0_TXCLK*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 26, kPortMuxAlt4); /*!< ENET MII0_TXD3*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 27, kPortMuxAlt4); /*!< ENET MII0_CRS*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 28, kPortMuxAlt4); /*!< ENET MII0_TXER*/ - PORT_HAL_SetMuxMode(PORTA_BASE, 29, kPortMuxAlt4); /*!< ENET MII0_COL*/ + #if FSL_FEATURE_ENET_SUPPORT_PTP PORT_HAL_SetMuxMode(PORTC_BASE, (16 + ENET_TIMER_CHANNEL_NUM), kPortMuxAlt4); /* ENET ENET0_1588_TMR0*/ PORT_HAL_SetDriveStrengthMode(PORTC_BASE, (16 + ENET_TIMER_CHANNEL_NUM), kPortHighDriveStrength); From 23cde3b008f213dfe392b84f2654369e93af7810 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Thu, 30 Apr 2015 07:33:37 +0100 Subject: [PATCH 18/24] mbed header file - mbed lib revision - 98 --- libraries/mbed/api/mbed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mbed/api/mbed.h b/libraries/mbed/api/mbed.h index 4524292ceb8..5bcd8e7ce53 100644 --- a/libraries/mbed/api/mbed.h +++ b/libraries/mbed/api/mbed.h @@ -16,7 +16,7 @@ #ifndef MBED_H #define MBED_H -#define MBED_LIBRARY_VERSION 97 +#define MBED_LIBRARY_VERSION 98 #include "platform.h" From bdaddafd92ba2b269c3dc33a2bd04ea404dd8656 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Thu, 30 Apr 2015 11:57:14 +0100 Subject: [PATCH 19/24] Squashed commit (pull request #1072) commit 8e9e89f5d7fd328132de1cabeaa32963246f92d7 Author: bcostm Date: Tue Apr 28 17:12:52 2015 +0200 [STM32L0] Change back AHBPresc table name commit 6433521fc1eed4031725322c213961dc3d8d1266 Author: bcostm Date: Fri Apr 24 10:34:41 2015 +0200 [STM32_L0] hal improvements - pins settings - check STM32Cube HAL_Init return value commit 7b6a5eadc67fb38991bfab3990014e0fbfce1145 Author: bcostm Date: Fri Apr 24 10:32:12 2015 +0200 [NUCLEO_L073RZ] Improvements (same as NUCLEO_L053R8) commit 0a7f6d2bea0eec29539b1a15428a6adaadd2daef Author: bcostm Date: Fri Apr 24 10:30:44 2015 +0200 [NUCLEO_L053R8] Improvements - Add new macro for pins setting (same as NUCLEO_F4) - Fix issue with constant tables commit 1f72ffe2fe9a56101d1e7f3b6e72f8267bd4b33d Author: bcostm Date: Fri Apr 24 10:26:55 2015 +0200 [DISCO_L053C8] Alignment with NUCLEO_L0, add IAR compilation + exporter commit ed2d7dcbe1542fbabe6948e446953166f79fbb18 Author: bcostm Date: Fri Mar 20 11:10:03 2015 +0100 [NUCLEO_F091RC/F303RE] Fix wrong detect_code field --- .../TOOLCHAIN_ARM_MICRO/startup_stm32l053xx.s | 10 +- .../TOOLCHAIN_ARM_STD/startup_stm32l053xx.s | 61 +- .../TOOLCHAIN_GCC_ARM/startup_stm32l053xx.s | 4 +- .../TOOLCHAIN_IAR/startup_stm32l053xx.s | 6 +- .../TARGET_DISCO_L053C8/cmsis_nvic.h | 1 - .../TARGET_DISCO_L053C8/system_stm32l0xx.c | 4 +- .../TOOLCHAIN_ARM_STD/startup_stm32l053xx.s | 6 +- .../TARGET_NUCLEO_L053R8/system_stm32l0xx.c | 4 +- .../TARGET_NUCLEO_L073RZ/system_stm32l0xx.c | 4 +- .../TARGET_STM32L0/PeripheralPins.h | 2 +- .../TARGET_DISCO_L053C8/PeripheralNames.h | 2 +- .../TARGET_DISCO_L053C8/PeripheralPins.c | 72 +- .../TARGET_DISCO_L053C8/PinNames.h | 86 +- .../TARGET_DISCO_L053C8/PortNames.h | 2 +- .../TARGET_DISCO_L053C8/device.h | 2 +- .../TARGET_DISCO_L053C8/objects.h | 6 +- .../TARGET_DISCO_L053C8/rtc_api.c | 4 +- .../TARGET_NUCLEO_L053R8/PeripheralNames.h | 2 +- .../TARGET_NUCLEO_L053R8/PeripheralPins.c | 74 +- .../TARGET_NUCLEO_L053R8/PinNames.h | 23 +- .../TARGET_NUCLEO_L053R8/PortNames.h | 2 +- .../TARGET_NUCLEO_L053R8/device.h | 2 +- .../TARGET_NUCLEO_L053R8/objects.h | 6 +- .../TARGET_NUCLEO_L073RZ/PeripheralNames.h | 2 +- .../TARGET_NUCLEO_L073RZ/PeripheralPins.c | 96 +- .../TARGET_NUCLEO_L073RZ/PinNames.h | 23 +- .../TARGET_NUCLEO_L073RZ/PortNames.h | 2 +- .../TARGET_NUCLEO_L073RZ/device.h | 2 +- .../TARGET_NUCLEO_L073RZ/objects.h | 6 +- .../TARGET_STM/TARGET_STM32L0/analogin_api.c | 49 +- .../TARGET_STM/TARGET_STM32L0/analogout_api.c | 53 +- .../hal/TARGET_STM/TARGET_STM32L0/gpio_api.c | 2 +- .../TARGET_STM/TARGET_STM32L0/gpio_irq_api.c | 6 +- .../TARGET_STM/TARGET_STM32L0/gpio_object.h | 5 +- .../hal/TARGET_STM/TARGET_STM32L0/i2c_api.c | 8 +- .../TARGET_STM32L0/mbed_overrides.c | 2 +- .../hal/TARGET_STM/TARGET_STM32L0/pinmap.c | 9 +- .../hal/TARGET_STM/TARGET_STM32L0/port_api.c | 2 +- .../TARGET_STM/TARGET_STM32L0/pwmout_api.c | 50 +- .../TARGET_STM/TARGET_STM32L0/serial_api.c | 7 +- .../hal/TARGET_STM/TARGET_STM32L0/sleep.c | 2 +- .../hal/TARGET_STM/TARGET_STM32L0/spi_api.c | 8 +- .../hal/TARGET_STM/TARGET_STM32L0/us_ticker.c | 2 +- workspace_tools/export/iar.py | 1 + .../export/iar_disco_l053c8.ewd.tmpl | 2733 +++++++++++++++++ .../export/iar_disco_l053c8.ewp.tmpl | 1899 ++++++++++++ workspace_tools/targets.py | 2 +- 47 files changed, 4990 insertions(+), 366 deletions(-) create mode 100644 workspace_tools/export/iar_disco_l053c8.ewd.tmpl create mode 100644 workspace_tools/export/iar_disco_l053c8.ewp.tmpl diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_MICRO/startup_stm32l053xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_MICRO/startup_stm32l053xx.s index 82152a6380b..deb767857ab 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_MICRO/startup_stm32l053xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_MICRO/startup_stm32l053xx.s @@ -1,8 +1,8 @@ -;******************** (C) COPYRIGHT 2014 STMicroelectronics ******************** +;******************** (C) COPYRIGHT 2015 STMicroelectronics ******************** ;* File Name : startup_stm32l053xx.s ;* Author : MCD Application Team -;* Version : V1.1.0 -;* Date : 18-June-2014 +;* Version : V1.2.0 +;* Date : 06-February-2015 ;* Description : STM32l053xx Devices vector table for MDK-ARM toolchain. ;* This module performs: ;* - Set the initial SP @@ -12,9 +12,9 @@ ;* calls main()). ;* After Reset the Cortex-M0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. -;* <<< Use Configuration Wizard in Context Menu >>> +;* <<< Use Configuration Wizard in Context Menu >>> ;******************************************************************************* -;* +;* ;* Redistribution and use in source and binary forms, with or without modification, ;* are permitted provided that the following conditions are met: ;* 1. Redistributions of source code must retain the above copyright notice, diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s index 6950660745b..c268cd252e3 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s @@ -1,8 +1,8 @@ -;******************** (C) COPYRIGHT 2014 STMicroelectronics ******************** +;******************** (C) COPYRIGHT 2015 STMicroelectronics ******************** ;* File Name : startup_stm32l053xx.s ;* Author : MCD Application Team -;* Version : V1.1.0 -;* Date : 18-June-2014 +;* Version : V1.2.0 +;* Date : 06-February-2015 ;* Description : STM32l053xx Devices vector table for MDK-ARM toolchain. ;* This module performs: ;* - Set the initial SP @@ -38,30 +38,8 @@ ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;* ;******************************************************************************* -; -; Amount of memory (in bytes) allocated for Stack -; Tailor this value to your application needs -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; -Stack_Size EQU 0x00000400 - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Heap_Size EQU 0x00000200 - - AREA HEAP, NOINIT, READWRITE, ALIGN=3 -__heap_base -Heap_Mem SPACE Heap_Size -__heap_limit +__initial_sp EQU 0x20002000 ; Top of RAM PRESERVE8 THUMB @@ -234,33 +212,4 @@ USB_IRQHandler ENDP ALIGN - -;******************************************************************************* -; User Stack and Heap initialization -;******************************************************************************* - IF :DEF:__MICROLIB - - EXPORT __initial_sp - EXPORT __heap_base - EXPORT __heap_limit - - ELSE - - IMPORT __use_two_region_memory - EXPORT __user_initial_stackheap - -__user_initial_stackheap - - LDR R0, = Heap_Mem - LDR R1, =(Stack_Mem + Stack_Size) - LDR R2, = (Heap_Mem + Heap_Size) - LDR R3, = Stack_Mem - BX LR - - ALIGN - - ENDIF - - END - -;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** + END diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_GCC_ARM/startup_stm32l053xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_GCC_ARM/startup_stm32l053xx.s index 35a69950383..4713bb34e2f 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_GCC_ARM/startup_stm32l053xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_GCC_ARM/startup_stm32l053xx.s @@ -2,8 +2,8 @@ ****************************************************************************** * @file startup_stm32l053xx.s * @author MCD Application Team - * @version V1.1.0 - * @date 18-June-2014 + * @version V1.2.0 + * @date 06-February-2015 * @brief STM32L053xx Devices vector table for Atollic TrueSTUDIO toolchain. * This module performs: * - Set the initial SP diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_IAR/startup_stm32l053xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_IAR/startup_stm32l053xx.s index 20869b07f1e..30b0ffa1658 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_IAR/startup_stm32l053xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_IAR/startup_stm32l053xx.s @@ -1,8 +1,8 @@ -;/******************** (C) COPYRIGHT 2014 STMicroelectronics ******************** +;/******************** (C) COPYRIGHT 2015 STMicroelectronics ******************** ;* File Name : startup_stm32l053xx.s ;* Author : MCD Application Team -;* Version : V1.1.0 -;* Date : 18-June-2014 +;* Version : V1.2.0 +;* Date : 06-February-2015 ;* Description : STM32L053xx Ultra Low Power Devices vector ;* This module performs: ;* - Set the initial SP diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/cmsis_nvic.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/cmsis_nvic.h index 0e0ab96f824..027dd9f78a6 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/cmsis_nvic.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/cmsis_nvic.h @@ -32,7 +32,6 @@ #ifndef MBED_CMSIS_NVIC_H #define MBED_CMSIS_NVIC_H -// STM32L053R8 // CORE: 16 vectors = 64 bytes from 0x00 to 0x3F // MCU Peripherals: 32 vectors = 128 bytes from 0x40 to 0xBF // Total: 48 vectors = 192 bytes (0xC0) to be reserved in RAM diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c index f2a95c6667b..1967b94ed00 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c @@ -147,7 +147,7 @@ */ uint32_t SystemCoreClock = 32000000; const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +const uint8_t PLLMulTable_2[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; /** * @} @@ -280,7 +280,7 @@ void SystemCoreClockUpdate (void) /* Get PLL clock source and multiplication factor ----------------------*/ pllmul = RCC->CFGR & RCC_CFGR_PLLMUL; plldiv = RCC->CFGR & RCC_CFGR_PLLDIV; - pllmul = PLLMulTable[(pllmul >> 18)]; + pllmul = PLLMulTable_2[(pllmul >> 18)]; plldiv = (plldiv >> 22) + 1; pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s index e79c386efe4..c268cd252e3 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s @@ -101,7 +101,7 @@ __Vectors DCD __initial_sp ; Top of Stack DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 DCD LCD_IRQHandler ; LCD DCD USB_IRQHandler ; USB - + __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors @@ -112,7 +112,7 @@ __Vectors_Size EQU __Vectors_End - __Vectors Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT __main - IMPORT SystemInit + IMPORT SystemInit LDR R0, =SystemInit BLX R0 LDR R0, =__main @@ -191,7 +191,7 @@ TSC_IRQHandler DMA1_Channel1_IRQHandler DMA1_Channel2_3_IRQHandler DMA1_Channel4_5_6_7_IRQHandler -ADC1_COMP_IRQHandler +ADC1_COMP_IRQHandler LPTIM1_IRQHandler TIM2_IRQHandler TIM6_DAC_IRQHandler diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/system_stm32l0xx.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/system_stm32l0xx.c index f2a95c6667b..1967b94ed00 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/system_stm32l0xx.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/system_stm32l0xx.c @@ -147,7 +147,7 @@ */ uint32_t SystemCoreClock = 32000000; const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +const uint8_t PLLMulTable_2[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; /** * @} @@ -280,7 +280,7 @@ void SystemCoreClockUpdate (void) /* Get PLL clock source and multiplication factor ----------------------*/ pllmul = RCC->CFGR & RCC_CFGR_PLLMUL; plldiv = RCC->CFGR & RCC_CFGR_PLLDIV; - pllmul = PLLMulTable[(pllmul >> 18)]; + pllmul = PLLMulTable_2[(pllmul >> 18)]; plldiv = (plldiv >> 22) + 1; pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/system_stm32l0xx.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/system_stm32l0xx.c index f2a95c6667b..1967b94ed00 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/system_stm32l0xx.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/system_stm32l0xx.c @@ -147,7 +147,7 @@ */ uint32_t SystemCoreClock = 32000000; const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +const uint8_t PLLMulTable_2[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; /** * @} @@ -280,7 +280,7 @@ void SystemCoreClockUpdate (void) /* Get PLL clock source and multiplication factor ----------------------*/ pllmul = RCC->CFGR & RCC_CFGR_PLLMUL; plldiv = RCC->CFGR & RCC_CFGR_PLLDIV; - pllmul = PLLMulTable[(pllmul >> 18)]; + pllmul = PLLMulTable_2[(pllmul >> 18)]; plldiv = (plldiv >> 22) + 1; pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/PeripheralPins.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/PeripheralPins.h index cc2fcaaf114..66638c1c48b 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/PeripheralPins.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/PeripheralPins.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralNames.h index 6b544f15727..f6add44db2f 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralPins.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralPins.c index c4bfc9dd21c..4c587655d72 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralPins.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralPins.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,29 +39,23 @@ //*** ADC *** const PinMap PinMap_ADC[] = { - {PA_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN0 - {PA_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN1 - {PA_2, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN2 - {PA_3, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN3 - {PA_4, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN4 - {PA_5, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN5 - {PA_6, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN6 - {PA_7, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN7 - {PB_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN8 - {PB_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN9 - {PC_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN10 - {PC_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN11 - {PC_2, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN12 - {PC_3, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN13 - {PC_4, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN14 - {PC_5, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN15 + {PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 {NC, NC, 0} }; //*** DAC *** const PinMap PinMap_DAC[] = { - {PA_4, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT + {PA_4, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // DAC_OUT {NC, NC, 0} }; @@ -87,25 +81,23 @@ const PinMap PinMap_I2C_SCL[] = { // TIM21 cannot be used because already used by the us_ticker const PinMap PinMap_PWM[] = { - {PA_0, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH1 - {PA_1, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH2 -// {PA_2, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21)}, // TIM21_CH1 -// {PA_2, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH3 - used by STDIO TX -// {PA_3, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21)}, // TIM21_CH2 -// {PA_3, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH4 - used by STDIO RX - {PA_5, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2)}, // TIM2_CH1 - used also to drive the LED - {PA_6, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22)}, // TIM22_CH1 - {PA_7, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22)}, // TIM22_CH2 - {PA_15, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2)}, // TIM2_CH1 - {PB_3, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH2 - {PB_4, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22)}, // TIM22_CH1 - {PB_5, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22)}, // TIM22_CH2 - {PB_10, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH3 - {PB_11, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH4 -// {PB_13, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21)}, // TIM21_CH1 -// {PB_14, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21)}, // TIM21_CH2 - {PC_6, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22)}, // TIM22_CH1 - {PC_7, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22)}, // TIM22_CH2 +// {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1 - Warning: user_button is on this pin + {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PA_2, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1 +// {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 - used by STDIO TX +// {PA_3, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2 +// {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 - used by STDIO RX + {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 - used also to drive the LED + {PA_6, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1 + {PA_7, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2 + {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 + {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1 + {PB_5, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2 + {PB_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PB_13, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 1, 0)}, // TIM21_CH1 +// {PB_14, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 2, 0)}, // TIM21_CH2 {NC, NC, 0} }; @@ -117,8 +109,6 @@ const PinMap PinMap_UART_TX[] = { {PA_14, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, // Warning: this pin is used by SWCLK {PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, {PB_10, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, - {PC_4, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)}, - {PC_10, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_LPUART1)}, {NC, NC, 0} }; @@ -128,8 +118,6 @@ const PinMap PinMap_UART_RX[] = { {PA_15, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, {PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, {PB_11, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, - {PC_5, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)}, - {PC_11, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_LPUART1)}, {NC, NC, 0} }; @@ -140,7 +128,6 @@ const PinMap PinMap_SPI_MOSI[] = { {PA_12, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_15, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)}, - {PC_3, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_SPI2)}, {NC, NC, 0} }; @@ -149,7 +136,6 @@ const PinMap PinMap_SPI_MISO[] = { {PA_11, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_14, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)}, - {PC_2, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_SPI2)}, {NC, NC, 0} }; diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PinNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PinNames.h index 26f0526f9ca..66022071f94 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PinNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PinNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,11 +36,22 @@ extern "C" { #endif -// See stm32l0xx_hal_gpio.h and stm32l0xx_hal_gpio_ex.h for values of MODE, PUPD and AFNUM -#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM) << 7) | ((PUPD) << 4) | ((MODE) << 0))) -#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) -#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) -#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) +#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE & 0x0F) << 0) |\ + ((PUPD & 0x07) << 4) |\ + ((AFNUM & 0x0F) << 7))) + +#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((MODE & 0x0F) << 0) |\ + ((PUPD & 0x07) << 4) |\ + ((AFNUM & 0x0F) << 7) |\ + ((CHANNEL & 0x0F) << 11) |\ + ((INVERTED & 0x01) << 15))) + +#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) +#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) +#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) +#define STM_PIN_CHANNEL(X) (((X) >> 11) & 0x0F) +#define STM_PIN_INVERTED(X) (((X) >> 15) & 0x01) + #define STM_MODE_INPUT (0) #define STM_MODE_OUTPUT_PP (1) #define STM_MODE_OUTPUT_OD (2) @@ -100,49 +111,36 @@ typedef enum { PB_14 = 0x1E, PB_15 = 0x1F, - PC_0 = 0x20, - PC_1 = 0x21, - PC_2 = 0x22, - PC_3 = 0x23, - PC_4 = 0x24, - PC_5 = 0x25, - PC_6 = 0x26, - PC_7 = 0x27, - PC_8 = 0x28, - PC_9 = 0x29, - PC_10 = 0x2A, - PC_11 = 0x2B, - PC_12 = 0x2C, PC_13 = 0x2D, PC_14 = 0x2E, PC_15 = 0x2F, - PD_2 = 0x32, - PH_0 = 0x70, PH_1 = 0x71, // Arduino connector namings - A0 = PA_0, - A1 = PA_1, - A2 = PA_4, - A3 = PB_0, - A4 = PC_1, - A5 = PC_0, - D0 = PA_3, - D1 = PA_2, - D2 = PA_10, - D3 = PB_3, - D4 = PB_5, - D5 = PB_4, - D6 = PB_10, - D7 = PA_8, - D8 = PA_9, - D9 = PC_7, - D10 = PB_6, - D11 = PA_7, - D12 = PA_6, - D13 = PA_5, + // Note: The Arduino connector is not present on this board. + // We keep these definitions for compatibility with Nucleo code examples. + A0 = PA_1, + A1 = PA_2, + A2 = PA_3, + A3 = PA_4, + A4 = PB_0, + A5 = PB_1, + D0 = PA_10, + D1 = PA_9, + D2 = PA_8, + D3 = PA_6, + D4 = PA_13, + D5 = PA_7, + D6 = PB_11, + D7 = PC_13, + D8 = PC_14, + D9 = PA_15, + D10 = PA_5, + D11 = PB_15, + D12 = PB_14, + D13 = PB_13, D14 = PB_9, D15 = PB_8, @@ -158,11 +156,11 @@ typedef enum { USBRX = PA_10, I2C_SCL = PB_8, I2C_SDA = PB_9, - SPI_MOSI = PB_14, - SPI_MISO = PB_15, + SPI_MOSI = PB_15, + SPI_MISO = PB_14, SPI_SCK = PB_13, SPI_CS = PB_12, - PWM_OUT = PB_3, + PWM_OUT = PB_11, // Not connected NC = (int)0xFFFFFFFF diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PortNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PortNames.h index 14295a0b4d8..2496b994c75 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PortNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PortNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device.h index fd151e35667..f842633cf8c 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/objects.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/objects.h index cb558809180..0ffa12d50a4 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/objects.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/objects.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,11 +57,13 @@ struct port_s { struct analogin_s { ADCName adc; PinName pin; + uint32_t channel; }; struct dac_s { DACName dac; PinName pin; + uint32_t channel; }; struct serial_s { @@ -98,6 +100,8 @@ struct pwmout_s { PinName pin; uint32_t period; uint32_t pulse; + uint32_t channel; + uint32_t inverted; }; #include "gpio_object.h" diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/rtc_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/rtc_api.c index 4395fcd9f0f..f24c77d17ed 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/rtc_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/rtc_api.c @@ -69,7 +69,7 @@ void rtc_init(void) RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured! RCC_OscInitStruct.LSEState = RCC_LSE_ON; // External 32.768 kHz clock on OSC_IN/OSC_OUT -#ifndef DONT_USE_LSE +#ifndef DONT_USE_LSE if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK) { // Connect LSE to RTC __HAL_RCC_RTC_CLKPRESCALER(RCC_RTCCLKSOURCE_LSE); @@ -90,7 +90,7 @@ void rtc_init(void) __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); // This value is LSI typical value. To be measured precisely using a timer input capture for example. rtc_freq = 37000; -#ifndef DONT_USE_LSE +#ifndef DONT_USE_LSE } #endif diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralNames.h index 2a26ecb4496..0d54dc17618 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralPins.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralPins.c index c4bfc9dd21c..c75a350cb1c 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralPins.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralPins.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,29 +39,29 @@ //*** ADC *** const PinMap PinMap_ADC[] = { - {PA_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN0 - {PA_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN1 - {PA_2, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN2 - {PA_3, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN3 - {PA_4, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN4 - {PA_5, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN5 - {PA_6, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN6 - {PA_7, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN7 - {PB_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN8 - {PB_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN9 - {PC_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN10 - {PC_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN11 - {PC_2, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN12 - {PC_3, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN13 - {PC_4, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN14 - {PC_5, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN15 + {PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + {PC_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + {PC_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 + {PC_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + {PC_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + {PC_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + {PC_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 {NC, NC, 0} }; //*** DAC *** const PinMap PinMap_DAC[] = { - {PA_4, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT + {PA_4, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // DAC_OUT {NC, NC, 0} }; @@ -87,25 +87,25 @@ const PinMap PinMap_I2C_SCL[] = { // TIM21 cannot be used because already used by the us_ticker const PinMap PinMap_PWM[] = { - {PA_0, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH1 - {PA_1, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH2 -// {PA_2, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21)}, // TIM21_CH1 -// {PA_2, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH3 - used by STDIO TX -// {PA_3, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21)}, // TIM21_CH2 -// {PA_3, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH4 - used by STDIO RX - {PA_5, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2)}, // TIM2_CH1 - used also to drive the LED - {PA_6, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22)}, // TIM22_CH1 - {PA_7, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22)}, // TIM22_CH2 - {PA_15, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2)}, // TIM2_CH1 - {PB_3, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH2 - {PB_4, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22)}, // TIM22_CH1 - {PB_5, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22)}, // TIM22_CH2 - {PB_10, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH3 - {PB_11, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH4 -// {PB_13, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21)}, // TIM21_CH1 -// {PB_14, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21)}, // TIM21_CH2 - {PC_6, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22)}, // TIM22_CH1 - {PC_7, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22)}, // TIM22_CH2 + {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1 + {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PA_2, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1 +// {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 - used by STDIO TX +// {PA_3, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2 +// {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 - used by STDIO RX + {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 - used also to drive the LED + {PA_6, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1 + {PA_7, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2 + {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 + {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1 + {PB_5, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2 + {PB_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PB_13, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 1, 0)}, // TIM21_CH1 +// {PB_14, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 2, 0)}, // TIM21_CH2 + {PC_6, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22, 1, 0)}, // TIM22_CH1 + {PC_7, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22, 2, 0)}, // TIM22_CH2 {NC, NC, 0} }; diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PinNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PinNames.h index d967f7f33ed..4467a6699d4 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PinNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PinNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,11 +36,22 @@ extern "C" { #endif -// See stm32l0xx_hal_gpio.h and stm32l0xx_hal_gpio_ex.h for values of MODE, PUPD and AFNUM -#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM) << 7) | ((PUPD) << 4) | ((MODE) << 0))) -#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) -#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) -#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) +#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE & 0x0F) << 0) |\ + ((PUPD & 0x07) << 4) |\ + ((AFNUM & 0x0F) << 7))) + +#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((MODE & 0x0F) << 0) |\ + ((PUPD & 0x07) << 4) |\ + ((AFNUM & 0x0F) << 7) |\ + ((CHANNEL & 0x0F) << 11) |\ + ((INVERTED & 0x01) << 15))) + +#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) +#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) +#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) +#define STM_PIN_CHANNEL(X) (((X) >> 11) & 0x0F) +#define STM_PIN_INVERTED(X) (((X) >> 15) & 0x01) + #define STM_MODE_INPUT (0) #define STM_MODE_OUTPUT_PP (1) #define STM_MODE_OUTPUT_OD (2) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PortNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PortNames.h index 14295a0b4d8..2496b994c75 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PortNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PortNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device.h index fd151e35667..f842633cf8c 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/objects.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/objects.h index cb558809180..0ffa12d50a4 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/objects.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/objects.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,11 +57,13 @@ struct port_s { struct analogin_s { ADCName adc; PinName pin; + uint32_t channel; }; struct dac_s { DACName dac; PinName pin; + uint32_t channel; }; struct serial_s { @@ -98,6 +100,8 @@ struct pwmout_s { PinName pin; uint32_t period; uint32_t pulse; + uint32_t channel; + uint32_t inverted; }; #include "gpio_object.h" diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralNames.h index 0a8c7c1f2df..d2038526218 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralPins.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralPins.c index d9779d2a05e..106a9489c61 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralPins.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralPins.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,30 +39,30 @@ //*** ADC *** const PinMap PinMap_ADC[] = { - {PA_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN0 - {PA_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN1 - {PA_2, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN2 - {PA_3, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN3 - {PA_4, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN4 - {PA_5, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN5 - {PA_6, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN6 - {PA_7, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN7 - {PB_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN8 - {PB_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN9 - {PC_0, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN10 - {PC_1, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN11 - {PC_2, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN12 - {PC_3, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN13 - {PC_4, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN14 - {PC_5, ADC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // ADC1_IN15 + {PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + {PC_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + {PC_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 + {PC_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + {PC_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + {PC_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + {PC_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 {NC, NC, 0} }; //*** DAC *** const PinMap PinMap_DAC[] = { - {PA_4, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT1 - {PA_5, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT2 + {PA_4, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 {NC, NC, 0} }; @@ -97,35 +97,35 @@ const PinMap PinMap_I2C_SCL[] = { // TIM21 cannot be used because already used by the us_ticker const PinMap PinMap_PWM[] = { - {PA_0, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH1 - {PA_1, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH2 -// {PA_2, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21)}, // TIM21_CH1 -// {PA_2, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH3 - used by STDIO TX -// {PA_3, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21)}, // TIM21_CH2 -// {PA_3, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH4 - used by STDIO RX - {PA_5, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2)}, // TIM2_CH1 - used also to drive the LED - {PA_6, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22)}, // TIM22_CH1 -// {PA_6, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH1 - {PA_7, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22)}, // TIM22_CH2 -// {PA_7, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH2 - {PA_15, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2)}, // TIM2_CH1 - {PB_0, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH3 - {PB_1, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH4 - {PB_3, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH2 - {PB_4, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22)}, // TIM22_CH1 -// {PB_4, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH1 - {PB_5, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22)}, // TIM22_CH2 -// {PB_5, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH2 - {PB_10, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH3 - {PB_11, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2)}, // TIM2_CH4 -// {PB_13, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21)}, // TIM21_CH1 -// {PB_14, PWM_21, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21)}, // TIM21_CH2 - {PC_6, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22)}, // TIM22_CH1 -// {PC_6, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH1 - {PC_7, PWM_22, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22)}, // TIM22_CH2 -// {PC_7, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH2 - {PC_8, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH3 - {PC_9, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH4 + {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1 + {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PA_2, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1 +// {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 - used by STDIO TX +// {PA_3, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2 +// {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 - used by STDIO RX + {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 - used also to drive the LED + {PA_6, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1 +// {PA_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PA_7, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2 +// {PA_7, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 + {PB_0, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PB_1, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1 +// {PB_4, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PB_5, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2 +// {PB_5, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PB_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PB_13, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 1, 0)}, // TIM21_CH1 +// {PB_14, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 2, 0)}, // TIM21_CH2 + {PC_6, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22, 1, 0)}, // TIM22_CH1 +// {PC_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PC_7, PWM_22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM22, 2, 0)}, // TIM22_CH2 +// {PC_7, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PC_8, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PC_9, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 {NC, NC, 0} }; diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h index d967f7f33ed..4467a6699d4 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,11 +36,22 @@ extern "C" { #endif -// See stm32l0xx_hal_gpio.h and stm32l0xx_hal_gpio_ex.h for values of MODE, PUPD and AFNUM -#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM) << 7) | ((PUPD) << 4) | ((MODE) << 0))) -#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) -#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) -#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) +#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE & 0x0F) << 0) |\ + ((PUPD & 0x07) << 4) |\ + ((AFNUM & 0x0F) << 7))) + +#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((MODE & 0x0F) << 0) |\ + ((PUPD & 0x07) << 4) |\ + ((AFNUM & 0x0F) << 7) |\ + ((CHANNEL & 0x0F) << 11) |\ + ((INVERTED & 0x01) << 15))) + +#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) +#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) +#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) +#define STM_PIN_CHANNEL(X) (((X) >> 11) & 0x0F) +#define STM_PIN_INVERTED(X) (((X) >> 15) & 0x01) + #define STM_MODE_INPUT (0) #define STM_MODE_OUTPUT_PP (1) #define STM_MODE_OUTPUT_OD (2) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PortNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PortNames.h index 14295a0b4d8..2496b994c75 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PortNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PortNames.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device.h index fd151e35667..f842633cf8c 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/objects.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/objects.h index cb558809180..0ffa12d50a4 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/objects.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/objects.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,11 +57,13 @@ struct port_s { struct analogin_s { ADCName adc; PinName pin; + uint32_t channel; }; struct dac_s { DACName dac; PinName pin; + uint32_t channel; }; struct serial_s { @@ -98,6 +100,8 @@ struct pwmout_s { PinName pin; uint32_t period; uint32_t pulse; + uint32_t channel; + uint32_t inverted; }; #include "gpio_object.h" diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogin_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogin_api.c index 7af8188b0f9..80b24ddcc7a 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogin_api.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,7 @@ #include "wait_api.h" #include "cmsis.h" #include "pinmap.h" +#include "mbed_error.h" #include "PeripheralPins.h" ADC_HandleTypeDef AdcHandle; @@ -45,6 +46,11 @@ void analogin_init(analogin_t *obj, PinName pin) obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC); MBED_ASSERT(obj->adc != (ADCName)NC); + // Get the pin function and assign the used channel to the object + uint32_t function = pinmap_function(pin, PinMap_ADC); + MBED_ASSERT(function != (uint32_t)NC); + obj->channel = STM_PIN_CHANNEL(function); + // Configure GPIO pinmap_pinout(pin, PinMap_ADC); @@ -77,7 +83,10 @@ void analogin_init(analogin_t *obj, PinName pin) AdcHandle.Init.LowPowerAutoWait = ENABLE; AdcHandle.Init.LowPowerFrequencyMode = DISABLE; // To be enabled only if ADC clock < 2.8 MHz AdcHandle.Init.LowPowerAutoPowerOff = DISABLE; - HAL_ADC_Init(&AdcHandle); + + if (HAL_ADC_Init(&AdcHandle) != HAL_OK) { + error("Cannot initialize ADC"); + } // Calibration HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_SINGLE_ENDED); @@ -88,58 +97,58 @@ void analogin_init(analogin_t *obj, PinName pin) static inline uint16_t adc_read(analogin_t *obj) { - ADC_ChannelConfTypeDef sConfig; + ADC_ChannelConfTypeDef sConfig = {0}; AdcHandle.Instance = (ADC_TypeDef *)(obj->adc); // Configure ADC channel - switch (obj->pin) { - case PA_0: + switch (obj->channel) { + case 0: sConfig.Channel = ADC_CHANNEL_0; break; - case PA_1: + case 1: sConfig.Channel = ADC_CHANNEL_1; break; - case PA_2: + case 2: sConfig.Channel = ADC_CHANNEL_2; break; - case PA_3: + case 3: sConfig.Channel = ADC_CHANNEL_3; break; - case PA_4: + case 4: sConfig.Channel = ADC_CHANNEL_4; break; - case PA_5: + case 5: sConfig.Channel = ADC_CHANNEL_5; break; - case PA_6: + case 6: sConfig.Channel = ADC_CHANNEL_6; break; - case PA_7: + case 7: sConfig.Channel = ADC_CHANNEL_7; break; - case PB_0: + case 8: sConfig.Channel = ADC_CHANNEL_8; break; - case PB_1: + case 9: sConfig.Channel = ADC_CHANNEL_9; break; - case PC_0: + case 10: sConfig.Channel = ADC_CHANNEL_10; break; - case PC_1: + case 11: sConfig.Channel = ADC_CHANNEL_11; break; - case PC_2: + case 12: sConfig.Channel = ADC_CHANNEL_12; break; - case PC_3: + case 13: sConfig.Channel = ADC_CHANNEL_13; break; - case PC_4: + case 14: sConfig.Channel = ADC_CHANNEL_14; break; - case PC_5: + case 15: sConfig.Channel = ADC_CHANNEL_15; break; default: diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogout_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogout_api.c index 001c583d502..ad8987cf3af 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogout_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/analogout_api.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,8 @@ static DAC_HandleTypeDef DacHandle; // These variables are used for the "free" function -static int pa4_used = 0; -static int pa5_used = 0; +static int channel1_used = 0; +static int channel2_used = 0; void analogout_init(dac_t *obj, PinName pin) { @@ -51,6 +51,11 @@ void analogout_init(dac_t *obj, PinName pin) obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC); MBED_ASSERT(obj->dac != (DACName)NC); + // Get the pin function and assign the used channel to the object + uint32_t function = pinmap_function(pin, PinMap_DAC); + MBED_ASSERT(function != (uint32_t)NC); + obj->channel = STM_PIN_CHANNEL(function); + // Configure GPIO pinmap_pinout(pin, PinMap_DAC); @@ -66,17 +71,22 @@ void analogout_init(dac_t *obj, PinName pin) sConfig.DAC_Trigger = DAC_TRIGGER_NONE; sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_DISABLE; - if (pin == PA_4) { - HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DAC_CHANNEL_1); - pa4_used = 1; - } - #if defined(DAC_CHANNEL_2) - if (pin == PA_5) { - HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DAC_CHANNEL_2); - pa5_used = 1; - } + if (obj->channel == 2) { + if (HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DAC_CHANNEL_2) != HAL_OK) { + error("Cannot configure DAC channel 2"); + } + channel2_used = 1; + } else #endif + { + // channel 1 per default + if (HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DAC_CHANNEL_1) != HAL_OK) { + error("Cannot configure DAC channel 1"); + } + obj->channel = 1; + channel1_used = 1; + } analogout_write_u16(obj, 0); } @@ -84,10 +94,10 @@ void analogout_init(dac_t *obj, PinName pin) void analogout_free(dac_t *obj) { // Reset DAC and disable clock - if (obj->pin == PA_4) pa4_used = 0; - if (obj->pin == PA_5) pa5_used = 0; + if (obj->channel == 1) channel1_used = 0; + if (obj->channel == 2) channel2_used = 0; - if ((pa4_used == 0) && (pa5_used == 0)) { + if ((channel1_used == 0) && (channel2_used == 0)) { __DAC_FORCE_RESET(); __DAC_RELEASE_RESET(); __DAC_CLK_DISABLE(); @@ -99,13 +109,12 @@ void analogout_free(dac_t *obj) static inline void dac_write(dac_t *obj, uint16_t value) { - if (obj->pin == PA_4) { + if (obj->channel == 1) { HAL_DAC_SetValue(&DacHandle, DAC_CHANNEL_1, DAC_ALIGN_12B_R, value); HAL_DAC_Start(&DacHandle, DAC_CHANNEL_1); } - #if defined(DAC_CHANNEL_2) - if (obj->pin == PA_5) { + if (obj->channel == 2) { HAL_DAC_SetValue(&DacHandle, DAC_CHANNEL_2, DAC_ALIGN_12B_R, value); HAL_DAC_Start(&DacHandle, DAC_CHANNEL_2); } @@ -114,17 +123,15 @@ static inline void dac_write(dac_t *obj, uint16_t value) static inline int dac_read(dac_t *obj) { - if (obj->pin == PA_4) { + if (obj->channel == 1) { return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1); } #if defined(DAC_CHANNEL_2) - else if (obj->pin == PA_5) { + if (obj->channel == 2) { return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_2); } #endif - else { - return 0; - } + return 0; } void analogout_write(dac_t *obj, float value) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_api.c index c8dd2c0150b..0cb6ca96eb1 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_irq_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_irq_api.c index 2f08bb55062..1f2a67566e4 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_irq_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_irq_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,8 +76,8 @@ static uint32_t pin_base_nr[16] = { 7, // pin 11 8, // pin 12 9, // pin 13 - 10, // pin 14 - 11 // pin 15 + 10, // pin 14 + 11 // pin 15 }; static gpio_irq_handler irq_handler; diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_object.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_object.h index 684d9687571..e0fb9baaabf 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_object.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/gpio_object.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,7 +64,8 @@ static inline int gpio_read(gpio_t *obj) return ((*obj->reg_in & obj->mask) ? 1 : 0); } -static inline int gpio_is_connected(const gpio_t *obj) { +static inline int gpio_is_connected(const gpio_t *obj) +{ return obj->pin != (PinName)NC; } diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/i2c_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/i2c_api.c index dde40d6e52e..b850fdc5492 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/i2c_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/i2c_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ #include "cmsis.h" #include "pinmap.h" +#include "mbed_error.h" #include "PeripheralPins.h" /* Timeout values for flags and events waiting loops. These timeouts are @@ -135,7 +136,10 @@ void i2c_frequency(i2c_t *obj, int hz) I2cHandle.Init.OwnAddress1 = 0; I2cHandle.Init.OwnAddress2 = 0; I2cHandle.Init.OwnAddress2Masks = I2C_OA2_NOMASK; - HAL_I2C_Init(&I2cHandle); + + if (HAL_I2C_Init(&I2cHandle) != HAL_OK) { + error("Cannot initialize I2C"); + } } inline int i2c_start(i2c_t *obj) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/mbed_overrides.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/mbed_overrides.c index 74ce0cf19de..509fed21988 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/mbed_overrides.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/mbed_overrides.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pinmap.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pinmap.c index 91a3186c75b..55fa610eb44 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pinmap.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pinmap.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,7 @@ #include "mbed_error.h" // GPIO mode look-up table +// Warning: order must be the same as the one defined in PinNames.h !!! static const uint32_t gpio_mode[13] = { 0x00000000, // 0 = GPIO_MODE_INPUT 0x00000001, // 1 = GPIO_MODE_OUTPUT_PP @@ -62,18 +63,24 @@ uint32_t Set_GPIO_Clock(uint32_t port_idx) gpio_add = GPIOB_BASE; __GPIOB_CLK_ENABLE(); break; +#if defined(GPIOC_BASE) case PortC: gpio_add = GPIOC_BASE; __GPIOC_CLK_ENABLE(); break; +#endif +#if defined(GPIOD_BASE) case PortD: gpio_add = GPIOD_BASE; __GPIOD_CLK_ENABLE(); break; +#endif +#if defined(GPIOH_BASE) case PortH: gpio_add = GPIOH_BASE; __GPIOH_CLK_ENABLE(); break; +#endif default: error("Pinmap error: wrong port number."); break; diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/port_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/port_api.c index e9828586653..b8ee1ec927f 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/port_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/port_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pwmout_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pwmout_api.c index a260fa6a555..4bfbaf5ed9f 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pwmout_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/pwmout_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,10 +42,13 @@ void pwmout_init(pwmout_t* obj, PinName pin) { // Get the peripheral name from the pin and assign it to the object obj->pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM); + MBED_ASSERT(obj->pwm != (PWMName)NC); - if (obj->pwm == (PWMName)NC) { - error("PWM error: pinout mapping failed."); - } + // Get the pin function and assign the used channel to the object + uint32_t function = pinmap_function(pin, PinMap_PWM); + MBED_ASSERT(function != (uint32_t)NC); + obj->channel = STM_PIN_CHANNEL(function); + obj->inverted = STM_PIN_INVERTED(function); // Enable TIM clock if (obj->pwm == PWM_2) __TIM2_CLK_ENABLE(); @@ -92,43 +95,27 @@ void pwmout_write(pwmout_t* obj, float value) sConfig.OCPolarity = TIM_OCPOLARITY_HIGH; sConfig.OCFastMode = TIM_OCFAST_ENABLE; - switch (obj->pin) { - // Channels 1 - case PA_0: - case PA_5: - case PA_6: - case PA_15: - case PB_4: - case PC_6: + switch (obj->channel) { + case 1: channel = TIM_CHANNEL_1; break; - // Channels 2 - case PA_1: - case PA_7: - case PB_3: - case PB_5: - case PC_7: + case 2: channel = TIM_CHANNEL_2; break; - // Channels 3 - case PA_2: - case PB_0: - case PB_10: - case PC_8: + case 3: channel = TIM_CHANNEL_3; break; - // Channels 4 - case PA_3: - case PB_1: - case PB_11: - case PC_9: + case 4: channel = TIM_CHANNEL_4; break; default: return; } - HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, channel); + if (HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, channel) != HAL_OK) { + error("Cannot initialize PWM"); + } + HAL_TIM_PWM_Start(&TimHandle, channel); } @@ -163,7 +150,10 @@ void pwmout_period_us(pwmout_t* obj, int us) TimHandle.Init.Prescaler = (uint16_t)(SystemCoreClock / 1000000) - 1; // 1 us tick TimHandle.Init.ClockDivision = 0; TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP; - HAL_TIM_PWM_Init(&TimHandle); + + if (HAL_TIM_PWM_Init(&TimHandle) != HAL_OK) { + error("Cannot initialize PWM"); + } // Set duty cycle again pwmout_write(obj, dc); diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/serial_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/serial_api.c index 9dc817713bd..1d61d80e77b 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/serial_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/serial_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ #include "cmsis.h" #include "pinmap.h" +#include "mbed_error.h" #include #include "PeripheralPins.h" @@ -74,7 +75,9 @@ static void init_uart(serial_t *obj) UartHandle.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_RXOVERRUNDISABLE_INIT; UartHandle.AdvancedInit.OverrunDisable = UART_ADVFEATURE_OVERRUN_DISABLE; - HAL_UART_Init(&UartHandle); + if (HAL_UART_Init(&UartHandle) != HAL_OK) { + error("Cannot initialize UART"); + } } void serial_init(serial_t *obj, PinName tx, PinName rx) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/sleep.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/sleep.c index b2830d17f43..52bb470c651 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/sleep.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/sleep.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/spi_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/spi_api.c index 3bca3770cbb..58d945f623c 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/spi_api.c @@ -1,6 +1,6 @@ /* mbed Microcontroller Library ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +35,7 @@ #include #include "cmsis.h" #include "pinmap.h" +#include "mbed_error.h" #include "PeripheralPins.h" static SPI_HandleTypeDef SpiHandle; @@ -57,7 +58,9 @@ static void init_spi(spi_t *obj) SpiHandle.Init.NSS = obj->nss; SpiHandle.Init.TIMode = SPI_TIMODE_DISABLED; - HAL_SPI_Init(&SpiHandle); + if (HAL_SPI_Init(&SpiHandle) != HAL_OK) { + error("Cannot initialize SPI"); + } __HAL_SPI_ENABLE(&SpiHandle); } @@ -193,6 +196,7 @@ void spi_frequency(spi_t *obj, int hz) } else { // >= 16000000 obj->br_presc = SPI_BAUDRATEPRESCALER_2; // 16 MHz } + init_spi(obj); } diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/us_ticker.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/us_ticker.c index 1443d15edd1..cbaebe3489b 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/us_ticker.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L0/us_ticker.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2014, STMicroelectronics + * Copyright (c) 2015, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/workspace_tools/export/iar.py b/workspace_tools/export/iar.py index 352ec189c1e..540db39c00d 100755 --- a/workspace_tools/export/iar.py +++ b/workspace_tools/export/iar.py @@ -59,6 +59,7 @@ class IAREmbeddedWorkbench(Exporter): 'NUCLEO_L053R8', 'NUCLEO_L073RZ', 'NUCLEO_L152RE', + 'DISCO_L053C8', #'STM32F407', Fails to build same for GCC 'MAXWSNENV', 'MAX32600MBED', diff --git a/workspace_tools/export/iar_disco_l053c8.ewd.tmpl b/workspace_tools/export/iar_disco_l053c8.ewd.tmpl new file mode 100644 index 00000000000..da36da6931e --- /dev/null +++ b/workspace_tools/export/iar_disco_l053c8.ewd.tmpl @@ -0,0 +1,2733 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 5 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Release + + ARM + + 0 + + C-SPY + 2 + + 26 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + IJET_ID + 2 + + 5 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/workspace_tools/export/iar_disco_l053c8.ewp.tmpl b/workspace_tools/export/iar_disco_l053c8.ewp.tmpl new file mode 100644 index 00000000000..c9c4362adaf --- /dev/null +++ b/workspace_tools/export/iar_disco_l053c8.ewp.tmpl @@ -0,0 +1,1899 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 22 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + {{source_files}} + + + diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index 55bc26fec68..c8de414a7dc 100755 --- a/workspace_tools/targets.py +++ b/workspace_tools/targets.py @@ -697,7 +697,7 @@ def __init__(self): Target.__init__(self) self.core = "Cortex-M0+" self.extra_labels = ['STM', 'STM32L0', 'STM32L053C8'] - self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"] + self.supported_toolchains = ["ARM", "uARM", "IAR", "GCC_ARM"] self.default_toolchain = "uARM" class MTS_MDOT_F405RG(Target): From 373e8c40c0c3cf21bb7d40d474784a8e070d7c48 Mon Sep 17 00:00:00 2001 From: Przemek Wirkus Date: Thu, 30 Apr 2015 19:39:30 +0100 Subject: [PATCH 20/24] Fixed test build failure, now BUILD_FAILURE is one of possible results. Added build report after build completion. Fixed result from execute() capture when result is NoneType value --- workspace_tools/test_api.py | 90 ++++++++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 21 deletions(-) diff --git a/workspace_tools/test_api.py b/workspace_tools/test_api.py index bca2da5270a..dfeccb6bfb6 100644 --- a/workspace_tools/test_api.py +++ b/workspace_tools/test_api.py @@ -49,6 +49,7 @@ from workspace_tools.build_api import build_project, build_mbed_libs, build_lib from workspace_tools.build_api import get_target_supported_toolchains from workspace_tools.build_api import write_build_report +from workspace_tools.build_api import print_build_results from workspace_tools.libraries import LIBRARIES, LIBRARY_MAP from workspace_tools.toolchains import TOOLCHAIN_BIN_PATH from workspace_tools.test_exporters import ReportExporter, ResultExporterType @@ -124,6 +125,7 @@ class SingleTestRunner(object): TEST_RESULT_TIMEOUT = "TIMEOUT" TEST_RESULT_NO_IMAGE = "NO_IMAGE" TEST_RESULT_MBED_ASSERT = "MBED_ASSERT" + TEST_RESULT_BUILD_FAILED = "BUILD_FAILED" GLOBAL_LOOPS_COUNT = 1 # How many times each test should be repeated TEST_LOOPS_LIST = [] # We redefine no.of loops per test_id @@ -142,7 +144,8 @@ class SingleTestRunner(object): "timeout" : TEST_RESULT_TIMEOUT, "no_image" : TEST_RESULT_NO_IMAGE, "end" : TEST_RESULT_UNDEF, - "mbed_assert" : TEST_RESULT_MBED_ASSERT + "mbed_assert" : TEST_RESULT_MBED_ASSERT, + "build_failed" : TEST_RESULT_BUILD_FAILED } def __init__(self, @@ -182,6 +185,11 @@ def __init__(self, from colorama import init init() + # Build results + build_failures = [] + build_successes = [] + build_skipped = [] + PATTERN = "\\{(" + "|".join(self.TEST_RESULT_MAPPING.keys()) + ")\\}" self.RE_DETECT_TESTCASE_RESULT = re.compile(PATTERN) # Settings related to test loops counters @@ -299,6 +307,8 @@ def is_shuffle_seed_float(self): def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_report): for toolchain in toolchains: + tt_id = "%s::%s" % (toolchain, target) + # Toolchain specific build successes and failures build_report[toolchain] = { "mbed_failure": False, @@ -310,13 +320,14 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep } # print target, toolchain # Test suite properties returned to external tools like CI - test_suite_properties = {} - test_suite_properties['jobs'] = self.opts_jobs - test_suite_properties['clean'] = clean - test_suite_properties['target'] = target - test_suite_properties['test_ids'] = ', '.join(test_ids) - test_suite_properties['toolchain'] = toolchain - test_suite_properties['shuffle_random_seed'] = self.shuffle_random_seed + test_suite_properties = { + 'jobs': self.opts_jobs, + 'clean': clean, + 'target': target, + 'test_ids': ', '.join(test_ids), + 'toolchain': toolchain, + 'shuffle_random_seed': self.shuffle_random_seed + } # print '=== %s::%s ===' % (target, toolchain) @@ -329,6 +340,7 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep build_mbed_libs_options = ["analyze"] if self.opts_goanna_for_mbed_sdk else None clean_mbed_libs_options = True if self.opts_goanna_for_mbed_sdk or clean or self.opts_clean else None + try: build_mbed_libs_result = build_mbed_libs(T, toolchain, @@ -337,12 +349,15 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep jobs=self.opts_jobs) if not build_mbed_libs_result: + self.build_skipped.append(tt_id) print self.logger.log_line(self.logger.LogType.NOTIF, 'Skipped tests for %s target. Toolchain %s is not yet supported for this target'% (T.name, toolchain)) continue + else: + self.build_successes.append(tt_id) except ToolException: - print self.logger.log_line(self.logger.LogType.ERROR, 'There were errors while building MBED libs for %s using %s'% (target, toolchain)) + self.build_failures.append(tt_id) build_report[toolchain]["mbed_failure"] = True - #return self.test_summary, self.shuffle_random_seed, self.test_summary_ext, self.test_suite_properties_ext + print self.logger.log_line(self.logger.LogType.ERROR, 'There were errors while building MBED libs for %s using %s'% (target, toolchain)) continue build_dir = join(BUILD_DIR, "test", target, toolchain) @@ -415,8 +430,6 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep continue - - for test_id in valid_test_map_keys: test = TEST_MAP[test_id] @@ -437,6 +450,12 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep test_uuid = uuid.uuid4() MACROS.append('TEST_SUITE_UUID="%s"'% str(test_uuid)) + # Prepare extended test results data structure (it can be used to generate detailed test report) + if toolchain not in self.test_summary_ext: + self.test_summary_ext[toolchain] = {} # test_summary_ext : toolchain + if target not in self.test_summary_ext[toolchain]: + self.test_summary_ext[toolchain][target] = {} # test_summary_ext : toolchain : target + project_name = self.opts_firmware_global_name if self.opts_firmware_global_name else None try: path = build_project(test.source_dir, @@ -457,7 +476,25 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep project_name_str = project_name if project_name is not None else test_id print self.logger.log_line(self.logger.LogType.ERROR, 'There were errors while building project %s'% (project_name_str)) build_report[toolchain]["test_build_failing"].append(test_id) - # return self.test_summary, self.shuffle_random_seed, self.test_summary_ext, self.test_suite_properties_ext + + # Append test results to global test summary + self.test_summary.append( + (self.TEST_RESULT_BUILD_FAILED, target, toolchain, test_id, 'Toolchain build failed', 0, 0, '-') + ) + + # Add detailed test result to test summary structure + if target not in self.test_summary_ext[toolchain][target]: + self.test_summary_ext[toolchain][target][test_id] = { 0: { + 'single_test_result' : self.TEST_RESULT_BUILD_FAILED, + 'single_test_output' : '', + 'target_name' : target, + 'toolchain_name' : toolchain, + 'test_id' : test_id, + 'test_description' : 'Toolchain build failed', + 'elapsed_time' : 0, + 'duration' : 0, + 'copy_method' : None + }} continue if self.opts_only_build_tests: @@ -479,17 +516,17 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep test_suite_properties['test.path.%s.%s.%s'% (target, toolchain, test_id)] = path # read MUTs, test specification and perform tests - single_test_result, detailed_test_results = self.handle(test_spec, target, toolchain, test_loops=test_loops) + handle_result = self.handle(test_spec, target, toolchain, test_loops=test_loops) + if handle_result: + single_test_result, detailed_test_results = handle_result + else: + continue # Append test results to global test summary if single_test_result is not None: self.test_summary.append(single_test_result) - # Prepare extended test results data structure (it can be used to generate detailed test report) - if toolchain not in self.test_summary_ext: - self.test_summary_ext[toolchain] = {} # test_summary_ext : toolchain - if target not in self.test_summary_ext[toolchain]: - self.test_summary_ext[toolchain][target] = {} # test_summary_ext : toolchain : target + # Add detailed test result to test summary structure if target not in self.test_summary_ext[toolchain][target]: self.test_summary_ext[toolchain][target][test_id] = detailed_test_results # test_summary_ext : toolchain : target : test_it @@ -511,6 +548,9 @@ def execute(self): self.shuffle_random_seed = round(float(self.opts_shuffle_test_seed), self.SHUFFLE_SEED_ROUND) build_reports = [] + self.build_failures = [] + self.build_successes = [] + self.build_skipped = [] if self.opts_parallel_test_exec: ################################################################### @@ -554,7 +594,6 @@ def execute(self): } for toolchain in sorted(target_build_report["report"], key=target_build_report["report"].get): - print "%s - %s" % (target_build_report["target"], toolchain) report = target_build_report["report"][toolchain] if report["mbed_failure"]: @@ -703,6 +742,7 @@ def generate_test_summary(self, test_summary, shuffle_seed=None): """ Prints well-formed summary with results (SQL table like) table shows target x test results matrix across """ + success_code = 0 # Success code that can be leter returned to result = "Test summary:\n" # Pretty table package is used to print results pt = PrettyTable(["Result", "Target", "Toolchain", "Test ID", "Test Description", @@ -723,7 +763,8 @@ def generate_test_summary(self, test_summary, shuffle_seed=None): self.TEST_RESULT_IOERR_SERIAL : 0, self.TEST_RESULT_NO_IMAGE : 0, self.TEST_RESULT_TIMEOUT : 0, - self.TEST_RESULT_MBED_ASSERT : 0 + self.TEST_RESULT_MBED_ASSERT : 0, + self.TEST_RESULT_BUILD_FAILED : 0 } for test in test_summary: @@ -1413,6 +1454,8 @@ def progress_bar(percent_progress, saturation=0): def singletest_in_cli_mode(single_test): """ Runs SingleTestRunner object in CLI (Command line interface) mode + + @return returns success code (0 == success) for building and running tests """ start = time() # Execute tests depending on options and filter applied @@ -1427,7 +1470,12 @@ def singletest_in_cli_mode(single_test): # prints well-formed summary with results (SQL table like) # table shows text x toolchain test result matrix print single_test.generate_test_summary_by_target(test_summary, shuffle_seed) + print print "Completed in %.2f sec"% (elapsed_time) + print + print print_build_results(single_test.build_successes, "Build successes:"), + print print_build_results(single_test.build_skipped, "Build skipped:"), + print print_build_results(single_test.build_failures, "Build failures:"), # Store extra reports in files if single_test.opts_report_html_file_name: From 9a720be3d4f71c1c71bbba5641d99cf9d1c562db Mon Sep 17 00:00:00 2001 From: Przemek Wirkus Date: Sat, 2 May 2015 23:08:00 +0100 Subject: [PATCH 21/24] Small improvements to reporting build failures --- workspace_tools/build.py | 9 ++++++--- workspace_tools/build_api.py | 2 +- workspace_tools/test_api.py | 17 ++++++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/workspace_tools/build.py b/workspace_tools/build.py index f402cb0222f..98d2fd52dfd 100755 --- a/workspace_tools/build.py +++ b/workspace_tools/build.py @@ -254,9 +254,12 @@ print "Completed in: (%.2f)s" % (time() - start) print - print print_build_results(successes, "Build successes:"), - print print_build_results(skipped, "Build skipped:"), - print print_build_results(failures, "Build failures:"), + for report, report_name in [(successes, "Build successes:"), + (skipped, "Build skipped:"), + (failures, "Build failures:"), + ]: + if report: + print print_build_results(report, report_name), if failures: sys.exit(1) diff --git a/workspace_tools/build_api.py b/workspace_tools/build_api.py index 0acea152cfa..dbcba3c0c8a 100644 --- a/workspace_tools/build_api.py +++ b/workspace_tools/build_api.py @@ -526,7 +526,7 @@ def static_analysis_scan_library(src_paths, build_path, target, toolchain_name, def print_build_results(result_list, build_name): """ Generate result string for build results """ result = "" - if result_list: + if len(result_list) > 0: result += build_name + "\n" result += "\n".join([" * %s" % f for f in result_list]) result += "\n" diff --git a/workspace_tools/test_api.py b/workspace_tools/test_api.py index dfeccb6bfb6..c88134eb28e 100644 --- a/workspace_tools/test_api.py +++ b/workspace_tools/test_api.py @@ -426,7 +426,6 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep print self.logger.log_line(self.logger.LogType.ERROR, 'There were errors while building library %s'% (lib_id)) build_report[toolchain]["library_failure"] = True build_report[toolchain]["library_build_failing"].append(lib_id) - #return self.test_summary, self.shuffle_random_seed, self.test_summary_ext, self.test_suite_properties_ext continue @@ -456,6 +455,8 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep if target not in self.test_summary_ext[toolchain]: self.test_summary_ext[toolchain][target] = {} # test_summary_ext : toolchain : target + tt_test_id = "%s::%s::%s" % (toolchain, target, test_id) # For logging only + project_name = self.opts_firmware_global_name if self.opts_firmware_global_name else None try: path = build_project(test.source_dir, @@ -476,6 +477,7 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep project_name_str = project_name if project_name is not None else test_id print self.logger.log_line(self.logger.LogType.ERROR, 'There were errors while building project %s'% (project_name_str)) build_report[toolchain]["test_build_failing"].append(test_id) + self.build_failures.append(tt_test_id) # Append test results to global test summary self.test_summary.append( @@ -1470,12 +1472,17 @@ def singletest_in_cli_mode(single_test): # prints well-formed summary with results (SQL table like) # table shows text x toolchain test result matrix print single_test.generate_test_summary_by_target(test_summary, shuffle_seed) - print + print "Completed in %.2f sec"% (elapsed_time) print - print print_build_results(single_test.build_successes, "Build successes:"), - print print_build_results(single_test.build_skipped, "Build skipped:"), - print print_build_results(single_test.build_failures, "Build failures:"), + # Write summary of the builds + + for report, report_name in [(single_test.build_successes, "Build successes:"), + (single_test.build_skipped, "Build skipped:"), + (single_test.build_failures, "Build failures:"), + ]: + if report: + print print_build_results(report, report_name) # Store extra reports in files if single_test.opts_report_html_file_name: From fa63b6703f6f25fff2f8eaf65ce4b5eb5e82c9dc Mon Sep 17 00:00:00 2001 From: Sissors Date: Sun, 3 May 2015 17:37:16 +0200 Subject: [PATCH 22/24] [HAL][KSDK] Fix issue with KSDK SPI timing Depending on the format by default the Freescale SPI peripheral does not give proper delay between SPI transfers. So code has been added which sets half a period delay between SPI transfers. --- .../targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c index 0826cd43db1..ebdec55e764 100644 --- a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c @@ -91,6 +91,7 @@ void spi_frequency(spi_t *obj, int hz) { CLOCK_SYS_GetFreq(kBusClock, &busClock); uint32_t spi_address[] = SPI_BASE_ADDRS; DSPI_HAL_SetBaudRate(spi_address[obj->instance], kDspiCtar0, (uint32_t)hz, busClock); + DSPI_HAL_CalculateDelay(spi_address[obj->instance], kDspiCtar0, kDspiAfterTransfer, busClock, 500000000 / hz); //Half clock period delay after SPI transfer } static inline int spi_writeable(spi_t * obj) { From 9f16e756872497671b34765e0e4ef70ecaafc8b2 Mon Sep 17 00:00:00 2001 From: Sissors Date: Sun, 3 May 2015 21:09:15 +0200 Subject: [PATCH 23/24] [HAL][KSDK] Switched delay type of SPI Even though it does not actually toggle the CS signal, we can also use the delay to CS toggle to get proper waveforms. This also fixes SPI in mode 3. --- .../targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c index ebdec55e764..be59ae21b65 100644 --- a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c @@ -91,7 +91,7 @@ void spi_frequency(spi_t *obj, int hz) { CLOCK_SYS_GetFreq(kBusClock, &busClock); uint32_t spi_address[] = SPI_BASE_ADDRS; DSPI_HAL_SetBaudRate(spi_address[obj->instance], kDspiCtar0, (uint32_t)hz, busClock); - DSPI_HAL_CalculateDelay(spi_address[obj->instance], kDspiCtar0, kDspiAfterTransfer, busClock, 500000000 / hz); //Half clock period delay after SPI transfer + DSPI_HAL_CalculateDelay(spi_address[obj->instance], kDspiCtar0, kDspiLastSckToPcs, busClock, 500000000 / hz); //Half clock period delay after SPI transfer } static inline int spi_writeable(spi_t * obj) { From a73ee5c3d67b5ba2a788c5d8294ace7519659867 Mon Sep 17 00:00:00 2001 From: raulMrello Date: Mon, 4 May 2015 09:35:58 +0200 Subject: [PATCH 24/24] Updated Thread.cpp|.h to support signal clear --- libraries/rtos/rtos/Thread.cpp | 4 ++++ libraries/rtos/rtos/Thread.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/libraries/rtos/rtos/Thread.cpp b/libraries/rtos/rtos/Thread.cpp index 035dc97bf32..181fbd297db 100644 --- a/libraries/rtos/rtos/Thread.cpp +++ b/libraries/rtos/rtos/Thread.cpp @@ -62,6 +62,10 @@ int32_t Thread::signal_set(int32_t signals) { return osSignalSet(_tid, signals); } +int32_t Thread::signal_clr(int32_t signals) { + return osSignalClear(_tid, signals); +} + Thread::State Thread::get_state() { #ifndef __MBED_CMSIS_RTOS_CA9 return ((State)_thread_def.tcb.state); diff --git a/libraries/rtos/rtos/Thread.h b/libraries/rtos/rtos/Thread.h index a8911e966b9..89334db706c 100644 --- a/libraries/rtos/rtos/Thread.h +++ b/libraries/rtos/rtos/Thread.h @@ -64,6 +64,12 @@ class Thread { */ int32_t signal_set(int32_t signals); + /** Clears the specified Signal Flags of an active thread. + @param signals specifies the signal flags of the thread that should be cleared. + @return resultant signal flags of the specified thread or 0x80000000 in case of incorrect parameters. + */ + int32_t signal_clr(int32_t signals); + /** State of the Thread */ enum State { Inactive, /**< Not created or terminated */