Synchronize changes with Mbed upstream: July 2024 edition (#309)

* remove stdio checks in serial init if no console is available

* STM32WL fix set preamble length to 8

* Add target support for XDOT_MAX32670

* TARGET_STM: only mask CAN rx interrupt after rx interrupt, not all CAN interrupts

* Sleep Radio in between DC scheduled

* Nuvoton HUSBD support endpoint write ZLP

* USBCDC: support ZLP

* Don't overlap STM32 FDCAN RAM sections

* allow to override antenna gain

* TFM: Fix undeclared function tfm_ns_interface_init

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: CAN: Fix filter mask

NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467).
NOTE: NUC472 CAN doesn't support filter.

* NUVOTON: CAN: Fix Rx interrupt doesn't work

Major modifications:
1. Handle Rx interrupt based on Message Object interrupt (CAN_IIDR=0x0001~0x0020) instead of CAN_STATUS.RxOK
2. Also handle Tx interrupt following above for consistency

Other related modifications:
1. Fix signature type error in CAN_CLR_INT_PENDING_BIT()
2. Add CAN_CLR_INT_PENDING_ONLY_BIT() which doesn't clear NewDat flag so that user can fetch received message in thread context

NOTE: This fix only targets CAN (NUC472/M453/M487), not CAN-FD (M467).

* NUVOTON: CAN: Fix Message Object number for Tx and recognition of Rx interrupt

1.  The same Message Object number cannot use for both Tx and Rx simultaneously.
    For Tx, Message Object number 31 is reserved instead of 0.
    For Rx, Message Object numbers 0~30 are used and for filters.
2.  NewDat bit (CAN_IsNewDataReceived()) isn't exclusive to Rx.
    Recognize Rx interrupt by Message Object number other than 31.

NOTE: This fix only targets CAN (NUC472/M453/M487), not CAN-FD (M467).

* NUVOTON: CAN: Fix filter mask being zero

On mask being zero, it means any match, not exact match.

NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467).
NOTE: NUC472 CAN doesn't support filter.

* Allow custom TCXO control parameter

Allow custom TCXO control parameter

* NUVOTON: EMAC: Fix undeclared function mbed_error_printf

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: AnalogIn: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: CAN: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: AnalogOut: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: SPI: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: I2C: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: Serial: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* Add separate flags for I2C slave transfer in progress

Fixes ARMmbed/mbed-os#15498

Adds 2 boolean flags to the STM32 `i2c_s` object
to indicate whether a transfer is in progress,
separate from the existing "transfer pending" flags.

`i2c_slave_write`, `i2c_slave_read` and their associated callbacks
are modified to use these flags in addition to the pending flags.
The original behavior of the pending flags is preserved.

* ESP8266: Fix accessing uninitialized variable

* Added missing delete

* Add ability to change number of status registers for macronix QSPIF devices

* correct scan parameters types

* skip CRC when initializing TDBStore

Problem: The build_ram_table() function of TDBStore loops over every entry, calculates the checksum and compares them to the stored checksum in the entry header to ensure integrity. For larger TDBStores (e.g. 8 MiB or more) in external single-SPI flash devices this check can take very long, thus rendering it unusable in some cases.

Solution: The suggested solution skips the time consuming CRC of the data. After reading the key and calculating its CRC, it sets next_offset to the beginning of the next entry, thereby skipping the data. While this skips the integrity check, it significantly reduces the initial building of the RAM table.

The data CRC can be enabled or disabled with a compiler flag.

Contribution is provided on behalf of BIOTRONIK.

* Added missing check for replay protection pointer before allocating new variable

Problem: If a key with write-once flag is being set in a SecureStore without rollback-protection store (i.e. _rbp_kv == NULL), additional memory will be allocated for the variable _ih->key. The memory will not be deleted, though, as the delete in line 434 only happens if a rollback-protection store exists (i.e. _rbp_kv != NULL)

Solution: Only allocate the memory if _rbp_kv != NULL

Contribution is provided on behalf of BIOTRONIK.

* Increase AT timeout to 10s in AT_CellularSMS::send_sms

For some devices sending can be slow (as an example see SIM800, it can be up to 60s), command is being run properly but default timeout is returning an invalid error.
See https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf

* Increase AT timeout to 10s in AT_CellularSMS::get_sms

When SMS list is big and baudrate is not fast enough, with default timeout we can suffer from timeout error while getting a sms because method is parsing the full list and this takes long.

* Fix AT_CellularSMS::list_messages breaking in text mode when CRLF is contained in SMS payload text

When parsing SMS, it can happen that we receive CRLF in the SMS payload (happened to me when receiving provider texts).
As an example, we can receive:

"""
Hello <CR><LF>
World!
"""

With previous implementation, second consume_to_stop_tag was stopping in <CR><LF> and rest of the code was failing for obvious reasons.
With this commit we consume the full payload as bytes.

* Add missing SPDX identifier to a bajillion Nuvoton source files + some others

* More license fixes, upgrade M451 legacy PinNames.h, add MCU description

* Fix some more legacy pin names

---------

