|
| 1 | +/** |
| 2 | + * || ____ _ __ |
| 3 | + * +------+ / __ )(_) /_______________ _____ ___ |
| 4 | + * | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ |
| 5 | + * +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ |
| 6 | + * || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ |
| 7 | + * |
| 8 | + * Crazyflie 2.0 NRF Firmware |
| 9 | + * Copyright (c) 2024, Bitcraze AB, All rights reserved. |
| 10 | + * |
| 11 | + * This library is free software; you can redistribute it and/or |
| 12 | + * modify it under the terms of the GNU Lesser General Public |
| 13 | + * License as published by the Free Software Foundation; either |
| 14 | + * version 3.0 of the License, or (at your option) any later version. |
| 15 | + * |
| 16 | + * This library is distributed in the hope that it will be useful, |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | + * Lesser General Public License for more details. |
| 20 | + * |
| 21 | + * You should have received a copy of the GNU Lesser General Public |
| 22 | + * License along with this library. |
| 23 | + */ |
| 24 | +#pragma once |
| 25 | + |
| 26 | +#include <stdint.h> |
| 27 | +#include <stdbool.h> |
| 28 | + |
| 29 | +#define PLATFORM_DEVICE_DATA_FLASH_POS 0x3FFE0 |
| 30 | +#define PLATFORM_DEVICE_TYPE_STRING_MAX_LEN 33 |
| 31 | +#define PLATFORM_DEVICE_TYPE_MAX_LEN 31 |
| 32 | + |
| 33 | +/** |
| 34 | + * Fetch deviceType string from flash |
| 35 | + * |
| 36 | + * This function defaults to "0;CF20;R=D" if no string is present in the |
| 37 | + * hardware |
| 38 | + * |
| 39 | + * \param [out] deviceTypeString Buffer of at least |
| 40 | + * PLATFORM_DEVICE_TYPE_STRING_MAX_LEN bytes |
| 41 | + * where the platform string will be stored |
| 42 | + */ |
| 43 | +void platformGetDeviceTypeString(char *deviceTypeString); |
| 44 | + |
| 45 | +/** |
| 46 | + * Initialize the platform |
| 47 | + * |
| 48 | + * Initialize the platform discovering capabilities and returns if it has been successful |
| 49 | + * |
| 50 | + * \return 0 in case of success, 1 in case of failure. |
| 51 | + */ |
| 52 | +int platformInit(); |
| 53 | + |
| 54 | +/** |
| 55 | + * Initialize the platform based on device type |
| 56 | + * |
| 57 | + * Generic initialization based on device type |
| 58 | + * |
| 59 | + * \return 0 in case of success, 1 in case of failure. |
| 60 | + */ |
| 61 | +int platformInitByDeviceType(); |
| 62 | + |
| 63 | +// ************** Capabilities functions ************** |
| 64 | +// The following functions can be implemented by different platform to give |
| 65 | +// access to the current device capabilities. Not all platform has to implement |
| 66 | +// all functions |
| 67 | +bool platformHasRfx2411n(); |
0 commit comments