Hilscher netX microcontroller driver  V0.0.5.0
Documentation of the netX driver package

The MLED driver, defined by DRV_MLED_HANDLE_T. More...

Collaboration diagram for MLED:

Data Structures

struct  DRV_MLED_CONFIGURATION_T
 The configuration of the driver. More...
 
struct  DRV_MLED_HANDLE_T
 The handle of the driver. More...
 

Macros

#define DRV_HANDLE_CHECK(handle)
 

Typedefs

typedef uint32_t DRV_MLED_MSK_T
 Type definition analog to the dio definition for the mleds as mask. More...
 
typedef uint32_t DRV_MLED_ID_T
 Type definition analog to the dio definition for the mleds by id. More...
 

Enumerations

enum  DRV_MLED_PRESCALE_BORDER_E {
  DRV_MLED_PRESCALE_BORDER_RESET = 0x00ul,
  DRV_MLED_PRESCALE_BORDER_1 = 0x01ul,
  DRV_MLED_PRESCALE_BORDER_DEFAULT = 0x400ul,
  DRV_MLED_PRESCALE_BORDER_1024 = 0x400ul,
  DRV_MLED_PRESCALE_BORDER_MIN = DRV_MLED_PRESCALE_BORDER_1,
  DRV_MLED_PRESCALE_BORDER_MAX = DRV_MLED_PRESCALE_BORDER_1024
}
 The MLED prescale counter border as f_pwm = f_clk / (512 * (prescale_counter_max + 1)) More...
 
enum  DRV_MLED_BLINK_BORDER_E {
  DRV_MLED_BLINK_BORDER_RESET = 0x00ul,
  DRV_MLED_BLINK_BORDER_1 = 0x01ul,
  DRV_MLED_BLINK_BORDER_DEFAULT = 0x32ul,
  DRV_MLED_BLINK_BORDER_512 = 0x200ul,
  DRV_MLED_BLINK_BORDER_MIN = DRV_MLED_BLINK_BORDER_1,
  DRV_MLED_BLINK_BORDER_MAX = DRV_MLED_BLINK_BORDER_512
}
 The MLED blink counter border as f_blink = 50 Hz / (blink_counter_border) More...
 
enum  DRV_MLED_BRIGHTNESS_E {
  DRV_MLED_BRIGHTNESS_RESET = 0x00ul,
  DRV_MLED_BRIGHTNESS_1 = 0x01ul,
  DRV_MLED_BRIGHTNESS_OFF = DRV_MLED_BRIGHTNESS_1,
  DRV_MLED_BRIGHTNESS_256 = 0x100ul,
  DRV_MLED_BRIGHTNESS_FULL = DRV_MLED_BRIGHTNESS_256,
  DRV_MLED_BRIGHTNESS_DEFAULT = DRV_MLED_BRIGHTNESS_256,
  DRV_MLED_BRIGHTNESS_MIN = DRV_MLED_BRIGHTNESS_1,
  DRV_MLED_BRIGHTNESS_MAX = DRV_MLED_BRIGHTNESS_256
}
 The MLED brightness duty=([value]-1)/255. More...
 
enum  DRV_MLED_MODE_E {
  DRV_MLED_MODE_STANDARD = 0x00ul,
  DRV_MLED_MODE_LINE_REGISTER = 0x01ul,
  DRV_MLED_MODE_BLINK = 0x02ul,
  DRV_MLED_MODE_BYPASS = 0x03ul,
  DRV_MLED_MODE_MAX = DRV_MLED_MODE_BYPASS
}
 The MLED modes. More...
 

Functions

DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_Init (DRV_MLED_HANDLE_T *const ptDriver)
 Initializes the mled device and handle by the given configuration. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_DeInit (DRV_MLED_HANDLE_T *const ptDriver)
 Deinitializes the mled device and handle. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_ChannelSetMode (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_ID_T uMledID, DRV_MLED_MODE_E eMode)
 Sets the mode of the MLED. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_ChannelSetBrightness (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_ID_T uMledID, DRV_MLED_BRIGHTNESS_E uBrightness)
 Sets the brightness of the MLED. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_ChannelInvert (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_ID_T uMledID)
 Inverts the MLED. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_ChannelOutSet (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_ID_T uMledID)
 Sets the MLED to set. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_ChannelOutReset (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_ID_T uMledID)
 Sets the MLED to reset. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_LineMaskedSet (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_MSK_T uMask, DRV_MLED_MSK_T uMledMSK)
 Manipulates the mled line and sets the bits given by the mask to the specified value. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_LineOutSet (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_MSK_T uMledMSK)
 Manipulates the MLED line and sets the given bits. More...
 
DRV_STATUS_E DRV_MLED_HANDLE_T::DRV_MLED_LineOutReset (DRV_MLED_HANDLE_T *const ptDriver, DRV_MLED_MSK_T uMledMSK)
 Manipulates the MLED line and resets the given bits. More...
 

Variables

static DRV_MLED_DEVICE_T *const s_apChannelDeviceAddressTable [DRV_MLED_DEVICE_COUNT] = DRV_MLED_DEVICE_LIST
 Table of the device addresses. More...
 

Detailed Description

The MLED driver, defined by DRV_MLED_HANDLE_T.

Macro Definition Documentation

#define DRV_HANDLE_CHECK (   handle)
Value:
;\
if((handle)==0){ \
return DRV_ERROR_PARAM; \
}\
if((handle)->ptDevice==0){ \
return DRV_ERROR_PARAM; \
}

Define for checking the consistency of the handle or static representation of the driver.

Definition at line 43 of file netx_drv_mled.c.

Typedef Documentation

typedef uint32_t DRV_MLED_ID_T

Type definition analog to the dio definition for the mleds by id.

