Skip to content

mokotechnology/nRF52_api_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

1. Environment construction

1.1 Segger embedded Studio installation

This tool is used for compilation, and the nRF_SDK_14 writing and compilation are based on this IDE.

(1)Download path of Segger embedded Studio:https://www.segger.com/products/development-tools/embedded-studio/

(2)Segger embedded Studio user guids:https://www.segger.com/doc/index.html

1.2 Nordic tool

The tool is placed in the provided sdk file package. The path to the file is in....\SDK_APIS(nRF52)\moko_doc\Nordic tool.

(1)nrfgostudio :

(2)nRF Command Line Tools:....\SDK_APIS(nRF52)\moko_doc\Nordic tool (https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download?lang=en#infotabs)

(3)JLink_Windows_V680e

2 SDK description of file structure

2.1 Folder structure

(1)...\SDK_APIS(nRF52)\nRF_SDK_14.2\components: Nordic provide a much components file

(2)...\SDK_APIS(nRF52)\nRF_SDK_14.2\external: Nordic file

(3)...\SDK_APIS(nRF52)\merge_hex: Moko Synthetic firmware required

(4)...\SDK_APIS(nRF52)\moko_src: Moko user code

(5)...\SDK_APIS(nRF52)\Mprojct: The directory where the compiled project is located

(6)...\SDK_APIS(nRF52)\moko_doc: Put installation files and Mokor files

2.2 Special Folder Description

  1. ibeacon_boot.hex : This is the file generated by the compilation of the boot project
  2. BLE_SDK.hex : This is the file generated by the compilation of the user project
  3. s112_nrf52810_5.1.0_softdevice.hex : This is the file of the protocol stack

This is the script file file.bat. Double-clicking the file will generate the three-in-one file BLE_SDK_1.0.0.hex, which supports re-modifying the file name.

3.Description of peripheral device API

3.1 Lis3dh driver

There is corresponding lis3dh function code in lis3dh_driver.c

  1. void lis3dh_init(void): Initializes lis3dh sensor drivers
  2. void task_read_3dh(void) : Read lis3dh sensor data

3.2 STK8232 driver

There is corresponding STK8232 function code in STK823x_app.c

  1. void STK832x_Init(void): Initializes STK832x sensor drivers
  2. void STK832x_read_data(void) : Read STK832x sensor data

3.3 SHT30 driver

There is corresponding sht30 temperature and humidity sensor function code in sht3x_driver.c

  1. void sht3x_Init(void) : Initialize sht30 temperature and humidity sensor
  2. void task_read_sht3x(void) : Read temperature and humidity sensor data

3.3 VL53L3 driver

There is corresponding VL53L3 TOF sensor function code in vl53lx_app.c

  1. void vl53lx_Init(void) : Initialize VL53L3 TOF sensor
  2. void set_vl53lx_config(uint8_t mode) : Set mode for Stort Range or Long Range
  3. void start_tof_measurement(void) :Start TOF sensor to work
  4. void calculate_vl53lx_distance(void) :Calculate the real distance

3.5 Uart production test function

This function in simple_uart.c and uart_commd.c file.

The protocol Documentation path: ...BLE_APIS(nRF52)\doc\Uart Protocol

  1. **simple_uart.c **: The initialization part of the uart driver function
  2. uart_commd.c : handle Production test commands

Description of special functions:

  1. void task_uart_manage(void) This is equivalent to the uart's enable and disable management functions. The specific operation is to disable the uart function after 30s, then turn on the RX io interrupt, wait data for the enable uart function of the data, and execute the corresponding cmd.

  2. void task_process_uart_data(void) Uart's function to receive data. in the while function.

  3. void analyze_uart_data(uint8_t cmd,uint8_t*datas,uint8_t len) Serial port data parsing function, parsing corresponding commands and function settings

3.6 update

Oct. 20, 2024‌

1.Update the dfu check code to "MOKO"

Nov. 04, 2024‌

1.Delete some sensor drivers to save firmware space

2.Change the storage address to fit 52810

3.Optimized lis3dh driver

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages