KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nano.h File Reference

Nanobeacon driver. More...

#include <stdbool.h>
#include <stdint.h>
#include "errorcode.h"
#include "kernel/err.h"
#include "lm32soc/dev_soc.h"

Go to the source code of this file.

Enumerations

enum  NanoEnable { nanoEnableNone = 0, nanoEnableCore = ( 1 << ( 0 ) ), nanoEnableStepUp = ( 1 << ( 1 ) ), nanoEnableCoreAndStepUp = ( 1 << ( 0 ) ) | ( 1 << ( 1 ) ) }
 Enumeration for nanobeacon enable states. More...
 

Functions

bool nanoConfig (uint32_t delay, uint32_t period, uint32_t width, uint32_t noOfPulses)
 Configures the nano-beacon. More...
 
void nanoSetPulseDoneTask (int taskId)
 Configures the task to run if a pulse is done. More...
 
static void nanoEnable (NanoEnable nanoEnable)
 Enable or disable the nano-beacon. More...
 

Detailed Description

Nanobeacon driver.

Definition in file nano.h.

Enumeration Type Documentation

enum NanoEnable

Enumeration for nanobeacon enable states.

Enumerator
nanoEnableNone 

nanoEnableNone

nanoEnableCore 

nanoEnableCore

nanoEnableStepUp 

nanoEnableStepUp

nanoEnableCoreAndStepUp 

nanoEnableCoreAndStepUp

Definition at line 35 of file nano.h.

Function Documentation

bool nanoConfig ( uint32_t  delay,
uint32_t  period,
uint32_t  width,
uint32_t  noOfPulses 
)

Configures the nano-beacon.

Parameters
delayThe delay from the start of the second in 16ns ticks.
periodThe period of the nano-beacon in 16ns ticks
widthThe width of the nano-beacon pulse in 16ns ticks
noOfPulsesThe number of pulses per PPS.
Return values
trueConfiguration succesful
falseConfiguration failed, check error module.

Definition at line 22 of file nano.c.

static void nanoEnable ( NanoEnable  nanoEnable)
inlinestatic

Enable or disable the nano-beacon.

Parameters
enabletrue - Enable, false - disable.

Definition at line 69 of file nano.h.

void nanoSetPulseDoneTask ( int  taskId)

Configures the task to run if a pulse is done.

Parameters
taskIdThe taskID, or -1 to disable.

Definition at line 34 of file nano.c.