Co-authored-by: Jost, Chris <79271064+chrJost@users.noreply.github.com>
Co-authored-by: Charles <hallard04@free.fr>
Co-authored-by: Leon Lindenfelser <llindenfelser@multitech.com>
Co-authored-by: Pavel Sorejs <sorejs@gmail.com>
Co-authored-by: cyliang tw <cyliang@nuvoton.com>
Co-authored-by: jmcloud <jmcloud@tesla.com>
Co-authored-by: Chun-Chieh Li <ccli8@nuvoton.com>
Co-authored-by: Adam Gausmann <adamg@esdemc.com>
Co-authored-by: Mingjie Shen <shen497@purdue.edu>
Co-authored-by: Matthias Goebel <matthias.goebel@biotronik.com>
Co-authored-by: danielzhang <danielzhang@mxic.com.cn>
Co-authored-by: Mathieu Camélique <mathieu.camelique@edu.hefr.ch>
Co-authored-by: David Alonso de la Torre <davidalto97@gmail.com>
pull/15530/head
Jamie Smith 2024-07-21 00:16:51 -07:00 committed by GitHub
parent 6b946d4c4f
commit de0c404983
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
236 changed files with 1204 additions and 170 deletions

View File

@ -82,7 +82,7 @@ public:
/**
* Get the scan interval.
*/
const scan_window_t &getInterval() const
const scan_interval_t &getInterval() const
{
return interval;
}
@ -90,7 +90,7 @@ public:
/**
* Get the scan window.
*/
const scan_interval_t &getWindow() const
const scan_window_t &getWindow() const
{
return window;
}
@ -121,8 +121,8 @@ public:
*/
ScanParameters(
phy_t phy = phy_t::LE_1M,
scan_window_t scan_interval = scan_interval_t::min(),
scan_interval_t scan_window = scan_window_t::min(),
scan_interval_t scan_interval = scan_interval_t::min(),
scan_window_t scan_window = scan_window_t::min(),
bool active_scanning = false,
own_address_type_t own_address_type = own_address_type_t::RANDOM,
scanning_filter_policy_t scanning_filter_policy = scanning_filter_policy_t::NO_FILTER

View File

@ -318,6 +318,13 @@ public:
*/
void skip_param(ssize_t len, uint32_t count);
/** Consumes the given length from the reading buffer even if the stop tag has been found
*
* @param len length to be consumed from reading buffer
* @param count number of parameters to be skipped
*/
void skip_param_bytes(ssize_t len, uint32_t count);
/** Reads given number of bytes from receiving buffer without checking any subparameter delimiters, such as comma.
*
* @param buf output buffer for the read
@ -408,6 +415,12 @@ public:
*/
bool consume_to_stop_tag();
/** Consumes the received content until current stop tag is found even if stop tag has been found previously
*
* @return true if stop tag is found, false otherwise
*/
bool consume_to_stop_tag_even_found();
/** Return the last 3GPP error code.
* @return last 3GPP error code
*/

View File

@ -420,6 +420,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
}
_at.lock();
_at.set_at_timeout(10s);
int write_size = 0;
@ -437,6 +438,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
// sending can be cancelled by giving <ESC> character (IRA 27).
_at.cmd_start(ESC);
_at.cmd_stop();
_at.restore_at_timeout();
_at.unlock();
return write_size;
}
@ -482,6 +484,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
pdu_str = create_pdu(phone_number, message + i * concatenated_sms_length, pdu_len,
sms_count, i + 1, header_len);
if (!pdu_str) {
_at.restore_at_timeout();
_at.unlock();
return NSAPI_ERROR_NO_MEMORY;
}
@ -509,6 +512,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
// sending can be cancelled by giving <ESC> character (IRA 27).
_at.cmd_start(ESC);
_at.cmd_stop();
_at.restore_at_timeout();
_at.unlock();
delete [] pdu_str;
return msg_write_len;
@ -523,6 +527,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
delete [] pdu_str;
remaining_len -= concatenated_sms_length;
if (_at.get_last_error() != NSAPI_ERROR_OK) {
_at.restore_at_timeout();
return _at.unlock_return_error();
}
}
@ -530,6 +535,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
_sms_message_ref_number++;
nsapi_error_t ret = _at.get_last_error();
_at.restore_at_timeout();
_at.unlock();
return (ret == NSAPI_ERROR_OK) ? msg_len : ret;
@ -697,6 +703,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
}
_at.lock();
_at.set_at_timeout(10s);
nsapi_size_or_error_t err = list_messages();
if (err == NSAPI_ERROR_OK) {
@ -710,6 +717,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
*buf_size = info->msg_size;
}
free_linked_list();
_at.restore_at_timeout();
_at.unlock();
return NSAPI_ERROR_PARAMETER;
}
@ -734,6 +742,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
free_linked_list();
_at.restore_at_timeout();
_at.unlock();
// update error only when there really was an error, otherwise we return the length
@ -1027,6 +1036,7 @@ nsapi_error_t AT_CellularSMS::list_messages()
int index = 0;
int length = 0;
char *pdu = NULL;
char buffer[32]; // 32 > SMS_STATUS_SIZE, SMS_MAX_PHONE_NUMBER_SIZE, SMS_MAX_TIME_STAMP_SIZE
_at.resp_start("+CMGL:");
while (_at.info_resp()) {
@ -1049,8 +1059,18 @@ nsapi_error_t AT_CellularSMS::list_messages()
// +CMGL: <index>,<stat>,<oa/da>,[<alpha>],[<scts>][,<tooa/toda>,<length>]<CR><LF><data>[<CR><LF>
// +CMGL: <index>,<stat>,<da/oa>,[<alpha>],[<scts>][,<tooa/toda>,<length>]<CR><LF><data>[...]]
index = _at.read_int();
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
_at.read_string(buffer, SMS_STATUS_SIZE);
_at.read_string(buffer, SMS_MAX_PHONE_NUMBER_SIZE);
_at.skip_param(); // <alpha>
_at.read_string(buffer, SMS_MAX_TIME_STAMP_SIZE);
_at.read_int();
int size = _at.read_int(); // length
_at.consume_to_stop_tag(); // consume until <CR><LF> end of header
if (size > 0) {
// we can not use skip param because we already consumed stop tag
_at.skip_param_bytes(size, 1);
}
_at.consume_to_stop_tag_even_found(); // consume until <CR><LF> -> data
}
if (index >= 0) {

View File

@ -484,6 +484,26 @@ void ATHandler::skip_param(ssize_t len, uint32_t count)
return;
}
void ATHandler::skip_param_bytes(ssize_t len, uint32_t count)
{
if (!ok_to_proceed()) {
return;
}
for (uint32_t i = 0; i < count; i++) {
ssize_t read_len = 0;
while (read_len < len) {
int c = get_char();
if (c == -1) {
set_error(NSAPI_ERROR_DEVICE_ERROR);
return;
}
read_len++;
}
}
return;
}
ssize_t ATHandler::read_bytes(uint8_t *buf, size_t len)
{
if (!ok_to_proceed()) {
@ -1093,6 +1113,26 @@ bool ATHandler::consume_to_stop_tag()
return false;
}
bool ATHandler::consume_to_stop_tag_even_found()
{
if (_error_found) {
return true;
}
if (!_is_fh_usable) {
_last_err = NSAPI_ERROR_BUSY;
return true;
}
if (consume_to_tag((const char *)_stop_tag->tag, true)) {
return true;
}
clear_error();
return false;
}
// consume by size needed?
void ATHandler::resp_stop()

View File

@ -201,6 +201,10 @@ void ATHandler::skip_param(ssize_t len, uint32_t count)
{
}
void ATHandler::skip_param_bytes(ssize_t len, uint32_t count)
{
}
ssize_t ATHandler::read_bytes(uint8_t *buf, size_t len)
{
return ATHandler_stub::ssize_value;
@ -301,6 +305,11 @@ bool ATHandler::consume_to_stop_tag()
return ATHandler_stub::bool_value;
}
bool ATHandler::consume_to_stop_tag_even_found()
{
return ATHandler_stub::bool_value;
}
void ATHandler::resp_stop()
{
if (ATHandler_stub::resp_stop_success_count > 0) {

View File

@ -155,8 +155,16 @@ TEST_F(TestAT_CellularSMS, test_AT_CellularSMS_get_sms)
ATHandler_stub::resp_info_false_counter = 1;
ATHandler_stub::resp_info_true_counter2 = 2;
ATHandler_stub::int_value = 11;
ATHandler_stub::read_string_index = 4;
ATHandler_stub::read_string_table[4] = "";
ATHandler_stub::read_string_index = (3 * 2) + (2 * 2); // 3 read_string in list_messages + 2 read_string in read_sms_from_index
ATHandler_stub::read_string_table[10] = "";
// list_messages
ATHandler_stub::read_string_table[9] = "1"; // status
ATHandler_stub::read_string_table[8] = "+00611223344"; // phone
ATHandler_stub::read_string_table[7] = "24/12/12,11:15:00+04"; // timestamp
ATHandler_stub::read_string_table[6] = "1"; // status
ATHandler_stub::read_string_table[5] = "+00611223344"; // phone
ATHandler_stub::read_string_table[4] = "24/12/12,11:15:00+04"; // timestamp
// read_sms_from_index
ATHandler_stub::read_string_table[3] = "REC READ";
ATHandler_stub::read_string_table[2] = "09/01/12,11:15:00+04";
ATHandler_stub::read_string_table[1] = "REC READ";

View File

@ -20,6 +20,7 @@
//#include <stdbool.h>
#include "m460_eth.h"
#include "mbed_toolchain.h"
#include "mbed_interface.h"
//#define NU_TRACE
#include "numaker_eth_hal.h"

View File

@ -20,6 +20,7 @@
#include <stdbool.h>
#include "m480_eth.h"
#include "mbed_toolchain.h"
#include "mbed_interface.h"
//#define NU_TRACE
#include "numaker_eth_hal.h"

View File

@ -20,6 +20,7 @@
#include <stdbool.h>
#include "nuc472_eth.h"
#include "mbed_toolchain.h"
#include "mbed_interface.h"
//#define NU_TRACE
#include "numaker_eth_hal.h"

View File

@ -437,7 +437,7 @@ void SX126X_LoRaRadio::cold_start_wakeup()
if (MBED_CONF_SX126X_LORA_DRIVER_XTAL == 0) {
#endif
caliberation_params_t calib_param;
set_dio3_as_tcxo_ctrl(TCXO_CTRL_1_7V, 320); //5 ms
set_dio3_as_tcxo_ctrl(MBED_CONF_SX126X_LORA_DRIVER_TCXO_CTRL, 320); //5 ms
calib_param.value = 0x7F;
write_opmode_command(RADIO_CALIBRATE, &calib_param.value, 1);
}

View File

@ -38,6 +38,10 @@
"help": "Default: -1 = use crystal-select, TXCO = 0, XTAL = 1",
"value": -1
},
"tcxo-ctrl": {
"help": "TCXO Control voltage. Default: TCXO control TCXO_CTRL_1_7V (RAK4630 use TCXO_CTRL_3_0V)",
"value": "TCXO_CTRL_1_7V"
},
"spi-mosi": {
"value": "NC"
},

View File

@ -1190,7 +1190,7 @@ bool ESP8266::get_sntp_config(bool *enable, int *timezone, char *server0,
&tmp, timezone, server0, server1, server2)
&& _parser.recv("OK\n");
_smutex.unlock();
*enable = tmp ? true : false;
*enable = (done && tmp) ? true : false;
return done;
}

View File

@ -1137,6 +1137,9 @@ lorawan_status_t LoRaMac::schedule_tx()
if (backoff_time != 0) {
tr_debug("DC enforced: Transmitting in %lu ms", backoff_time);
_can_cancel_tx = true;
if (_device_class != CLASS_C) {
_lora_phy->put_radio_to_sleep();
}
_lora_time.start(_params.timers.backoff_timer, backoff_time);
}
return LORAWAN_STATUS_OK;

View File

@ -187,7 +187,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define AS923_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define AS923_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -96,7 +96,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define AU915_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define AU915_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -95,7 +95,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define CN470_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define CN470_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define CN779_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define CN779_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define EU433_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define EU433_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define EU868_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define IN865_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define IN865_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -111,7 +111,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define KR920_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define KR920_DEFAULT_ANTENNA_GAIN 2.15f
#endif
/*!
* ADR Ack limit

View File

@ -94,6 +94,15 @@
*/
#define US915_DEFAULT_MAX_ERP 30.0f
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define US915_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define US915_DEFAULT_ANTENNA_GAIN 0.00f
#endif
/*!
* ADR Ack limit
*/
@ -299,7 +308,7 @@ LoRaPHYUS915::LoRaPHYUS915()
phy_params.max_tx_power = US915_MAX_TX_POWER;
phy_params.default_tx_power = US915_DEFAULT_TX_POWER;
phy_params.default_max_eirp = 0;
phy_params.default_antenna_gain = 0;
phy_params.default_antenna_gain = US915_DEFAULT_ANTENNA_GAIN;
phy_params.adr_ack_limit = US915_ADR_ACK_LIMIT;
phy_params.adr_ack_delay = US915_ADR_ACK_DELAY;
phy_params.max_rx_window = US915_MAX_RX_WINDOW;

View File

@ -102,7 +102,8 @@
"target_overrides": {
"STM32WL": {
"wakeup-time": 3,
"max-sys-rx-error": 10
"max-sys-rx-error": 10,
"downlink-preamble-length": 8
}
}
}