Definition at line 48 of file netx_drv_mled.h.

typedef uint32_t DRV_MLED_MSK_T

Type definition analog to the dio definition for the mleds as mask.

Definition at line 43 of file netx_drv_mled.h.

Enumeration Type Documentation

The MLED blink counter border as f_blink = 50 Hz / (blink_counter_border)

Enumerator
DRV_MLED_BLINK_BORDER_RESET 

The lowest border.

DRV_MLED_BLINK_BORDER_1 

The lowest border.

DRV_MLED_BLINK_BORDER_DEFAULT 

The lowest border.

DRV_MLED_BLINK_BORDER_512 

The lowest border.

DRV_MLED_BLINK_BORDER_MIN 

Min value for border checking.

DRV_MLED_BLINK_BORDER_MAX 

Max value for border ckecking.

Definition at line 66 of file netx_drv_mled.h.

The MLED brightness duty=([value]-1)/255.

Enumerator
DRV_MLED_BRIGHTNESS_RESET 

The value is not modified, so in reset is is reset or if it was changed it is not modified.

DRV_MLED_BRIGHTNESS_1 

The darkest(off).

DRV_MLED_BRIGHTNESS_OFF 

The darkest(off).

DRV_MLED_BRIGHTNESS_256 

The brightest.

DRV_MLED_BRIGHTNESS_FULL 

The brightest.

DRV_MLED_BRIGHTNESS_DEFAULT 
DRV_MLED_BRIGHTNESS_MIN 

The default brightness is 255 Min value for border checking.

DRV_MLED_BRIGHTNESS_MAX 

Max value for border ckecking.

Definition at line 79 of file netx_drv_mled.h.

The MLED modes.

Enumerator
DRV_MLED_MODE_STANDARD 

The invert, set and reset will change the state of the mled.

DRV_MLED_MODE_LINE_REGISTER 

Sets the mled line mode to act after the line register.

DRV_MLED_MODE_BLINK 

Puts the mled channels to blink.

DRV_MLED_MODE_BYPASS 

Bypasses the pwm and puts the pin to the (not)inverted level.

DRV_MLED_MODE_MAX 

Max value for border ckecking.

Definition at line 94 of file netx_drv_mled.h.

The MLED prescale counter border as f_pwm = f_clk / (512 * (prescale_counter_max + 1))

Enumerator
DRV_MLED_PRESCALE_BORDER_RESET 

The lowest border.

DRV_MLED_PRESCALE_BORDER_1 

The lowest border.

DRV_MLED_PRESCALE_BORDER_DEFAULT 

The lowest border.

DRV_MLED_PRESCALE_BORDER_1024 

The lowest border.

DRV_MLED_PRESCALE_BORDER_MIN 

Min value for border checking.

DRV_MLED_PRESCALE_BORDER_MAX 

Max value for border ckecking.

Definition at line 53 of file netx_drv_mled.h.

Function Documentation

DRV_STATUS_E DRV_MLED_ChannelInvert ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_ID_T  uMledID 
)

Inverts the MLED.

Definition at line 175 of file netx_drv_mled.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_MLED_ChannelOutReset ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_ID_T  uMledID 
)

Sets the MLED to reset.

Definition at line 214 of file netx_drv_mled.c.

DRV_STATUS_E DRV_MLED_ChannelOutSet ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_ID_T  uMledID 
)

Sets the MLED to set.

Definition at line 197 of file netx_drv_mled.c.

DRV_STATUS_E DRV_MLED_ChannelSetBrightness ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_ID_T  uMledID,
DRV_MLED_BRIGHTNESS_E  uBrightness 
)

Sets the brightness of the MLED.

Definition at line 153 of file netx_drv_mled.c.

DRV_STATUS_E DRV_MLED_ChannelSetMode ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_ID_T  uMledID,
DRV_MLED_MODE_E  eMode 
)

Sets the mode of the MLED.

Definition at line 131 of file netx_drv_mled.c.

DRV_STATUS_E DRV_MLED_DeInit ( DRV_MLED_HANDLE_T *const  ptDriver)

Deinitializes the mled device and handle.

It trys to get a lock on the handle so that it is able to be reset. Then it will reset the nvic, the device states and the context given.

Parameters
[in,out]ptDriverThe handle of the driver
Returns
DRV_OK Everything is ok. DRV_LOCKED The api is locked and not accessible. DRV_ERROR_PARAM A given parameter is not correct.

Definition at line 119 of file netx_drv_mled.c.

DRV_STATUS_E DRV_MLED_Init ( DRV_MLED_HANDLE_T *const  ptDriver)

Initializes the mled device and handle by the given configuration.

Definition at line 57 of file netx_drv_mled.c.

DRV_STATUS_E DRV_MLED_LineMaskedSet ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_MSK_T  uMask,
DRV_MLED_MSK_T  uMledMSK 
)

Manipulates the mled line and sets the bits given by the mask to the specified value.

Definition at line 231 of file netx_drv_mled.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_MLED_LineOutReset ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_MSK_T  uMledMSK 
)

Manipulates the MLED line and resets the given bits.

Definition at line 267 of file netx_drv_mled.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_MLED_LineOutSet ( DRV_MLED_HANDLE_T *const  ptDriver,
DRV_MLED_MSK_T  uMledMSK 
)

Manipulates the MLED line and sets the given bits.

Definition at line 250 of file netx_drv_mled.c.

Here is the call graph for this function:

Variable Documentation

DRV_MLED_DEVICE_T* const s_apChannelDeviceAddressTable[DRV_MLED_DEVICE_COUNT] = DRV_MLED_DEVICE_LIST
static

Table of the device addresses.

Used to identify the device addresses by the device id.

Definition at line 37 of file netx_drv_mled.c.