[lightning-ln882h] Add support for Lightning LN882H family (#312)
* fix mbedtls bad pointer in function call (prototype mismatch) * fix issue with weak families functions implemented in static library, it will never be linked. fixed by redefining prototypes inside families * [ln882x] add support for lightning ln882x & ln882h families * add i2c (wire) support * add analog (adc) support * add watchdog support * [ln882x] changed default uart 0/1 pins; added board wl2s * [ln882x] fix IRQ & ADC pins * [ln882x] boards cosmetic * [ln882x] wifi sta use otp mac addr by default; re-enabled wifi powersave mode * [ln882x] clang-format clean code * [ln882x] clang-format clean code * Update families.json * Apply suggestions from code review * [ln882x] reformat json board files * [ln882x] os_queue cleanup * [ln882x] removed Beken auto-download command * [ln882x] removed personal script file * [ln882x] removed unusefull pi section in debugging.md * [ln882x] removed Arduino.h and changed private I2C definition * [ln882x] updated README.md * [ln882x] changed pin naming scheme to PA/PB * [ln882x] clean code * [ln882x] clean code * [ln882x] add ota image verification * Update push-dev.yml * [ln882x] fix boards ADC missing inputs] * [ln882x] removed reg_xxx fixup files and use include guards instead * [ln882x] cleanup code * [ln882x] cleanup code * [ln882x] fix lt_init weak functions linking * [ln882x] revert lt_api.h modification, fixed with previous commit * [ln882x] setup UF2 firmware for flasher with partitions * [ln882x] update README.md * [ln882x] include ln_wifi.h and ln_serial.h to avoid including bad headers on case insensitive systems * [ln882x] Replace RingBuffer by SerialRingBuffer * [ln882x] clang-format * [ln882x] update README.md * Apply suggestions from code review * Reformat board JSON files * Add mkdocs link redirect * Update ltchiptool to v4.12.0 --------- Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
This commit is contained in:
31
cores/lightning-ln882h/base/config/lwipopts.h
Normal file
31
cores/lightning-ln882h/base/config/lwipopts.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright (c) Etienne Le Cousin 2024-03-10. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include_next "lwipopts.h"
|
||||
|
||||
#if (!defined(LWIP_IPV4) || LWIP_IPV4) && !LWIP_IPV6
|
||||
#define ip_addr ip4_addr // LwIP 2.0.x compatibility
|
||||
#define ip_addr_t ip4_addr_t // LwIP 2.0.x compatibility
|
||||
#endif
|
||||
#if !LWIP_IPV4 && LWIP_IPV6
|
||||
#define ip_addr ip6_addr // LwIP 2.0.x compatibility
|
||||
#define ip_addr_t ip6_addr_t // LwIP 2.0.x compatibility
|
||||
#endif
|
||||
#define in_addr_t u32_t
|
||||
#define IN_ADDR_T_DEFINED 1
|
||||
|
||||
#ifndef INT_MAX
|
||||
#define INT_MAX 2147483647 // for RECV_BUFSIZE_DEFAULT
|
||||
#endif
|
||||
|
||||
#define LWIP_NUM_NETIF_CLIENT_DATA 1
|
||||
#define LWIP_NETIF_EXT_STATUS_CALLBACK 1
|
||||
#undef MEMP_NUM_UDP_PCB
|
||||
#define MEMP_NUM_UDP_PCB 7
|
||||
|
||||
// LWIP_COMPAT_MUTEX cannot prevent priority inversion. It is recommended to implement priority-aware mutexes. (Define
|
||||
// LWIP_COMPAT_MUTEX_ALLOWED to disable this error.)
|
||||
#define LWIP_COMPAT_MUTEX_ALLOWED 1
|
||||
|
||||
#define LWIP_TCPIP_TIMEOUT 1
|
||||
82
cores/lightning-ln882h/base/config/proj_config.h
Normal file
82
cores/lightning-ln882h/base/config/proj_config.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#ifndef _PROJ_CONFIG_H_
|
||||
#define _PROJ_CONFIG_H_
|
||||
|
||||
#define DISABLE (0)
|
||||
#define ENABLE (1)
|
||||
|
||||
#define __CONFIG_OS_KERNEL RTOS_FREERTOS
|
||||
|
||||
/*
|
||||
* Clock settings section
|
||||
* Note:
|
||||
*
|
||||
*/
|
||||
#define XTAL_CLOCK (40000000)
|
||||
#define RCO_CLOCK (32000)
|
||||
#define PLL_CLOCK (160000000)
|
||||
|
||||
// TODO: SystemCoreClock
|
||||
#define SYSTEM_CLOCK (160000000)
|
||||
|
||||
/*
|
||||
* Module enable/disable control
|
||||
*/
|
||||
#define FLASH_XIP ENABLE
|
||||
#define LN_ASSERT_EN ENABLE
|
||||
#define HAL_ASSERT_EN ENABLE
|
||||
#define PRINTF_OMIT DISABLE // when release software, set 1 to omit all printf logs
|
||||
#define OS_TICK_COMPENSATE
|
||||
|
||||
// Check big and endian mode
|
||||
#if defined(__CC_ARM)
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#error "Please set the compiler to little-endian mode"
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#if (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
|
||||
#error "Please set the compiler to little-endian mode"
|
||||
#endif // __BYTE_ORDER__
|
||||
#else
|
||||
#error "Unsupported compiler"
|
||||
#endif
|
||||
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
/*
|
||||
* flash image settings
|
||||
*/
|
||||
#define FLASH_IMAGE_VER_MAJOR 0
|
||||
#define FLASH_IMAGE_VER_MINOR 1
|
||||
#define SOC_CRP_FLAG 0
|
||||
|
||||
/*
|
||||
* Hardware config
|
||||
*/
|
||||
#define CFG_UART0_TX_BUF_SIZE 256
|
||||
#define CFG_UART0_RX_BUF_SIZE 256
|
||||
#define CFG_UART1_TX_BUF_SIZE 128
|
||||
#define CFG_UART1_RX_BUF_SIZE 256
|
||||
#define CFG_UART2_TX_BUF_SIZE 128
|
||||
#define CFG_UART2_RX_BUF_SIZE 256
|
||||
|
||||
#define CFG_UART_BAUDRATE_LOG 115200
|
||||
#define CFG_UART_BAUDRATE_CONSOLE 115200
|
||||
|
||||
/*
|
||||
* FreeRTOS config
|
||||
*/
|
||||
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)(160 * 1024))
|
||||
|
||||
/*
|
||||
* log
|
||||
*/
|
||||
#ifndef __cplusplus
|
||||
#define hexdump ln_hexdump
|
||||
#endif // __cplusplus
|
||||
|
||||
#define mbedtls_platform_set_calloc_free(calloc, free)
|
||||
|
||||
#endif /* _PROJ_CONFIG_H_ */
|
||||
Reference in New Issue
Block a user