View File

@ -230,6 +230,7 @@ protected:
uint8_t _rx_buffer[CDC_MAX_PACKET_SIZE];
uint8_t *_rx_buf;
uint32_t _rx_size;
bool _trans_zlp;
};
/** @}*/

View File

@ -39,7 +39,7 @@ public:
AsyncWrite(USBCDC *serial, uint8_t *buf, uint32_t size):
serial(serial), tx_buf(buf), tx_size(size), result(false)
{
need_zlp = (size % CDC_MAX_PACKET_SIZE == 0) ? true : false;
}
virtual ~AsyncWrite()
@ -59,6 +59,12 @@ public:
tx_size -= actual_size;
tx_buf += actual_size;
if (tx_size == 0) {
// For ZLP case, not ending yet and need one more time to invoke process to send zero packet.
if (need_zlp) {
need_zlp = false;
serial->_send_isr_start();
return false;
}
result = true;
return true;
}
@ -72,6 +78,7 @@ public:
uint8_t *tx_buf;
uint32_t tx_size;
bool result;
bool need_zlp;
};
class USBCDC::AsyncRead: public AsyncOp {
@ -186,6 +193,7 @@ void USBCDC::_init()
_rx_in_progress = false;
_rx_buf = _rx_buffer;
_rx_size = 0;
_trans_zlp = false;
}
void USBCDC::callback_reset()
@ -383,10 +391,16 @@ void USBCDC::send_nb(uint8_t *buffer, uint32_t size, uint32_t *actual, bool now)
uint32_t free = sizeof(_tx_buffer) - _tx_size;
uint32_t write_size = free > size ? size : free;
if (size > 0) {
memcpy(_tx_buf, buffer, write_size);
memcpy(_tx_buf + _tx_size, buffer, write_size);
}
_tx_size += write_size;
*actual = write_size;
/* Enable ZLP flag as while send_nb() zero size */
if (size == 0) {
_trans_zlp = true;
}
if (now) {
_send_isr_start();
}
@ -404,6 +418,14 @@ void USBCDC::_send_isr_start()
_tx_in_progress = true;
}
}
/* Send ZLP write start */
if (!_tx_in_progress && _trans_zlp) {
if (USBDevice::write_start(_bulk_in, _tx_buffer, 0)) {
_tx_in_progress = true;
_trans_zlp = false;
}
}
}
/*

View File

@ -18,6 +18,8 @@
#include "mbed_error.h"
#include "tfm_ns_interface.h"
int32_t tfm_ns_interface_init(void);
void mbed_tfm_init(void)
{
/*

View File

@ -18,11 +18,16 @@
"QSPI_POLARITY_MODE": 0,
"QSPI_FREQ": "40000000",
"QSPI_MIN_READ_SIZE": "1",
"QSPI_MIN_PROG_SIZE": "1"
"QSPI_MIN_PROG_SIZE": "1",
"QSPI_MACRONIX_NUM_STATUS_REGISTER": {
"help": "For most of Macronix QSPI flashes, they only have 2 status registers. However, some, e.g. MX25R6435F, have 3. This option can be used to control how many status registers the flash is assumed to have.",
"value": "2"
}
},
"target_overrides": {
"MX25R6435F": {
"QSPI_FREQ": "8000000"
"QSPI_FREQ": "8000000",
"QSPI_MACRONIX_NUM_STATUS_REGISTER":"3"
},
"MX25L51245G": {
"QSPI_FREQ": "8000000"

View File

@ -25,6 +25,10 @@
#define MBED_CONF_MBED_TRACE_ENABLE 0
#endif
#ifndef MBED_CONF_QSPI_MACRONIX_NUM_STATUS_REGISTER
#define MBED_CONF_QSPI_MACRONIX_NUM_STATUS_REGISTER 2
#endif
#include "mbed-trace/mbed_trace.h"
#define TRACE_GROUP "QSPIF"
@ -1108,12 +1112,12 @@ int QSPIFBlockDevice::_handle_vendor_quirks()
break;
case 0xc2:
// Macronix devices have several quirks:
// 1. Have one status register and 2 config registers, with a nonstandard instruction for reading the config registers
// 1. Have one status register and several config registers, with a nonstandard instruction for reading the config registers
// 2. Require setting a "fast mode" bit in config register 2 to operate at higher clock rates
// 3. Should never attempt to enable 4-byte addressing (it causes reads and writes to fail)
tr_debug("Applying quirks for macronix");
_needs_fast_mode = true;
_num_status_registers = 3;
_num_status_registers = MBED_CONF_QSPI_MACRONIX_NUM_STATUS_REGISTER;
_read_status_reg_2_inst = QSPIF_INST_RDCR;
break;
case 0x9d:

View File

@ -290,7 +290,7 @@ int SecureStore::set_start(set_handle_t *handle, const char *key, size_t final_d
goto fail;
}
if (create_flags & (REQUIRE_REPLAY_PROTECTION_FLAG | WRITE_ONCE_FLAG)) {
if (_rbp_kv && (create_flags & (REQUIRE_REPLAY_PROTECTION_FLAG | WRITE_ONCE_FLAG))) {
_ih->key = new char[strlen(key) + 1];
strcpy(_ih->key, key);
}

View File

@ -374,6 +374,10 @@ int TDBStore::read_record(uint8_t area, uint32_t offset, char *key,
if (calc_hash) {
hash = calc_crc(hash, chunk_size, dest_buf);
#ifdef KVSTORE_RAM_TABLE_NO_CRC_CHECK
next_offset = align_up(offset + total_size, _prog_size);
return ret;
#endif /* KVSTORE_RAM_TABLE_NO_CRC_CHECK */
}
user_key_ptr += chunk_size;
@ -1165,6 +1169,7 @@ int TDBStore::deinit()
delete[] ram_table;
delete[] _work_buf;
delete[] _key_buf;
delete reinterpret_cast<inc_set_handle_t *>(_inc_set_handle);
}
_is_initialized = false;

