hmeta - Hardware metadata#

Adapted Air780E/Air700E Air780EP

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Tip

This library has its own demo,click this link to view the demo example of hmeta

Example

-- This library is under development
--[[
    The purpose of this library is to demonstrate the capabilities of the current hardware, such:
1. How many GPIO are there, what is the default mode of each GPIO, and whether it supports pull-up/pull-down
2. How many I2C and what rates are supported
3. How much SPI is there, which rates and modes are supported
4. extended properties such as differentiating Air780E and Air600E

]]

hmeta.model()#

Get Module Name

Parameters

None

Return Value

return value type

explanation

string

If it can be recognized, return the module type, otherwise it will be nil

Examples

sys.taskInit(function()
    while 1 do
        sys.wait(3000)
        -- hmeta Identifying the underlying module type
        -- Different modules can use the same bsp, but depending on the package, the specific module can still be identified according to the internal data
        log.info("hmeta", hmeta.model())
        log.info("bsp",   rtos.bsp())
    end
end)

hmeta.hwver()#

Get the hardware version number of the module

Parameters

None

Return Value

return value type

explanation

string

If it can be recognized, return the module type, otherwise it will be nil

Examples

sys.taskInit(function()
    while 1 do
        sys.wait(3000)
        -- hmeta Identifying the underlying module type
        -- Different modules can use the same bsp, but depending on the package, the specific module can still be identified according to the internal data
        log.info("hmeta", hmeta.model(), hmeta.hwver())
        log.info("bsp",   rtos.bsp())
    end
end)