View File

@ -29,6 +29,8 @@
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*******************************************************************************
*
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef MBED_PERIPHERALNAMES_H

View File

@ -29,6 +29,8 @@
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*******************************************************************************
*
* @copyright SPDX-License-Identifier: MIT
*/
/* MBED TARGET LIST: MAX32670EVKIT */

View File

@ -0,0 +1,16 @@
add_library(mbed-xdot-max32670 INTERFACE)
target_include_directories(mbed-xdot-max32670
INTERFACE
.
)
target_link_libraries(mbed-xdot-max32670
INTERFACE
mbed-max32670
)
target_sources(mbed-xdot-max32670
INTERFACE
SystemInit.c
)

View File

@ -0,0 +1,74 @@
/*******************************************************************************
* Copyright (C) Maxim Integrated Products, Inc., All Rights Reserved.
*
* 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 MAXIM INTEGRATED 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.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*******************************************************************************
*
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef MBED_PERIPHERALNAMES_H
#define MBED_PERIPHERALNAMES_H
#include "cmsis.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
UART_0 = MXC_BASE_UART0,
UART_1 = MXC_BASE_UART1,
UART_2 = MXC_BASE_UART2,
UART_3 = MXC_BASE_UART3,
#if defined(MBED_CONF_TARGET_STDIO_UART)
STDIO_UART = MBED_CONF_TARGET_STDIO_UART,
#else
STDIO_UART = UART_0,
#endif
} UARTName;
typedef enum {
I2C_0 = MXC_BASE_I2C0,
I2C_1 = MXC_BASE_I2C1,
I2C_2 = MXC_BASE_I2C2,
} I2CName;
typedef enum {
SPI_0 = MXC_BASE_SPI0,
SPI_1 = MXC_BASE_SPI1,
SPI_2 = MXC_BASE_SPI2,
} SPIName;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,191 @@
/*******************************************************************************
* Copyright (C) 2022 Maxim Integrated Products, Inc., All Rights Reserved.
*
* 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 MAXIM INTEGRATED 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.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*******************************************************************************
*
* @copyright SPDX-License-Identifier: MIT
*/
/* MBED TARGET LIST: MAX32670EVKIT */
#ifndef MBED_PINNAMES_H
#define MBED_PINNAMES_H
#include "cmsis.h"
#include "gpio_regs.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
PIN_INPUT = 0,
PIN_OUTPUT = 1
} PinDirection;
#define PORT_SHIFT 12
#define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT)
#define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT))
#define NOT_CONNECTED (int)0xFFFFFFFF
typedef enum {
// Port 0
P0_0 = (0 << PORT_SHIFT),
P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15,
P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23,P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31,
// Port 1
P1_0 = (1 << PORT_SHIFT),
P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15,
P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23,P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31,
// USB bridge connected UART pins
#if defined(MBED_CONF_TARGET_STDIO_UART_TX)
CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
CONSOLE_TX = P0_29,
#endif // MBED_CONF_TARGET_STDIO_UART_TX
#if defined(MBED_CONF_TARGET_STDIO_UART_RX)
CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
CONSOLE_RX = P0_28,
#endif // MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_TX = CONSOLE_TX,
STDIO_UART_RX = CONSOLE_RX,
// ----- Start of xDot external pin definitions -----
WAKE = P0_19,
GPIO0 = P0_30,
GPIO1 = P0_27,
GPIO2 = P0_26,
GPIO3 = P0_25,
// AT command port UART
UART_RX = P0_8,
UART_TX = P0_9,
UART_CTS = P0_10,
UART_RTS = P0_11,
UART0_RX = UART_RX,
UART0_TX = UART_TX,
UART0_CTS = UART_CTS,
UART0_RTS = UART_RTS,
// debug UART
UART1_RX = P0_28,
UART1_TX = P0_29,
// SwD
SWDIO = P0_0,
SWCLK = P0_1,
// I2C
I2C1_SCL = P0_12,
I2C1_SDA = P0_13,
// SPI
SPI0_SCK = P0_4,
SPI0_MOSI = P0_3,
SPI0_MISO = P0_2,
SPI0_SS = P0_5,
// ----- End of xDot external pin definitions -----
// ----- Start of xDot dedicated internal pins. -----
MEM_PWR_EN = P0_24, // Power to EEPROM, Flash & Secure element
FLASH_CS = P0_23,
// EEPROM and SE I2C
I2C0_SCL = P0_6,
I2C0_SDA = P0_7,
SE_SDA = I2C0_SDA,
SE_SCL = I2C0_SCL,
// SX1262
SPI1_SCK = P0_16,
SPI1_MOSI = P0_15,
SPI1_MISO = P0_14,
SPI1_SS = P0_17,
LORA_MISO = SPI1_MISO,
LORA_MOSI = SPI1_MOSI,
LORA_SCK = SPI1_SCK,
LORA_NSS = SPI1_SS,
LORA_RESET = P0_20,
LORA_BUSY = P0_21,
LORA_DIO1 = P0_22,
RF_SW_CTRL = P0_18, // RF switch, active high
// ----- End of xDot dedicated internal pins. -----
// ----- Start of aliases for MAX32670 serial_api.c -----
// The xDot does not use these serial UARTs or the serial_api
// code. These pins are used on the xDot as detailed above.
UART0B_RX = P0_24,
UART0B_TX = P0_25,
UART1B_RX = P0_2,
UART1B_TX = P0_3,
UART2B_RX = P0_14,
UART2B_TX = P0_15,
// ----- end of aliases for MAX32670 serial_api.c -----
// Not connected
NC = NOT_CONNECTED
} PinName;
#define LED1 P0_30
#define I2C_SCL I2C1_SCL
#define I2C_SDA I2C1_SDA
#define SPI_MISO SPI0_MISO
#define SPI_MOSI SPI0_MOSI
#define SPI_SCK SPI0_SCK
#define SPI_NSS SPI0_SS
typedef enum {
PullNone = 0,
PullUp = 1,
PullDown = 2,
PullDefault = PullUp
} PinMode;
typedef enum {
LED_ON = 0,
LED_OFF = 1
} LedStates;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,116 @@
/* mbed Microcontroller Library
*******************************************************************************
* Copyright (c) 2023, MultiTech Systems
* All rights reserved.
*
* 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 MultiTech 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.
*******************************************************************************
*
* @copyright SPDX-License-Identifier: MIT
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "max32670.h"
#include "gcr_regs.h"
#include "mxc_sys.h"
#include "pwrseq_regs.h"
#define XDOT_ERFO_FREQ 24000000 // Change to 24000000 for xDot 1.5 Rev A
void SystemCoreClockUpdateXdot(void)
{
uint32_t base_freq, div, clk_src;
// Get the clock source and frequency
clk_src = (MXC_GCR->clkctrl & MXC_F_GCR_CLKCTRL_SYSCLK_SEL);
switch (clk_src)
{
case MXC_S_GCR_CLKCTRL_SYSCLK_SEL_EXTCLK:
base_freq = EXTCLK_FREQ;
break;
case MXC_S_GCR_CLKCTRL_SYSCLK_SEL_ERFO:
base_freq = XDOT_ERFO_FREQ;
break;
case MXC_S_GCR_CLKCTRL_SYSCLK_SEL_INRO:
base_freq = INRO_FREQ;
break;
case MXC_S_GCR_CLKCTRL_SYSCLK_SEL_IPO:
base_freq = IPO_FREQ;
break;
case MXC_S_GCR_CLKCTRL_SYSCLK_SEL_IBRO:
base_freq = IBRO_FREQ;
break;
case MXC_S_GCR_CLKCTRL_SYSCLK_SEL_ERTCO:
base_freq = ERTCO_FREQ;
break;
default:
// Codes 001 and 111 are reserved.
// This code should never execute, however, initialize to safe value.
base_freq = HIRC_FREQ;
break;
}
// Get the clock divider
if (clk_src == MXC_S_GCR_CLKCTRL_SYSCLK_SEL_IPO)
{
base_freq = base_freq >> ((MXC_GCR->clkctrl & MXC_F_GCR_CLKCTRL_IPO_DIV)>> MXC_F_GCR_CLKCTRL_IPO_DIV_POS);
}
div = (MXC_GCR->clkctrl & MXC_F_GCR_CLKCTRL_SYSCLK_DIV) >> MXC_F_GCR_CLKCTRL_SYSCLK_DIV_POS;
SystemCoreClock = base_freq >> div;
}
int PreInit(void)
{
return 0;
}
void SystemInit(void)
{
/* Make sure interrupts are enabled. */
__enable_irq();
#if (__FPU_PRESENT == 1)
/* Enable FPU on Cortex-M4, which occupies coprocessor slots 10 & 11 */
/* Grant full access, per "Table B3-24 CPACR bit assignments". */
/* DDI0403D "ARMv7-M Architecture Reference Manual" */
SCB->CPACR |= SCB_CPACR_CP10_Msk | SCB_CPACR_CP11_Msk;
__DSB();
__ISB();
#endif
MXC_PWRSEQ->lpcn &= ~(1 << 31); // Ensure ERTCO is on
MXC_SYS_Clock_Select(MXC_SYS_CLOCK_IPO);
SystemCoreClockUpdateXdot();
// Increase drive strength of I2C_SE bus and Mem Pwr En.
// Note: Mem Pwr En doesn't help, higher drive strength on se i2c pins seems to though
MXC_GPIO0->ds0 |= (1 << 6) | (1 << 7) | (1 << 24);
MXC_GPIO0->ds1 |= (1 << 6) | (1 << 7) | (1 << 24);
MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_GPIO0);
MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_GPIO1);
}

View File

@ -23,6 +23,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "hal/PinNameAliases.h"

View File

@ -23,6 +23,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
/* Maximum DAC modules */

View File

@ -23,6 +23,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -23,6 +23,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -24,6 +24,7 @@
#include "mbed_error.h"
#include "mbed_assert.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_bitutil.h"
#include <string.h>

View File

@ -23,6 +23,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2020 Nuvoton Technology Corporation
* Copyright (c) 2019-2020 Nuvoton Technology Corporation
* SPDX-License-Identifier: Apache-2.0
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -22,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "hal/PinNameAliases.h"

View File

@ -22,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
/* Maximum DAC modules */

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2022 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,6 +24,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -22,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -22,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -23,6 +23,7 @@
#include "mbed_error.h"
#include "mbed_assert.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_bitutil.h"
#include <string.h>

View File

@ -23,6 +23,7 @@
#include "mbed_error.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -132,9 +133,6 @@ typedef enum {
D13 = PC_5,
D14 = PE_5,
D15 = PE_4,
I2C_SCL = D15,
I2C_SDA = D14,
// NOTE: board-specific naming
// UART naming
@ -152,25 +150,27 @@ typedef enum {
#endif
SERIAL_TX = CONSOLE_TX,
SERIAL_RX = CONSOLE_RX,
// LED naming
LED1 = PD_2,
LED2 = PD_3,
LED3 = PD_7,
LED4 = LED1, // No real LED. Just for passing ATS.
LED_RED = LED2,
LED_GREEN = LED3,
LED_BLUE = LED1,
// Button naming
SW2 = PA_15,
SW3 = PA_14,
BUTTON1 = SW2,
BUTTON2 = SW3,
// Force PinName to 32-bit required by NU_PINNAME_BIND(...)
FORCE_ENUM_PINNAME_32BIT = 0x7FFFFFFF,
} PinName;
// LEDs
#define LED1 PD_2
#define LED2 PD_3
#define LED3 PD_7
// Button naming
#define SW2 PA_15
#define SW3 PA_14
#define BUTTON1 SW2
#define BUTTON2 SW3
// I2C
#define I2C_SCL D15
#define I2C_SDA D14
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -21,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "hal/PinNameAliases.h"

View File

@ -22,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
/* Maximum DAC modules */

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,17 +24,30 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"
#include "mbed_critical.h"
#include "mbed_error.h"
#define NU_CAN_DEBUG 0
#define CAN_NUM 1
/* Reserve Message Object number 31 for Tx */
#define NU_CAN_MSG_OBJ_NUM_TX 31
/* Max number of message ID filter handle */
#define NU_CAN_MAXNUM_HNDL NU_CAN_MSG_OBJ_NUM_TX
/* Convert to string literal */
#define NU_STR_(X) #X
#define NU_STR(X) NU_STR_(X)
static uintptr_t can_irq_contexts[CAN_NUM] = {0};
static can_irq_handler can0_irq_handler;
extern void CAN_CLR_INT_PENDING_ONLY_BIT(CAN_T *tCAN, uint32_t u32MsgNum);
static const struct nu_modinit_s can_modinit_tab[] = {
{CAN_0, CAN0_MODULE, 0, 0, CAN0_RST, CAN0_IRQn, NULL},
@ -125,12 +139,10 @@ static void can_irq(CANName name, int id)
/**************************/
if(can->STATUS & CAN_STATUS_RXOK_Msk) {
can->STATUS &= ~CAN_STATUS_RXOK_Msk; /* Clear Rx Ok status*/
can0_irq_handler(can_irq_contexts[id], IRQ_RX);
}
if(can->STATUS & CAN_STATUS_TXOK_Msk) {
can->STATUS &= ~CAN_STATUS_TXOK_Msk; /* Clear Tx Ok status*/
can0_irq_handler(can_irq_contexts[id], IRQ_TX);
}
/**************************/
@ -143,6 +155,14 @@ static void can_irq(CANName name, int id)
if(can->STATUS & CAN_STATUS_BOFF_Msk) {
can0_irq_handler(can_irq_contexts[id], IRQ_BUS);
}
} else if (u8IIDRstatus >= 1 && u8IIDRstatus <= 32) {
if ((u8IIDRstatus - 1) != NU_CAN_MSG_OBJ_NUM_TX) {
can0_irq_handler(can_irq_contexts[id], IRQ_RX);
CAN_CLR_INT_PENDING_ONLY_BIT(can, (u8IIDRstatus -1));
} else {
can0_irq_handler(can_irq_contexts[id], IRQ_TX);
CAN_CLR_INT_PENDING_BIT(can, (u8IIDRstatus -1));
}
} else if (u8IIDRstatus!=0) {
can0_irq_handler(can_irq_contexts[id], IRQ_OVERRUN);
@ -213,6 +233,9 @@ void can_irq_set(can_t *obj, CanIrqType irq, uint32_t enable)
int can_write(can_t *obj, CAN_Message msg, int cc)
{
/* Unused */
(void) cc;
STR_CANMSG_T CMsg;
CMsg.IdType = (uint32_t)msg.format;
@ -221,7 +244,7 @@ int can_write(can_t *obj, CAN_Message msg, int cc)
CMsg.DLC = msg.len;
memcpy((void *)&CMsg.Data[0],(const void *)&msg.data[0], (unsigned int)8);
return CAN_Transmit((CAN_T *)NU_MODBASE(obj->can), cc, &CMsg);
return CAN_Transmit((CAN_T *)NU_MODBASE(obj->can), NU_CAN_MSG_OBJ_NUM_TX, &CMsg);
}
int can_read(can_t *obj, CAN_Message *msg, int handle)
@ -285,16 +308,19 @@ int can_mode(can_t *obj, CanMode mode)
int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle)
{
uint32_t numask = mask;
if( numask == 0x0000 )
{
return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id);
/* Check validity of filter handle */
if (handle < 0 || handle >= NU_CAN_MAXNUM_HNDL) {
/* NOTE: 0 is ambiguous, error or filter handle 0. */
error("Support max " NU_STR(NU_CAN_MAXNUM_HNDL) " CAN filters");
return 0;
}
uint32_t numask = mask;
if( format == CANStandard )
{
numask = (mask << 18);
}
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
numask = (numask | ((CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk) << 16));
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
}

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series Analog Comparator(ACMP) driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 Series ACMP Driver Header File
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#ifndef __ACMP_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series CAN driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"
@ -981,7 +981,7 @@ int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum , STR_CANMSG_T* pCanMsg)
*
* @details An interrupt remains pending until the application software has cleared it.
*/
void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum)
void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint32_t u32MsgNum)
{
uint32_t u32MsgIfNum;
@ -994,6 +994,19 @@ void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum)
ReleaseIF(tCAN, u32MsgIfNum);
}
/* Clone of CAN_CLR_INT_PENDING_BIT() with NewDat not cleared */
void CAN_CLR_INT_PENDING_ONLY_BIT(CAN_T *tCAN, uint32_t u32MsgNum)
{
uint32_t u32MsgIfNum;
if((u32MsgIfNum = LockIF_TL(tCAN)) == 2)
u32MsgIfNum = 0;
tCAN->IF[u32MsgIfNum].CMASK = CAN_IF_CMASK_CLRINTPND_Msk;
tCAN->IF[u32MsgIfNum].CREQ = 1 + u32MsgNum;
ReleaseIF(tCAN, u32MsgIfNum);
}
/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 Series CAN Driver Header File
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#ifndef __CAN_H__
@ -148,7 +148,7 @@ typedef struct
uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate);
uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode);
void CAN_Close(CAN_T *tCAN);
void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum);
void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint32_t u32MsgNum);
void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask);
void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask);
int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum , STR_CANMSG_T* pCanMsg);

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series CLK driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series DAC driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series EADC driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series FMC driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
//* Includes ------------------------------------------------------------------*/

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series GPIO driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series I2C driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 Series I2C Driver Header File
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#ifndef __I2C_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 Series OTG Driver Header File
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#ifndef __OTG_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series PDMA driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series PDMA driver header file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#ifndef __PDMA_H__
#define __PDMA_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series PWM driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series PWM driver header file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#ifndef __PWM_H__
#define __PWM_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series SPI driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"
/** @addtogroup Standard_Driver Standard Driver

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series SPI driver header file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#ifndef __SPI_H__
#define __SPI_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/11 10:26a $
* @brief M451 series SYS driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/24 4:54p $
* @brief M451 series TK driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
*****************************************************************************/
#include "M451Series.h"

View File

@ -5,8 +5,8 @@
* $Date: 15/08/24 4:52p $
* @brief M451 Series TK Driver Header File
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#ifndef __TK_H__

View File

@ -5,8 +5,8 @@
* $Date: 15/08/21 3:34p $
* @brief M451 series USBD driver source file
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include <string.h>

View File

@ -4,8 +4,8 @@
* @version 2.0.0
* @date 10, January, 2014
*
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
* @copyright SPDX-License-Identifier: Apache-2.0
* @copyright Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
******************************************************************************/
#ifndef __USBD_H__
#define __USBD_H__

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2020 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -21,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -21,6 +22,7 @@
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_miscutil.h"
#include "nu_bitutil.h"

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2017-2018 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,6 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,6 +23,7 @@
#include "mbed_error.h"
#include "mbed_assert.h"
#include "PeripheralPins.h"
#include "gpio_api.h"
#include "nu_modutil.h"
#include "nu_bitutil.h"
#include <string.h>

Some files were not shown because too many files have changed in this diff Show More